pub struct StreamState {Show 15 fields
pub id: u32,
pub mode: StreamMode,
pub stream_key: Option<String>,
pub publish_type: Option<String>,
pub started_at: Option<Instant>,
pub has_video_header: bool,
pub has_audio_header: bool,
pub has_metadata: bool,
pub last_video_ts: u32,
pub last_audio_ts: u32,
pub video_frames: u64,
pub audio_frames: u64,
pub keyframes: u64,
pub bytes_received: u64,
pub gop_buffer: GopBuffer,
}Expand description
Per-stream state
Fields§
§id: u32Message stream ID
mode: StreamModeCurrent mode
stream_key: Option<String>Stream key/name (for publish/play)
publish_type: Option<String>Publish type (“live”, “record”, “append”)
started_at: Option<Instant>Time when stream became active
has_video_header: boolWhether we’ve received video sequence header
has_audio_header: boolWhether we’ve received audio sequence header
has_metadata: boolWhether we’ve received metadata
last_video_ts: u32Last video timestamp
last_audio_ts: u32Last audio timestamp
video_frames: u64Video frames received
audio_frames: u64Audio frames received
keyframes: u64Keyframes received
bytes_received: u64Total bytes received on this stream
gop_buffer: GopBufferGOP buffer for late-joiner support
Implementations§
Source§impl StreamState
impl StreamState
Sourcepub fn start_publish(&mut self, stream_key: String, publish_type: String)
pub fn start_publish(&mut self, stream_key: String, publish_type: String)
Start publishing on this stream
Sourcepub fn start_play(&mut self, stream_name: String)
pub fn start_play(&mut self, stream_name: String)
Start playing on this stream
Sourcepub fn is_publishing(&self) -> bool
pub fn is_publishing(&self) -> bool
Check if stream is publishing
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Check if stream is playing
Sourcepub fn on_video(
&mut self,
timestamp: u32,
is_keyframe: bool,
is_header: bool,
size: usize,
)
pub fn on_video( &mut self, timestamp: u32, is_keyframe: bool, is_header: bool, size: usize, )
Update video state
Sourcepub fn on_metadata(&mut self)
pub fn on_metadata(&mut self)
Mark metadata received
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamState
impl RefUnwindSafe for StreamState
impl Send for StreamState
impl Sync for StreamState
impl Unpin for StreamState
impl UnwindSafe for StreamState
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