Gst::Event Class Reference

Gst::Event — A structure describing events that are passed up and down a pipeline. More...

#include <event.h>

Inheritance diagram for Gst::Event:

Gst::MiniObject Gst::EventBufferSize Gst::EventEos Gst::EventFlushStart Gst::EventFlushStop Gst::EventLatency Gst::EventNavigation Gst::EventNewSegment Gst::EventQos Gst::EventSeek Gst::EventTag

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.
Glib::RefPtr<Gst::Eventcopy () 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::Eventcreate_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::Objectget_source ()
 The source Gst::Object that generated this event.
Glib::RefPtr<const Gst::Objectget_source () const

Static Public Member Functions

static Glib::RefPtr<Gst::Eventwrap (GstEvent* event, bool take_copy=false)
 Wrap a GstEvent* in a C++ instance, creating an instance of a derived Gst::Event.


Detailed Description

Gst::Event — A structure describing 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

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

Copy the event using the event specific copy function.

Returns:
The Gst::Event copy.

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 pointer) that is writable.

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.

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.

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

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

GstEvent* Gst::Event::gobj (  )  [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.

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.

Parameters:
name Name to check.
Returns:
true if name matches the name of the event structure.
Since: 0.10.20.

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.

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:

Generated on Thu Jan 15 09:33:12 2009 for gstreamermm by  doxygen 1.5.7.1