This sets up API to release OutputSurface from LTHClient.
[chromium-blink-merge.git] / media / mojo / services / service_factory_impl.h
blob8357f8ad4e5f1cd429701cf208c168f12112f03c
1 // Copyright 2015 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_SERVICE_FACTORY_IMPL_H_
6 #define MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "media/mojo/interfaces/service_factory.mojom.h"
11 #include "media/mojo/services/mojo_cdm_service_context.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
14 namespace mojo {
15 class AppRefCount;
16 class ServiceProvider;
19 namespace media {
21 class CdmFactory;
22 class MediaLog;
23 class RendererFactory;
25 class ServiceFactoryImpl : public interfaces::ServiceFactory {
26 public:
27 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request,
28 mojo::ServiceProvider* service_provider,
29 scoped_refptr<MediaLog> media_log,
30 scoped_ptr<mojo::AppRefCount> parent_app_refcount);
31 ~ServiceFactoryImpl() final;
33 // interfaces::ServiceFactory implementation.
34 void CreateRenderer(
35 mojo::InterfaceRequest<interfaces::Renderer> renderer) final;
36 void CreateCdm(
37 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final;
39 private:
40 RendererFactory* GetRendererFactory();
41 CdmFactory* GetCdmFactory();
43 MojoCdmServiceContext cdm_service_context_;
45 mojo::StrongBinding<interfaces::ServiceFactory> binding_;
46 mojo::ServiceProvider* service_provider_;
47 scoped_refptr<MediaLog> media_log_;
48 scoped_ptr<mojo::AppRefCount> parent_app_refcount_;
50 scoped_ptr<RendererFactory> renderer_factory_;
51 scoped_ptr<CdmFactory> cdm_factory_;
53 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl);
56 } // namespace media
58 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_