Skip to main content

ReferencePictureSelectionIndication

Struct ReferencePictureSelectionIndication 

Source
pub struct ReferencePictureSelectionIndication {
    pub sender_ssrc: u32,
    pub media_ssrc: u32,
    pub payload_type: u8,
    pub native_rpsi: Bytes,
    pub unused_bits: u8,
}
Expand description

Reference Picture Selection Indication (PSFB FMT=3): the receiver names a reference picture in the codec’s own terms. Exactly one indication per packet.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      PB       |0| Payload Type|    Native RPSI bit string     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   defined per codec          ...                | Padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields§

§sender_ssrc: u32

The source that sends the indication.

§media_ssrc: u32

The media sender it is for.

§payload_type: u8

The RTP payload type that says how the bit string is to be read, 7 bits.

§native_rpsi: Bytes

The native RPSI bit string, as the codec defines it, most significant bit first. When its length is not a whole number of octets, the last octet’s low bits are padding.

§unused_bits: u8

How many low bits of the last octet of native_rpsi are not part of the bit string, 0 to 7. They are sent as zero.

Implementations§

Source§

impl ReferencePictureSelectionIndication

Source

pub fn hevc( sender_ssrc: u32, media_ssrc: u32, payload_type: u8, nuh_layer_id: u8, pic_order_cnt_val: u32, ) -> Result<Self>

An RPSI for an H.265 stream (RFC 7798 section 8.3): a request that the encoder use the picture with nuh_layer_id (6 bits) and pic_order_cnt_val as its reference. The native bit string is “a base16 representation of the 8 bits consisting of the 2 most significant bits equal to 0 and 6 bits of nuh_layer_id, … followed by the 32 bits representing the value of the PicOrderCntVal (in network byte order)”: ten hexadecimal digits. RFC 7798 deprecates RPSI as a positive acknowledgement; this is the request form, the only one it allows. A nuh_layer_id over 63 is refused.

Source

pub fn hevc_picture(&self) -> Option<(u8, u32)>

The (nuh_layer_id, PicOrderCntVal) of an H.265 RPSI’s native bit string (RFC 7798 section 8.3), None when it is not ten hexadecimal digits with the two high bits of the layer octet zero.

Source

pub fn picture_id( sender_ssrc: u32, media_ssrc: u32, payload_type: u8, picture_id: u16, extended: bool, ) -> Result<Self>

An RPSI for a VP8 stream (RFC 7741 section 5.1) or a VP9 stream (RFC 9628 section 5.1): the native bit string “is simply the (7- or 15-bit) Picture ID of the received frame”, as its payload descriptor carried it: 7 bits for a Picture ID below 128 unless extended, 15 bits otherwise (the descriptor’s M bit). The bits are left-aligned in the octets, the low bit of the last octet unused. A Picture ID above 15 bits is refused.

Source

pub fn vp8_vp9_picture_id(&self) -> Option<u16>

The Picture ID of a VP8 or VP9 RPSI (Self::picture_id): a native bit string of 7 or 15 bits, None for any other length.

Source

pub fn native_rpsi_bits(&self) -> usize

The length of the native bit string in bits.

Trait Implementations§

Source§

impl Clone for ReferencePictureSelectionIndication

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReferencePictureSelectionIndication

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReferencePictureSelectionIndication

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for ReferencePictureSelectionIndication

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ReferencePictureSelectionIndication

Source§

impl Marshal for ReferencePictureSelectionIndication

Source§

fn marshal_to(&self, buf: &mut [u8]) -> Result<usize>

Encodes into buf, returning the number of bytes written. Read more
Source§

fn marshal(&self) -> Result<BytesMut, Error>

Encodes into a freshly allocated buffer sized by MarshalSize::marshal_size. Read more
Source§

impl MarshalSize for ReferencePictureSelectionIndication

Source§

fn marshal_size(&self) -> usize

The number of bytes Marshal::marshal_to will write for this value.
Source§

impl Packet for ReferencePictureSelectionIndication

Source§

fn header(&self) -> Header

This packet’s RTCP header.
Source§

fn destination_ssrc(&self) -> Vec<u32>

The SSRCs this packet is about. Read more
Source§

fn raw_size(&self) -> usize

The encoded size in bytes, header and padding included.
Source§

fn as_any(&self) -> &dyn Any

Downcasting hook, so a caller holding Box<dyn Packet> can recover the concrete type.
Source§

fn equal(&self, other: &dyn Packet) -> bool

Compares against another packet, since PartialEq is not object safe.
Source§

fn cloned(&self) -> Box<dyn Packet>

Clones this packet behind a trait object, since Clone is not object safe.
Source§

impl PartialEq for ReferencePictureSelectionIndication

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReferencePictureSelectionIndication

Source§

impl Unmarshal for ReferencePictureSelectionIndication

Source§

fn unmarshal<B>(raw_packet: &mut B) -> Result<Self>
where Self: Sized, B: Buf,

Decodes one value from buf, advancing it past the bytes consumed. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.