Skip to main content

BusMessage

Enum BusMessage 

Source
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

§element: String

The failing element’s instance name, as the runner assigned it.

§error: G2gError
§

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.

Fields

§old: PipelineState

State before the change.

§new: PipelineState

State after the change.

§

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

§running_time_ns: u64

Running time (PTS) of the frame this report concerns.

§jitter_ns: i64

How far past its deadline the frame was, in ns. Signed: positive is late (behind the clock), negative early.

§processed: u64

Frames the sink has presented so far (cumulative).

§dropped: u64

Frames the sink has dropped so far (cumulative, this drop included).

§

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

§percent: u8

Fill of the reported input link, 0 (empty / underrun) to 100 (full).

§element: Option<String>

Instance name of the element the reported link feeds (<category>N, or a launch line’s name=). None when the level is a source’s own prebuffer rather than a runner link.

§

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

§tags: TagList

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

§stream_id: String

The tagged stream’s id, as announced in the StreamCollection.

§tags: TagList

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.

Fields

§ids: Vec<String>

The stream ids the demuxer is now forwarding.

§

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.

Fields

§duration_ns: u64

The new total duration in nanoseconds.

§

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.

Fields

§position_ns: u64

Stream-time position (ns) where the segment ended.

§

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

§entered: bool

true for the thread’s enter, false for its leave.

§thread_id: u64

Identifies the OS thread the arm runs on: a hash of its std::thread::ThreadId, since the id itself has no stable numeric form. Only equality is meaningful, so an enter pairs with its leave.

§

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

Source§

fn clone(&self) -> BusMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BusMessage

Source§

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

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

impl PartialEq for BusMessage

Source§

fn eq(&self, other: &BusMessage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BusMessage

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ElementBound for T
where T: Send,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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, <T as TryFrom<U>>::Error>

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.