forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media: Support MojoRendererService in the browser process.
On some platforms, we run part of the media pipeline in the browser process. For example, on ChromeCast and on Android, audio/video buffers are decoded in the browser process. Currently, there are some ad-hoc IPC mechanism implemented for these platforms to support hosting the decoders in the browser process. This CL aims at providing a common mojo based path to support this scenario. This CL makes it possible to host a mojo::MeidaRenderer service in the browser process. By default, it's using media::RendererImpl and some default audio/video decoders. In later CLs, I'll update this so that we can support embedder specific media::Renderer implementation in MojoRendererService. Note that media playback is NOT working yet due to DataPipe is not working out-of-process. Test steps: 1, Change "enable_media_mojo_renderer" to true in media/media_options.gni. 2, Build a GN build of Chrome. 3, Play <video> in Chrome. BUG=431776 TEST=See above test steps. Review URL: https://codereview.chromium.org/712463004 Cr-Commit-Position: refs/heads/master@{#313463}
- Loading branch information
1 parent
df01d14
commit e611733
Showing
10 changed files
with
123 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "content/public/common/service_registry.h" | ||
#include "content/renderer/media/media_renderer_service_provider.h" | ||
|
||
namespace content { | ||
|
||
MediaRendererServiceProvider::MediaRendererServiceProvider( | ||
ServiceRegistry* service_registry) | ||
: service_registry_(service_registry) { | ||
} | ||
|
||
MediaRendererServiceProvider::~MediaRendererServiceProvider() { | ||
} | ||
|
||
void MediaRendererServiceProvider::ConnectToService( | ||
mojo::InterfacePtr<mojo::MediaRenderer>* media_renderer_ptr) { | ||
service_registry_->ConnectToRemoteService(media_renderer_ptr); | ||
} | ||
|
||
} // namespace content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_SERVICE_PROVIDER_H_ | ||
#define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_SERVICE_PROVIDER_H_ | ||
|
||
#include "base/macros.h" | ||
#include "content/common/content_export.h" | ||
#include "media/mojo/services/mojo_renderer_factory.h" | ||
|
||
namespace content { | ||
|
||
class ServiceRegistry; | ||
|
||
// ServiceRegistry based media::MojoRendererFactory::ServiceProvider | ||
// implementation. | ||
class CONTENT_EXPORT MediaRendererServiceProvider | ||
: public media::MojoRendererFactory::ServiceProvider { | ||
public: | ||
explicit MediaRendererServiceProvider(ServiceRegistry* service_registry); | ||
~MediaRendererServiceProvider() final; | ||
|
||
void ConnectToService( | ||
mojo::InterfacePtr<mojo::MediaRenderer>* media_renderer_ptr) final; | ||
|
||
private: | ||
ServiceRegistry* service_registry_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(MediaRendererServiceProvider); | ||
}; | ||
|
||
} // namespace content | ||
|
||
#endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_SERVICE_PROVIDER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters