diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-10-08 10:42:26 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-10-08 10:42:26 +0000 |
commit | 0e9db391c73bba77851d7d5f637b4f305c61d364 (patch) | |
tree | 30a200bcf78f32fe4b4cf922077b80e51fad8238 /gst | |
parent | d0777d87fb887eb988db0c992eebbf6bde0be94d (diff) |
gst/multifile/gstmultifilesrc.c: Implement DEFAULT and BUFFER position queries. See #555260.
Original commit message from CVS:
* gst/multifile/gstmultifilesrc.c: (gst_multi_file_src_class_init),
(gst_multi_file_src_query):
Implement DEFAULT and BUFFER position queries. See #555260.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/multifile/gstmultifilesrc.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c index dfd1520f..ee39c565 100644 --- a/gst/multifile/gstmultifilesrc.c +++ b/gst/multifile/gstmultifilesrc.c @@ -63,6 +63,7 @@ static void gst_multi_file_src_set_property (GObject * object, guint prop_id, static void gst_multi_file_src_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstCaps *gst_multi_file_src_getcaps (GstBaseSrc * src); +static gboolean gst_multi_file_src_query (GstBaseSrc * src, GstQuery * query); static GstStaticPadTemplate gst_multi_file_src_pad_template = @@ -135,9 +136,10 @@ gst_multi_file_src_class_init (GstMultiFileSrcClass * klass) gobject_class->dispose = gst_multi_file_src_dispose; - gstpushsrc_class->create = gst_multi_file_src_create; - gstbasesrc_class->get_caps = gst_multi_file_src_getcaps; + gstbasesrc_class->query = gst_multi_file_src_query; + + gstpushsrc_class->create = gst_multi_file_src_create; if (sizeof (off_t) < 8) { GST_LOG ("No large file support, sizeof (off_t) = %" G_GSIZE_FORMAT, @@ -186,6 +188,39 @@ gst_multi_file_src_getcaps (GstBaseSrc * src) } static gboolean +gst_multi_file_src_query (GstBaseSrc * src, GstQuery * query) +{ + gboolean res; + GstMultiFileSrc *mfsrc; + + mfsrc = GST_MULTI_FILE_SRC (src); + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_POSITION: + { + GstFormat format; + + gst_query_parse_position (query, &format, NULL); + switch (format) { + case GST_FORMAT_BUFFERS: + case GST_FORMAT_DEFAULT: + gst_query_set_position (query, GST_FORMAT_BUFFERS, mfsrc->index); + res = TRUE; + break; + default: + res = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + break; + } + break; + } + default: + res = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + break; + } + return res; +} + +static gboolean gst_multi_file_src_set_location (GstMultiFileSrc * src, const gchar * location) { g_free (src->filename); |