Skip to main content

EncodedFrame

Struct EncodedFrame 

Source
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: bool

Video only: whether this is a key frame (always false for audio).

§payload_type: u8§ssrc: u32§timestamp: u32

The frame’s RTP timestamp.

§capture_time_ms: i64

Capture timestamp in milliseconds (monotonic, same epoch as webrtc::TimeMicros). Zero when unavailable.

§mime_type: &'a str

e.g. "video/VP8", "audio/opus".

§data: &'a [u8]

The encoded payload.

Implementations§

Source§

impl EncodedFrame<'_>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.