Some compiler warning removed.

Original commit message from CVS:
Some compiler warning removed.
Updated the event handler in filesrc.
This commit is contained in:
Wim Taymans 2001-10-21 21:58:29 +00:00
parent 657b9c3ddc
commit 55515f8433
8 changed files with 50 additions and 52 deletions

View file

@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator)
aggregator->numsinkpads = 0; aggregator->numsinkpads = 0;
aggregator->sinkpads = NULL; aggregator->sinkpads = NULL;
aggregator->silent = FALSE; aggregator->silent = FALSE;
aggregator->sched = AGGREGATOR_LOOP;
} }
static GstPad* static GstPad*

View file

@ -49,8 +49,7 @@ struct _elements_entry {
extern GType gst_filesrc_get_type(void); extern GType gst_filesrc_get_type(void);
extern GstElementDetails gst_filesrc_details;
extern GstElementDetails *gst_filesrc_details;
static struct _elements_entry _elements[] = { static struct _elements_entry _elements[] = {
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init },

View file

@ -148,11 +148,13 @@ enum {
static void gst_filesrc_class_init (GstFileSrcClass *klass); static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc); 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_set_property (GObject *object, guint prop_id,
static void gst_filesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); 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 GstBuffer * gst_filesrc_get (GstPad *pad);
static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEventType event, gint64 location, guint32 data); static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event);
static GstElementStateReturn gst_filesrc_change_state (GstElement *element); static GstElementStateReturn gst_filesrc_change_state (GstElement *element);
@ -477,13 +479,13 @@ gst_filesrc_get (GstPad *pad)
// check for seek // check for seek
if (src->seek_happened) { if (src->seek_happened) {
src->seek_happened = FALSE; src->seek_happened = FALSE;
return gst_event_new(GST_EVENT_DISCONTINUOUS); return GST_BUFFER (gst_event_new(GST_EVENT_DISCONTINUOUS));
} }
// check for EOF // check for EOF
if (src->curoffset == src->filelen) { if (src->curoffset == src->filelen) {
gst_element_set_state(src,GST_STATE_PAUSED); gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
return gst_event_new(GST_EVENT_EOS); return GST_BUFFER (gst_event_new(GST_EVENT_EOS));
} }
// calculate end pointers so we don't have to do so repeatedly later // 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.offset = src->curoffset;
region.size = readsize; region.size = readsize;
map = g_tree_search (src->map_regions, map = g_tree_search (src->map_regions,
(GCompareFunc) gst_filesrc_search_region_match, (GSearchFunc) gst_filesrc_search_region_match,
&region); &region);
// if we found an exact match, subbuffer it // if we found an exact match, subbuffer it
@ -647,22 +649,19 @@ gst_filesrc_change_state (GstElement *element)
} }
static gboolean 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)); GstFileSrc *src = GST_FILESRC(GST_PAD_PARENT(pad));
if (event == GST_EVENT_SEEK) { switch (GST_EVENT_TYPE (event)) {
if (data == SEEK_SET) { case GST_EVENT_SEEK:
src->curoffset = (guint64)location; src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
} else if (data == SEEK_CUR) {
src->curoffset += (gint64)location;
} else if (data == SEEK_END) {
src->curoffset = src->filelen - (guint64)location;
}
src->seek_happened = TRUE; src->seek_happened = TRUE;
gst_event_free (event);
// push a discontinuous event? // push a discontinuous event?
return TRUE; default:
break;
} }
return FALSE; return TRUE;
} }

View file

@ -146,7 +146,7 @@ gst_httpsrc_get(GstPad *pad)
return NULL; return NULL;
} }
g_print ("%d\n", readbytes); g_print ("%ld\n", readbytes);
if (readbytes < src->bytes_per_read) { if (readbytes < src->bytes_per_read) {
// FIXME: set the buffer's EOF bit here // FIXME: set the buffer's EOF bit here
} }

View file

@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator)
aggregator->numsinkpads = 0; aggregator->numsinkpads = 0;
aggregator->sinkpads = NULL; aggregator->sinkpads = NULL;
aggregator->silent = FALSE; aggregator->silent = FALSE;
aggregator->sched = AGGREGATOR_LOOP;
} }
static GstPad* static GstPad*

View file

@ -49,8 +49,7 @@ struct _elements_entry {
extern GType gst_filesrc_get_type(void); extern GType gst_filesrc_get_type(void);
extern GstElementDetails gst_filesrc_details;
extern GstElementDetails *gst_filesrc_details;
static struct _elements_entry _elements[] = { static struct _elements_entry _elements[] = {
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init },

View file

@ -148,11 +148,13 @@ enum {
static void gst_filesrc_class_init (GstFileSrcClass *klass); static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc); 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_set_property (GObject *object, guint prop_id,
static void gst_filesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); 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 GstBuffer * gst_filesrc_get (GstPad *pad);
static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEventType event, gint64 location, guint32 data); static gboolean gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event);
static GstElementStateReturn gst_filesrc_change_state (GstElement *element); static GstElementStateReturn gst_filesrc_change_state (GstElement *element);
@ -477,13 +479,13 @@ gst_filesrc_get (GstPad *pad)
// check for seek // check for seek
if (src->seek_happened) { if (src->seek_happened) {
src->seek_happened = FALSE; src->seek_happened = FALSE;
return gst_event_new(GST_EVENT_DISCONTINUOUS); return GST_BUFFER (gst_event_new(GST_EVENT_DISCONTINUOUS));
} }
// check for EOF // check for EOF
if (src->curoffset == src->filelen) { if (src->curoffset == src->filelen) {
gst_element_set_state(src,GST_STATE_PAUSED); gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
return gst_event_new(GST_EVENT_EOS); return GST_BUFFER (gst_event_new(GST_EVENT_EOS));
} }
// calculate end pointers so we don't have to do so repeatedly later // 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.offset = src->curoffset;
region.size = readsize; region.size = readsize;
map = g_tree_search (src->map_regions, map = g_tree_search (src->map_regions,
(GCompareFunc) gst_filesrc_search_region_match, (GSearchFunc) gst_filesrc_search_region_match,
&region); &region);
// if we found an exact match, subbuffer it // if we found an exact match, subbuffer it
@ -647,22 +649,19 @@ gst_filesrc_change_state (GstElement *element)
} }
static gboolean 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)); GstFileSrc *src = GST_FILESRC(GST_PAD_PARENT(pad));
if (event == GST_EVENT_SEEK) { switch (GST_EVENT_TYPE (event)) {
if (data == SEEK_SET) { case GST_EVENT_SEEK:
src->curoffset = (guint64)location; src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
} else if (data == SEEK_CUR) {
src->curoffset += (gint64)location;
} else if (data == SEEK_END) {
src->curoffset = src->filelen - (guint64)location;
}
src->seek_happened = TRUE; src->seek_happened = TRUE;
gst_event_free (event);
// push a discontinuous event? // push a discontinuous event?
return TRUE; default:
break;
} }
return FALSE; return TRUE;
} }

View file

@ -146,7 +146,7 @@ gst_httpsrc_get(GstPad *pad)
return NULL; return NULL;
} }
g_print ("%d\n", readbytes); g_print ("%ld\n", readbytes);
if (readbytes < src->bytes_per_read) { if (readbytes < src->bytes_per_read) {
// FIXME: set the buffer's EOF bit here // FIXME: set the buffer's EOF bit here
} }