#include <event.h>
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. | |
Glib::RefPtr<Gst::Event> | copy () const |
Copy the event using the event specific copy function. | |
const Gst::Structure | get_structure () const |
Access the structure of the event. | |
bool | has_name (const Glib::ustring& name) |
Checks if event has the given name. | |
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 |
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. |
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);
virtual Gst::Event::~Event | ( | ) | [virtual] |
Glib::RefPtr<Gst::Event> Gst::Event::copy | ( | ) | const |
Copy the event using the event specific copy function.
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.
Reimplemented from Gst::MiniObject.
EventType Gst::Event::get_event_type | ( | ) | const |
Get the Gst::EventType of the event.
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.
ClockTime Gst::Event::get_timestamp | ( | ) | const |
Get the Gst::ClockTime timestamp of the event.
This is the time when the event was created.
const GstEvent* Gst::Event::gobj | ( | ) | const [inline] |
GstEvent* Gst::Event::gobj | ( | ) | [inline] |
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.
bool Gst::Event::has_name | ( | const Glib::ustring & | name | ) |
Checks if event has the given name.
This function is usually used to check the name of a custom event.
name | Name to check. |
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.
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.
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. |