pub struct RecordingSink { /* private fields */ }Expand description
Unix-socket fan-out that broadcasts every encoded H.264 frame to connected consumers.
A listener thread accepts connections and gives each its own bounded queue and writer thread
(see [ClientHandle]) so one slow reader cannot stall the others or the encode thread.
Implementations§
Source§impl RecordingSink
impl RecordingSink
Sourcepub fn try_bind(settings_path: &str) -> Option<Arc<Self>>
pub fn try_bind(settings_path: &str) -> Option<Arc<Self>>
Bind a Unix socket at settings_path, or return None when no path is configured or the
bind fails. Recording is an optional tap that must never take the pipeline down, so a bind
error is logged and swallowed.
Sourcepub fn should_force_idr(&self) -> bool
pub fn should_force_idr(&self) -> bool
Returns true exactly once after a new client connects, signalling that the next encode
should produce an IDR so the consumer starts from a clean reference frame.
Sourcepub fn write_frame(&self, stripes: &[EncodedStripe], full_height: i32)
pub fn write_frame(&self, stripes: &[EncodedStripe], full_height: i32)
Delivery-layer tap for one encoded frame. The socket carries a single H.264
elementary stream, so only a lone full-height stripe (data_type == 2) is
recordable: striped CPU encodes are N independent per-stripe streams, and
interleaving them would produce an undecodable file — those are skipped with a
one-time notice (live streaming is unaffected). The 10-byte wire header
(0x04 tag) is skipped via the queued offset so consumers receive plain
Annex-B.
Never blocks and never copies: the Arc payload is cloned into each client’s
bounded queue with try_send, and a client whose queue is full or whose
writer died is dropped.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RecordingSink
impl RefUnwindSafe for RecordingSink
impl Send for RecordingSink
impl Sync for RecordingSink
impl Unpin for RecordingSink
impl UnsafeUnpin for RecordingSink
impl UnwindSafe for RecordingSink
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more