diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c index 5323445f5e..4fc36178c9 100644 --- a/gst-libs/gst/uridownloader/gsturidownloader.c +++ b/gst-libs/gst/uridownloader/gsturidownloader.c @@ -309,9 +309,11 @@ gst_uri_downloader_set_range (GstUriDownloader * downloader, } static gboolean -gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri) +gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri, + gboolean compress) { GstPad *pad; + GObjectClass *gobject_class; if (!gst_uri_is_valid (uri)) return FALSE; @@ -324,6 +326,10 @@ gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri) if (!downloader->priv->urisrc) return FALSE; + gobject_class = G_OBJECT_GET_CLASS (downloader->priv->urisrc); + if (g_object_class_find_property (gobject_class, "compress")) + g_object_set (downloader->priv->urisrc, "compress", compress, NULL); + /* add a sync handler for the bus messages to detect errors in the download */ gst_element_set_bus (GST_ELEMENT (downloader->priv->urisrc), downloader->priv->bus); @@ -340,9 +346,10 @@ gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri) GstFragment * gst_uri_downloader_fetch_uri (GstUriDownloader * downloader, const gchar * uri, - GError ** err) + gboolean compress, GError ** err) { - return gst_uri_downloader_fetch_uri_with_range (downloader, uri, 0, -1, err); + return gst_uri_downloader_fetch_uri_with_range (downloader, uri, compress, 0, + -1, err); } /** @@ -356,7 +363,8 @@ gst_uri_downloader_fetch_uri (GstUriDownloader * downloader, const gchar * uri, */ GstFragment * gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader, - const gchar * uri, gint64 range_start, gint64 range_end, GError ** err) + const gchar * uri, gboolean compress, gint64 range_start, + gint64 range_end, GError ** err) { GstStateChangeReturn ret; GstFragment *download = NULL; @@ -372,7 +380,7 @@ gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader, goto quit; } - if (!gst_uri_downloader_set_uri (downloader, uri)) { + if (!gst_uri_downloader_set_uri (downloader, uri, compress)) { GST_WARNING_OBJECT (downloader, "Failed to set URI"); goto quit; } diff --git a/gst-libs/gst/uridownloader/gsturidownloader.h b/gst-libs/gst/uridownloader/gsturidownloader.h index 9303f0c322..3a9184e4a0 100644 --- a/gst-libs/gst/uridownloader/gsturidownloader.h +++ b/gst-libs/gst/uridownloader/gsturidownloader.h @@ -56,8 +56,8 @@ struct _GstUriDownloaderClass GType gst_uri_downloader_get_type (void); GstUriDownloader * gst_uri_downloader_new (void); -GstFragment * gst_uri_downloader_fetch_uri (GstUriDownloader * downloader, const gchar * uri, GError ** err); -GstFragment * gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader, const gchar * uri, gint64 range_start, gint64 range_end, GError ** err); +GstFragment * gst_uri_downloader_fetch_uri (GstUriDownloader * downloader, const gchar * uri, gboolean compress, GError ** err); +GstFragment * gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader, const gchar * uri, gboolean compress, gint64 range_start, gint64 range_end, GError ** err); void gst_uri_downloader_reset (GstUriDownloader *downloader); void gst_uri_downloader_cancel (GstUriDownloader *downloader); void gst_uri_downloader_free (GstUriDownloader *downloader);