From 55515f8433ecdf35d934679a8a922b312813d2b9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 21 Oct 2001 21:58:29 +0000 Subject: [PATCH] Some compiler warning removed. Original commit message from CVS: Some compiler warning removed. Updated the event handler in filesrc. --- gst/elements/gstaggregator.c | 1 + gst/elements/gstelements.c | 3 +-- gst/elements/gstfilesrc.c | 45 ++++++++++++++++++++-------------------- gst/elements/gsthttpsrc.c | 2 +- plugins/elements/gstaggregator.c | 1 + plugins/elements/gstelements.c | 3 +-- plugins/elements/gstfilesrc.c | 45 ++++++++++++++++++++-------------------- plugins/elements/gsthttpsrc.c | 2 +- 8 files changed, 50 insertions(+), 52 deletions(-) diff --git a/gst/elements/gstaggregator.c b/gst/elements/gstaggregator.c index 49ec28f..1004567 100644 --- a/gst/elements/gstaggregator.c +++ b/gst/elements/gstaggregator.c @@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator) aggregator->numsinkpads = 0; aggregator->sinkpads = NULL; aggregator->silent = FALSE; + aggregator->sched = AGGREGATOR_LOOP; } static GstPad* diff --git a/gst/elements/gstelements.c b/gst/elements/gstelements.c index bdd540d..0b21e99 100644 --- a/gst/elements/gstelements.c +++ b/gst/elements/gstelements.c @@ -49,8 +49,7 @@ struct _elements_entry { extern GType gst_filesrc_get_type(void); - -extern GstElementDetails *gst_filesrc_details; +extern GstElementDetails gst_filesrc_details; static struct _elements_entry _elements[] = { { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, diff --git a/gst/elements/gstfilesrc.c b/gst/elements/gstfilesrc.c index 8873086..d26190e 100644 --- a/gst/elements/gstfilesrc.c +++ b/gst/elements/gstfilesrc.c @@ -145,14 +145,16 @@ enum { }; -static void gst_filesrc_class_init (GstFileSrcClass *klass); -static void gst_filesrc_init (GstFileSrc *filesrc); +static void gst_filesrc_class_init (GstFileSrcClass *klass); +static void gst_filesrc_init (GstFileSrc *filesrc); -static void gst_filesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gst_filesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gst_filesrc_set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec); +static void gst_filesrc_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec); -static GstBuffer * gst_filesrc_get (GstPad *pad); -static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEventType event, gint64 location, guint32 data); +static GstBuffer * gst_filesrc_get (GstPad *pad); +static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event); static GstElementStateReturn gst_filesrc_change_state (GstElement *element); @@ -477,13 +479,13 @@ gst_filesrc_get (GstPad *pad) // check for seek if (src->seek_happened) { src->seek_happened = FALSE; - return gst_event_new(GST_EVENT_DISCONTINUOUS); + return GST_BUFFER (gst_event_new(GST_EVENT_DISCONTINUOUS)); } // check for EOF if (src->curoffset == src->filelen) { - gst_element_set_state(src,GST_STATE_PAUSED); - return gst_event_new(GST_EVENT_EOS); + gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED); + return GST_BUFFER (gst_event_new(GST_EVENT_EOS)); } // calculate end pointers so we don't have to do so repeatedly later @@ -535,7 +537,7 @@ gst_filesrc_get (GstPad *pad) region.offset = src->curoffset; region.size = readsize; map = g_tree_search (src->map_regions, - (GCompareFunc) gst_filesrc_search_region_match, + (GSearchFunc) gst_filesrc_search_region_match, ®ion); // if we found an exact match, subbuffer it @@ -647,22 +649,19 @@ gst_filesrc_change_state (GstElement *element) } static gboolean -gst_filesrc_srcpad_event(GstPad *pad, GstEventType event, gint64 location, guint32 data) +gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event) { GstFileSrc *src = GST_FILESRC(GST_PAD_PARENT(pad)); - if (event == GST_EVENT_SEEK) { - if (data == SEEK_SET) { - src->curoffset = (guint64)location; - } else if (data == SEEK_CUR) { - src->curoffset += (gint64)location; - } else if (data == SEEK_END) { - src->curoffset = src->filelen - (guint64)location; - } - src->seek_happened = TRUE; - // push a discontinuous event? - return TRUE; + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_SEEK: + src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event); + src->seek_happened = TRUE; + gst_event_free (event); + // push a discontinuous event? + default: + break; } - return FALSE; + return TRUE; } diff --git a/gst/elements/gsthttpsrc.c b/gst/elements/gsthttpsrc.c index f5fa68e..1dd2cce 100644 --- a/gst/elements/gsthttpsrc.c +++ b/gst/elements/gsthttpsrc.c @@ -146,7 +146,7 @@ gst_httpsrc_get(GstPad *pad) return NULL; } - g_print ("%d\n", readbytes); + g_print ("%ld\n", readbytes); if (readbytes < src->bytes_per_read) { // FIXME: set the buffer's EOF bit here } diff --git a/plugins/elements/gstaggregator.c b/plugins/elements/gstaggregator.c index 49ec28f..1004567 100644 --- a/plugins/elements/gstaggregator.c +++ b/plugins/elements/gstaggregator.c @@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator) aggregator->numsinkpads = 0; aggregator->sinkpads = NULL; aggregator->silent = FALSE; + aggregator->sched = AGGREGATOR_LOOP; } static GstPad* diff --git a/plugins/elements/gstelements.c b/plugins/elements/gstelements.c index bdd540d..0b21e99 100644 --- a/plugins/elements/gstelements.c +++ b/plugins/elements/gstelements.c @@ -49,8 +49,7 @@ struct _elements_entry { extern GType gst_filesrc_get_type(void); - -extern GstElementDetails *gst_filesrc_details; +extern GstElementDetails gst_filesrc_details; static struct _elements_entry _elements[] = { { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 8873086..d26190e 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -145,14 +145,16 @@ enum { }; -static void gst_filesrc_class_init (GstFileSrcClass *klass); -static void gst_filesrc_init (GstFileSrc *filesrc); +static void gst_filesrc_class_init (GstFileSrcClass *klass); +static void gst_filesrc_init (GstFileSrc *filesrc); -static void gst_filesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gst_filesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gst_filesrc_set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec); +static void gst_filesrc_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec); -static GstBuffer * gst_filesrc_get (GstPad *pad); -static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEventType event, gint64 location, guint32 data); +static GstBuffer * gst_filesrc_get (GstPad *pad); +static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event); static GstElementStateReturn gst_filesrc_change_state (GstElement *element); @@ -477,13 +479,13 @@ gst_filesrc_get (GstPad *pad) // check for seek if (src->seek_happened) { src->seek_happened = FALSE; - return gst_event_new(GST_EVENT_DISCONTINUOUS); + return GST_BUFFER (gst_event_new(GST_EVENT_DISCONTINUOUS)); } // check for EOF if (src->curoffset == src->filelen) { - gst_element_set_state(src,GST_STATE_PAUSED); - return gst_event_new(GST_EVENT_EOS); + gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED); + return GST_BUFFER (gst_event_new(GST_EVENT_EOS)); } // calculate end pointers so we don't have to do so repeatedly later @@ -535,7 +537,7 @@ gst_filesrc_get (GstPad *pad) region.offset = src->curoffset; region.size = readsize; map = g_tree_search (src->map_regions, - (GCompareFunc) gst_filesrc_search_region_match, + (GSearchFunc) gst_filesrc_search_region_match, ®ion); // if we found an exact match, subbuffer it @@ -647,22 +649,19 @@ gst_filesrc_change_state (GstElement *element) } static gboolean -gst_filesrc_srcpad_event(GstPad *pad, GstEventType event, gint64 location, guint32 data) +gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event) { GstFileSrc *src = GST_FILESRC(GST_PAD_PARENT(pad)); - if (event == GST_EVENT_SEEK) { - if (data == SEEK_SET) { - src->curoffset = (guint64)location; - } else if (data == SEEK_CUR) { - src->curoffset += (gint64)location; - } else if (data == SEEK_END) { - src->curoffset = src->filelen - (guint64)location; - } - src->seek_happened = TRUE; - // push a discontinuous event? - return TRUE; + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_SEEK: + src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event); + src->seek_happened = TRUE; + gst_event_free (event); + // push a discontinuous event? + default: + break; } - return FALSE; + return TRUE; } diff --git a/plugins/elements/gsthttpsrc.c b/plugins/elements/gsthttpsrc.c index f5fa68e..1dd2cce 100644 --- a/plugins/elements/gsthttpsrc.c +++ b/plugins/elements/gsthttpsrc.c @@ -146,7 +146,7 @@ gst_httpsrc_get(GstPad *pad) return NULL; } - g_print ("%d\n", readbytes); + g_print ("%ld\n", readbytes); if (readbytes < src->bytes_per_read) { // FIXME: set the buffer's EOF bit here } -- 2.7.4