[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / cdm_document_service.mojom
1 // Copyright 2015 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 "mojo/public/mojom/base/unguessable_token.mojom";
8 import "mojo/public/mojom/base/file_path.mojom";
9 import "media/mojo/mojom/media_types.mojom";
10
11 // Contains data linked to an origin that the CDM stores in the browser
12 // process.
13 [EnableIf=is_win]
14 struct MediaFoundationCdmData {
15   // The origin ID of the document associated with the CDM. The origin ID
16   // is used in place of the origin when hiding the concrete origin is needed.
17   // The origin ID is also user resettable by clearing the browsing data.
18   mojo_base.mojom.UnguessableToken origin_id;
19
20   // The token is set by the CDM. The token is then saved in the Pref Service so
21   // that it can be reused by the CDM for that same origin in the future.
22   array<uint8>? client_token;
23
24   // The path where the MediaFoundation CDM should store its data. The path is
25   // specific to the current chrome user and the device's architecture.
26   mojo_base.mojom.FilePath cdm_store_path_root;
27 };
28
29 // The service itself is associated with a RenderFrameHost in the browser
30 // process and will be called by a client living in the utility process hosting
31 // the CDM.
32 interface CdmDocumentService {
33   // Allows authorized services to verify that the underlying platform is
34   // trusted. An example of a trusted platform is a Chrome OS device in
35   // verified boot mode. This can be used for protected content playback.
36   //
37   // Input parameters:
38   // - |service_id|: the service ID for the |challenge|.
39   // - |challenge|: the challenge data.
40   //
41   // Output parameters:
42   // - |success|: whether the platform is successfully verified. If true/false
43   //              the following 3 parameters should be non-empty/empty.
44   // - |signed_data|: the data signed by the platform.
45   // - |signed_data_signature|: the signature of the signed data block.
46   // - |platform_key_certificate|: the device specific certificate for the
47   //                               requested service.
48   ChallengePlatform(string service_id, string challenge) =>
49       (bool success,
50        string signed_data,
51        string signed_data_signature,
52        string platform_key_certificate);
53
54   // Requests a particular version of the device's Storage Id (or latest
55   // available version if 0 is specified). This returns the requested
56   // |storage_id|, which may be empty if it is not supported by the platform.
57   GetStorageId(uint32 version) => (uint32 version, array<uint8> storage_id);
58
59   // Returns true if Verified Access is enabled in settings, false otherwise.
60   [EnableIf=is_chromeos]
61   IsVerifiedAccessEnabled() => (bool enabled);
62
63   // Gets the Media FoundationCDM data for the origin associated with the CDM.
64   // - `media_foundation_cdm_data`: The CDM data for the origin associated with
65   //                                the CDM.
66   [EnableIf=is_win]
67   GetMediaFoundationCdmData() => (MediaFoundationCdmData cdm_data);
68
69   // Sets the client token for the origin associated with the CDM. The token is
70   // set by the CDM. The token is then saved in the Pref Service so that it can
71   // be reused by the CDM for that same origin in the future.
72   [EnableIf=is_win]
73   SetCdmClientToken(array<uint8> client_token);
74
75   // Reports a CDM event, which can facilitate metrics reporting or fallback
76   // logic.  For error events, the `hresult` provides more details about the
77   // error.
78   [EnableIf=is_win]
79   OnCdmEvent(CdmEvent event, uint32 hresult);
80 };