Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed)

Created:
4 years, 4 months ago by xjz
Modified:
4 years, 2 months ago
Reviewers:
mark a. foltz, xhwang, miu
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

The CL adds: 1. The notification to WebMediaPlayer when html video is in fullscreen playing back but it is not the fullscreen element. 2. The switching logic for media renderer in WebMediaPlayerImpl.

Patch Set 1 #

Patch Set 2 : Move the notification to FullscreenController. #

Total comments: 6

Patch Set 3 : Add notification to HTMLMediaElement and move the notification to WebMediaPlayer in HTMLMediaElemen… #

Patch Set 4 : Addressed Frank's comments and some renaming. #

Patch Set 5 : Add switching logic for media renderer in WebMediaPlayerImpl. #

Patch Set 6 : Add switching of CdmFactory. #

Total comments: 16

Patch Set 7 : Seperate the controll logic to a new class. #

Patch Set 8 : Some revision. #

Total comments: 1

Patch Set 9 : Add callback to get the Audio/Video configs. #

Patch Set 10 : Removed callbacks for audio/video configs. #

Patch Set 11 : Rebase. And added callbacks to Renderer to get Audio/Video config. #

Patch Set 12 : Use RendererController interface. #

Patch Set 13 : Get Audio/Video config from PipelineMetadata. And rebase. #

Total comments: 34

Patch Set 14 : Addressed comments. #

Total comments: 36

Patch Set 15 : Addressed comments and some fixes. #

Patch Set 16 : Rebased and some fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+692 lines, -20 lines) Patch
M content/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +20 lines, -7 lines 0 comments Download
M media/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
A media/base/mediaplayer_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +36 lines, -0 lines 0 comments Download
A + media/base/mediaplayer_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -3 lines 0 comments Download
M media/base/pipeline_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -1 line 0 comments Download
M media/base/pipeline_metadata.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +11 lines, -3 lines 0 comments Download
A media/base/pipeline_metadata.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +19 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +15 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +25 lines, -1 line 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M media/remoting/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +18 lines, -1 line 0 comments Download
A + media/remoting/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 0 chunks +-1 lines, --1 lines 0 comments Download
A media/remoting/remoting_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +87 lines, -0 lines 0 comments Download
A media/remoting/remoting_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +181 lines, -0 lines 0 comments Download
A media/remoting/remoting_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +161 lines, -0 lines 0 comments Download
A media/remoting/remoting_renderer_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +47 lines, -0 lines 0 comments Download
A media/remoting/remoting_renderer_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +38 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/FullscreenController.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebMediaPlayer.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (39 generated)
liberato (no reviews please)
what you're doing seems reasonable, but there are plenty of subtleties that perhaps i'm missing. ...
4 years, 4 months ago (2016-08-03 21:54:17 UTC) #3
xjz
liberato@: Thanks for your comments! Addressed them in Patch# 4. https://codereview.chromium.org/2204673004/diff/20001/third_party/WebKit/Source/web/FullscreenController.cpp File third_party/WebKit/Source/web/FullscreenController.cpp (right): https://codereview.chromium.org/2204673004/diff/20001/third_party/WebKit/Source/web/FullscreenController.cpp#newcode91 ...
4 years, 4 months ago (2016-08-04 02:28:16 UTC) #4
miu
This looks good to me. Please loop-in owners of the WebKit code.
4 years, 4 months ago (2016-08-09 19:22:43 UTC) #5
liberato (no reviews please)
thanks -fl https://codereview.chromium.org/2204673004/diff/100001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/2204673004/diff/100001/media/blink/webmediaplayer_impl.cc#newcode1760 media/blink/webmediaplayer_impl.cc:1760: void WebMediaPlayerImpl::OnSinkAvailable() { would it be clearer ...
4 years, 3 months ago (2016-08-29 16:49:12 UTC) #9
mark a. foltz
Will look if I have time (don't block on my review).
4 years, 3 months ago (2016-09-06 21:30:38 UTC) #11
xjz
Thanks for all the feedbacks. Still working on this. :) https://codereview.chromium.org/2204673004/diff/100001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/2204673004/diff/100001/media/blink/webmediaplayer_impl.cc#newcode1760 ...
4 years, 3 months ago (2016-09-09 23:13:07 UTC) #13
miu
https://codereview.chromium.org/2204673004/diff/140001/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc (right): https://codereview.chromium.org/2204673004/diff/140001/media/base/pipeline_impl.cc#newcode569 media/base/pipeline_impl.cc:569: AudioDecoderConfig PipelineImpl::RendererWrapper::GetAudioDecoderConfig() base::Optional<AudioDecoderConfig> PipelineImpl::RendererWrapper::GetAudioDecoderConfig() const { base::AutoLock autolock(&lock_); if ...
4 years, 3 months ago (2016-09-14 20:59:27 UTC) #16
miu
Looks great! At a high level (described in more detail later): 1. I think we ...
4 years, 2 months ago (2016-09-28 01:33:32 UTC) #20
miu
https://codereview.chromium.org/2204673004/diff/280001/media/remoting/remoting_controller.cc File media/remoting/remoting_controller.cc (right): https://codereview.chromium.org/2204673004/diff/280001/media/remoting/remoting_controller.cc#newcode18 media/remoting/remoting_controller.cc:18: remoter_factory->Create(binding_.CreateInterfacePtrAndBind(), This issue came up on Eric's change: We ...
4 years, 2 months ago (2016-09-28 07:23:09 UTC) #21
xhwang
I did review the CL. Just commenting on miu's comments. Naming: We only use "MediaPlayer" ...
4 years, 2 months ago (2016-09-28 23:27:25 UTC) #23
xjz
Addressed comments. PTAL. https://codereview.chromium.org/2204673004/diff/280001/media/base/renderer_controller.h File media/base/renderer_controller.h (right): https://codereview.chromium.org/2204673004/diff/280001/media/base/renderer_controller.h#newcode15 media/base/renderer_controller.h:15: // This class is an observer ...
4 years, 2 months ago (2016-09-29 22:54:22 UTC) #26
miu
IMHO, we're ready to start the code review process w/ the other stakeholders. https://codereview.chromium.org/2204673004/diff/340001/content/renderer/render_frame_impl.cc File ...
4 years, 2 months ago (2016-09-30 08:12:11 UTC) #27
xjz
4 years, 2 months ago (2016-10-01 00:28:42 UTC) #48
Addressed miu's comments. Thanks all for the reviewing. Opened a new issue for
public code review. https://codereview.chromium.org/2389473002

https://codereview.chromium.org/2204673004/diff/340001/content/renderer/rende...
File content/renderer/render_frame_impl.cc (right):

https://codereview.chromium.org/2204673004/diff/340001/content/renderer/rende...
content/renderer/render_frame_impl.cc:2712: // TODO(miu): In a soon-upcoming
change, call GetRemoterFactory()->Create() to
On 2016/09/30 08:12:10, miu wrote:
> Looks like you can remove this TODO comment now. ;)

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/BUILD.gn
File media/BUILD.gn (right):

https://codereview.chromium.org/2204673004/diff/340001/media/BUILD.gn#newcode603
media/BUILD.gn:603: "//media/base",
On 2016/09/30 08:12:10, miu wrote:
> Is this still needed?

Removed.

https://codereview.chromium.org/2204673004/diff/340001/media/base/mediaplayer...
File media/base/mediaplayer_observer.h (right):

https://codereview.chromium.org/2204673004/diff/340001/media/base/mediaplayer...
media/base/mediaplayer_observer.h:36: virtual void SetSwitchRenderCallback(const
SwitchRendererCallback& cb) = 0;
On 2016/09/30 08:12:10, miu wrote:
> Hmm...Everything except this looks like an "observed event of interest." Is
> there a simple way to not have this method in this observer interface? Maybe
> this SetSwitchRendererCallback() can be called from render_frame_impl.cc?

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/base/mediaplayer...
media/base/mediaplayer_observer.h:39:
DISALLOW_COPY_AND_ASSIGN(MediaPlayerObserver);
On 2016/09/30 08:12:10, miu wrote:
> This doesn't belong in a pure virtual interface, since there's no reason to
> restrict copying of a class that can't be instantiated.

Removed.

https://codereview.chromium.org/2204673004/diff/340001/media/blink/webmediapl...
File media/blink/webmediaplayer_impl.cc (right):

https://codereview.chromium.org/2204673004/diff/340001/media/blink/webmediapl...
media/blink/webmediaplayer_impl.cc:1105: if (observer_)
On 2016/09/30 08:12:10, miu wrote:
> style: Multi-line then-clause needs braces around it.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/blink/webmediapl...
File media/blink/webmediaplayer_impl.h (right):

https://codereview.chromium.org/2204673004/diff/340001/media/blink/webmediapl...
media/blink/webmediaplayer_impl.h:560: // Outlives this class. This observer may
trigger restarting pipeline to
On 2016/09/30 08:12:10, miu wrote:
> This comment may need adjustment, depending on the other comment.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/blink/webmediapl...
media/blink/webmediaplayer_impl.h:562: MediaPlayerObserver* observer_;
On 2016/09/30 08:12:10, miu wrote:
> nit: const please.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
File media/remoting/remoting_controller.cc (right):

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller.cc:177: // TODO(xjz): Send RPC message to
notify ChromeCast.
On 2016/09/30 08:12:10, miu wrote:
> We shouldn't be talking about Chromecast in Chromium code. This implementation
> could be used by any remote device that supports media remoting with the RPC
> scheme being implemented in src/media/remoting.
> 
> That said, I don't think you need the TODO comment here. By running the
> |switch_renderer_cb_|, the RemotingRenderer will be shut down and it can send
> the RPC itself.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
File media/remoting/remoting_controller.h (right):

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller.h:16: // 2) Gets info from
media::WebMediaPlayerImpl;
On 2016/09/30 08:12:10, miu wrote:
> For #2, WMPI is not known in media/remoting code. Suggestion:
> 
>   2) Monitors player events as a MediaPlayerObserver.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller.h:25: explicit
RemotingController(mojom::RemoterFactory* remoter_factory);
On 2016/09/30 08:12:10, miu wrote:
> This looks like you're injecting a RemoterFactory as a dependency. So, please
> comment that |remoter_factory| is just being used to create a Remoter and need
> not remain valid after the constructor returns.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller.h:46: bool is_remoting();
On 2016/09/30 08:12:10, miu wrote:
> Simple accessors should be defined inline (and const):
> 
>   bool is_remoting() const { return is_remoting_; }

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
File media/remoting/remoting_controller_unittest.cc (right):

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller_unittest.cc:42:
FakeRemoter(mojom::RemotingSourcePtr source, bool enable_remoting)
On 2016/09/30 08:12:10, miu wrote:
> naming nit: Instead of |enable_remoting|, this is really controlling whether
> starting will fail.

Renamed as |start_will_fail|.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller_unittest.cc:49: source_->OnStarted();
On 2016/09/30 08:12:10, miu wrote:
> Because OnStarted() is called later, on a reply IPC, consider posting a task
> instead of calling OnStarted() directly.

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller_unittest.cc:51:
source_->OnStartFailed(mojom::RemotingStartFailReason::ROUTE_TERMINATED);
On 2016/09/30 08:12:10, miu wrote:
> ditto here: post task

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller_unittest.cc:61:
source_->OnStopped(mojom::RemotingStopReason::LOCAL_PLAYBACK);
On 2016/09/30 08:12:10, miu wrote:
> ditto here: post task

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_controller_unittest.cc:75: FakeRemoterFactory(bool
enable_remoting)
On 2016/09/30 08:12:10, miu wrote:
> explicit

Done.

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
File media/remoting/remoting_renderer_factory.h (right):

https://codereview.chromium.org/2204673004/diff/340001/media/remoting/remotin...
media/remoting/remoting_renderer_factory.h:39: std::unique_ptr<RendererFactory>
default_renderer_factory_;
On 2016/09/30 08:12:11, miu wrote:
> Please const both of these.

Done.

https://codereview.chromium.org/2204673004/diff/340001/third_party/WebKit/Sou...
File third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp (right):

https://codereview.chromium.org/2204673004/diff/340001/third_party/WebKit/Sou...
third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp:795: // Notify WMPI if
the video is loaded in fullscreen or its ancestor is full screen element.
On 2016/09/30 08:12:11, miu wrote:
> Blink coding style generally leans on the side of "no comments" so consider
> removing this one. Same goes for comments in the other files.
> 
> If you decide to keep it, don't mention WMPI since this code doesn't know what
a
> WMPI is (but it does know what a WebMediaPlayer is).

Done. Removed comments.

Powered by Google App Engine
This is Rietveld 408576698