Changeset 202556 in webkit


Ignore:
Timestamp:
Jun 28, 2016, 3:20:59 AM (9 years ago)
Author:
Philippe Normand
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202551 r202556  
     12016-06-28  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] improved duration query support in the HTTP source element
     4        https://bugs.webkit.org/show_bug.cgi?id=159204
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        When we have the Content-Length value it is possible to infer the TIME
     9        duration in most cases by performing a convert query in the downstream
     10        elements. This is especially useful when the duration query wasn't
     11        managed by the sinks and thus reached the source element.
     12
     13        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
     14        (webKitWebSrcQueryWithParent):
     15
    1162016-06-28  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

    r202050 r202556  
    676676            gst_query_set_duration(query, format, src->priv->size);
    677677            result = TRUE;
     678        } else if (format == GST_FORMAT_TIME) {
     679            gint64 duration = -1;
     680            GRefPtr<GstPad> target = adoptGRef(gst_ghost_pad_get_target(GST_GHOST_PAD_CAST(pad)));
     681            GRefPtr<GstPad> peer = adoptGRef(gst_pad_get_peer(target.get()));
     682            result = gst_pad_query_convert(peer.get(), GST_FORMAT_BYTES, src->priv->size, format, &duration);
     683            if (result)
     684                gst_query_set_duration(query, format, duration);
    678685        }
    679686        break;
Note: See TracChangeset for help on using the changeset viewer.