Message

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.

class Message : Boxed {}

Members

Functions

addRedirectEntry
void addRedirectEntry(string location, gst.tag_list.TagList tagList, gst.structure.Structure entryStruct)

Creates and appends a new entry.

getNumRedirectEntries
size_t getNumRedirectEntries()
getSeqnum
uint getSeqnum()

Retrieve the sequence number of a message.

getStreamStatusObject
gobject.value.Value getStreamStatusObject()

Extracts the object managing the streaming thread from message.

getStructure
gst.structure.Structure getStructure()

Access the structure of the message.

hasName
bool hasName(string name)

Checks if message has the given name. This function is usually used to check the name of a custom message.

parseAsyncDone
void parseAsyncDone(gst.types.ClockTime runningTime)

Extract the running_time from the async_done message.

parseBuffering
void parseBuffering(int percent)

Extracts the buffering percent from the GstMessage. see also gst.message.Message.newBuffering.

parseBufferingStats
void parseBufferingStats(gst.types.BufferingMode mode, int avgIn, int avgOut, long bufferingLeft)

Extracts the buffering stats values from message.

parseClockLost
void parseClockLost(gst.clock.Clock clock)

Extracts the lost clock from the GstMessage. The clock object returned remains valid until the message is freed.

parseClockProvide
void parseClockProvide(gst.clock.Clock clock, bool ready)

Extracts the clock and ready flag from the GstMessage. The clock object returned remains valid until the message is freed.

parseContextType
bool parseContextType(string contextType)

Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.

parseDeviceAdded
void parseDeviceAdded(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.

parseDeviceChanged
void parseDeviceChanged(gst.device.Device device, 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 device properties has changed and device represents the new modified version of changed_device.

parseDeviceRemoved
void parseDeviceRemoved(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.

parseError
void parseError(glib.error.ErrorG gerror, 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.

parseErrorDetails
void parseErrorDetails(gst.structure.Structure structure)

Returns the optional details structure, may be NULL if none. The returned structure must not be freed.

parseGroupId
bool parseGroupId(uint groupId)

Extract the group from the STREAM_START message.

parseHaveContext
void parseHaveContext(gst.context.Context context)

Extract the context from the HAVE_CONTEXT message.

parseInfo
void parseInfo(glib.error.ErrorG gerror, 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.

parseInfoDetails
void parseInfoDetails(gst.structure.Structure structure)

Returns the optional details structure, may be NULL if none The returned structure must not be freed.

parseInstantRateRequest
void parseInstantRateRequest(double rateMultiplier)

Parses the rate_multiplier from the instant-rate-request message.

parseNewClock
void parseNewClock(gst.clock.Clock clock)

Extracts the new clock from the GstMessage. The clock object returned remains valid until the message is freed.

parseProgress
void parseProgress(gst.types.ProgressType type, string code, string text)

Parses the progress type, code and text.

parsePropertyNotify
void parsePropertyNotify(gst.object.ObjectGst object, string propertyName, 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.

parseQos
void parseQos(bool live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration)

Extract the timestamps and live status from the QoS message.

parseQosStats
void parseQosStats(gst.types.Format format, ulong processed, ulong dropped)

Extract the QoS stats representing the history of the current continuous pipeline playback period.

parseQosValues
void parseQosValues(long jitter, double proportion, int quality)

Extract the QoS values that have been calculated/analysed from the QoS data

parseRedirectEntry
void parseRedirectEntry(size_t entryIndex, string location, gst.tag_list.TagList tagList, 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 this message exists.

parseRequestState
void parseRequestState(gst.types.State state)

Extract the requested state from the request_state message.

parseResetTime
void parseResetTime(gst.types.ClockTime runningTime)

Extract the running-time from the RESET_TIME message.

parseSegmentDone
void parseSegmentDone(gst.types.Format format, long position)

Extracts the position and format from the segment done message.

parseSegmentStart
void parseSegmentStart(gst.types.Format format, long position)

Extracts the position and format from the segment start message.

parseStateChanged
void parseStateChanged(gst.types.State oldstate, gst.types.State newstate, gst.types.State pending)

Extracts the old and new states from the GstMessage.

parseStepDone
void parseStepDone(gst.types.Format format, ulong amount, double rate, bool flush, bool intermediate, ulong duration, bool eos)

Extract the values the step_done message.

parseStepStart
void parseStepStart(bool active, gst.types.Format format, ulong amount, double rate, bool flush, bool intermediate)

Extract the values from step_start message.

parseStreamCollection
void parseStreamCollection(gst.stream_collection.StreamCollection collection)

Parses a stream-collection message.

parseStreamStatus
void parseStreamStatus(gst.types.StreamStatusType type, 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.

parseStreamsSelected
void parseStreamsSelected(gst.stream_collection.StreamCollection collection)

Parses a streams-selected message.

parseStructureChange
void parseStructureChange(gst.types.StructureChangeType type, gst.element.Element owner, bool busy)

Extracts the change type and completion status from the GstMessage.

parseTag
void parseTag(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.

parseToc
void parseToc(gst.toc.Toc toc, bool updated)

Extract the TOC from the #GstMessage. The TOC returned in the output argument is a copy; the caller must free it with gst_toc_unref() when done.

parseWarning
void parseWarning(glib.error.ErrorG gerror, 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.

parseWarningDetails
void parseWarningDetails(gst.structure.Structure structure)

Returns the optional details structure, may be NULL if none The returned structure must not be freed.

setBufferingStats
void setBufferingStats(gst.types.BufferingMode mode, int avgIn, int avgOut, long bufferingLeft)

Configures the buffering stats values in message.

setGroupId
void setGroupId(uint groupId)

Sets the group id on the stream-start message.

setQosStats
void setQosStats(gst.types.Format format, ulong processed, ulong dropped)

Set the QoS stats representing the history of the current continuous pipeline playback period.

setQosValues
void setQosValues(long jitter, double proportion, int quality)

Set the QoS values that have been calculated/analysed from the QoS data

setSeqnum
void setSeqnum(uint seqnum)

Set the sequence number of a message.

setStreamStatusObject
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.

streamsSelectedAdd
void streamsSelectedAdd(gst.stream.Stream stream)

Adds the stream to the message.

streamsSelectedGetSize
uint streamsSelectedGetSize()

Returns the number of streams contained in the message.

streamsSelectedGetStream
gst.stream.Stream streamsSelectedGetStream(uint idx)

Retrieves the #GstStream with index index from the message.

writableStructure
gst.structure.Structure writableStructure()

Get a writable version of the structure.

Static functions

newApplication
gst.message.Message newApplication(gst.object.ObjectGst 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.

newAsyncDone
gst.message.Message newAsyncDone(gst.object.ObjectGst src, gst.types.ClockTime runningTime)

The message is posted when elements completed an ASYNC state change. running_time contains the time of the desired running_time when this elements goes to PLAYING. A value of #GST_CLOCK_TIME_NONE for running_time means that the element has no clock interaction and thus doesn't care about the running_time of the pipeline.

newAsyncStart
gst.message.Message newAsyncStart(gst.object.ObjectGst src)

This message is posted by elements when they start an ASYNC state change.

newBuffering
gst.message.Message newBuffering(gst.object.ObjectGst 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 means that the buffering completed.

newClockLost
gst.message.Message newClockLost(gst.object.ObjectGst src, gst.clock.Clock clock)

Create a clock lost message. This message is posted whenever the clock is not valid anymore.

newClockProvide
gst.message.Message newClockProvide(gst.object.ObjectGst 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).

newCustom
gst.message.Message newCustom(gst.types.MessageType type, gst.object.ObjectGst src, gst.structure.Structure structure)

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.

newDeviceAdded
gst.message.Message newDeviceAdded(gst.object.ObjectGst 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.

newDeviceChanged
gst.message.Message newDeviceChanged(gst.object.ObjectGst 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 the new modified version of changed_device.

newDeviceRemoved
gst.message.Message newDeviceRemoved(gst.object.ObjectGst 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.

newDurationChanged
gst.message.Message newDurationChanged(gst.object.ObjectGst src)

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 total duration of a pipeline.

newElement
gst.message.Message newElement(gst.object.ObjectGst 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 of the message should be documented in the element's documentation. The structure field can be null.

newEos
gst.message.Message newEos(gst.object.ObjectGst src)

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.

newError
gst.message.Message newError(gst.object.ObjectGst src, glib.error.ErrorG 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 receiving this message should stop the pipeline.

newErrorWithDetails
gst.message.Message newErrorWithDetails(gst.object.ObjectGst src, glib.error.ErrorG error, string debug_, gst.structure.Structure details)

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 receiving this message should stop the pipeline.

newHaveContext
gst.message.Message newHaveContext(gst.object.ObjectGst src, gst.context.Context context)

This message is posted when an element has a new local #GstContext.

newInfo
gst.message.Message newInfo(gst.object.ObjectGst src, glib.error.ErrorG error, string debug_)

Create a new info message. The message will make copies of error and debug.

newInfoWithDetails
gst.message.Message newInfoWithDetails(gst.object.ObjectGst src, glib.error.ErrorG error, string debug_, gst.structure.Structure details)

Create a new info message. The message will make copies of error and debug.

newInstantRateRequest
gst.message.Message newInstantRateRequest(gst.object.ObjectGst 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 running time when the rate change should happen and to send an GST_EVENT_INSTANT_RATE_SYNC_TIME event to notify the elements in the pipeline.

newLatency
gst.message.Message newLatency(gst.object.ObjectGst src)

This message can be posted by elements when their latency requirements have changed.

newNeedContext
gst.message.Message newNeedContext(gst.object.ObjectGst src, string contextType)

This message is posted when an element needs a specific #GstContext.

newNewClock
gst.message.Message newNewClock(gst.object.ObjectGst src, gst.clock.Clock clock)

Create a new clock message. This message is posted whenever the pipeline selects a new clock for the pipeline.

newProgress
gst.message.Message newProgress(gst.object.ObjectGst 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.

newPropertyNotify
gst.message.Message newPropertyNotify(gst.object.ObjectGst src, string propertyName, gobject.value.Value val)
newQos
gst.message.Message newQos(gst.object.ObjectGst 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 such as processing at lower accuracy).

newRedirect
gst.message.Message newRedirect(gst.object.ObjectGst src, string location, gst.tag_list.TagList tagList, gst.structure.Structure entryStruct)

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 such a redirection cannot be handled inside a source element, for example when HTTP 302/303 redirects return a non-HTTP URL.

newRequestState
gst.message.Message newRequestState(gst.object.ObjectGst 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 being played.

newResetTime
gst.message.Message newResetTime(gst.object.ObjectGst 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.

newSegmentDone
gst.message.Message newSegmentDone(gst.object.ObjectGst 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 that posted a segment_start have posted the segment_done.

newSegmentStart
gst.message.Message newSegmentStart(gst.object.ObjectGst 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 maintenance reasons in container elements.

newStateChanged
gst.message.Message newStateChanged(gst.object.ObjectGst 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.

newStateDirty
gst.message.Message newStateDirty(gst.object.ObjectGst src)

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.

newStepDone
gst.message.Message newStepDone(gst.object.ObjectGst 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.

newStepStart
gst.message.Message newStepStart(gst.object.ObjectGst 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.

newStreamCollection
gst.message.Message newStreamCollection(gst.object.ObjectGst src, gst.stream_collection.StreamCollection collection)

Creates a new stream-collection message. The message is used to announce new #GstStreamCollection

newStreamStart
gst.message.Message newStreamStart(gst.object.ObjectGst src)

Create a new stream_start message. This message is generated and posted in the sink elements of a GstBin. The bin will only forward the STREAM_START message to the application if all sinks have posted an STREAM_START message.

newStreamStatus
gst.message.Message newStreamStatus(gst.object.ObjectGst 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.

newStreamsSelected
gst.message.Message newStreamsSelected(gst.object.ObjectGst 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 #GST_EVENT_SELECT_STREAMS event, or when an element (such as decodebin3) makes an initial selection of streams.

newStructureChange
gst.message.Message newStructureChange(gst.object.ObjectGst 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.

newTag
gst.message.Message newTag(gst.object.ObjectGst 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.

newToc
gst.message.Message newToc(gst.object.ObjectGst src, gst.toc.Toc toc, bool updated)

Create a new TOC message. The message is posted by elements that discovered or updated a TOC.

newWarning
gst.message.Message newWarning(gst.object.ObjectGst src, glib.error.ErrorG error, string debug_)

Create a new warning message. The message will make copies of error and debug.

newWarningWithDetails
gst.message.Message newWarningWithDetails(gst.object.ObjectGst src, glib.error.ErrorG error, string debug_, gst.structure.Structure details)

Create a new warning message. The message will make copies of error and debug.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.