OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_RENDERER_FACTORY_H_ | 5 #ifndef MEDIA_BASE_RENDERER_FACTORY_H_ |
6 #define MEDIA_BASE_RENDERER_FACTORY_H_ | 6 #define MEDIA_BASE_RENDERER_FACTORY_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
12 #include "media/base/renderer.h" | 13 #include "media/base/renderer.h" |
13 #include "media/base/surface_manager.h" | 14 #include "media/base/surface_manager.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class SingleThreadTaskRunner; | 17 class SingleThreadTaskRunner; |
17 class TaskRunner; | 18 class TaskRunner; |
18 } | 19 } |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 | 22 |
22 class AudioRendererSink; | 23 class AudioRendererSink; |
23 class VideoRendererSink; | 24 class VideoRendererSink; |
24 | 25 |
25 // A factory class for creating media::Renderer to be used by media pipeline. | 26 // A factory class for creating media::Renderer to be used by media pipeline. |
26 class MEDIA_EXPORT RendererFactory { | 27 class MEDIA_EXPORT RendererFactory { |
27 public: | 28 public: |
28 RendererFactory(); | 29 RendererFactory(); |
29 virtual ~RendererFactory(); | 30 virtual ~RendererFactory(); |
30 | 31 |
31 // Creates and returns a Renderer. All methods of the created Renderer except | 32 // Creates and returns a Renderer. All methods of the created Renderer except |
32 // for GetMediaTime() will be called on the |media_task_runner|. | 33 // for GetMediaTime() will be called on the |media_task_runner|. |
33 // GetMediaTime() could be called on any thread. | 34 // GetMediaTime() could be called on any thread. |
34 // The created Renderer can use |audio_renderer_sink| to render audio and | 35 // The created Renderer can use |audio_renderer_sink| to render audio and |
35 // |video_renderer_sink| to render video. | 36 // |video_renderer_sink| to render video. |
36 virtual scoped_ptr<Renderer> CreateRenderer( | 37 virtual std::unique_ptr<Renderer> CreateRenderer( |
37 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 38 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
38 const scoped_refptr<base::TaskRunner>& worker_task_runner, | 39 const scoped_refptr<base::TaskRunner>& worker_task_runner, |
39 AudioRendererSink* audio_renderer_sink, | 40 AudioRendererSink* audio_renderer_sink, |
40 VideoRendererSink* video_renderer_sink, | 41 VideoRendererSink* video_renderer_sink, |
41 const RequestSurfaceCB& request_surface_cb) = 0; | 42 const RequestSurfaceCB& request_surface_cb) = 0; |
42 | 43 |
43 private: | 44 private: |
44 DISALLOW_COPY_AND_ASSIGN(RendererFactory); | 45 DISALLOW_COPY_AND_ASSIGN(RendererFactory); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace media | 48 } // namespace media |
48 | 49 |
49 #endif // MEDIA_BASE_RENDERER_FACTORY_H_ | 50 #endif // MEDIA_BASE_RENDERER_FACTORY_H_ |
OLD | NEW |