gstreamermm 1.10.0

Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gst::Event Class Reference

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

`#include <gstreamermm/event.h>`

Inheritance diagram for Gst::Event:
[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...
GstEvent* | gobj ()
| Provides access to the underlying C instance. More...
const GstEvent* | gobj () const
| Provides access to the underlying C instance. More...
GstEvent* | 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...
| Event ()=delete
| Event (const Event&)=delete
Event& | operator= (const Event&)=delete
Gst::Structure | get_structure () const
| Access the structure of the event. More...
bool | has_name (const Glib::ustring& name) const
| Checks if event has the given name. More...
guint32 | get_seqnum () const
| Retrieve the sequence number of a event. More...
void | set_seqnum (guint32 seqnum)
| Set the sequence number of a event. More...
gint64 | get_running_time_offset () const
| Retrieve the accumulated running time offset of the event. More...
void | set_running_time_offset (gint64 offset)
| Set the running time offset of a event. More...
Glib::RefPtr< Gst::Event > | copy () const
| Copy the event using the event specific copy function. More...
Glib::RefPtr< Gst::Event > | create_writable ()
| Makes a writable event from the given event. More...
bool | is_downstream () const
| Check if an event can travel downstream. More...
bool | is_serialized () const
| Check if an event is serialized with the data stream. More...
bool | is_upstream () const
| Check if an event can travel upstream. More...
EventType | get_event_type () const
| Get the Gst::EventType of the event. More...
Gst::ClockTime | get_timestamp () const
| Get the Gst::ClockTime timestamp of the event. More...
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 ()=delete
| MiniObject (const MiniObject&)=delete
MiniObject& | operator= (const MiniObject&)=delete
| ~MiniObject ()
guint | get_flags () const
void | set_flags (const guint& value)
gint | get_refcount () const
gint | get_lockstate () const
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...
void | set_qdata (GQuark quark, QuarkData* data)
| This sets an opaque, named pointer on a miniobject. More...
QuarkData* | get_qdata (GQuark quark) const
| This function gets back user data pointers stored via set_qdata(). More...
QuarkData* | steal_qdata (GQuark quark)
| This function gets back user data pointers stored via set_qdata() and removes the data from object without invoking its destroy() function (if any was set). More...
void | add_finalize_notifier (const SlotFinalizer& slot)
| Adds notifier when mini object is finalized. More...
void | remove_finalize_notifier ()
| Remove finalize notifier. More...

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

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::Event > | wrap (GstEvent* 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...

## Additional Inherited Members
Public Types inherited from Gst::MiniObject
typedef sigc::slot< void > | SlotFinalizer

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

## ◆ Event() [1/2]

Gst::Event::Event | ( |  | ) |
| delete

## ◆ Event() [2/2]

Gst::Event::Event | ( | const Event& |  | ) |
| delete

## Member Function Documentation

## ◆ copy()

Glib::RefPtr<Gst::Event> Gst::Event::copy | ( |  | ) | const

Copy the event using the event specific copy function.

Returns
  The new event.

## ◆ create_writable()

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

Makes a writable event from the given event.

If the source event is already writable, this will simply return the same event.

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

## ◆ get_event_type()

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

Get the Gst::EventType of the event.

## ◆ get_running_time_offset()

gint64 Gst::Event::get_running_time_offset | ( |  | ) | const

Retrieve the accumulated running time offset of the event.

Events passing through Gst::Pads that have a running time offset set via Gst::Pad::set_offset() will get their offset adjusted according to the pad's offset.

If the event contains any information that related to the running time, this information will need to be updated before usage with this offset.

Returns
  The event's running time offset

MT safe.

## ◆ get_seqnum()

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 have the same sequence number unless that correspondence was made explicitly.

Returns
  The event's sequence number.

MT safe.

## ◆ get_structure()

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.

## ◆ get_timestamp()

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

Get the Gst::ClockTime timestamp of the event.

This is the time when the event was created.

## ◆ gobj() [1/2]

GstEvent* Gst::Event::gobj | ( |  | ) |

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GstEvent* Gst::Event::gobj | ( |  | ) | const

Provides access to the underlying C instance.

## ◆ gobj_copy()

GstEvent* Gst::Event::gobj_copy | ( |  | ) | const

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

## ◆ has_name()

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.

Parameters

  name | Name to check.

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

## ◆ is_downstream()

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

Check if an event can travel downstream.

## ◆ is_serialized()

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

Check if an event is serialized with the data stream.

## ◆ is_upstream()

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

Check if an event can travel upstream.

## ◆ operator delete()

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

## ◆ operator=()

Event& Gst::Event::operator= | ( | const Event& |  | ) |
| delete

## ◆ reference()

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

Increment the reference count for this object.

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

## ◆ set_running_time_offset()

void Gst::Event::set_running_time_offset | ( | gint64 | offset | ) |

Set the running time offset of a event.

See get_running_time_offset() for more information.

MT safe.

Parameters

  offset | A the new running time offset.

## ◆ set_seqnum()

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.

Parameters

  seqnum | A sequence number.

## ◆ unreference()

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

Decrement the reference count for this object.

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

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gst::Event > wrap | ( | GstEvent * | 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.