Expand description
Real-life example: using a stream in a rendering thread.
This example demonstrates using the GPU to draw camera frames with zero copies. This example uses the “next” (simpler) API in multiple threads, with polling for readiness.
The difficulty of this example is that there are two event loops: one for the display and one fetching frames from the camera. The display loop cannot simply block waiting for the camera because it’s got other events to handle. The camera can’t simply draw to the screen because it is not available until the other loop is ready.
So instead, the camera loop waits for frames to be ready and notifies the display loop. A reference to the camera stream handle is borrowed and sent to the display loop every time a new camera frame arrives.
Enums§
Functions§
- main 🔒