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>,
) -> GapPayload
pub fn opus_20ms( media_source_id: u32, rtp_sequence: u16, key_phase: u32, opus: Vec<u8>, ) -> GapPayload
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>,
) -> GapPayload
pub fn with_timestamp( media_source_id: u32, rtp_sequence: u16, rtp_timestamp: u64, key_phase: u32, opus: Vec<u8>, ) -> GapPayload
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<GapPayload, CodecError>
pub fn from_cbor(data: &[u8]) -> Result<GapPayload, CodecError>
Decodes a CBOR-encoded payload.
Sourcepub fn from_bytes(
data: &[u8],
codec: PayloadCodec,
) -> Result<GapPayload, CodecError>
pub fn from_bytes( data: &[u8], codec: PayloadCodec, ) -> Result<GapPayload, CodecError>
Decodes from the given codec.
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<GapPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GapPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<GapPayload> for GapPayload
impl From<GapPayload> for GapPayload
Source§fn from(p: GapPayload) -> GapPayload
fn from(p: GapPayload) -> GapPayload
Converts to this type from the input type.
Source§impl Serialize for GapPayload
impl Serialize for GapPayload
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'a> TryFrom<GapPayloadRef<'a>> for GapPayload
impl<'a> TryFrom<GapPayloadRef<'a>> for GapPayload
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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