Skip to main content

WebRtcError

Enum WebRtcError 

Source
pub enum WebRtcError {
Show 25 variants Str0m(RtcError), Io(Error), UnsupportedBuffer(&'static str), MissingPacketPts, NegativePacketPts(i64), PacketTimestampNormalizationOverflow { value: i64, offset: i64, }, InvalidPacketTimeBase { numerator: i32, denominator: i32, }, PacketTimestampOverflow { pts: u64, numerator: i32, denominator: i32, }, OutboundCodecNotDeclared(TrackId), SourceCodecUnsupported(Id), ParameterSetsNotSupported { track_id: TrackId, codec: Codec, }, MissingParameterSets(TrackId), OutboundCodecNotNegotiated { track_id: TrackId, codec: Codec, negotiated: Vec<Codec>, }, NotAnnexB(TrackId), MalformedLengthPrefixedPacket(TrackId), StreamInfoTimeout { track_id: TrackId, timeout: Duration, }, UnsupportedCodecParameters(Codec), H264ParameterSetsNotReceived, InvalidH264ParameterSet(&'static str), CodecConfigurationTooLarge { size: usize, }, CodecParametersAllocationFailed { size: usize, }, InvalidStreamClockRate { codec: Codec, clock_rate: u32, }, InvalidStreamChannelCount { codec: Codec, channels: u8, }, DirectionChanged { mid: Mid, from: Direction, to: Direction, }, Closed,
}
Available on crate feature webrtc only.
Expand description

Errors specific to WebRtcPeer, its handle, and its track endpoints. Converts into the crate-wide Error via ? (see crate::error::Error).

Variants§

§

Str0m(RtcError)

str0m rejected signaling, RTP, or connection state.

§

Io(Error)

Sending or receiving a network datagram failed.

§

UnsupportedBuffer(&'static str)

An outbound track received a buffer other than an encoded packet.

§

MissingPacketPts

An outbound encoded packet has no presentation timestamp.

§

NegativePacketPts(i64)

A packet timestamp is negative and cannot be represented as RTP media time.

§

PacketTimestampNormalizationOverflow

Applying the track’s initial timestamp shift overflowed an FFmpeg packet timestamp.

Fields

§value: i64

PTS or DTS before normalization.

§offset: i64

Track-wide shift established by its first packet.

§

InvalidPacketTimeBase

A packet time base has a non-positive component.

Fields

§numerator: i32

Invalid rational numerator.

§denominator: i32

Invalid rational denominator.

§

PacketTimestampOverflow

Rescaling the packet timestamp exceeds str0m’s media-time range.

Fields

§pts: u64

Non-negative packet PTS that overflowed during rescaling.

§numerator: i32

Packet time-base numerator.

§denominator: i32

Packet time-base denominator.

§

OutboundCodecNotDeclared(TrackId)

A sink for a track added by the remote peer was pushed before the caller declared which codec its packets contain. SDP can negotiate several codecs for one track, so the peer cannot infer this from the track itself without risking a payload-type mismatch.

§

SourceCodecUnsupported(Id)

Codec parameters describe a codec WebRTC does not carry, so there is no RTP payload type this sink could send them under.

§

ParameterSetsNotSupported

Codec parameters carry configuration this sink cannot put in front of a keyframe. H.264’s avcC is converted; HEVC’s hvcC and VVC’s vvcC are not, so those need an encoder writing Annex-B headers.

Fields

§track_id: TrackId

Track whose source was being declared.

§codec: Codec

Codec the unusable configuration describes.

§

MissingParameterSets(TrackId)

The first keyframe on a track whose parameter sets live outside the bitstream carries none, and none were declared to put in front of it. RTP has no container to carry them, so a receiver would wait forever.

§

OutboundCodecNotNegotiated

The caller selected or tried to send an outbound codec that this track’s SDP negotiation did not retain. A failed super::track::WebRtcTrackSink::set_codec leaves the previous valid selection unchanged.

Fields

§track_id: TrackId

Track whose outbound codec was being selected.

§codec: Codec

Codec rejected by the negotiated media section.

§negotiated: Vec<Codec>

Distinct codecs currently available on that media section.

§

NotAnnexB(TrackId)

An outbound H.264 packet is length-prefixed — the form a container demuxer produces — and this sink has no avcC configuration to convert it with. RTP carries Annex-B, so such a packet would leave as a well-formed stream no receiver can decode.

§

MalformedLengthPrefixedPacket(TrackId)

A packet this sink’s avcC configuration says is length-prefixed does not parse as one — truncated, or carrying a different prefix size.

§

StreamInfoTimeout

No RTP media arrived before a caller’s explicit wait deadline. The source remains usable and the caller may retry with another timeout.

Fields

§track_id: TrackId

Track whose first actual payload has not arrived yet.

§timeout: Duration

Caller-supplied maximum wait.

§

UnsupportedCodecParameters(Codec)

The selected RTP payload is not media that can be represented as FFmpeg codec parameters (for example, RTX repair payload).

§

H264ParameterSetsNotReceived

H.264 codec parameters were requested from an SDP-only value rather than stream info confirmed from received SPS/PPS.

§

InvalidH264ParameterSet(&'static str)

A received H.264 parameter set cannot form codec configuration.

§

CodecConfigurationTooLarge

Codec configuration cannot fit FFmpeg’s signed extradata length.

Fields

§size: usize

Configuration size that could not be represented.

§

CodecParametersAllocationFailed

FFmpeg could not allocate owned codec extradata plus its required padding.

Fields

§size: usize

Requested allocation size including FFmpeg padding.

§

InvalidStreamClockRate

str0m accepts any non-zero u32 clock rate, while FFmpeg’s Rational denominator and audio sample rate are signed 32-bit values.

Fields

§codec: Codec

Codec whose RTP clock rate was being converted.

§clock_rate: u32

Clock rate outside FFmpeg’s signed range.

§

InvalidStreamChannelCount

An audio payload declared a channel count that FFmpeg cannot use.

Fields

§codec: Codec

Audio codec whose channel count was being converted.

§channels: u8

Invalid channel count from the payload specification.

§

DirectionChanged

The remote peer renegotiated a track’s direction after this element had already handed out its endpoints. Those describe the direction the track attached with (see super::track::TrackEndpoints) and cannot be re-issued, so what the caller holds no longer matches the connection. Reported rather than silently tolerated — the outbound half of a track that just became receive-only is dropped by str0m without an error, and the inbound half of one that just became send-only simply goes quiet.

Fields

§mid: Mid

The mid of the track whose direction changed.

§from: Direction

The direction the track attached with.

§to: Direction

The direction the remote peer renegotiated it to.

§

Closed

The peer run loop has ended and accepts no further commands.

Trait Implementations§

Source§

impl Debug for WebRtcError

Source§

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

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

impl Display for WebRtcError

Source§

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

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

impl Error for WebRtcError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for WebRtcError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<RtcError> for WebRtcError

Source§

fn from(source: RtcError) -> Self

Converts to this type from the input type.
Source§

impl From<WebRtcError> for Error

Source§

fn from(source: WebRtcError) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CryptoSafe for T
where T: Send + Sync + Debug,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more