| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module media.mojom; |
| |
| import "media/mojo/mojom/audio_decoder.mojom"; |
| [EnableIf=enable_cdm_proxy] |
| import "media/mojo/mojom/cdm_proxy.mojom"; |
| import "media/mojo/mojom/decryptor.mojom"; |
| import "media/mojo/mojom/content_decryption_module.mojom"; |
| import "media/mojo/mojom/renderer.mojom"; |
| import "media/mojo/mojom/renderer_extensions.mojom"; |
| import "media/mojo/mojom/video_decoder.mojom"; |
| import "mojo/public/mojom/base/token.mojom"; |
| import "mojo/public/mojom/base/unguessable_token.mojom"; |
| |
| // A factory for creating media mojo interfaces. Renderers can only access |
| // ContentDecryptionModules created with the same factory. |
| interface InterfaceFactory { |
| CreateAudioDecoder(pending_receiver<AudioDecoder> audio_decoder); |
| CreateVideoDecoder(pending_receiver<VideoDecoder> video_decoder); |
| |
| // Creates a regular media::Renderer (DefaultRendererFactory). |
| // TODO(guohuideng): remove |audio_device_id|, it's not used. |
| CreateDefaultRenderer(string audio_device_id, |
| pending_receiver<Renderer> renderer); |
| |
| [EnableIf=enable_cast_renderer] |
| // Creates a CastRenderer (CastRendererClientFactory). |
| // This is used on Chromecast only. The |overlay_plane_id| is generated by |
| // VideoOverlayFactory owned by MojoRenderer, therefore identifies the |
| // MojoRenderer. With |overlay_plane_id|, The service can keep track of |
| // which hosted CastRenderer is associated with which client. |
| // This is necessary because MediaService will need to look up CastRenderer |
| // by the |overlay_plane_id| to set video geometry on. |
| CreateCastRenderer(mojo_base.mojom.UnguessableToken overlay_plane_id, |
| pending_receiver<Renderer> renderer); |
| |
| [EnableIf=is_android] |
| // Creates a MediaPlayerRenderer (MediaPlayerRendererClientFactory). |
| // - |renderer_extension| is bound in MediaPlayerRenderer, and receives calls |
| // from MediaPlayerRendererClient. |
| // - |client_extension| is bound in MediaPlayerRendererClient, and receives |
| // calls from the MediaPlayerRenderer. |
| CreateMediaPlayerRenderer( |
| pending_remote<MediaPlayerRendererClientExtension> client_extension, |
| pending_receiver<Renderer> renderer, |
| pending_receiver<MediaPlayerRendererExtension> renderer_extension); |
| |
| [EnableIf=is_android] |
| // Creates a FlingingRenderer (FlingingRendererClientFactory). |
| // The |presentation_id| is used to find an already set-up RemotePlayback |
| // session (see blink::RemotePlayback). |
| CreateFlingingRenderer( |
| string presentation_id, |
| pending_remote<FlingingRendererClientExtension> client_extension, |
| pending_receiver<Renderer> renderer); |
| |
| // Creates a CDM based on the |key_system| provided. A |key_system| is a |
| // generic term for a decryption mechanism and/or content protection provider. |
| // It should be a reverse domain name, e.g. "com.example.somesystem". However, |
| // this call may be initiated by an untrusted process (e.g. renderer), so the |
| // implementation must fully validate |key_system| before creating the CDM. |
| CreateCdm(string key_system, pending_receiver<ContentDecryptionModule> cdm); |
| |
| // Creates a Decryptor associated with the |cdm_id|. |
| CreateDecryptor(int32 cdm_id, pending_receiver<Decryptor> decryptor); |
| |
| // Creates a CdmProxy that proxies part of CDM functionalities to a different |
| // entity, e.g. hardware CDM modules. The created |cdm_proxy| must match the |
| // type of the CDM, identified by |cdm_guid|. |
| [EnableIf=enable_cdm_proxy] |
| CreateCdmProxy(mojo_base.mojom.Token cdm_guid, |
| pending_receiver<CdmProxy> cdm_proxy); |
| }; |