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

Unified Diff: mojo/services/html_viewer/webmediaplayer_factory.cc

Issue 783003002: Introduce media::RendererFactory interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/mojo_renderer_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/html_viewer/webmediaplayer_factory.cc
diff --git a/mojo/services/html_viewer/webmediaplayer_factory.cc b/mojo/services/html_viewer/webmediaplayer_factory.cc
index 15b6177b87b2d66efed8d100673e36c07a5bb097..7f067545a6418e370fead2b004d8425fbead1f38 100644
--- a/mojo/services/html_viewer/webmediaplayer_factory.cc
+++ b/mojo/services/html_viewer/webmediaplayer_factory.cc
@@ -14,12 +14,12 @@
#include "media/base/audio_hardware_config.h"
#include "media/base/media.h"
#include "media/base/media_log.h"
-#include "media/base/renderer.h"
#include "media/blink/webmediaplayer_impl.h"
#include "media/blink/webmediaplayer_params.h"
+#include "media/filters/default_renderer_factory.h"
#include "media/filters/gpu_video_accelerator_factories.h"
#include "media/mojo/interfaces/media_renderer.mojom.h"
-#include "media/mojo/services/mojo_renderer_impl.h"
+#include "media/mojo/services/mojo_renderer_factory.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
@@ -53,37 +53,32 @@ blink::WebMediaPlayer* WebMediaPlayerFactory::CreateMediaPlayer(
blink::WebMediaPlayerClient* client,
Shell* shell) {
#if defined(OS_ANDROID)
- return NULL;
+ return nullptr;
#else
- scoped_ptr<media::Renderer> renderer;
+ scoped_refptr<media::MediaLog> media_log(new media::MediaLog());
+ scoped_ptr<media::RendererFactory> media_renderer_factory;
if (enable_mojo_media_renderer_) {
ServiceProviderPtr media_renderer_service_provider;
shell->ConnectToApplication("mojo:media",
GetProxy(&media_renderer_service_provider));
-
- MediaRendererPtr mojo_media_renderer;
- ConnectToService(media_renderer_service_provider.get(),
- &mojo_media_renderer);
-
- renderer.reset(new media::MojoRendererImpl(GetMediaThreadTaskRunner(),
- mojo_media_renderer.Pass()));
+ media_renderer_factory.reset(
+ new media::MojoRendererFactory(media_renderer_service_provider.Pass()));
+ } else {
+ media_renderer_factory.reset(
+ new media::DefaultRendererFactory(media_log,
+ nullptr, // No GPU factory.
+ GetAudioHardwareConfig()));
}
media::WebMediaPlayerParams params(
- media::WebMediaPlayerParams::DeferLoadCB(),
- CreateAudioRendererSink(),
- GetAudioHardwareConfig(),
- new media::MediaLog(),
- scoped_refptr<media::GpuVideoAcceleratorFactories>(),
- GetMediaThreadTaskRunner(),
- compositor_task_runner_,
- NULL);
+ media::WebMediaPlayerParams::DeferLoadCB(), CreateAudioRendererSink(),
+ media_log, GetMediaThreadTaskRunner(), compositor_task_runner_, nullptr);
base::WeakPtr<media::WebMediaPlayerDelegate> delegate;
// TODO(xhwang): Provide a media based CdmFactory implementation.
- return new media::WebMediaPlayerImpl(frame, client, delegate, renderer.Pass(),
- nullptr, params);
+ return new media::WebMediaPlayerImpl(
+ frame, client, delegate, media_renderer_factory.Pass(), nullptr, params);
#endif
}
« no previous file with comments | « media/mojo/services/mojo_renderer_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698