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"
15 class SingleThreadTaskRunner
;
20 class AudioRendererSink
;
21 class VideoRendererSink
;
23 // A factory class for creating media::Renderer to be used by media pipeline.
24 class MEDIA_EXPORT RendererFactory
{
27 virtual ~RendererFactory();
29 // Creates and returns a Renderer. All methods of the created Renderer except
30 // for GetMediaTime() will be called on the |media_task_runner|.
31 // GetMediaTime() could be called on any thread.
32 // The created Renderer can use |audio_renderer_sink| to render audio and
33 // |video_renderer_sink| to render video.
34 virtual scoped_ptr
<Renderer
> CreateRenderer(
35 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner
,
36 AudioRendererSink
* audio_renderer_sink
,
37 VideoRendererSink
* video_renderer_sink
) = 0;
40 DISALLOW_COPY_AND_ASSIGN(RendererFactory
);
45 #endif // MEDIA_BASE_RENDERER_FACTORY_H_