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

Unified Diff: media/base/renderer_factory.h

Issue 783003002: Introduce media::RendererFactory interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix html_viewer 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
Index: media/base/renderer_factory.h
diff --git a/media/base/renderer_factory.h b/media/base/renderer_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..211447e6708f21d97178b081dfffe30a8c324752
--- /dev/null
+++ b/media/base/renderer_factory.h
@@ -0,0 +1,42 @@
+// 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 MEDIA_BASE_RENDERER_FACTORY_H_
+#define MEDIA_BASE_RENDERER_FACTORY_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "media/base/media_export.h"
+#include "media/base/renderer.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace media {
+
+class AudioRendererSink;
+
+// A factory class for creating media::Renderer to be used by media pipeline.
+class MEDIA_EXPORT RendererFactory {
+ public:
+ RendererFactory();
+ virtual ~RendererFactory();
+
+ // Creates and returns a Renderer. All methods of the created Renderer except
+ // for GetMediaTime() will be called on the |media_task_runner|.
+ // GetMediaTime() could be called on any thread.
+ // The created Renderer can use the |audio_renderer_sink| to render audio.
+ virtual scoped_ptr<Renderer> CreateRenderer(
+ const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
+ AudioRendererSink* audio_renderer_sink) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RendererFactory);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_RENDERER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698