[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / cdm_service.mojom
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 module media.mojom;
6
7 import "media/mojo/mojom/content_decryption_module.mojom";
8 import "media/mojo/mojom/frame_interface_factory.mojom";
9 import "mojo/public/mojom/base/file_path.mojom";
10 import "sandbox/policy/mojom/sandbox.mojom";
11 import "services/service_manager/public/mojom/interface_provider.mojom";
12
13 [EnableIf=is_mac]
14 import "sandbox/mac/mojom/seatbelt_extension_token.mojom";
15
16 // A service to create a CdmFactory that can provide CDM service, typically
17 // to the media pipeline running in the renderer process. The service itself
18 // runs in the CDM (utility) process. The service is always connected from the
19 // browser process.
20 interface CdmService {
21   // Requests an CdmFactory. `frame_interfaces` can optionally be used to
22   // provide interfaces hosted by the caller to the remote CdmFactory
23   // implementation.
24   CreateCdmFactory(pending_receiver<CdmFactory> factory,
25                    pending_remote<FrameInterfaceFactory> frame_interfaces);
26 };
27
28 // An interface to provide a sandbox seatbelt extension token synchronously.
29 [EnableIf=is_mac]
30 interface SeatbeltExtensionTokenProvider {
31   [Sync]
32   GetTokens() => (array<sandbox.mac.mojom.SeatbeltExtensionToken> tokens);
33 };
34
35 // A broker service to get the `CdmService`, needed to pass necessary parameters
36 // to preload the CDM before creating the `CdmService`. The `CdmServiceBroker`
37 // runs in the CDM (utility) process and is connected from the browser process
38 // (see content/browser/media/service_factory.cc). In the process there should
39 // only be one `CdmServiceBroker` and one `CdmService` instance running. As such
40 // the `GetService()` should only be called once and the subsequent calls will
41 // simply fail.
42 //
43 // Notes on CDM preloading and sandbox:
44 // - On Windows, when `CdmServiceBroker` is connected the CDM was not sandboxed
45 // to allow CDM preloading. After `GetService()` the process is fully sandboxed.
46 // - On Mac, the process is fully sandboxed when launched, and `token_provider`
47 // is needed to help load the CDM in the process.
48 // - On Linux/ChromeOS, the CDM is preloaded in the zygote sandbox.
49 [ServiceSandbox=sandbox.mojom.Sandbox.kCdm]
50 interface CdmServiceBroker {
51   // Loads the CDM at `cdm_path` into the process and returns the `CdmService`.
52   GetService(mojo_base.mojom.FilePath cdm_path,
53              [EnableIf=is_mac]
54              pending_remote<SeatbeltExtensionTokenProvider>? token_provider,
55              pending_receiver<CdmService> receiver);
56 };