souphttpsrc: Add URI query handler

Fixes bug #642337.
This commit is contained in:
Andoni Morales Alastruey 2011-02-14 20:20:08 +01:00 committed by Sebastian Dröge
parent d466f07def
commit b2fb4edcb7

View file

@ -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);
}
@ -1394,6 +1396,28 @@ gst_soup_http_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment)
return TRUE;
}
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)
{