Shared state between the callback and the stream. This structure coordinates frame delivery from the Media Foundation callback (which runs on a MF worker thread) to the async `next_frame()` method.
| 71 | /// This structure coordinates frame delivery from the Media Foundation callback |
| 72 | /// (which runs on a MF worker thread) to the async `next_frame()` method. |
| 73 | struct SharedState { |
| 74 | /// Storage for the most recent frame sample. |
| 75 | sample_slot: Mutex<Option<SendableSample>>, |
| 76 | |
| 77 | /// Hardware timestamp from the last frame (in 100ns units). |
| 78 | timestamp: AtomicI64, |
| 79 | |
| 80 | /// Flag indicating whether the stream is actively capturing. |
| 81 | is_running: AtomicBool, |
| 82 | |
| 83 | /// Weak reference to the source reader for requesting the next sample. |
| 84 | reader: RwLock<Weak<SendableSourceReader>>, |
| 85 | |
| 86 | /// Semaphore for frame synchronization. |
| 87 | frame_ready: Semaphore, |
| 88 | } |
| 89 | |
| 90 | /// Media Foundation callback for receiving video samples. |
| 91 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected