Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / media / mojo / services / mojo_renderer_factory.h
blob944fae512e2f8090ef237e917ae38859f48a1eb2
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"
13 namespace media {
15 // The default factory class for creating MojoRendererImpl.
16 class MEDIA_EXPORT MojoRendererFactory : public RendererFactory {
17 public:
18 // A class that can help get a mojo::MediaRenderer service for
19 // MojoRendererFactory.
20 class ServiceProvider {
21 public:
22 ServiceProvider() {};
23 virtual ~ServiceProvider() {};
24 virtual void ConnectToService(
25 mojo::InterfacePtr<mojo::MediaRenderer>* media_renderer_ptr) = 0;
27 private:
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,
37 VideoRendererSink* video_renderer_sink) final;
39 private:
40 scoped_ptr<ServiceProvider> service_provider_;
42 DISALLOW_COPY_AND_ASSIGN(MojoRendererFactory);
45 } // namespace media
47 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_FACTORY_H_