RESOLVED FIXED 54627
[GStreamer] URI queries support in webkitwebsrc
https://bugs.webkit.org/show_bug.cgi?id=54627
Summary [GStreamer] URI queries support in webkitwebsrc
Andoni
Reported 2011-02-17 01:59:08 PST
Created attachment 82770 [details] Add support for uri queries Attached patch that adds support for URI queries. You can find it in the following branch too. http://gitorious.org/~ylatuya/webkitgtk/ylatuyas-webkit/commits/hls
Attachments
Add support for uri queries (2.19 KB, patch)
2011-02-17 01:59 PST, Andoni
no flags
Patch (2.41 KB, patch)
2011-02-17 03:22 PST, Andoni
no flags
Patch (2.59 KB, patch)
2011-02-18 08:32 PST, Andoni
mrobinson: review+
Philippe Normand
Comment 1 2011-02-17 02:09:01 PST
Can you please add a ChangeLog and check the code style with Tools/Scripts/check-webkit-style ?
Philippe Normand
Comment 2 2011-02-17 02:09:27 PST
Andoni
Comment 3 2011-02-17 03:22:33 PST
Philippe Normand
Comment 4 2011-02-17 03:40:15 PST
LGTM. Any reviewer to flip the switch? :)
Martin Robinson
Comment 5 2011-02-17 07:36:15 PST
Comment on attachment 82777 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=82777&action=review Thanks for your contribution! Please consider the following review comments. This patch is only a few changes from an r+. > WebCore/ChangeLog:10 > + [GStreamer] URI queries support in webkitwebsrc > + https://bugs.webkit.org/show_bug.cgi?id=54627 > + > + * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: > + (webkit_web_src_init): > + (webKitWebSrcQuery): Do you mind explaining a bit what this adds? Those familiar with Gstreamer will understand what sry query support means, but not the majority of the people skimming the ChangeLog. > WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:120 > +static gboolean webKitWebSrcQuery(GstPad * pad, GstQuery * query); No spaces before the asterisks here. > WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:493 > + > +static gboolean webKitWebSrcQuery(GstPad * pad, GstQuery * query) > +{ > + WebKitWebSrc * src = WEBKIT_WEB_SRC(gst_pad_get_parent_element(pad)); Ditto. > WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:494 > + gboolean ret; Normally we don't abbreviate variable names in WebKit, so perhaps something like "success"?
Andoni
Comment 6 2011-02-18 08:32:55 PST
Andoni
Comment 7 2011-02-18 08:42:40 PST
Updated patch with your suggestions. I'm currently trying to add support for http live streaming streams[1] to gstreamer and as part of it I wanted to be able to watch them using webkit with the video tag. The hls demuxer is using gst_element_from_uri() to fetch fragments and update the playlist so that the webkit source element is used. It needs to have the 'location' property, this way the uri can be set in the element and it also needs to reply to URI queries so that the demuxer can know the uri of the playlist and use it to update it. You can see a screenshot[2] of epiphany playing a multibitrate stream in gstreamer's bug reports[3] :) [1]http://tools.ietf.org/html/draft-pantos-http-live-streaming-05 [2]http://bugzilla-attachments.gnome.org/attachment.cgi?id=181032 [3]https://bugzilla.gnome.org/show_bug.cgi?id=594035
Martin Robinson
Comment 8 2011-02-18 08:44:36 PST
Comment on attachment 82964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=82964&action=review Great stuff. Philippe do you mind landing this with the corrected ChangeLog? > WebCore/ChangeLog:11 > + No new tests. (OOPS!) Just need to replace this with an explanation of why there are no tests. > WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:511 > + WebKitWebSrc* src = WEBKIT_WEB_SRC(gst_pad_get_parent_element(pad)); > + gboolean success; > + > + switch (GST_QUERY_TYPE(query)) { > + case GST_QUERY_URI: > + gst_query_set_uri(query, src->priv->uri); > + success = TRUE; > + break; > + default: > + success = FALSE; > + break; > + } > + > + if (!success) > + success = gst_element_query(GST_ELEMENT(src->priv->appsrc), query); > + > + gst_object_unref(src); > + return success; This looks fine, but adding a GRefPtr specialization for GstObjects would make it even cleaner: { GRefPtr<GstObject*> src = adoptGRef(WEBKIT_WEB_SRC(gst_pad_get_parent_element(pad))); if (GST_QUERY_TYPE(query) == GST_QUERY_URI) { gst_query_set_uri(query, src->priv->uri) return TRUE; } return gst_element_query(GST_ELEMENT(src->priv->appsrc), query); }
Philippe Normand
Comment 9 2011-02-21 01:56:23 PST
I just noticed this patch was made against an old version of the module. I added DURATION query support since then, so the patch needs fixup before landing, I'll do that, complete the ChangeLog and land the patch ;)
Philippe Normand
Comment 10 2011-02-21 02:13:31 PST
Philippe Normand
Comment 11 2011-02-21 02:15:02 PST
I think the GRefPtr stuff should be part of another patch, I'll try to prepare that.
Note You need to log in before you can comment on or make changes to this bug.