Message

Description 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: A GstElement usually posts messages on the bus provided by the parent container using gst_element_post_message(). Last reviewed on 2005-11-09 (0.9.4)

class Message {}

Constructors

this
this(GstMessage* gstMessage)

Sets our main struct and passes it to the parent class

this
this(ObjectGst src, Structure structure)

Create a new application-typed message. GStreamer will never create these messages; they are a gift from us to you. Enjoy.

this
this(ObjectGst src, Clock clock, int 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). This message is mainly used internally to manage the clock selection.

this
this(ObjectGst src, Clock clock)

Create a clock lost message. This message is posted whenever the clock is not valid anymore. If this message is posted by the pipeline, the pipeline will select a new clock again when it goes to PLAYING. It might therefore be needed to set the pipeline to PAUSED and PLAYING again.

this
this(GstMessageType type, ObjectGst src, 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.

this
this(ObjectGst src, GstState oldstate, GstState newstate, GstState pending)

Create a state change message. This message is posted whenever an element changed its state.

this
this(ObjectGst src, 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.

this
this(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. When percent is < 100 the application should PAUSE a PLAYING pipeline. When percent is 100, the application can set the pipeline (back) to PLAYING. The application must be prepared to receive BUFFERING messages in the PREROLLING state and may only set the pipeline to PLAYING after receiving a message with percent set to 100, which can happen after the pipeline completed prerolling.

this
this(ObjectGst src, GstFormat format, long duration)

Create a new duration message. This message is posted by elements that know the duration of a stream in a specific format. This message is received by bins and is used to calculate the total duration of a pipeline. Elements may post a duration message with a duration of GST_CLOCK_TIME_NONE to indicate that the duration has changed and the cached duration should be discarded. The new duration can then be retrieved via a query.

this
this(ObjectGst src)

The message is posted when elements completed an ASYNC state change.

Members

Functions

doref
Message doref()

Convenience macro to increase the reference count of the message.

getMessageStruct
GstMessage* getMessageStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

getStructure
Structure getStructure()

Access the structure of the message.

parseAsyncStart
void parseAsyncStart(int newBaseTime)

Extract the new_base_time from the async_start message. MT safe.

parseBuffering
void parseBuffering(int percent)

Extracts the buffering percent from the GstMessage. see also gst_message_new_buffering().

parseClockLost
void parseClockLost(Clock clock)

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

parseClockProvide
void parseClockProvide(Clock clock, int ready)

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

parseDuration
void parseDuration(GstFormat format, long duration)

Extracts the duration and format from the duration message. The duration might be GST_CLOCK_TIME_NONE, which indicates that the duration has changed. Applications should always use a query to retrieve the duration of a pipeline. MT safe.

parseError
void parseError(ErrorG gerror, string dbug)

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. MT safe.

parseInfo
void parseInfo(ErrorG gerror, string dbug)

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. MT safe.

parseNewClock
void parseNewClock(Clock clock)

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

parseSegmentDone
void parseSegmentDone(GstFormat format, long position)

Extracts the position and format from the segment start message. MT safe.

parseSegmentStart
void parseSegmentStart(GstFormat format, long position)

Extracts the position and format from the segment start message. MT safe.

parseStateChanged
void parseStateChanged(GstState* oldstate, GstState* newstate, GstState* pending)

Extracts the old and new states from the GstMessage. MT safe.

parseTag
TagList parseTag()

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. MT safe.

parseWarning
void parseWarning(ErrorG gerror, string dbug)

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. MT safe.

src
ObjectGst src()

Get the src (the element that originated the message) of the message.

structure
Structure structure()

Get the structure.

type
GstMessageType type()

Get the type of the message.

Static functions

newAsyncStart
Message newAsyncStart(ObjectGst src, int newBaseTime)

This message is posted by elements when they start an ASYNC state change. new_base_time is set to TRUE when the element lost its state when it was PLAYING.

newEOS
Message newEOS(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. MT safe.

newElement
Message newElement(ObjectGst src, 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. MT safe.

newError
Message newError(ObjectGst src, ErrorG error, string dbug)

Create a new error message. The message will copy error and debug. This message is posted by element when a fatal event occured. The pipeline will probably (partially) stop. The application receiving this message should stop the pipeline. MT safe.

newInfo
Message newInfo(ObjectGst src, ErrorG error, string dbug)

Create a new info message. The message will make copies of error and debug. MT safe. Since 0.10.12

newLatency
Message newLatency(ObjectGst src)

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

newNewClock
Message newNewClock(ObjectGst src, Clock clock)

Create a new clock message. This message is posted whenever the pipeline selectes a new clock for the pipeline. MT safe.

newSegmentDone
Message newSegmentDone(ObjectGst src, GstFormat 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. MT safe.

newSegmentStart
Message newSegmentStart(ObjectGst src, GstFormat 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. MT safe.

newStateDirty
Message newStateDirty(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. MT safe.

newWarning
Message newWarning(ObjectGst src, ErrorG error, string dbug)

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

typeGetName
string typeGetName(GstMessageType type)

Get a printable name for the given message type. Do not modify or free.

typeToQuark
Quark typeToQuark(GstMessageType type)

Get the unique quark for the given message type.

Variables

gstMessage
GstMessage* gstMessage;

the main Gtk struct

Meta