Bug 91301 - create different WebKit::WebMediaPlayer based on URL
Summary: create different WebKit::WebMediaPlayer based on URL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: wjia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-13 17:20 PDT by wjia
Modified: 2012-08-23 12:00 PDT (History)
11 users (show)

See Also:


Attachments
Patch (5.90 KB, patch)
2012-07-13 17:31 PDT, wjia
no flags Details | Formatted Diff | Diff
Patch (5.91 KB, patch)
2012-08-14 16:03 PDT, wjia
no flags Details | Formatted Diff | Diff
Patch (5.91 KB, patch)
2012-08-21 16:31 PDT, wjia
no flags Details | Formatted Diff | Diff
Patch (5.89 KB, patch)
2012-08-22 15:36 PDT, wjia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wjia 2012-07-13 17:20:56 PDT
In Chromium, it's better to create a different WebKit::WebMediaPlayer based on URL, since media stream has different characteristics than regular media playback. Therefore, the URL is needed when frame client's createMediaPlayer() is called.

A prototype patch can be found at http://codereview.chromium.org/10382048/
Comment 1 wjia 2012-07-13 17:31:24 PDT
Created attachment 152382 [details]
Patch
Comment 2 WebKit Review Bot 2012-07-13 17:33:11 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 wjia 2012-07-13 17:34:51 PDT
The patch is uploaded for review first. It's pending on Chromium patch http://codereview.chromium.org/10537091/. Due to API change, this patch will be landed after Chromium patch is landed.
Comment 4 WebKit Review Bot 2012-07-13 17:45:18 PDT
Comment on attachment 152382 [details]
Patch

Attachment 152382 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13237316
Comment 5 Eric Carlson 2012-07-13 17:46:46 PDT
Comment on attachment 152382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152382&action=review

> Tools/ChangeLog:8
> +        Additional information of the change such as approach, rationale. Please add per-function descriptions below (OOPS!).

Oops!
Comment 6 Darin Fisher (:fishd, Google) 2012-07-16 09:20:15 PDT
Comment on attachment 152382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152382&action=review

> Source/WebKit/chromium/public/WebFrameClient.h:91
> +    virtual WebMediaPlayer* createMediaPlayer(const WebURL&, WebFrame*, WebMediaPlayerClient*) { return 0; }

nit: WebFrameClient methods always take a WebFrame pointer as their first parameter.
Comment 7 Andrew Scherkus 2012-07-16 11:31:35 PDT
Comment on attachment 152382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152382&action=review

> Source/WebKit/chromium/ChangeLog:3
> +        create different WebKit::WebMediaPlayer based on URL

This describes the intent but not the patch contents

This should be more along the lines of "Pass URL to WebFrameClient::createMediaPlayer()" with the additional information below describing why we want to do this (i.e., "Permits creation of different WebMediaPlayer implementations based on the URL.")

> Source/WebKit/chromium/ChangeLog:8
> +        Additional information of the change such as approach, rationale. Please add per-function descriptions below (OOPS!).

Please fill out
Comment 8 Andrew Scherkus 2012-07-16 12:06:04 PDT
Whoops my other comments didn't get published!

Nits aside -- I think the approach is OK.

As pointed out in http://codereview.chromium.org/10537091/ an alternative would involve relying on the media engine registrar + supportsType() by registering multiple media engines (i.e., the existing one and another one for media stream URLs)

If we wanted to go that path I think we'd have to plumb the registrar mechanism through the Chromium WebKit API (i.e., ask Chromium to register multiple engines). In the end I think we'd end up with an even more indirect way of creating WebMediaPlayer implementations so I'm not sure it'd be worth it.
Comment 9 wjia 2012-08-14 16:03:59 PDT
Created attachment 158431 [details]
Patch
Comment 10 wjia 2012-08-14 16:09:53 PDT
Please take another look. Need LGTM from this patch in order to land chromium patch http://codereview.chromium.org/10537091/. Then this patch can be landed.
Comment 11 WebKit Review Bot 2012-08-14 16:24:57 PDT
Comment on attachment 158431 [details]
Patch

Attachment 158431 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13504348
Comment 12 Peter Beverloo (cr-android ews) 2012-08-15 06:17:27 PDT
Comment on attachment 158431 [details]
Patch

Attachment 158431 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/13491998
Comment 13 wjia 2012-08-21 16:31:15 PDT
Created attachment 159795 [details]
Patch
Comment 14 wjia 2012-08-22 14:20:50 PDT
ping. With chromium patch being landed, this patch is ready to go.
Comment 15 Adam Barth 2012-08-22 14:32:20 PDT
Comment on attachment 159795 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=159795&action=review

> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:48
> -static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, Frame* frame)
> +static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, const String& url, Frame* frame)

It seems like this function should take a KURL rather than a String.

> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:324
> +    m_webMediaPlayer = createWebMediaPlayer(this, m_url, frame);

So, m_url is a String?  Why not a KURL?
Comment 16 wjia 2012-08-22 15:36:14 PDT
Created attachment 160022 [details]
Patch
Comment 17 wjia 2012-08-22 15:40:37 PDT
(In reply to comment #15)
> (From update of attachment 159795 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=159795&action=review
> 
> > Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:48
> > -static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, Frame* frame)
> > +static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, const String& url, Frame* frame)
> 
> It seems like this function should take a KURL rather than a String.
> 
> > Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:324
> > +    m_webMediaPlayer = createWebMediaPlayer(this, m_url, frame);
> 
> So, m_url is a String?  Why not a KURL?

Changed to use KURL in createWebMediaPlayer() in new patch. Not sure why m_url is a String, instead of KURL.
Comment 18 Adam Barth 2012-08-22 15:48:02 PDT
Comment on attachment 160022 [details]
Patch

Thanks.  A good followup patch would be to see if we can change m_url to be a KURL.
Comment 19 WebKit Review Bot 2012-08-23 12:00:41 PDT
Comment on attachment 160022 [details]
Patch

Clearing flags on attachment: 160022

Committed r126463: <http://trac.webkit.org/changeset/126463>
Comment 20 WebKit Review Bot 2012-08-23 12:00:46 PDT
All reviewed patches have been landed.  Closing bug.