microsoft / azure-percept-advanced-development

Azure Percept DK advanced topics
Other
69 stars 34 forks source link

Fix H.264 streaming bug #52

Closed MaxStrange closed 3 years ago

MaxStrange commented 3 years ago

This commit fixes the bug where the H.264 stream will crash after X minutes of streaming it.

This changes from a pull-style mechanism, where the GStreamer pipeline fires a callback function every time it needs a new buffer, which then grabs a buffer from a non-thread-safe queue, to a push-style mechanism, where the GStreamer pipeline is split into two pieces: an appsrc which is constantly accepting buffers from the main thread, and another half which is only connected when a client has connected to the device.

I also added a new "H264Stream" parameter to the module twin, which allows you to turn off the stream. Previously it turns out you had no way of turning off the H.264 stream.