| GStreamer Library Reference Manual (Core) | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
#include <gst/gst.h> enum GstEventType; #define GST_EVENT_TYPE (event) #define GST_EVENT_SRC (event) #define GST_EVENT_TIMESTAMP (event) enum GstSeekType; #define GST_EVENT_SEEK_TYPE (event) #define GST_EVENT_SEEK_OFFSET (event) #define GST_EVENT_SEEK_FLUSH (event) #define GST_EVENT_INFO_PROPS (event) struct GstEvent; GstEvent* gst_event_new (GstEventType type); void gst_event_free (GstEvent *event); GstEvent* gst_event_new_seek (GstSeekType type, gint64 offset, gboolean flush); #define gst_event_new_flush () GstEvent* gst_event_new_info (const gchar *firstname, ...); |
The event classes are used to construct and query events.
Events are usually created with gst_event_new() which takes the event type as an argument. properties specific to the event can be set afterwards with the provided macros. The event is freed with gst_event_free().
gst_event_new_seek() is a usually used to create a seek event and it takes the needed parameters for a seek event.
gst_event_new_flush() creates a new flush event.
typedef enum {
GST_EVENT_UNKNOWN,
/* horizontal events */
GST_EVENT_EOS,
GST_EVENT_FLUSH,
GST_EVENT_EMPTY,
GST_EVENT_SEEK,
GST_EVENT_DISCONTINUOUS,
GST_EVENT_NEW_MEDIA,
/* vertical events */
GST_EVENT_INFO,
GST_EVENT_ERROR,
} GstEventType; |
The different major types of events.
| GST_EVENT_UNKNOWN | unknown event. |
| GST_EVENT_EOS | an end-of-stream event. |
| GST_EVENT_FLUSH | a flush event. |
| GST_EVENT_EMPTY | an empty event. |
| GST_EVENT_SEEK | a seek event. |
| GST_EVENT_DISCONTINUOUS | a discontinuous event to indicate the stream has a discontinuity. |
| GST_EVENT_NEW_MEDIA | |
| GST_EVENT_INFO | an informational event |
| GST_EVENT_ERROR | an error event |
#define GST_EVENT_SRC(event) (GST_EVENT(event)->src) |
The source object that generated this event
#define GST_EVENT_TIMESTAMP(event) (GST_EVENT(event)->timestamp) |
Get the timestamp of the event.
typedef enum {
GST_SEEK_ANY,
GST_SEEK_TIMEOFFSET_SET,
GST_SEEK_BYTEOFFSET_SET,
GST_SEEK_BYTEOFFSET_CUR,
GST_SEEK_BYTEOFFSET_END,
} GstSeekType; |
The different types of seek events.
#define GST_EVENT_SEEK_TYPE(event) (GST_EVENT(event)->event_data.seek.type) |
Get the seektype of the GST_EVENT_SEEK.
#define GST_EVENT_SEEK_OFFSET(event) (GST_EVENT(event)->event_data.seek.offset) |
Get the offset of the seek event.
#define GST_EVENT_SEEK_FLUSH(event) (GST_EVENT(event)->event_data.seek.flush) |
Qeury wether the seek event also needs a flush.
#define GST_EVENT_INFO_PROPS(event) (GST_EVENT(event)->event_data.info.props) |
The properties of the info event
struct GstEvent {
GstData data;
GstEventType type;
guint64 timestamp;
GstObject *src;
union {
struct {
GstSeekType type;
gint64 offset;
gboolean flush;
} seek;
struct {
GstProps *props;
} info;
struct {
GstElementState old_state;
GstElementState new_state;
} state;
} event_data;
}; |
The event data structure.
| GstData data | The parent data type. |
| GstEventType type | The event type. |
| guint64 timestamp | The event timestamp. |
| GstObject *src |
GstEvent* gst_event_new_seek (GstSeekType type, gint64 offset, gboolean flush); |
Allocate a new seek event with the given parameters.
#define gst_event_new_flush() gst_event_new(GST_EVENT_FLUSH) |
Create a new flush event.
GstEvent* gst_event_new_info (const gchar *firstname, ...); |
Allocate a new info event with the given props.