pub struct WebRtcStreamInfo { /* private fields */ }webrtc only.Expand description
Parameters confirmed from actual payloads on an inbound WebRTC track.
SDP exposes several possible codecs, while this value identifies the one
the remote sender actually used. Audio payload metadata is sufficient as
soon as the first payload arrives. H.264 is different: construction waits
until both SPS and PPS have arrived, so Self::codec_parameters can
describe the stream without borrowing the remote encoder’s configuration.
Implementations§
Source§impl WebRtcStreamInfo
impl WebRtcStreamInfo
Sourcepub fn codec_spec(&self) -> CodecSpec
pub fn codec_spec(&self) -> CodecSpec
Returns the full str0m payload specification observed on the stream.
Sourcepub fn video_dimensions(&self) -> Option<(u32, u32)>
pub fn video_dimensions(&self) -> Option<(u32, u32)>
Returns dimensions parsed from received codec configuration, currently
Some for H.264 information returned by wait_stream_info.
Sourcepub fn time_base(&self) -> Result<Rational>
pub fn time_base(&self) -> Result<Rational>
Returns the RTP timestamp time base derived from the codec clock rate.
Sourcepub fn codec_parameters(&self) -> Result<Parameters>
pub fn codec_parameters(&self) -> Result<Parameters>
Builds FFmpeg codec parameters for this depayloaded stream.
The result describes the compressed stream independently of its next
consumer and can be passed to a decoder or container muxer. H.264
includes received SPS/PPS and dimensions, while Opus includes the
negotiated channel layout and OpusHead. Whether a particular
container accepts the codec remains the muxer’s responsibility.
Trait Implementations§
Source§impl Clone for WebRtcStreamInfo
impl Clone for WebRtcStreamInfo
Source§fn clone(&self) -> WebRtcStreamInfo
fn clone(&self) -> WebRtcStreamInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more