Gjsify LogoGjsify Logo

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_post_message().

record

Hierarchy

  • Message

Index

Constructors

Properties

Methods

Constructors

Properties

mini_object: Gst.MiniObject

the parent structure

field
seqnum: number

the sequence number of the message

field
src: Gst.Object

the src of the message

field
timestamp: number

the timestamp of the message

field

the #GstMessageType of the message

field
name: string

Methods

  • Creates and appends a new entry.

    The specified location string is copied. However, ownership over the tag list and structure are transferred to the message.

    Parameters

    • location: string

      location string for the new entry

    • tag_list: Gst.TagList

      tag list for the new entry

    • entry_struct: Gst.Structure

      structure for the new entry

    Returns void

  • get_num_redirect_entries(): number
  • get_seqnum(): number
  • Retrieve the sequence number of a message.

    Messages have ever-incrementing sequence numbers, which may also be set explicitly via gst_message_set_seqnum(). Sequence numbers are typically used to indicate that a message corresponds to some other set of messages or events, for example a SEGMENT_DONE message corresponding to a SEEK event. It is considered good practice to make this correspondence when possible, though it is not required.

    Note that events and messages share the same sequence number incrementor; two events or messages will never have the same sequence number unless that correspondence was made explicitly.

    Returns number

  • get_stream_status_object(): any
  • has_name(name: string): boolean
  • Checks if message has the given name. This function is usually used to check the name of a custom message.

    Parameters

    • name: string

      name to check

    Returns boolean

  • parse_async_done(): number
  • parse_buffering(): number
  • Extracts the buffering percent from the GstMessage. see also gst_message_new_buffering().

    MT safe.

    Returns number

  • parse_clock_provide(): [Gst.Clock, boolean]
  • Extracts the clock and ready flag from the GstMessage. The clock object returned remains valid until the message is freed.

    MT safe.

    Returns [Gst.Clock, boolean]

  • parse_context_type(): [boolean, string]
  • Parses a device-added message. The device-added message is produced by #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance of monitored devices.

    Returns Gst.Device

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

    Returns [Gst.Device, Gst.Device]

  • Parses a device-removed message. The device-removed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. It announces the disappearance of monitored devices.

    Returns Gst.Device

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

    Typical usage of this function might be:

      ...
    switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_ERROR: {
    GError *err = NULL;
    gchar *dbg_info = NULL;

    gst_message_parse_error (msg, &err, &dbg_info);
    g_printerr ("ERROR from element %s: %s\n",
    GST_OBJECT_NAME (msg->src), err->message);
    g_printerr ("Debugging info: %s\n", (dbg_info) ? dbg_info : "none");
    g_error_free (err);
    g_free (dbg_info);
    break;
    }
    ...
    }
    ...

    MT safe.

    Returns [GLib.Error, string]

  • parse_group_id(): [boolean, number]
  • 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.

    Returns [GLib.Error, string]

  • parse_instant_rate_request(): number
  • parse_property_notify(): [Gst.Object, string, any]
  • Parses a property-notify message. These will be posted on the bus only when set up with gst_element_add_property_notify_watch() or gst_element_add_property_deep_notify_watch().

    Returns [Gst.Object, string, any]

  • parse_qos(): [boolean, number, number, number, number]
  • Extract the timestamps and live status from the QoS message.

    The returned values give the running_time, stream_time, timestamp and duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown values.

    MT safe.

    Returns [boolean, number, number, number, number]

  • parse_qos_stats(): [Gst.Format, number, number]
  • Extract the QoS stats representing the history of the current continuous pipeline playback period.

    When format is GST_FORMAT_UNDEFINED both dropped and processed are invalid. Values of -1 for either processed or dropped mean unknown values.

    MT safe.

    Returns [Gst.Format, number, number]

  • parse_qos_values(): [number, number, number]
  • Extract the QoS values that have been calculated/analysed from the QoS data

    MT safe.

    Returns [number, number, number]

  • Parses the location and/or structure from the entry with the given index. The index must be between 0 and gst_message_get_num_redirect_entries() - 1. Returned pointers are valid for as long as this message exists.

    Parameters

    • entry_index: number

      index of the entry to parse

    Returns [string, Gst.TagList, Gst.Structure]

  • parse_reset_time(): number
  • Extracts the old and new states from the GstMessage.

    Typical usage of this function might be:

      ...
    switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_STATE_CHANGED: {
    GstState old_state, new_state;

    gst_message_parse_state_changed (msg, &old_state, &new_state, NULL);
    g_print ("Element %s changed state from %s to %s.\n",
    GST_OBJECT_NAME (msg->src),
    gst_element_state_get_name (old_state),
    gst_element_state_get_name (new_state));
    break;
    }
    ...
    }
    ...

    MT safe.

    Returns [Gst.State, Gst.State, Gst.State]

  • parse_step_done(): [Gst.Format, number, number, boolean, boolean, number, boolean]
  • parse_step_start(): [boolean, Gst.Format, number, number, boolean, boolean]
  • 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.

    Typical usage of this function might be:

      ...
    switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_TAG: {
    GstTagList *tags = NULL;

    gst_message_parse_tag (msg, &tags);
    g_print ("Got tags from element %s\n", GST_OBJECT_NAME (msg->src));
    handle_tags (tags);
    gst_tag_list_unref (tags);
    break;
    }
    ...
    }
    ...

    MT safe.

    Returns Gst.TagList

  • parse_toc(): [Toc, boolean]
  • 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.

    MT safe.

    Returns [Toc, boolean]

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

    Returns [GLib.Error, string]

  • set_buffering_stats(mode: Gst.BufferingMode, avg_in: number, avg_out: number, buffering_left: number): void
  • Configures the buffering stats values in message.

    Parameters

    • mode: Gst.BufferingMode

      a buffering mode

    • avg_in: number

      the average input rate

    • avg_out: number

      the average output rate

    • buffering_left: number

      amount of buffering time left in milliseconds

    Returns void

  • set_group_id(group_id: number): void
  • Sets the group id on the stream-start message.

    All streams that have the same group id are supposed to be played together, i.e. all streams inside a container file should have the same group id but different stream ids. The group id should change each time the stream is started, resulting in different group ids each time a file is played for example.

    MT safe.

    Parameters

    • group_id: number

      the group id

    Returns void

  • set_qos_stats(format: Gst.Format, processed: number, dropped: number): void
  • Set the QoS stats representing the history of the current continuous pipeline playback period.

    When format is GST_FORMAT_UNDEFINED both dropped and processed are invalid. Values of -1 for either processed or dropped mean unknown values.

    MT safe.

    Parameters

    • format: Gst.Format

      Units of the 'processed' and 'dropped' fields. Video sinks and video filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT (samples).

    • processed: number

      Total number of units correctly processed since the last state change to READY or a flushing operation.

    • dropped: number

      Total number of units dropped since the last state change to READY or a flushing operation.

    Returns void

  • set_qos_values(jitter: number, proportion: number, quality: number): void
  • Set the QoS values that have been calculated/analysed from the QoS data

    MT safe.

    Parameters

    • jitter: number

      The difference of the running-time against the deadline.

    • proportion: number

      Long term prediction of the ideal rate relative to normal rate to get optimal quality.

    • quality: number

      An element dependent integer value that specifies the current quality level of the element. The default maximum quality is 1000000.

    Returns void

  • set_seqnum(seqnum: number): void
  • Set the sequence number of a message.

    This function might be called by the creator of a message to indicate that the message relates to other messages or events. See gst_message_get_seqnum() for more information.

    MT safe.

    Parameters

    • seqnum: number

      A sequence number.

    Returns void

  • set_stream_status_object(object: any): void
  • Configures the object handling the streaming thread. This is usually a GstTask object but other objects might be added in the future.

    Parameters

    • object: any

      the object controlling the streaming

    Returns void

  • streams_selected_add(stream: Gst.Stream): void
  • streams_selected_get_size(): number
  • streams_selected_get_stream(idx: number): Gst.Stream
  • Create a new application-typed message. GStreamer will never create these messages; they are a gift from us to you. Enjoy.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • structure: Gst.Structure

      the structure for the message. The message will take ownership of the structure.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • running_time: number

      the desired running_time

    Returns Gst.Message

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

    MT safe.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • percent: number

      The buffering percent

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • clock: Gst.Clock

      the clock that was lost

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • clock: Gst.Clock

      the clock it provides

    • ready: boolean

      %TRUE if the sender can provide a clock

    Returns Gst.Message

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

    Parameters

    • type: Gst.MessageType

      The #GstMessageType to distinguish messages

    • src: Gst.Object

      The object originating the message.

    • structure: Gst.Structure

      the structure for the message. The message will take ownership of the structure.

    Returns Gst.Message

  • Creates a new device-added message. The device-added message is produced by #GstDeviceProvider or a #GstDeviceMonitor. They announce the appearance of monitored devices.

    Parameters

    • src: Gst.Object

      The #GstObject that created the message

    • device: Gst.Device

      The new #GstDevice

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The #GstObject that created the message

    • device: Gst.Device

      The newly created device representing replaced_device with its new configuration.

    • changed_device: Gst.Device

    Returns Gst.Message

  • Creates a new device-removed message. The device-removed message is produced by #GstDeviceProvider or a #GstDeviceMonitor. They announce the disappearance of monitored devices.

    Parameters

    • src: Gst.Object

      The #GstObject that created the message

    • device: Gst.Device

      The removed #GstDevice

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • structure: Gst.Structure

      The structure for the message. The message will take ownership of the structure.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • error: GLib.Error

      The GError for this message.

    • debug: string

      A debugging string.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • error: GLib.Error

      The GError for this message.

    • debug: string

      A debugging string.

    • details: Gst.Structure

      A GstStructure with details

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The #GstObject that posted the message

    • rate_multiplier: number

      the rate multiplier factor that should be applied

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • context_type: string

      The context type that is needed

    Returns Gst.Message

  • Progress messages are posted by elements when they use an asynchronous task to perform actions triggered by a state change.

    code contains a well defined string describing the action. text should contain a user visible string detailing the current action.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • type: Gst.ProgressType

      a #GstProgressType

    • code: string

      a progress code

    • text: string

      free, user visible text describing the progress

    Returns Gst.Message

  • new_qos(src: Gst.Object, live: boolean, running_time: number, stream_time: number, timestamp: number, duration: number): Gst.Message
  • 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).

    This message can be posted by an element that performs synchronisation against the clock (live) or it could be dropped by an element that performs QoS because of QOS events received from a downstream element (!live).

    running_time, stream_time, timestamp, duration should be set to the respective running-time, stream-time, timestamp and duration of the (dropped) buffer that generated the QoS event. Values can be left to GST_CLOCK_TIME_NONE when unknown.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • live: boolean

      if the message was generated by a live element

    • running_time: number

      the running time of the buffer that generated the message

    • stream_time: number

      the stream time of the buffer that generated the message

    • timestamp: number

      the timestamps of the buffer that generated the message

    • duration: number

      the duration of the buffer that generated the message

    Returns Gst.Message

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

    The redirect message can hold multiple entries. The first one is added when the redirect message is created, with the given location, tag_list, entry_struct arguments. Use gst_message_add_redirect_entry() to add more entries.

    Each entry has a location, a tag list, and a structure. All of these are optional. The tag list and structure are useful for additional metadata, such as bitrate statistics for the given location.

    By default, message recipients should treat entries in the order they are stored. The recipient should therefore try entry #0 first, and if this entry is not acceptable or working, try entry #1 etc. Senders must make sure that they add entries in this order. However, recipients are free to ignore the order and pick an entry that is "best" for them. One example would be a recipient that scans the entries for the one with the highest bitrate tag.

    The specified location string is copied. However, ownership over the tag list and structure are transferred to the message.

    Parameters

    • src: Gst.Object

      The #GstObject whose property changed (may or may not be a #GstElement)

    • location: string

      location string for the new entry

    • tag_list: Gst.TagList

      tag list for the new entry

    • entry_struct: Gst.Structure

      structure for the new entry

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • state: Gst.State

      The new requested state

    Returns Gst.Message

  • This message is posted when the pipeline running-time should be reset to running_time, like after a flushing seek.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • running_time: number

      the requested running-time

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • format: Gst.Format

      The format of the position being done

    • position: number

      The position of the segment being done

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • format: Gst.Format

      The format of the position being played

    • position: number

      The position of the segment being played

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message

    Returns Gst.Message

  • new_step_done(src: Gst.Object, format: Gst.Format, amount: number, rate: number, flush: boolean, intermediate: boolean, duration: number, eos: boolean): Gst.Message
  • This message is posted by elements when they complete a part, when intermediate set to %TRUE, or a complete step operation.

    duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped amount of media in format format.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • format: Gst.Format

      the format of amount

    • amount: number

      the amount of stepped data

    • rate: number

      the rate of the stepped amount

    • flush: boolean

      is this an flushing step

    • intermediate: boolean

      is this an intermediate step

    • duration: number

      the duration of the data

    • eos: boolean

      the step caused EOS

    Returns Gst.Message

  • new_step_start(src: Gst.Object, active: boolean, format: Gst.Format, amount: number, rate: number, flush: boolean, intermediate: boolean): Gst.Message
  • This message is posted by elements when they accept or activate a new step event for amount in format.

    active is set to %FALSE when the element accepted the new step event and has queued it for execution in the streaming threads.

    active is set to %TRUE when the element has activated the step operation and is now ready to start executing the step in the streaming thread. After this message is emitted, the application can queue a new step operation in the element.

    Parameters

    • src: Gst.Object

      The object originating the message.

    • active: boolean

      if the step is active or queued

    • format: Gst.Format

      the format of amount

    • amount: number

      the amount of stepped data

    • rate: number

      the rate of the stepped amount

    • flush: boolean

      is this an flushing step

    • intermediate: boolean

      is this an intermediate step

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    Returns Gst.Message

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

    The message also contains the #GstStreamCollection to which the various streams belong to.

    Users of gst_message_new_streams_selected() can add the selected streams with gst_message_streams_selected_add().

    Parameters

    Returns Gst.Message

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

    src should be the sinkpad that unlinked or linked.

    Parameters

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      The object originating the message.

    • tag_list: Gst.TagList

      the tag list for the message.

    Returns Gst.Message

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

    Parameters

    • src: Gst.Object

      the object originating the message.

    • toc: Toc

      #GstToc structure for the message.

    • updated: boolean

      whether TOC was updated or not.

    Returns Gst.Message

  • Modifies a pointer to a #GstMessage to point to a different #GstMessage. This function is similar to gst_message_replace() except that it takes ownership of new_message.

    Parameters

    • old_message: Gst.Message

      pointer to a pointer to a #GstMessage to be replaced.

    • new_message: Gst.Message

      pointer to a #GstMessage that will replace the message pointed to by old_message.

    Returns [boolean, Gst.Message]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method