Trait gstreamer_rtp::subclass::prelude::RTPHeaderExtensionImpl
source · pub trait RTPHeaderExtensionImpl: RTPHeaderExtensionImplExt + ElementImpl {
const URI: &'static str;
// Provided methods
fn supported_flags(&self) -> RTPHeaderExtensionFlags { ... }
fn max_size(&self, input: &BufferRef) -> usize { ... }
fn write(
&self,
input: &BufferRef,
write_flags: RTPHeaderExtensionFlags,
output: &BufferRef,
output_data: &mut [u8],
) -> Result<usize, LoggableError> { ... }
fn read(
&self,
read_flags: RTPHeaderExtensionFlags,
input_data: &[u8],
output: &mut BufferRef,
) -> Result<(), LoggableError> { ... }
fn set_non_rtp_sink_caps(&self, caps: &Caps) -> Result<(), LoggableError> { ... }
fn update_non_rtp_src_caps(
&self,
caps: &mut CapsRef,
) -> Result<(), LoggableError> { ... }
fn set_attributes(
&self,
direction: RTPHeaderExtensionDirection,
attributes: &str,
) -> Result<(), LoggableError> { ... }
fn set_caps_from_attributes(
&self,
caps: &mut CapsRef,
) -> Result<(), LoggableError> { ... }
}
Required Associated Constants§
Provided Methods§
sourcefn supported_flags(&self) -> RTPHeaderExtensionFlags
fn supported_flags(&self) -> RTPHeaderExtensionFlags
sourcefn max_size(&self, input: &BufferRef) -> usize
fn max_size(&self, input: &BufferRef) -> usize
This is used to know how much data a certain header extension will need for both allocating the resulting data, and deciding how much payload data can be generated.
Implementations should return as accurate a value as is possible using the
information given in the input buffer
.
§input_meta
§Returns
the maximum size of the data written by this extension
sourcefn write(
&self,
input: &BufferRef,
write_flags: RTPHeaderExtensionFlags,
output: &BufferRef,
output_data: &mut [u8],
) -> Result<usize, LoggableError>
fn write( &self, input: &BufferRef, write_flags: RTPHeaderExtensionFlags, output: &BufferRef, output_data: &mut [u8], ) -> Result<usize, LoggableError>
Writes the RTP header extension to data
using information available from
the input_meta
. data
will be sized to be at least the value returned
from RTPHeaderExtensionExt::max_size()
.
§input_meta
the input gst::Buffer
to read information from if necessary
§write_flags
RTPHeaderExtensionFlags
for how the extension should
be written
§output
output RTP gst::Buffer
§data
location to write the rtp header extension into
§Returns
the size of the data written, < 0 on failure
sourcefn read(
&self,
read_flags: RTPHeaderExtensionFlags,
input_data: &[u8],
output: &mut BufferRef,
) -> Result<(), LoggableError>
fn read( &self, read_flags: RTPHeaderExtensionFlags, input_data: &[u8], output: &mut BufferRef, ) -> Result<(), LoggableError>
Read the RTP header extension from data
.
§read_flags
RTPHeaderExtensionFlags
for how the extension should
be written
§data
location to read the rtp header extension from
§buffer
a gst::Buffer
to modify if necessary
§Returns
whether the extension could be read from data
sourcefn set_non_rtp_sink_caps(&self, caps: &Caps) -> Result<(), LoggableError>
fn set_non_rtp_sink_caps(&self, caps: &Caps) -> Result<(), LoggableError>
sourcefn update_non_rtp_src_caps(
&self,
caps: &mut CapsRef,
) -> Result<(), LoggableError>
fn update_non_rtp_src_caps( &self, caps: &mut CapsRef, ) -> Result<(), LoggableError>
sourcefn set_attributes(
&self,
direction: RTPHeaderExtensionDirection,
attributes: &str,
) -> Result<(), LoggableError>
fn set_attributes( &self, direction: RTPHeaderExtensionDirection, attributes: &str, ) -> Result<(), LoggableError>
set the necessary attributes that may be signaled e.g. with an SDP.
sourcefn set_caps_from_attributes(
&self,
caps: &mut CapsRef,
) -> Result<(), LoggableError>
fn set_caps_from_attributes( &self, caps: &mut CapsRef, ) -> Result<(), LoggableError>
RTPHeaderExtensionExt::set_id()
must have been called with a valid
extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced
by gst_sdp_media_attributes_to_caps()
.
§caps
writable gst::Caps
to modify
§Returns
whether the configured attributes on self
can successfully be set on
caps