Commit 6f96a24d authored by Wim Taymans's avatar Wim Taymans

- The clock_wait now returns the difference between requested time and unlock time.

Original commit message from CVS:
- The clock_wait now returns the difference between requested time and
unlock time.
- Misc defines like GST_SECOND in gstclock.h
- remove pre/post in gstelement.c until fixed.
- added release_locks to gstelement so that the element can unlock itself
- added some more predefined events.
- added folowing functions to gstpad:
- convert function: get the relation between formats on this pad
- query function: get stats about the pad (position/total/latency)
- internal connect function: find out how this pad connects to other
pad internally to the element.
- generic pad_dispatcher.
- removed the last bits of pullregion
- use release_locks on the queue.
- added some events to queue
- make gstthread use the new release_locks function
- make the scheduler use the new clock_wait functions
- added events to fakesink
- added query functions to filesrc
- swap type and offset in the bytestream seek API to match fseek
- added some event handling in bytestream.
parent 692b0764
......@@ -149,6 +149,8 @@ gst_fakesink_init (GstFakeSink *fakesink)
fakesink->last_message = NULL;
GST_ELEMENT (fakesink)->setclockfunc = gst_fakesink_set_clock;
GST_FLAG_SET (fakesink, GST_ELEMENT_EVENT_AWARE);
}
static void
......@@ -251,8 +253,26 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
fakesink = GST_FAKESINK (gst_pad_get_parent (pad));
if (fakesink->sync) {
gst_element_clock_wait (GST_ELEMENT (fakesink), fakesink->clock, GST_BUFFER_TIMESTAMP (buf));
if (GST_IS_EVENT (buf)) {
GstEvent *event = GST_EVENT (buf);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_DISCONTINUOUS:
if (fakesink->sync && fakesink->clock) {
gint64 value = GST_EVENT_DISCONT_OFFSET (event, 0).value;
gst_clock_handle_discont (fakesink->clock, value);
}
default:
gst_pad_event_default (pad, event);
break;
}
gst_event_free (event);
return;
}
if (fakesink->sync && fakesink->clock) {
gst_element_clock_wait (GST_ELEMENT (fakesink), fakesink->clock, GST_BUFFER_TIMESTAMP (buf), NULL);
}
if (!fakesink->silent) {
......
......@@ -322,7 +322,7 @@ gst_fakesrc_event_handler (GstPad *pad, GstEvent *event)
case GST_EVENT_SEEK:
src->buffer_count = GST_EVENT_SEEK_OFFSET (event);
if (!GST_EVENT_SEEK_FLUSH (event)) {
if (!GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) {
gst_event_free (event);
break;
}
......
......@@ -271,24 +271,29 @@ gst_filesink_handle_event (GstPad *pad, GstEvent *event)
switch (type) {
case GST_EVENT_SEEK:
/* we need to seek */
if (GST_EVENT_SEEK_FLUSH(event))
if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH)
if (fflush(filesink->file))
gst_element_error(GST_ELEMENT(filesink),
"Error flushing the buffer cache of file \'%s\' to disk: %s",
gst_filesink_getcurrentfilename(filesink), sys_errlist[errno]);
switch (GST_EVENT_SEEK_TYPE(event))
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
g_warning("Any other then byte-offset seeking is not supported!\n");
}
switch (GST_EVENT_SEEK_METHOD(event))
{
case GST_SEEK_BYTEOFFSET_SET:
case GST_SEEK_METHOD_SET:
fseek(filesink->file, GST_EVENT_SEEK_OFFSET(event), SEEK_SET);
break;
case GST_SEEK_BYTEOFFSET_CUR:
case GST_SEEK_METHOD_CUR:
fseek(filesink->file, GST_EVENT_SEEK_OFFSET(event), SEEK_CUR);
break;
case GST_SEEK_BYTEOFFSET_END:
case GST_SEEK_METHOD_END:
fseek(filesink->file, GST_EVENT_SEEK_OFFSET(event), SEEK_END);
break;
default:
g_warning("Any other then byte-offset seeking is not supported!\n");
g_warning("unkown seek method!\n");
break;
}
break;
......
......@@ -110,6 +110,8 @@ static void gst_filesrc_get_property (GObject *object, guint prop_id,
static GstBuffer * gst_filesrc_get (GstPad *pad);
static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event);
static gboolean gst_filesrc_srcpad_query (GstPad *pad, GstPadQueryType type,
GstSeekType *format, gint64 *value);
static GstElementStateReturn gst_filesrc_change_state (GstElement *element);
......@@ -184,8 +186,9 @@ static void
gst_filesrc_init (GstFileSrc *src)
{
src->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (src->srcpad,gst_filesrc_get);
gst_pad_set_event_function (src->srcpad,gst_filesrc_srcpad_event);
gst_pad_set_get_function (src->srcpad, gst_filesrc_get);
gst_pad_set_event_function (src->srcpad, gst_filesrc_srcpad_event);
gst_pad_set_query_function (src->srcpad, gst_filesrc_srcpad_query);
gst_element_add_pad (GST_ELEMENT (src), src->srcpad);
src->pagesize = getpagesize();
......@@ -201,7 +204,7 @@ gst_filesrc_init (GstFileSrc *src)
src->mapbuf = NULL;
src->mapsize = 4 * 1024 * 1024; /* default is 4MB */
src->map_regions = g_tree_new(gst_filesrc_bufcmp);
src->map_regions = g_tree_new (gst_filesrc_bufcmp);
src->map_regions_lock = g_mutex_new();
src->seek_happened = FALSE;
......@@ -445,12 +448,19 @@ gst_filesrc_get (GstPad *pad)
/* check for seek */
if (src->seek_happened) {
GstEvent *event;
src->seek_happened = FALSE;
return GST_BUFFER (gst_event_new (GST_EVENT_DISCONTINUOUS));
GST_DEBUG (GST_CAT_EVENT, "filesrc sending discont\n");
event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
GST_EVENT_DISCONT_FLUSH (event) = src->need_flush;
src->need_flush = FALSE;
return GST_BUFFER (event);
}
/* check for flush */
if (src->need_flush) {
src->need_flush = FALSE;
GST_DEBUG (GST_CAT_EVENT, "filesrc sending flush\n");
return GST_BUFFER (gst_event_new_flush ());
}
......@@ -645,6 +655,7 @@ gst_filesrc_change_state (GstElement *element)
case GST_STATE_READY_TO_PAUSED:
case GST_STATE_PAUSED_TO_READY:
src->curoffset = 0;
src->seek_happened = TRUE;
default:
break;
}
......@@ -655,21 +666,50 @@ gst_filesrc_change_state (GstElement *element)
return GST_STATE_SUCCESS;
}
static gboolean
gst_filesrc_srcpad_query (GstPad *pad, GstPadQueryType type,
GstFormat *format, gint64 *value)
{
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
switch (type) {
case GST_PAD_QUERY_TOTAL:
if (*format != GST_FORMAT_BYTES) {
return FALSE;
}
*value = src->filelen;
break;
case GST_PAD_QUERY_POSITION:
if (*format != GST_FORMAT_BYTES) {
return FALSE;
}
*value = src->curoffset;
break;
default:
return FALSE;
break;
}
return TRUE;
}
static gboolean
gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
{
GstFileSrc *src = GST_FILESRC(GST_PAD_PARENT(pad));
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
switch (GST_EVENT_SEEK_TYPE (event)) {
case GST_SEEK_BYTEOFFSET_SET:
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
return FALSE;
}
switch (GST_EVENT_SEEK_METHOD (event)) {
case GST_SEEK_METHOD_SET:
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
break;
case GST_SEEK_BYTEOFFSET_CUR:
case GST_SEEK_METHOD_CUR:
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
break;
case GST_SEEK_BYTEOFFSET_END:
case GST_SEEK_METHOD_END:
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
break;
default:
......@@ -678,9 +718,7 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
}
g_object_notify (G_OBJECT (src), "offset");
src->seek_happened = TRUE;
src->need_flush = GST_EVENT_SEEK_FLUSH(event);
gst_event_free (event);
/* push a discontinuous event? */
src->need_flush = GST_EVENT_SEEK_FLAGS(event) & GST_SEEK_FLAG_FLUSH;
break;
case GST_EVENT_FLUSH:
src->need_flush = TRUE;
......
......@@ -258,10 +258,12 @@ gst_clock_set_active (GstClock *clock, gboolean active)
GST_LOCK (clock);
if (active) {
clock->start_time = time - clock->last_time;;
clock->start_time = time - clock->last_time;
clock->accept_discont = TRUE;
}
else {
clock->last_time = time - clock->start_time;
clock->accept_discont = FALSE;
}
GST_UNLOCK (clock);
......@@ -286,6 +288,39 @@ gst_clock_is_active (GstClock *clock)
return clock->active;
}
gboolean
gst_clock_handle_discont (GstClock *clock, guint64 time)
{
GstClockTime itime = 0LL;
GST_DEBUG (GST_CAT_CLOCK, "clock discont %llu %llu %d\n", time, clock->start_time, clock->accept_discont);
GST_LOCK (clock);
if (clock->accept_discont) {
if (CLASS (clock)->get_internal_time) {
itime = CLASS (clock)->get_internal_time (clock);
}
}
else {
GST_UNLOCK (clock);
GST_DEBUG (GST_CAT_CLOCK, "clock discont refused %llu %llu\n", time, clock->start_time);
return FALSE;
}
clock->start_time = itime - time;
clock->last_time = time;
clock->accept_discont = FALSE;
GST_UNLOCK (clock);
GST_DEBUG (GST_CAT_CLOCK, "new time %llu\n", gst_clock_get_time (clock));
g_mutex_lock (clock->active_mutex);
g_cond_broadcast (clock->active_cond);
g_mutex_unlock (clock->active_mutex);
return TRUE;
}
/**
* gst_clock_get_time
* @clock: a #GstClock to query
......@@ -311,7 +346,7 @@ gst_clock_get_time (GstClock *clock)
ret = CLASS (clock)->get_internal_time (clock) - clock->start_time;
}
/* make sure the time is increasing, else return last_time */
if (ret < clock->last_time) {
if ((gint64) ret < (gint64) clock->last_time) {
ret = clock->last_time;
}
else {
......@@ -355,7 +390,7 @@ gst_clock_wait_async_func (GstClock *clock, GstClockTime time,
* Returns: the #GstClockReturn result of the operation.
*/
GstClockReturn
gst_clock_wait (GstClock *clock, GstClockTime time)
gst_clock_wait (GstClock *clock, GstClockTime time, GstClockTimeDiff *jitter)
{
GstClockID id;
GstClockReturn res;
......@@ -363,7 +398,7 @@ gst_clock_wait (GstClock *clock, GstClockTime time)
g_return_val_if_fail (GST_IS_CLOCK (clock), GST_CLOCK_STOPPED);
id = gst_clock_wait_async_func (clock, time, NULL, NULL);
res = gst_clock_wait_id (clock, id);
res = gst_clock_wait_id (clock, id, jitter);
return res;
}
......@@ -460,12 +495,13 @@ gst_clock_unlock_func (GstClock *clock, GstClockTime time, GstClockID id, gpoint
* Returns: result of the operation.
*/
GstClockReturn
gst_clock_wait_id (GstClock *clock, GstClockID id)
gst_clock_wait_id (GstClock *clock, GstClockID id, GstClockTimeDiff *jitter)
{
GstClockReturn res = GST_CLOCK_TIMEOUT;
GstClockEntry *entry = (GstClockEntry *) id;
GstClockTime current_real, current, target;
GTimeVal timeval;
GstClockTimeDiff this_jitter;
g_return_val_if_fail (GST_IS_CLOCK (clock), GST_CLOCK_ERROR);
g_return_val_if_fail (entry, GST_CLOCK_ERROR);
......@@ -479,16 +515,24 @@ gst_clock_wait_id (GstClock *clock, GstClockID id)
entry->func = gst_clock_unlock_func;
target = GST_CLOCK_ENTRY_TIME (entry) - current + current_real;
GST_DEBUG (GST_CAT_CLOCK, "%llu %llu %llu\n", target, current, current_real);
GST_DEBUG (GST_CAT_CLOCK, "real_target %llu, current_real %llu, target %llu, now %llu\n",
target, current_real, GST_CLOCK_ENTRY_TIME (entry), current);
if (target > current_real) {
timeval.tv_usec = target % 1000000;
timeval.tv_sec = target / 1000000;
GST_TIME_TO_TIMEVAL (target, timeval);
GST_CLOCK_ENTRY_TIMED_WAIT (entry, &timeval);
current = gst_clock_get_time (clock);
this_jitter = current - GST_CLOCK_ENTRY_TIME (entry);
}
else {
res = GST_CLOCK_EARLY;
this_jitter = target - current_real;
}
GST_CLOCK_ENTRY_UNLOCK (entry);
if (jitter)
*jitter = this_jitter;
gst_clock_free_entry (clock, entry);
return res;
......
......@@ -45,8 +45,18 @@ typedef guint64 GstClockTime;
typedef gint64 GstClockTimeDiff;
typedef gpointer GstClockID;
#define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s)-(e))
#define GST_TIMEVAL_TO_TIME(tv) ((tv).tv_sec * (guint64) G_USEC_PER_SEC + (tv).tv_usec)
#define GST_SECOND ((guint64)G_USEC_PER_SEC)
#define GST_MSECOND ((guint64)GST_SECOND/1000LL)
#define GST_USECOND ((guint64)GST_SECOND/1000000LL)
#define GST_NSECOND ((guint64)GST_SECOND/1000000000LL)
#define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s)-(e))
#define GST_TIMEVAL_TO_TIME(tv) ((tv).tv_sec * GST_SECOND + (tv).tv_usec * GST_USECOND)
#define GST_TIME_TO_TIMEVAL(t,tv) \
G_STMT_START { \
(tv).tv_sec = (t) / GST_SECOND; \
(tv).tv_usec = ((t) / GST_USECOND) % GST_SECOND; \
} G_STMT_END
typedef struct _GstClock GstClock;
typedef struct _GstClockClass GstClockClass;
......@@ -66,6 +76,7 @@ struct _GstClock {
GstClockTime start_time;
GstClockTime last_time;
gboolean accept_discont;
gdouble speed;
gboolean active;
GList *entries;
......@@ -95,18 +106,19 @@ gdouble gst_clock_get_speed (GstClock *clock);
void gst_clock_set_active (GstClock *clock, gboolean active);
gboolean gst_clock_is_active (GstClock *clock);
void gst_clock_reset (GstClock *clock);
gboolean gst_clock_handle_discont (GstClock *clock, guint64 time);
gboolean gst_clock_async_supported (GstClock *clock);
GstClockTime gst_clock_get_time (GstClock *clock);
GstClockReturn gst_clock_wait (GstClock *clock, GstClockTime time);
GstClockReturn gst_clock_wait (GstClock *clock, GstClockTime time, GstClockTimeDiff *jitter);
GstClockID gst_clock_wait_async (GstClock *clock, GstClockTime time,
GstClockCallback func, gpointer user_data);
void gst_clock_cancel_wait_async (GstClock *clock, GstClockID id);
GstClockID gst_clock_notify_async (GstClock *clock, GstClockTime interval,
GstClockCallback func, gpointer user_data);
void gst_clock_remove_notify_async (GstClock *clock, GstClockID id);
GstClockReturn gst_clock_wait_id (GstClock *clock, GstClockID id);
GstClockReturn gst_clock_wait_id (GstClock *clock, GstClockID id, GstClockTimeDiff *jitter);
GstClockID gst_clock_get_next_id (GstClock *clock);
void gst_clock_unlock_id (GstClock *clock, GstClockID id);
......
......@@ -183,6 +183,7 @@ gst_element_init (GstElement *element)
element->pads = NULL;
element->loopfunc = NULL;
element->sched = NULL;
element->clock = NULL;
element->sched_private = NULL;
element->state_mutex = g_mutex_new ();
element->state_cond = g_cond_new ();
......@@ -223,9 +224,8 @@ gst_element_dispatch_properties_changed (GObject *object,
G_OBJECT_CLASS (parent_class)->dispatch_properties_changed (object, n_pspecs, pspecs);
/* now let the parent dispatch those, too */
gst_object = GST_OBJECT (object);
while (gst_object)
{
gst_object = GST_OBJECT_PARENT (object);
while (gst_object) {
/* need own category? */
for (i = 0; i < n_pspecs; i++) {
GST_DEBUG (GST_CAT_EVENT, "deep notification from %s to %s (%s)", GST_OBJECT_NAME (object),
......@@ -266,7 +266,7 @@ static void
gst_element_threadsafe_properties_pre_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "locking element %s", GST_OBJECT_NAME (element));
g_mutex_lock (element->property_mutex);
//g_mutex_lock (element->property_mutex);
gst_element_set_pending_properties (element);
}
......@@ -274,7 +274,7 @@ static void
gst_element_threadsafe_properties_post_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "unlocking element %s", GST_OBJECT_NAME (element));
g_mutex_unlock (element->property_mutex);
//g_mutex_unlock (element->property_mutex);
}
void
......@@ -678,6 +678,8 @@ gst_element_set_clock (GstElement *element, GstClock *clock)
if (element->setclockfunc)
element->setclockfunc (element, clock);
element->clock = clock;
}
/**
......@@ -711,16 +713,41 @@ gst_element_get_clock (GstElement *element)
* Returns: the #GstClockReturn result of the wait operation
*/
GstClockReturn
gst_element_clock_wait (GstElement *element, GstClock *clock, GstClockTime time)
gst_element_clock_wait (GstElement *element, GstClock *clock, GstClockTime time, GstClockTimeDiff *jitter)
{
GstClockReturn res;
g_return_val_if_fail (element != NULL, GST_CLOCK_ERROR);
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_CLOCK_ERROR);
if (GST_ELEMENT_SCHED (element)) {
return gst_scheduler_clock_wait (GST_ELEMENT_SCHED (element), element, clock, time);
res = gst_scheduler_clock_wait (GST_ELEMENT_SCHED (element), element, clock, time, jitter);
}
else
return GST_CLOCK_TIMEOUT;
res = GST_CLOCK_TIMEOUT;
return res;
}
/**
* gst_element_release_locks:
* @element: an element
*
* Instruct the element to release all the locks it is holding, ex
* blocking reads, waiting for the clock, ...
*
* Returns: TRUE if the locks could be released.
*/
gboolean
gst_element_release_locks (GstElement *element)
{
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
if (CLASS (element)->release_locks)
return CLASS (element)->release_locks (element);
return TRUE;
}
/**
......
......@@ -130,6 +130,7 @@ struct _GstElement {
gpointer sched_private;
GstElementSetClockFunction setclockfunc;
GstElementGetClockFunction getclockfunc;
GstClock *clock;
/* element pads */
guint16 numpads;
......@@ -169,6 +170,7 @@ struct _GstElementClass {
void (*get_property) (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/* vtable*/
gboolean (*release_locks) (GstElement *element);
/* change the element state */
GstElementStateReturn (*change_state) (GstElement *element);
/* request a new pad */
......@@ -211,7 +213,10 @@ GstObject* gst_element_get_parent (GstElement *element);
GstClock* gst_element_get_clock (GstElement *element);
void gst_element_set_clock (GstElement *element, GstClock *clock);
GstClockReturn gst_element_clock_wait (GstElement *element, GstClock *clock, GstClockTime time);
GstClockReturn gst_element_clock_wait (GstElement *element, GstClock *clock,
GstClockTime time, GstClockTimeDiff *jitter);
gboolean gst_element_release_locks (GstElement *element);
void gst_element_yield (GstElement *element);
gboolean gst_element_interrupt (GstElement *element);
......
......@@ -25,6 +25,8 @@
#include "gst/gstevent.h"
#include <string.h> /* memcpy */
/* #define MEMPROF */
GType _gst_event_type;
static GMemChunk *_gst_event_chunk;
......@@ -71,9 +73,13 @@ gst_event_new (GstEventType type)
{
GstEvent *event;
#ifndef MEMPROF
g_mutex_lock (_gst_event_chunk_lock);
event = g_mem_chunk_alloc (_gst_event_chunk);
g_mutex_unlock (_gst_event_chunk_lock);
#else
event = g_new0(GstEvent, 1);
#endif
GST_INFO (GST_CAT_EVENT, "creating new event %p", event);
GST_DATA_TYPE (event) = _gst_event_type;
......@@ -97,9 +103,13 @@ gst_event_copy (GstEvent *event)
{
GstEvent *copy;
#ifndef MEMPROF
g_mutex_lock (_gst_event_chunk_lock);
copy = g_mem_chunk_alloc (_gst_event_chunk);
g_mutex_unlock (_gst_event_chunk_lock);
#else
copy = g_new0(GstEvent, 1);
#endif
memcpy (copy, event, sizeof (GstEvent));
......@@ -127,7 +137,11 @@ gst_event_free (GstEvent* event)
default:
break;
}
#ifndef MEMPROF
g_mem_chunk_free (_gst_event_chunk, event);
#else
g_free (event);
#endif
g_mutex_unlock (_gst_event_chunk_lock);
}
......@@ -142,16 +156,65 @@ gst_event_free (GstEvent* event)
* Returns: A new seek event.
*/
GstEvent*
gst_event_new_seek (GstSeekType type, gint64 offset, gboolean flush)
gst_event_new_seek (GstSeekType type, gint64 offset)
{
GstEvent *event;
event = gst_event_new (GST_EVENT_SEEK);
GST_EVENT_SEEK_TYPE (event) = type;
GST_EVENT_SEEK_OFFSET (event) = offset;
GST_EVENT_SEEK_FLUSH (event) = flush;
return event;
}
GstEvent*
gst_event_new_discontinuous (gboolean new_media, GstSeekType format1, ...)
{
va_list var_args;
GstEvent *event;
gint count = 0;
event = gst_event_new (GST_EVENT_DISCONTINUOUS);
GST_EVENT_DISCONT_NEW_MEDIA (event) = new_media;
va_start (var_args, format1);
while (format1) {
GST_EVENT_DISCONT_OFFSET (event, count).format = format1 & GST_SEEK_FORMAT_MASK;
GST_EVENT_DISCONT_OFFSET (event, count).value = va_arg (var_args, gint64);
format1 = va_arg (var_args, GstSeekType);
count++;
}
va_end (var_args);
GST_EVENT_DISCONT_OFFSET_LEN (event) = count;
return event;
}
gboolean
gst_event_discont_get_value (GstEvent *event, GstSeekType type, gint64 *value)
{
gint i, n;
g_return_val_if_fail (event, FALSE);
g_return_val_if_fail (value, FALSE);
n = GST_EVENT_DISCONT_OFFSET_LEN (event);
for (i = 0; i < n; i++) {
if (GST_EVENT_DISCONT_OFFSET(event,i).format == type) {
*value = GST_EVENT_DISCONT_OFFSET(event,i).value;
return TRUE;
}
}
return FALSE;
}
......@@ -25,23 +25,22 @@
#define __GST_EVENT_H__
#include <gst/gsttypes.h>
#include <gst/gstelement.h>
#include <gst/gstobject.h>
#include <gst/gstdata.h>
#include <gst/gstcaps.h>
#include <gst/gstformat.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
typedef enum {
GST_EVENT_UNKNOWN,
GST_EVENT_EOS,
GST_EVENT_FLUSH,
GST_EVENT_EMPTY,
GST_EVENT_SEEK,
GST_EVENT_DISCONTINUOUS,
GST_EVENT_NEW_MEDIA,
GST_EVENT_QOS,
GST_EVENT_SEEK,
GST_EVENT_FILLER,
} GstEventType;
extern GType _gst_event_type;
......@@ -54,20 +53,45 @@ extern GType _gst_event_type;
#define GST_EVENT_TIMESTAMP(event) (GST_EVENT(event)->timestamp)
#define GST_EVENT_SRC(event) (GST_EVENT(event)->src)
#define GST_SEEK_FORMAT_SHIFT 0