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,
}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
InvalidPacketTimeBase
A packet time base has a non-positive component.
PacketTimestampOverflow
Rescaling the packet timestamp exceeds str0m’s media-time range.
Fields
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
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
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
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.
CodecParametersAllocationFailed
FFmpeg could not allocate owned codec extradata plus its required 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
InvalidStreamChannelCount
An audio payload declared a channel count that FFmpeg cannot use.
Fields
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
Closed
The peer run loop has ended and accepts no further commands.
Trait Implementations§
Source§impl Debug for WebRtcError
impl Debug for WebRtcError
Source§impl Display for WebRtcError
impl Display for WebRtcError
Source§impl Error for WebRtcError
impl Error for WebRtcError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()