Title: [182534] trunk/Source/WebCore
Revision
182534
Author
[email protected]
Date
2015-04-08 03:32:24 -0700 (Wed, 08 Apr 2015)

Log Message

[GStreamer] compress property for the HTTP source element
https://bugs.webkit.org/show_bug.cgi?id=143518

Reviewed by Carlos Garcia Campos.

Added a compress property so the default behavior or not
requesting content encoded to the server can be overridden if
needed. This is useful for adaptive streaming playback.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcStart):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (182533 => 182534)


--- trunk/Source/WebCore/ChangeLog	2015-04-08 10:12:54 UTC (rev 182533)
+++ trunk/Source/WebCore/ChangeLog	2015-04-08 10:32:24 UTC (rev 182534)
@@ -1,3 +1,19 @@
+2015-04-08  Philippe Normand  <[email protected]>
+
+        [GStreamer] compress property for the HTTP source element
+        https://bugs.webkit.org/show_bug.cgi?id=143518
+
+        Reviewed by Carlos Garcia Campos.
+
+        Added a compress property so the default behavior or not
+        requesting content encoded to the server can be overridden if
+        needed. This is useful for adaptive streaming playback.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcSetProperty):
+        (webKitWebSrcGetProperty):
+        (webKitWebSrcStart):
+
 2015-04-08  Joonghun Park  <[email protected]>
 
         Remove CSS functions min() and max() which had been dropped from specification

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (182533 => 182534)


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2015-04-08 10:12:54 UTC (rev 182533)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2015-04-08 10:32:24 UTC (rev 182534)
@@ -112,6 +112,7 @@
     gchar* uri;
     bool keepAlive;
     GUniquePtr<GstStructure> extraHeaders;
+    bool compress;
 
     WebCore::MediaPlayer* player;
 
@@ -150,7 +151,8 @@
     PROP_IRADIO_TITLE,
     PROP_LOCATION,
     PROP_KEEP_ALIVE,
-    PROP_EXTRA_HEADERS
+    PROP_EXTRA_HEADERS,
+    PROP_COMPRESS
 };
 
 static GstStaticPadTemplate srcTemplate = GST_STATIC_PAD_TEMPLATE("src",
@@ -256,6 +258,10 @@
         g_param_spec_boxed("extra-headers", "Extra Headers", "Extra headers to append to the HTTP request",
             GST_TYPE_STRUCTURE, static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
+    g_object_class_install_property(oklass, PROP_COMPRESS,
+        g_param_spec_boolean("compress", "Compress", "Allow compressed content encodings",
+            FALSE, static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+
     eklass->change_state = webKitWebSrcChangeState;
 
     g_type_class_add_private(klass, sizeof(WebKitWebSrcPrivate));
@@ -349,6 +355,9 @@
         src->priv->extraHeaders.reset(s ? gst_structure_copy(s) : nullptr);
         break;
     }
+    case PROP_COMPRESS:
+        src->priv->compress = g_value_get_boolean(value);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
         break;
@@ -383,6 +392,9 @@
     case PROP_EXTRA_HEADERS:
         gst_value_set_structure(value, priv->extraHeaders.get());
         break;
+    case PROP_COMPRESS:
+        g_value_set_boolean(value, priv->compress);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
         break;
@@ -542,13 +554,17 @@
         request.setHTTPReferrer(priv->player->referrer());
 
 #if USE(SOUP)
-    // Let's disable HTTP Accept-Encoding here as we don't want the received response to be
-    // encoded in any way as we need to rely on the proper size of the returned data on
+    // By default, HTTP Accept-Encoding is disabled here as we don't
+    // want the received response to be encoded in any way as we need
+    // to rely on the proper size of the returned data on
     // didReceiveResponse.
     // If Accept-Encoding is used, the server may send the data in encoded format and
     // request.expectedContentLength() will have the "wrong" size (the size of the
     // compressed data), even though the data received in didReceiveData is uncompressed.
-    request.setAcceptEncoding(false);
+    // This is however useful to enable for adaptive streaming
+    // scenarios, when the demuxer needs to download playlists.
+    if (!priv->compress)
+        request.setAcceptEncoding(false);
 #endif
 
     // Let Apple web servers know we want to access their nice movie trailers.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to