Public Member Functions | Static Public Member Functions

# Gst::Event Class Reference

A class that represents events that are passed up and down a pipeline. More...

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

List of all members.

## Public Member Functions
virtual | ~Event ()
GstEvent* | gobj ()
| Provides access to the underlying C GstMiniObject.
const GstEvent* | gobj () const
| Provides access to the underlying C GstMiniObject.
GstEvent* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
const Gst::Structure | get_structure () const
| Access the structure of the event.
bool | has_name (const Glib::ustring& name) const
| Checks if event has the given name.
guint32 | get_seqnum () const
| Retrieve the sequence number of a event.
void | set_seqnum (guint32 seqnum)
| Set the sequence number of a event.
Glib::RefPtr< Gst::Event > | create_writable ()
| Checks if an event is writable.
bool | is_downstream () const
| Check if an event can travel downstream.
bool | is_serialized () const
| Check if an event is serialized with the data stream.
bool | is_upstream () const
| Check if an event can travel upstream.
EventType | get_event_type () const
| Get the Gst::EventType of the event.
ClockTime | get_timestamp () const
| Get the Gst::ClockTime timestamp of the event.
Glib::RefPtr< Gst::Object > | get_source ()
| The source Gst::Object that generated this event.
Glib::RefPtr< const Gst::Object > | get_source () const
virtual Glib::RefPtr < Gst::MiniObject > | copy_vfunc () const
| Virtual function called when the Gst::Event needs to be copied.
virtual void | finalize_vfunc ()
| Virtual function called when the Gst::Event is about to be finalized.
## Static Public Member Functions
static Glib::RefPtr< Gst::Event > | wrap (GstEvent* event, bool take_copy=false)
| Wrap a GstEvent in a C++ instance, creating an instance of a derived Gst::Event.

## Detailed Description

A class that represents events that are passed up and down a pipeline.

The event class provides factory methods to construct and functions query (parse) events.

Events are usually created by using the Gst::Event derrived classes' create() methods. To send an event application will usually use Gst::Element::send_event() and elements will use Gst::Pad::send_event() or Gst::Pad::push_event().

Events that have been received can be parsed with their respective parse() functions.

Events are passed between elements in parallel to the data stream. Some events are serialized with buffers, others are not. Some events only travel downstream, others only upstream. Some events can travel both upstream and downstream.

The events are used to signal special conditions in the datastream such as EOS (end of stream) or the start of a new stream-segment. Events are also used to flush the pipeline of any pending data.

Most of the event API is used inside plugins. Applications usually only construct and use seek events. To do that Gst::EventSeek::create() is used to create a seek event. It takes the needed parameters to specity seeking time and mode. The event is then sent to the element like so:

     pipeline->send_event(event);

## Constructor & Destructor Documentation

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

## Member Function Documentation

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

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

Reimplemented from Gst::MiniObject.

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

Checks if an event is writable.

If not, a writable copy is made and returned.

Returns:
  A Gst::Event (possibly the same reference) that is writable.

Reimplemented from Gst::MiniObject.

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

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

Reimplemented from Gst::MiniObject.

EventType Gst::Event::get_event_type | ( | ) | const

Get the Gst::EventType of the event.

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

Retrieve the sequence number of a event.

Events have ever-incrementing sequence numbers, which may also be set explicitly via set_seqnum(). Sequence numbers are typically used to indicate that a event corresponds to some other set of events or messages, for example an EOS event 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.

Since gstreamermm 0.10:
  .22

Returns:
  The event's sequence number.

MT safe.

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

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

The source Gst::Object that generated this event.

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

Access the structure of the event.

Returns:
  The structure of the event. The structure is still owned by the event, which means that you should not free it and that the pointer becomes invalid when you free the event.

MT safe.

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

Get the Gst::ClockTime timestamp of the event.

This is the time when the event was created.

GstEvent* Gst::Event::gobj | ( | ) | `[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

const GstEvent* Gst::Event::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

GstEvent* Gst::Event::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.

bool Gst::Event::has_name | ( | const Glib::ustring & | name ) | const

Checks if event has the given name.

This function is usually used to check the name of a custom event.

Since gstreamermm 0.10:
  .20

Parameters:

  name | Name to check.

Returns:
  `true` if name matches the name of the event structure.

bool Gst::Event::is_downstream | ( | ) | const

Check if an event can travel downstream.

bool Gst::Event::is_serialized | ( | ) | const

Check if an event is serialized with the data stream.

bool Gst::Event::is_upstream | ( | ) | const

Check if an event can travel upstream.

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

Set the sequence number of a event.

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

MT safe.

Since gstreamermm 0.10:
  .22

Parameters:

  seqnum | A sequence number.

Glib::RefPtr< Gst::Event > wrap | ( | GstEvent * | event,
|  | bool | take_copy = `false`
| ) |  | `[static]`

Wrap a GstEvent in a C++ instance, creating an instance of a derived Gst::Event.

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

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/event.h