Stops the video capture stream. Flushes any pending samples and prevents further callbacks.
(&mut self)
| 476 | /// |
| 477 | /// Flushes any pending samples and prevents further callbacks. |
| 478 | async fn stop(&mut self) -> Result<()> { |
| 479 | self.shared.is_running.store(false, Ordering::Release); |
| 480 | |
| 481 | unsafe { |
| 482 | let _ = self |
| 483 | .source_reader |
| 484 | .0 |
| 485 | .Flush(MF_SOURCE_READER_FIRST_VIDEO_STREAM.0 as u32); |
| 486 | } |
| 487 | |
| 488 | Ok(()) |
| 489 | } |
| 490 | |
| 491 | /// Waits for and returns the next available frame. |
| 492 | /// |