pub struct SinkDriver<S: MediaSink>(/* private fields */);Expand description
Adapts a MediaSink to the bus’s FrameSink so it
can be driven directly by
StreamHandle::drive_to — the one-call
path to record or restream any live stream (a WebRTC ingest included) to a
sink, with the instant-start GOP replay the bus already provides.
ⓘ
let handle = playback.get_stream(&key)?;
let mut driver = SinkDriver::new(RecordingSink::new(storage, "rec/cam", 2));
handle.drive_to(&shutdown, &mut driver).await?;
driver.into_inner().flush().await?; // finalize the last chunkImplementations§
Source§impl<S: MediaSink> SinkDriver<S>
impl<S: MediaSink> SinkDriver<S>
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Recover the inner sink (e.g. to flush it after the drive ends).
Trait Implementations§
Source§impl<S: MediaSink> FrameSink for SinkDriver<S>
impl<S: MediaSink> FrameSink for SinkDriver<S>
Auto Trait Implementations§
impl<S> Freeze for SinkDriver<S>where
S: Freeze,
impl<S> RefUnwindSafe for SinkDriver<S>where
S: RefUnwindSafe,
impl<S> Send for SinkDriver<S>
impl<S> Sync for SinkDriver<S>
impl<S> Unpin for SinkDriver<S>where
S: Unpin,
impl<S> UnsafeUnpin for SinkDriver<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SinkDriver<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more