Title: [202556] trunk/Source/WebCore
Revision
202556
Author
[email protected]
Date
2016-06-28 03:20:59 -0700 (Tue, 28 Jun 2016)

Log Message

[GStreamer] improved duration query support in the HTTP source element
https://bugs.webkit.org/show_bug.cgi?id=159204

Reviewed by Carlos Garcia Campos.

When we have the Content-Length value it is possible to infer the TIME
duration in most cases by performing a convert query in the downstream
elements. This is especially useful when the duration query wasn't
managed by the sinks and thus reached the source element.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcQueryWithParent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202555 => 202556)


--- trunk/Source/WebCore/ChangeLog	2016-06-28 10:15:58 UTC (rev 202555)
+++ trunk/Source/WebCore/ChangeLog	2016-06-28 10:20:59 UTC (rev 202556)
@@ -1,3 +1,18 @@
+2016-06-28  Philippe Normand  <[email protected]>
+
+        [GStreamer] improved duration query support in the HTTP source element
+        https://bugs.webkit.org/show_bug.cgi?id=159204
+
+        Reviewed by Carlos Garcia Campos.
+
+        When we have the Content-Length value it is possible to infer the TIME
+        duration in most cases by performing a convert query in the downstream
+        elements. This is especially useful when the duration query wasn't
+        managed by the sinks and thus reached the source element.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcQueryWithParent):
+
 2016-06-28  Youenn Fablet  <[email protected]>
 
         Binding generator should generate accessors for constructors safely accessed from JS builtin

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2016-06-28 10:15:58 UTC (rev 202555)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2016-06-28 10:20:59 UTC (rev 202556)
@@ -675,6 +675,13 @@
         if (format == GST_FORMAT_BYTES && src->priv->size > 0) {
             gst_query_set_duration(query, format, src->priv->size);
             result = TRUE;
+        } else if (format == GST_FORMAT_TIME) {
+            gint64 duration = -1;
+            GRefPtr<GstPad> target = adoptGRef(gst_ghost_pad_get_target(GST_GHOST_PAD_CAST(pad)));
+            GRefPtr<GstPad> peer = adoptGRef(gst_pad_get_peer(target.get()));
+            result = gst_pad_query_convert(peer.get(), GST_FORMAT_BYTES, src->priv->size, format, &duration);
+            if (result)
+                gst_query_set_duration(query, format, duration);
         }
         break;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to