gst.message

Module for [Message] class

class Message

Types 1

Messages are implemented as a subclass of #GstMiniObject with a generic #GstStructure as the content. This allows for writing custom messages without requiring an API change while allowing a wide range of different types of messages.

Messages are posted by objects in the pipeline and are passed to the application using the #GstBus.

The basic use pattern of posting a message on a #GstBus is as follows:

gst_bus_post (bus, gst_message_new_eos());

A #GstElement usually posts messages on the bus provided by the parent container using [gst.element.Element.postMessage].

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
Message self()Returns `this`, for use in `with` statements.
gst.mini_object.MiniObject miniObject() @propertyGet `miniObject` field. Returns: the parent structure
gst.types.MessageType type() @propertyGet `type` field. Returns: the #GstMessageType of the message
void type(gst.types.MessageType propval) @propertySet `type` field. Params: propval = the #GstMessageType of the message
ulong timestamp() @propertyGet `timestamp` field. Returns: the timestamp of the message
void timestamp(ulong propval) @propertySet `timestamp` field. Params: propval = the timestamp of the message
gst.object.ObjectWrap src() @propertyGet `src` field. Returns: the src of the message
void src(gst.object.ObjectWrap propval) @propertySet `src` field. Params: propval = the src of the message
uint seqnum() @propertyGet `seqnum` field. Returns: the sequence number of the message
void seqnum(uint propval) @propertySet `seqnum` field. Params: propval = the sequence number of the message
gst.message.Message newApplication(gst.object.ObjectWrap src, gst.structure.Structure structure)Create a new application-typed message. GStreamer will never create these messages; they are a gift from us to you. Enjoy.
gst.message.Message newAsyncDone(gst.object.ObjectWrap src, gst.types.ClockTime runningTime)The message is posted when elements completed an ASYNC state change. runningtime contains the time of the desired runningtime when this elements goes to PLAYING. A value of #GSTCLOCKTIMENONE for ru...
gst.message.Message newAsyncStart(gst.object.ObjectWrap src = null)This message is posted by elements when they start an ASYNC state change.
gst.message.Message newBuffering(gst.object.ObjectWrap src, int percent)Create a new buffering message. This message can be posted by an element that needs to buffer data before it can continue processing. percent should be a value between 0 and 100. A value of 100 mea...
gst.message.Message newClockLost(gst.object.ObjectWrap src, gst.clock.Clock clock)Create a clock lost message. This message is posted whenever the clock is not valid anymore.
gst.message.Message newClockProvide(gst.object.ObjectWrap src, gst.clock.Clock clock, bool ready)Create a clock provide message. This message is posted whenever an element is ready to provide a clock or lost its ability to provide a clock (maybe because it paused or became EOS).
gst.message.Message newCustom(gst.types.MessageType type, gst.object.ObjectWrap src = null, gst.structure.Structure structure = null)Create a new custom-typed message. This can be used for anything not handled by other message-specific functions to pass a message to the app. The structure field can be null.
gst.message.Message newDeviceAdded(gst.object.ObjectWrap src, gst.device.Device device)Creates a new device-added message. The device-added message is produced by #GstDeviceProvider or a #GstDeviceMonitor. They announce the appearance of monitored devices.
gst.message.Message newDeviceChanged(gst.object.ObjectWrap src, gst.device.Device device, gst.device.Device changedDevice)Creates a new device-changed message. The device-changed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. They announce that a device properties has changed and device represent th...
gst.message.Message newDeviceRemoved(gst.object.ObjectWrap src, gst.device.Device device)Creates a new device-removed message. The device-removed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. They announce the disappearance of monitored devices.
gst.message.Message newDurationChanged(gst.object.ObjectWrap src = null)Create a new duration changed message. This message is posted by elements that know the duration of a stream when the duration changes. This message is received by bins and is used to calculate the...
gst.message.Message newElement(gst.object.ObjectWrap src, gst.structure.Structure structure)Create a new element-specific message. This is meant as a generic way of allowing one-way communication from an element to an application, for example "the firewire cable was unplugged". The format...
gst.message.Message newEos(gst.object.ObjectWrap src = null)Create a new eos message. This message is generated and posted in the sink elements of a GstBin. The bin will only forward the EOS message to the application if all sinks have posted an EOS message.
gst.message.Message newError(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_)Create a new error message. The message will copy error and debug. This message is posted by element when a fatal event occurred. The pipeline will probably (partially) stop. The application receiv...
gst.message.Message newErrorWithDetails(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_, gst.structure.Structure details = null)Create a new error message. The message will copy error and debug. This message is posted by element when a fatal event occurred. The pipeline will probably (partially) stop. The application receiv...
gst.message.Message newHaveContext(gst.object.ObjectWrap src, gst.context.Context context)This message is posted when an element has a new local #GstContext.
gst.message.Message newInfo(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_)Create a new info message. The message will make copies of error and debug.
gst.message.Message newInfoWithDetails(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_, gst.structure.Structure details = null)Create a new info message. The message will make copies of error and debug.
gst.message.Message newInstantRateRequest(gst.object.ObjectWrap src, double rateMultiplier)Creates a new instant-rate-request message. Elements handling the instant-rate-change event must post this message. The message is handled at the pipeline, and allows the pipeline to select the run...
gst.message.Message newLatency(gst.object.ObjectWrap src = null)This message can be posted by elements when their latency requirements have changed.
gst.message.Message newNeedContext(gst.object.ObjectWrap src, string contextType)This message is posted when an element needs a specific #GstContext.
gst.message.Message newNewClock(gst.object.ObjectWrap src, gst.clock.Clock clock)Create a new clock message. This message is posted whenever the pipeline selects a new clock for the pipeline.
gst.message.Message newProgress(gst.object.ObjectWrap src, gst.types.ProgressType type, string code, string text)Progress messages are posted by elements when they use an asynchronous task to perform actions triggered by a state change.
gst.message.Message newQos(gst.object.ObjectWrap src, bool live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration)A QOS message is posted on the bus whenever an element decides to drop a buffer because of QoS reasons or whenever it changes its processing strategy because of QoS reasons (quality adjustments suc...
gst.message.Message newRedirect(gst.object.ObjectWrap src, string location, gst.tag_list.TagList tagList = null, gst.structure.Structure entryStruct = null)Creates a new redirect message and adds a new entry to it. Redirect messages are posted when an element detects that the actual data has to be retrieved from a different location. This is useful if...
gst.message.Message newRequestState(gst.object.ObjectWrap src, gst.types.State state)This message can be posted by elements when they want to have their state changed. A typical use case would be an audio server that wants to pause the pipeline because a higher priority stream is b...
gst.message.Message newResetTime(gst.object.ObjectWrap src, gst.types.ClockTime runningTime)This message is posted when the pipeline running-time should be reset to running_time, like after a flushing seek.
gst.message.Message newSegmentDone(gst.object.ObjectWrap src, gst.types.Format format, long position)Create a new segment done message. This message is posted by elements that finish playback of a segment as a result of a segment seek. This message is received by the application after all elements...
gst.message.Message newSegmentStart(gst.object.ObjectWrap src, gst.types.Format format, long position)Create a new segment message. This message is posted by elements that start playback of a segment as a result of a segment seek. This message is not received by the application but is used for main...
gst.message.Message newStateChanged(gst.object.ObjectWrap src, gst.types.State oldstate, gst.types.State newstate, gst.types.State pending)Create a state change message. This message is posted whenever an element changed its state.
gst.message.Message newStateDirty(gst.object.ObjectWrap src = null)Create a state dirty message. This message is posted whenever an element changed its state asynchronously and is used internally to update the states of container objects.
gst.message.Message newStepDone(gst.object.ObjectWrap src, gst.types.Format format, ulong amount, double rate, bool flush, bool intermediate, ulong duration, bool eos)This message is posted by elements when they complete a part, when intermediate set to true, or a complete step operation.
gst.message.Message newStepStart(gst.object.ObjectWrap src, bool active, gst.types.Format format, ulong amount, double rate, bool flush, bool intermediate)This message is posted by elements when they accept or activate a new step event for amount in format.
gst.message.Message newStreamCollection(gst.object.ObjectWrap src, gst.stream_collection.StreamCollection collection)Creates a new stream-collection message. The message is used to announce new #GstStreamCollection
gst.message.Message newStreamStart(gst.object.ObjectWrap src = null)Create a new streamstart message. This message is generated and posted in the sink elements of a GstBin. The bin will only forward the STREAMSTART message to the application if all sinks have poste...
gst.message.Message newStreamStatus(gst.object.ObjectWrap src, gst.types.StreamStatusType type, gst.element.Element owner)Create a new stream status message. This message is posted when a streaming thread is created/destroyed or when the state changed.
gst.message.Message newStreamsSelected(gst.object.ObjectWrap src, gst.stream_collection.StreamCollection collection)Creates a new steams-selected message. The message is used to announce that an array of streams has been selected. This is generally in response to a #GSTEVENTSELECT_STREAMS event, or when an eleme...
gst.message.Message newStructureChange(gst.object.ObjectWrap src, gst.types.StructureChangeType type, gst.element.Element owner, bool busy)Create a new structure change message. This message is posted when the structure of a pipeline is in the process of being changed, for example when pads are linked or unlinked.
gst.message.Message newTag(gst.object.ObjectWrap src, gst.tag_list.TagList tagList)Create a new tag message. The message will take ownership of the tag list. The message is posted by elements that discovered a new taglist.
gst.message.Message newToc(gst.object.ObjectWrap src, gst.toc.Toc toc, bool updated)Create a new TOC message. The message is posted by elements that discovered or updated a TOC.
gst.message.Message newWarning(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_)Create a new warning message. The message will make copies of error and debug.
gst.message.Message newWarningWithDetails(gst.object.ObjectWrap src, glib.error.ErrorWrap error, string debug_, gst.structure.Structure details = null)Create a new warning message. The message will make copies of error and debug.
void addRedirectEntry(string location, gst.tag_list.TagList tagList = null, gst.structure.Structure entryStruct = null)Creates and appends a new entry.
uint getSeqnum()Retrieve the sequence number of a message.
gobject.value.Value getStreamStatusObject()Extracts the object managing the streaming thread from message. Returns: a GValue containing the object that manages the streaming thread. This object is usually of type GstTask but other types can...
gst.structure.Structure getStructure()Access the structure of the message. Returns: The structure of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes invalid...
bool hasName(string name)Checks if message has the given name. This function is usually used to check the name of a custom message.
void parseAsyncDone(out gst.types.ClockTime runningTime)Extract the runningtime from the asyncdone message.
void parseBuffering(out int percent)Extracts the buffering percent from the GstMessage. see also [gst.message.Message.newBuffering].
void parseBufferingStats(out gst.types.BufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft)Extracts the buffering stats values from message.
void parseClockLost(out gst.clock.Clock clock)Extracts the lost clock from the GstMessage. The clock object returned remains valid until the message is freed.
void parseClockProvide(out gst.clock.Clock clock, out bool ready)Extracts the clock and ready flag from the GstMessage. The clock object returned remains valid until the message is freed.
bool parseContextType(out string contextType)Parse a context type from an existing GSTMESSAGENEED_CONTEXT message.
void parseDeviceAdded(out gst.device.Device device)Parses a device-added message. The device-added message is produced by #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance of monitored devices.
void parseDeviceChanged(out gst.device.Device device, out gst.device.Device changedDevice)Parses a device-changed message. The device-changed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. It announces the disappearance of monitored devices. * It announce that a devic...
void parseDeviceRemoved(out gst.device.Device device)Parses a device-removed message. The device-removed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. It announces the disappearance of monitored devices.
void parseError(out glib.error.ErrorWrap gerror, out string debug_)Extracts the GError and debug string from the GstMessage. The values returned in the output arguments are copies; the caller must free them when done.
void parseErrorDetails(out gst.structure.Structure structure)Returns the optional details structure, may be NULL if none. The returned structure must not be freed.
bool parseGroupId(out uint groupId)Extract the group from the STREAM_START message.
void parseHaveContext(out gst.context.Context context)Extract the context from the HAVE_CONTEXT message.
void parseInfo(out glib.error.ErrorWrap gerror, out string debug_)Extracts the GError and debug string from the GstMessage. The values returned in the output arguments are copies; the caller must free them when done.
void parseInfoDetails(out gst.structure.Structure structure)Returns the optional details structure, may be NULL if none The returned structure must not be freed.
void parseInstantRateRequest(out double rateMultiplier)Parses the rate_multiplier from the instant-rate-request message.
void parseNewClock(out gst.clock.Clock clock)Extracts the new clock from the GstMessage. The clock object returned remains valid until the message is freed.
void parseProgress(out gst.types.ProgressType type, out string code, out string text)Parses the progress type, code and text.
void parsePropertyNotify(out gst.object.ObjectWrap object, out string propertyName, out gobject.value.Value propertyValue)Parses a property-notify message. These will be posted on the bus only when set up with [gst.element.Element.addPropertyNotifyWatch] or [gst.element.Element.addPropertyDeepNotifyWatch].
void parseQos(out bool live, out ulong runningTime, out ulong streamTime, out ulong timestamp, out ulong duration)Extract the timestamps and live status from the QoS message.
void parseQosStats(out gst.types.Format format, out ulong processed, out ulong dropped)Extract the QoS stats representing the history of the current continuous pipeline playback period.
void parseQosValues(out long jitter, out double proportion, out int quality)Extract the QoS values that have been calculated/analysed from the QoS data
void parseRedirectEntry(size_t entryIndex, out string location, out gst.tag_list.TagList tagList, out gst.structure.Structure entryStruct)Parses the location and/or structure from the entry with the given index. The index must be between 0 and [gst.message.Message.getNumRedirectEntries] - 1. Returned pointers are valid for as long as...
void parseRequestState(out gst.types.State state)Extract the requested state from the request_state message.
void parseResetTime(out gst.types.ClockTime runningTime)Extract the running-time from the RESET_TIME message.
void parseSegmentDone(out gst.types.Format format, out long position)Extracts the position and format from the segment done message.
void parseSegmentStart(out gst.types.Format format, out long position)Extracts the position and format from the segment start message.
void parseStateChanged(out gst.types.State oldstate, out gst.types.State newstate, out gst.types.State pending)Extracts the old and new states from the GstMessage.
void parseStepDone(out gst.types.Format format, out ulong amount, out double rate, out bool flush, out bool intermediate, out ulong duration, out bool eos)Extract the values the step_done message.
void parseStepStart(out bool active, out gst.types.Format format, out ulong amount, out double rate, out bool flush, out bool intermediate)Extract the values from step_start message.
void parseStreamCollection(out gst.stream_collection.StreamCollection collection)Parses a stream-collection message.
void parseStreamStatus(out gst.types.StreamStatusType type, out gst.element.Element owner)Extracts the stream status type and owner the GstMessage. The returned owner remains valid for as long as the reference to message is valid and should thus not be unreffed.
void parseStreamsSelected(out gst.stream_collection.StreamCollection collection)Parses a streams-selected message.
void parseStructureChange(out gst.types.StructureChangeType type, out gst.element.Element owner, out bool busy)Extracts the change type and completion status from the GstMessage.
void parseTag(out gst.tag_list.TagList tagList)Extracts the tag list from the GstMessage. The tag list returned in the output argument is a copy; the caller must free it when done.
void parseToc(out gst.toc.Toc toc, out bool updated)Extract the TOC from the #GstMessage. The TOC returned in the output argument is a copy; the caller must free it with gsttocunref() when done.
void parseWarning(out glib.error.ErrorWrap gerror, out string debug_)Extracts the GError and debug string from the GstMessage. The values returned in the output arguments are copies; the caller must free them when done.
void parseWarningDetails(out gst.structure.Structure structure)Returns the optional details structure, may be NULL if none The returned structure must not be freed.
void setBufferingStats(gst.types.BufferingMode mode, int avgIn, int avgOut, long bufferingLeft)Configures the buffering stats values in message.
void setGroupId(uint groupId)Sets the group id on the stream-start message.
void setQosStats(gst.types.Format format, ulong processed, ulong dropped)Set the QoS stats representing the history of the current continuous pipeline playback period.
void setQosValues(long jitter, double proportion, int quality)Set the QoS values that have been calculated/analysed from the QoS data
void setSeqnum(uint seqnum)Set the sequence number of a message.
void setStreamStatusObject(gobject.value.Value object)Configures the object handling the streaming thread. This is usually a GstTask object but other objects might be added in the future.
void streamsSelectedAdd(gst.stream.Stream stream)Adds the stream to the message.
uint streamsSelectedGetSize()Returns the number of streams contained in the message. Returns: The number of streams contained within.
gst.stream.Stream streamsSelectedGetStream(uint idx)Retrieves the #GstStream with index index from the message.
gst.structure.Structure writableStructure()Get a writable version of the structure. Returns: The structure of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes inv...
Constructors
this(gst.types.MessageType type = gst.types.MessageType.init, ulong timestamp = ulong.init, gst.object.ObjectWrap src = gst.object.ObjectWrap.init, uint seqnum = uint.init)Create a `message.Message` boxed type. Params: type = the #GstMessageType of the message timestamp = the timestamp of the message src = the src of the message seqnum = the sequence number of the me...
this(void * ptr, Flag!"Take" take)