From adc048eb64bc26c7a2e210cc440a33737f8c4e43 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Sun, 26 Jun 2011 20:32:53 +0200 Subject: [PATCH] neonhttpsrc: implement URI query --- ext/neon/gstneonhttpsrc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c index 2844dcd..b295f08 100644 --- a/ext/neon/gstneonhttpsrc.c +++ b/ext/neon/gstneonhttpsrc.c @@ -98,6 +98,7 @@ static gboolean gst_neonhttp_src_get_size (GstBaseSrc * bsrc, guint64 * size); static gboolean gst_neonhttp_src_is_seekable (GstBaseSrc * bsrc); static gboolean gst_neonhttp_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment); +static gboolean gst_neonhttp_src_query (GstBaseSrc * bsrc, GstQuery * query); static gboolean gst_neonhttp_src_set_proxy (GstNeonhttpSrc * src, const gchar * uri); @@ -268,6 +269,7 @@ gst_neonhttp_src_class_init (GstNeonhttpSrcClass * klass) gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_neonhttp_src_is_seekable); gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_neonhttp_src_do_seek); + gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_neonhttp_src_query); gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_neonhttp_src_create); @@ -778,6 +780,28 @@ gst_neonhttp_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) } static gboolean +gst_neonhttp_src_query (GstBaseSrc * bsrc, GstQuery * query) +{ + GstNeonhttpSrc *src = GST_NEONHTTP_SRC (bsrc); + gboolean ret; + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_URI: + gst_query_set_uri (query, src->location); + ret = TRUE; + break; + default: + ret = FALSE; + break; + } + + if (!ret) + ret = GST_BASE_SRC_CLASS (parent_class)->query (bsrc, query); + + return ret; +} + +static gboolean gst_neonhttp_src_set_location (GstNeonhttpSrc * src, const gchar * uri) { ne_uri_free (&src->uri); -- 2.7.4