pub enum BusMessage {
Show 21 variants
StreamStart,
Eos,
Info(String),
Error(G2gError),
ElementError {
element: String,
error: G2gError,
},
Warning(G2gError),
NegotiationFailed(NegotiationFailure),
StateChanged {
old: PipelineState,
new: PipelineState,
},
AsyncDone,
Qos {
running_time_ns: u64,
jitter_ns: i64,
processed: u64,
dropped: u64,
},
Buffering {
percent: u8,
element: Option<String>,
},
Tag {
tags: TagList,
program: Option<u16>,
},
StreamTag {
stream_id: String,
tags: TagList,
},
Chapters(Vec<Chapter>),
StreamCollection(StreamCollection),
StreamsSelected {
ids: Vec<String>,
},
DurationChanged {
duration_ns: u64,
},
SegmentDone {
position_ns: u64,
},
StreamStatus {
entered: bool,
thread_id: u64,
},
ClockLost,
Custom(u64),
}Expand description
An out-of-band message from an element to the application.
Variants§
StreamStart
A new stream has started: posted by the runner’s source arm before the
source produces any data, one per source (the GStreamer
GST_MESSAGE_STREAM_START analog, M206). Brackets a stream with the
matching Eos so an application can track stream
lifetime (e.g. reset per-stream UI on each start).
Eos
End-of-stream observed by the posting element.
Info(String)
An informational, non-error notification (the GStreamer
GST_MESSAGE_INFO analog, M206), the third severity below
Warning and Error. Carries
a human-readable message. Posted by elements or the application for
progress / status that is not a problem (a reconnect, a fallback taken),
so it never tears the pipeline down.
Error(G2gError)
Fatal error; the application should tear the pipeline down.
ElementError
The fatal error that ended a run, named with the element instance that
raised it. G2gError carries no element identity and the runner only
logged the name, which a program cannot act on; an application that wants
to react per element (retrying an auto-plugged decode with a different
decoder) reads this. Posted once, alongside the error the runner returns.
Fields
Warning(G2gError)
Non-fatal condition worth surfacing.
NegotiationFailed(NegotiationFailure)
A caps negotiation failed, carrying the structured
NegotiationFailure that names which link conflicted on what.
The runner still returns the (opaque) G2gError::CapsMismatch to its
caller; this preserves the detail the error type can’t, so the
application can report the offending element pair (M18 item 7).
StateChanged
The pipeline’s lifecycle state changed (M76). Posted by
StateController::set_state on every
effective transition along the NULL → READY → PAUSED → PLAYING ladder.
AsyncDone
An async state change completed (M77): a non-live Paused transition
finished once the sink took its preroll buffer. The GStreamer
ASYNC_DONE analog; posted once per preroll by
StateController::notify_prerolled.
Qos
Quality-of-service report (M85): a sink is running behind the pipeline
clock and dropped a frame that arrived too late to present. The
GStreamer GST_MESSAGE_QOS analog. Posted by a synchronizing sink
(e.g. SyncSink) when
it drops a late frame, so the application can react (lower the source
rate, simplify the pipeline) instead of silently falling behind. A sink
given a report interval (QosTracker::set_report_interval_ns)
also posts the same running stats periodically while frames flow, so the
trend is visible before anything is dropped.
Fields
Buffering
Buffering level report (M87): the fill percent (0-100) of a monitored
link. The GStreamer GST_MESSAGE_BUFFERING analog. g2g has no queue
element (per-edge LinkPolicy is the leaky-queue analog), so this
reports the bounded link channel’s own occupancy, posted by the runner’s
transform and sink arms for their input link when the level crosses a
quartile band. An application can pause until it sees 100, surface a
“buffering…” indicator while it is low, or find which interior link
starves by watching element.
Fields
Tag
Stream metadata a demuxer recovered from the container (the GStreamer
GST_MESSAGE_TAG analog). Posted out of band so the application can read
title / artist / encoder / etc. without intercepting the data path. A
demuxer with a tag source (e.g. oggdemux parsing VorbisComment) posts
it once the metadata header is parsed.
Fields
The metadata read from the container.
program: Option<u16>The program these tags describe, for a container whose metadata is
per program: an MPEG-TS program_number, one message per SDT service
entry, so a multi-program transport stream reports each service’s own
name (M878). None for a container with a single metadata scope
(Matroska, MP4, Ogg, FLV), where the tags describe the whole stream.
StreamTag
Metadata scoped to one elementary stream of a container, the stream-scoped
sibling of Tag (which stays whole-container). Posted
by a demuxer whose container tags name a track (a Matroska Tag whose
Targets carries a TagTrackUID, M787); stream_id is the id that track
has in the posted StreamCollection, so
the application attaches the tags to the stream it already knows.
Fields
The tags scoped to that stream.
Chapters(Vec<Chapter>)
The chapter list (table of contents) a demuxer recovered from the
container, in file order (the GStreamer GST_MESSAGE_TOC analog, M1046).
Posted out of band once the container’s chapter element is parsed, like
Tag, so an application can build a chapter menu and
seek to Chapter::start_ns without
intercepting the data path.
StreamCollection(StreamCollection)
The elementary streams a demuxer found in the container (the GStreamer
GST_MESSAGE_STREAM_COLLECTION analog, M376, the data model playbin is
built on). Posted out of band once the demuxer has parsed its track list,
listing every available audio / video / text stream (its type and
Caps) regardless of which one(s) the demuxer
forwards, so the application can discover what is in the container. App
driven selection among them is a follow-up.
StreamsSelected
The set of streams a demuxer now forwards changed in response to an
application selection (the GStreamer GST_MESSAGE_STREAMS_SELECTED
analog, M377). Carries the active stream ids (the ids from the
StreamCollection), so the app confirms
which streams took effect after a
StreamSelectController::select.
DurationChanged
The total stream duration became known or changed (the GStreamer
GST_MESSAGE_DURATION_CHANGED analog, M203). Posted by the runner’s
source arm when a source first reports a duration
(SourceLoop::query_duration),
so an application can refresh a seek bar’s length. The value is also
readable any time from the PipelineProgress
handle; this message is the push notification of the change.
SegmentDone
A SeekFlags::SEGMENT seek reached
its stop (the GStreamer GST_MESSAGE_SEGMENT_DONE analog). Posted by
SeekController::notify_segment_done
when a bus is attached to the controller, at the same moment the source
arms the take-once back-channel, so an application that loops a segment
can drive the next loop seek from the bus instead of polling
segment_done_count.
StreamStatus
A streaming thread started or finished (the GStreamer
GST_MESSAGE_STREAM_STATUS enter / leave analog). Only the thread-per-arm
runner (run_graph_threaded) posts
it, one entered: true before an arm’s future first polls on its own OS
thread and one entered: false when that future finishes, so an
application can see how many threads the graph is really spread over and
when each ends. The cooperative runner multiplexes every arm on the
caller’s executor and posts nothing.
Fields
ClockLost
The elected pipeline clock lost the reference it disciplines to (the
GStreamer GST_MESSAGE_CLOCK_LOST analog): a PTP clock whose master went
away, say. The runner posts it once per loss, having polled
PipelineClock::healthy on the elected
clock, then re-elects over the candidates that are still healthy and
retargets every sink’s ClockSync at the winner. The
application does not have to act; this says the timeline it was
synchronising to is no longer the one it started with.
Custom(u64)
Application-defined signal carrying an opaque code.
Trait Implementations§
Source§impl Clone for BusMessage
impl Clone for BusMessage
Source§fn clone(&self) -> BusMessage
fn clone(&self) -> BusMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more