MCPcopy Create free account
hub / github.com/RustCV/RustCV / SharedState

Class SharedState

rustcv-backend-msmf/src/stream.rs:73–88  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
73struct 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///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected