Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / media / base / renderer_factory.h
blob4b35f01764b825771b4ddf36349e26fc36f5f226
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_BASE_RENDERER_FACTORY_H_
6 #define MEDIA_BASE_RENDERER_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "media/base/media_export.h"
12 #include "media/base/renderer.h"
14 namespace base {
15 class SingleThreadTaskRunner;
16 class TaskRunner;
19 namespace media {
21 class AudioRendererSink;
22 class VideoRendererSink;
24 // A factory class for creating media::Renderer to be used by media pipeline.
25 class MEDIA_EXPORT RendererFactory {
26 public:
27 RendererFactory();
28 virtual ~RendererFactory();
30 // Creates and returns a Renderer. All methods of the created Renderer except
31 // for GetMediaTime() will be called on the |media_task_runner|.
32 // GetMediaTime() could be called on any thread.
33 // The created Renderer can use |audio_renderer_sink| to render audio and
34 // |video_renderer_sink| to render video.
35 virtual scoped_ptr<Renderer> CreateRenderer(
36 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
37 const scoped_refptr<base::TaskRunner>& worker_task_runner,
38 AudioRendererSink* audio_renderer_sink,
39 VideoRendererSink* video_renderer_sink) = 0;
41 private:
42 DISALLOW_COPY_AND_ASSIGN(RendererFactory);
45 } // namespace media
47 #endif // MEDIA_BASE_RENDERER_FACTORY_H_