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

Unified Diff: media/remoting/remoting_renderer_factory.cc

Issue 2389473002: Media Remoting: Add RemotingController. (Closed)
Patch Set: Add building flag. Created 4 years, 2 months 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
Index: media/remoting/remoting_renderer_factory.cc
diff --git a/media/remoting/remoting_renderer_factory.cc b/media/remoting/remoting_renderer_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..52a5db8859da5c087c7f4931e1f5b903e5afde1c
--- /dev/null
+++ b/media/remoting/remoting_renderer_factory.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 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 "media/remoting/remoting_renderer_factory.h"
+
+#include "base/logging.h"
+
+namespace media {
+
+RemotingRendererFactory::RemotingRendererFactory(
+ std::unique_ptr<RendererFactory> default_renderer_factory,
+ std::unique_ptr<RemotingController> remoting_controller)
+ : default_renderer_factory_(std::move(default_renderer_factory)),
+ remoting_controller_(std::move(remoting_controller)) {}
+
+RemotingRendererFactory::~RemotingRendererFactory() {}
+
+std::unique_ptr<Renderer> RemotingRendererFactory::CreateRenderer(
+ const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
+ const scoped_refptr<base::TaskRunner>& worker_task_runner,
+ AudioRendererSink* audio_renderer_sink,
+ VideoRendererSink* video_renderer_sink,
+ const RequestSurfaceCB& request_surface_cb) {
+ if (remoting_controller_ && remoting_controller_->is_remoting()) {
+ VLOG(1) << "Create Remoting renderer.";
+ // TODO(xjz): Merge this with Eric's implementation.
+ NOTIMPLEMENTED();
+ return std::unique_ptr<Renderer>();
+ } else {
+ VLOG(1) << "Create Local playback renderer.";
+ return default_renderer_factory_->CreateRenderer(
+ media_task_runner, worker_task_runner, audio_renderer_sink,
+ video_renderer_sink, request_surface_cb);
+ }
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698