pub struct GapPayload {
pub media_source_id: u32,
pub rtp_sequence: u32,
pub rtp_timestamp: u64,
pub key_phase: u32,
pub opus_frame: ByteBuf,
}Expand description
Audio frame payload.
Fields§
§media_source_id: u32Audio source identifier (microphone or device).
rtp_sequence: u3216-bit rtp_sequence widened to u32 for CBOR uint compatibility.
rtp_timestamp: u6448 kHz timestamp.
key_phase: u32Key phase (binds the payload to a specific MLS epoch).
opus_frame: ByteBufOpus frame bytes.
Implementations§
Source§impl GapPayload
impl GapPayload
Sourcepub fn opus_20ms(
media_source_id: u32,
rtp_sequence: u16,
key_phase: u32,
opus: Vec<u8>,
) -> Self
pub fn opus_20ms( media_source_id: u32, rtp_sequence: u16, key_phase: u32, opus: Vec<u8>, ) -> Self
Builds a 20 ms Opus frame at 48 kHz (960 samples).
Sourcepub fn with_timestamp(
media_source_id: u32,
rtp_sequence: u16,
rtp_timestamp: u64,
key_phase: u32,
opus: Vec<u8>,
) -> Self
pub fn with_timestamp( media_source_id: u32, rtp_sequence: u16, rtp_timestamp: u64, key_phase: u32, opus: Vec<u8>, ) -> Self
Builds an Opus frame with an explicit rtp_timestamp.
Prefer GapPayload::opus_20ms for the common 48 kHz / 20 ms case.
Sourcepub fn from_cbor(data: &[u8]) -> Result<Self, CodecError>
pub fn from_cbor(data: &[u8]) -> Result<Self, CodecError>
Decodes a CBOR-encoded payload.
Trait Implementations§
Source§impl Clone for GapPayload
impl Clone for GapPayload
Source§fn clone(&self) -> GapPayload
fn clone(&self) -> GapPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GapPayload
impl Debug for GapPayload
Source§impl<'de> Deserialize<'de> for GapPayload
impl<'de> Deserialize<'de> for GapPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GapPayload
impl RefUnwindSafe for GapPayload
impl Send for GapPayload
impl Sync for GapPayload
impl Unpin for GapPayload
impl UnsafeUnpin for GapPayload
impl UnwindSafe for GapPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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>
Converts
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>
Converts
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