libs/gst/base/gstbasesrc.c: Publish supported query types.

Original commit message from CVS:
Patch by: Lutz Mueller <lutz at topfrose dot de>
* libs/gst/base/gstbasesrc.c: (gst_base_src_class_init),
(gst_base_src_get_query_types), (gst_base_src_update_length):
Publish supported query types.
Update last_stop field in get_range mode so the position
query works. Fixes #342321.
This commit is contained in:
Lutz Mueller 2006-05-30 10:57:44 +00:00 committed by Wim Taymans
parent 5fba3f8c44
commit eb3f062cc1
2 changed files with 36 additions and 0 deletions

View file

@ -1,3 +1,13 @@
2006-05-30 Wim Taymans <wim@fluendo.com>
Patch by: Lutz Mueller <lutz at topfrose dot de>
* libs/gst/base/gstbasesrc.c: (gst_base_src_class_init),
(gst_base_src_get_query_types), (gst_base_src_update_length):
Publish supported query types.
Update last_stop field in get_range mode so the position
query works. Fixes #342321.
2006-05-30 Tim-Philipp Müller <tim at centricular dot net>
* docs/gst/gstreamer-sections.txt:

View file

@ -267,6 +267,7 @@ static void gst_base_src_get_property (GObject * object, guint prop_id,
static gboolean gst_base_src_event_handler (GstPad * pad, GstEvent * event);
static gboolean gst_base_src_send_event (GstElement * elem, GstEvent * event);
static gboolean gst_base_src_default_event (GstBaseSrc * src, GstEvent * event);
static const GstQueryType *gst_base_src_get_query_types (GstElement * element);
static gboolean gst_base_src_query (GstPad * pad, GstQuery * query);
@ -329,6 +330,8 @@ gst_base_src_class_init (GstBaseSrcClass * klass)
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_base_src_change_state);
gstelement_class->send_event = GST_DEBUG_FUNCPTR (gst_base_src_send_event);
gstelement_class->get_query_types =
GST_DEBUG_FUNCPTR (gst_base_src_get_query_types);
klass->negotiate = GST_DEBUG_FUNCPTR (gst_base_src_default_negotiate);
klass->event = GST_DEBUG_FUNCPTR (gst_base_src_default_event);
@ -899,6 +902,25 @@ no_format:
}
}
static const GstQueryType *
gst_base_src_get_query_types (GstElement * element)
{
static const GstQueryType query_types[] = {
GST_QUERY_DURATION,
GST_QUERY_POSITION,
GST_QUERY_SEEKING,
GST_QUERY_SEGMENT,
GST_QUERY_FORMATS,
GST_QUERY_LATENCY,
GST_QUERY_JITTER,
GST_QUERY_RATE,
GST_QUERY_CONVERT,
0
};
return query_types;
}
/* all events send to this element directly
*/
static gboolean
@ -1210,6 +1232,10 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length)
if (*length == 0)
goto unexpected_length;
/* keep track f current position. segment is in bytes, we checked
* that above. */
gst_segment_set_last_stop (&src->segment, GST_FORMAT_BYTES, offset);
return TRUE;
/* ERRORS */