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]

## Public Member Functions

void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstMessage* | gobj ()
| Provides access to the underlying C instance. More...
const GstMessage* | gobj () const
| Provides access to the underlying C instance. More...
GstMessage* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Gst::Structure | get_structure () const
| Access the structure of the message. More...
Glib::RefPtr< Gst::Message > | create_writable ()
| Checks if a message is writable. More...
guint32 | get_seqnum () const
| Retrieve the sequence number of a message. More...
void | set_seqnum (guint32 seqnum)
| Set the sequence number of a message. More...
MessageType | get_message_type () const
| Get the GstMessageType of message. More...
ClockTime | get_timestamp () const
| Get the timestamp of message. More...
Glib::RefPtr< Gst::Object > | get_source ()
| Get the object that posted the message. More...
Glib::RefPtr< const Gst::Object > | get_source () const
Public Member Functions inherited from Gst::MiniObject
void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstMiniObject* | gobj ()
| Provides access to the underlying C instance. More...
const GstMiniObject* | gobj () const
| Provides access to the underlying C instance. More...
GstMiniObject* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| ~MiniObject ()
guint | get_flags () const
void | set_flags (const guint& value)
bool | lock (LockFlags flags)
| Lock the mini-object with the specified access mode in flags. More...
void | unlock (LockFlags flags)
| Unlock the mini-object with the specified access mode in flags. More...
bool | is_writable () const
| If mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE lock on object is the only one, this means that changes to the object will not be visible to any other object. More...
Glib::RefPtr< MiniObject > | create_writable ()
| Checks if a mini-object is writable. More...

## Protected Member Functions

| Message ()
void | operator delete (void*, std::size_t)
Protected Member Functions inherited from Gst::MiniObject
| MiniObject ()
void | operator delete (void*, std::size_t)

## Static Protected Member Functions

template<class MsgType >
static Glib::RefPtr< MsgType > | wrap (GstMessage* message, bool take_copy=false)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::Message > | wrap (GstMessage* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::MiniObject
Glib::RefPtr< Gst::MiniObject > | wrap (GstMiniObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## 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

Gst::Message::Message | ( |  | ) |

protected

## Member Function Documentation

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.

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

Provides access to the underlying C instance.

const GstMessage* Gst::Message::gobj | ( |  | ) | const

Provides access to the underlying C instance.

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

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

void Gst::Message::operator delete | ( | void * | ,
|  | std::size_t |
| ) |  |

protected

void Gst::Message::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

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

MT safe.

Parameters

  seqnum | A sequence number.

void Gst::Message::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

template <class MsgType >

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

inline static protected

## Friends And Related Function Documentation

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

related

A Glib::wrap() method for this object.

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