From: Andoni Morales Alastruey Date: Mon, 14 Feb 2011 19:20:08 +0000 (+0100) Subject: souphttpsrc: Add URI query handler X-Git-Tag: RELEASE-0.10.29~622 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2fb4edcb72474aed9be5846450deb4be6b33cd5;p=platform%2Fupstream%2Fgst-plugins-good.git souphttpsrc: Add URI query handler Fixes bug #642337. --- diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 4d77984..819fdec 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -135,6 +135,7 @@ static gboolean gst_soup_http_src_get_size (GstBaseSrc * bsrc, guint64 * size); static gboolean gst_soup_http_src_is_seekable (GstBaseSrc * bsrc); static gboolean gst_soup_http_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment); +static gboolean gst_soup_http_src_query (GstBaseSrc * bsrc, GstQuery * query); static gboolean gst_soup_http_src_unlock (GstBaseSrc * bsrc); static gboolean gst_soup_http_src_unlock_stop (GstBaseSrc * bsrc); static gboolean gst_soup_http_src_set_location (GstSoupHTTPSrc * src, @@ -307,6 +308,7 @@ gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass) gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_soup_http_src_is_seekable); gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_soup_http_src_do_seek); + gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_soup_http_src_query); gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_soup_http_src_create); } @@ -1395,6 +1397,28 @@ gst_soup_http_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) } static gboolean +gst_soup_http_src_query (GstBaseSrc * bsrc, GstQuery * query) +{ + GstSoupHTTPSrc *src = GST_SOUP_HTTP_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_soup_http_src_set_location (GstSoupHTTPSrc * src, const gchar * uri) { if (src->location) {