pub struct EncodedFrame<'a> {
pub direction: FrameDirection,
pub kind: MediaKind,
pub is_key_frame: bool,
pub payload_type: u8,
pub ssrc: u32,
pub timestamp: u32,
pub capture_time_ms: i64,
pub mime_type: &'a str,
pub data: &'a [u8],
/* private fields */
}Expand description
A borrowed encoded media frame. data and mime_type are valid only for
the duration of the callback — copy them to retain.
Fields§
§direction: FrameDirection§kind: MediaKind§is_key_frame: boolVideo only: whether this is a key frame (always false for audio).
payload_type: u8§ssrc: u32§timestamp: u32The frame’s RTP timestamp.
capture_time_ms: i64Capture timestamp in milliseconds (monotonic, same epoch as
webrtc::TimeMicros). Zero when unavailable.
mime_type: &'a stre.g. "video/VP8", "audio/opus".
data: &'a [u8]The encoded payload.
Implementations§
Source§impl EncodedFrame<'_>
impl EncodedFrame<'_>
Sourcepub fn replace_data(&self, data: &[u8])
pub fn replace_data(&self, data: &[u8])
Replace this frame’s encoded payload (copied). Combine with
FrameAction::Forward to send/forward your own encoded bytes in place
of the original. No effect if FrameAction::Drop is returned.
Auto Trait Implementations§
impl<'a> !Send for EncodedFrame<'a>
impl<'a> !Sync for EncodedFrame<'a>
impl<'a> Freeze for EncodedFrame<'a>
impl<'a> RefUnwindSafe for EncodedFrame<'a>
impl<'a> Unpin for EncodedFrame<'a>
impl<'a> UnsafeUnpin for EncodedFrame<'a>
impl<'a> UnwindSafe for EncodedFrame<'a>
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