Skip to content
Permalink
Browse files
[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):

Canonical link: https://commits.webkit.org/177303@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
philn committed Jun 28, 2016
1 parent 139b72e commit e679e8a8b31232ad86e73a7687406590d1a29351
Showing with 22 additions and 0 deletions.
  1. +15 −0 Source/WebCore/ChangeLog
  2. +7 −0 Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -1,3 +1,18 @@
2016-06-28 Philippe Normand <pnormand@igalia.com>

[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 <youenn@apple.com>

Binding generator should generate accessors for constructors safely accessed from JS builtin
@@ -675,6 +675,13 @@ static gboolean webKitWebSrcQueryWithParent(GstPad* pad, GstObject* parent, GstQ
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;
}

0 comments on commit e679e8a

Please sign in to comment.