mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 16:18:16 +00:00
Some compiler warning removed.
Original commit message from CVS: Some compiler warning removed. Updated the event handler in filesrc.
This commit is contained in:
parent
657b9c3ddc
commit
55515f8433
8 changed files with 50 additions and 52 deletions
|
@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator)
|
|||
aggregator->numsinkpads = 0;
|
||||
aggregator->sinkpads = NULL;
|
||||
aggregator->silent = FALSE;
|
||||
aggregator->sched = AGGREGATOR_LOOP;
|
||||
}
|
||||
|
||||
static GstPad*
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ gst_aggregator_init (GstAggregator *aggregator)
|
|||
aggregator->numsinkpads = 0;
|
||||
aggregator->sinkpads = NULL;
|
||||
aggregator->silent = FALSE;
|
||||
aggregator->sched = AGGREGATOR_LOOP;
|
||||
}
|
||||
|
||||
static GstPad*
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue