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_MOJO_SERVICES_MOJO_RENDERER_FACTORY_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_FACTORY_H_
8 #include "media/base/media_export.h"
9 #include "media/base/renderer_factory.h"
10 #include "media/mojo/interfaces/media_renderer.mojom.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h"
15 // The default factory class for creating MojoRendererImpl.
16 class MEDIA_EXPORT MojoRendererFactory
: public RendererFactory
{
18 // A class that can help get a mojo::MediaRenderer service for
19 // MojoRendererFactory.
20 class ServiceProvider
{
23 virtual ~ServiceProvider() {};
24 virtual void ConnectToService(
25 mojo::InterfacePtr
<mojo::MediaRenderer
>* media_renderer_ptr
) = 0;
28 DISALLOW_COPY_AND_ASSIGN(ServiceProvider
);
31 explicit MojoRendererFactory(scoped_ptr
<ServiceProvider
> service_provider
);
32 ~MojoRendererFactory() final
;
34 scoped_ptr
<Renderer
> CreateRenderer(
35 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner
,
36 AudioRendererSink
* audio_renderer_sink
) final
;
39 scoped_ptr
<ServiceProvider
> service_provider_
;
41 DISALLOW_COPY_AND_ASSIGN(MojoRendererFactory
);
46 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_FACTORY_H_