gstreamermm: Gst::Message Class Reference

gstreamermm 0.10.10.2

- Main Page
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Related Functions
Gst::Message Class Reference

A class that represents lightweight objects to signal the application of pipeline events. More...

Inheritance diagram for Gst::Message:
[legend]
Collaboration diagram for Gst::Message:
[legend]

List of all members.

## Public Member Functions
virtual | ~Message ()
GstMessage* | gobj ()
| Provides access to the underlying C GstMiniObject.
const GstMessage* | gobj () const
| Provides access to the underlying C GstMiniObject.
GstMessage* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Gst::Structure | get_structure () const
| Access the structure of the message.
Glib::RefPtr< Gst::Message > | create_writable ()
| Checks if a message is writable.
guint32 | get_seqnum () const
| Retrieve the sequence number of a message.
void | set_seqnum (guint32 seqnum)
| Set the sequence number of a message.
MessageType | get_message_type () const
| Get the GstMessageType of message.
ClockTime | get_timestamp () const
| Get the timestamp of message.
Glib::RefPtr< Gst::Object > | get_source ()
| Get the object that posted the message.
Glib::RefPtr< const Gst::Object > | get_source () const
virtual Glib::RefPtr < Gst::MiniObject > | copy_vfunc () const
| Virtual function called when the Gst::Message needs to be copied.
virtual void | finalize_vfunc ()
| Virtual function called when the Gst::Message is about to be finalized.
## Static Public Member Functions
static Glib::RefPtr< Gst::Message > | wrap (GstMessage* message, bool take_copy=false)
| Wrap a GstMessage in a C++ instance, creating an instance of a derived Gst::Message.
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::Message > | wrap (GstMessage* object, bool take_copy=false)

## Detailed Description

A class that represents lightweight objects to signal the application of pipeline events.

Messages are implemented as a subclass of Gst::MiniObject with a generic Gst::Structure 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 Gst::Bus.

The basic use pattern of posting a message on a Gst::Bus is as follows:

     bus->post(Gst::MessageEos::create(my_element));

## Constructor & Destructor Documentation

virtual Gst::Message::~Message | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual Glib::RefPtr<Gst::MiniObject> Gst::Message::copy_vfunc | ( |  | ) | const`[virtual]`

Virtual function called when the Gst::Message needs to be copied.

Reimplemented from Gst::MiniObject.

Glib::RefPtr<Gst::Message> Gst::Message::create_writable | ( |  | ) |

Checks if a message is writable.

If not, a writable copy is made and returned.

Returns:
  A Gst::Message (possibly the same pointer) that is writable.

Reimplemented from Gst::MiniObject.

virtual void Gst::Message::finalize_vfunc | ( |  | ) | `[virtual]`

Virtual function called when the Gst::Message is about to be finalized.

Reimplemented from Gst::MiniObject.

MessageType Gst::Message::get_message_type | ( |  | ) | const

Get the GstMessageType of message.

guint32 Gst::Message::get_seqnum | ( |  | ) | const

Retrieve the sequence number of a message.

Messages have ever-incrementing sequence numbers, which may also be set explicitly via 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 not have the same sequence number unless that correspondence was made explicitly.

Returns:
  The message's sequence number.

MT safe.

Glib::RefPtr<Gst::Object> Gst::Message::get_source | ( |  | ) |

Get the object that posted the message.

Glib::RefPtr<const Gst::Object> Gst::Message::get_source | ( |  | ) | const

Gst::Structure Gst::Message::get_structure | ( |  | ) | const

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 when you free the message.

MT safe.

ClockTime Gst::Message::get_timestamp | ( |  | ) | const

Get the timestamp of message.

This is the timestamp when the message was created.

GstMessage* Gst::Message::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

const GstMessage* Gst::Message::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

GstMessage* Gst::Message::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gst::MiniObject.

void Gst::Message::set_seqnum | ( | guint32 | seqnum | ) |

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 get_seqnum() for more information.

MT safe.

Parameters:

  seqnum | A sequence number.

static Glib::RefPtr<Gst::Message> Gst::Message::wrap | ( | GstMessage * | message,
|  | bool | take_copy = `false`
| ) |  | `[static]`

Wrap a GstMessage in a C++ instance, creating an instance of a derived Gst::Message.

Gst::wrap() would just create a Gst::Message (rather than a derived one) because the derived Gst::Message classes do not correspond to GType types in the GStreamer API.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::Message > wrap | ( | GstMessage * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

Parameters:

  object | The C instance
  take_copy | false if the result should take ownership of the C instance. true if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/message.h