-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This article shows how to use it: http://lazyfoo.net/tutorials/SDL/42_texture_streaming/index.php
Didn't really look into it, but it might be something worth looking into :)
Current Implementation
Currently the BackupCamera uses the main thread to render the texture onto the main screen, and "streams" the video from another thread using OpenCV.
To communicate the image from the OpenCV thread to the main thread, we use a triple buffer rather than a mutex, which would halt our main thread and defeat the purpose of the threading.
We could use two buffers and apply a mutex and we won't be blocked too often, but with 3 buffers, we can just eliminate the need of a mutex - I think :).
Section with the buffer:
BackupCamera/src/videoStream.cpp
Line 70 in df17451
| void VideoStream::ThreadFunction() |