OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo; | 5 module mojo; |
6 | 6 |
7 import "media/mojo/interfaces/decryptor.mojom"; | 7 import "media/mojo/interfaces/decryptor.mojom"; |
8 | 8 |
9 // Transport layer of media::MediaKeys::Exception (see media/base/media_keys.h). | 9 // Transport layer of media::MediaKeys::Exception (see media/base/media_keys.h). |
10 // This is used for ContentDecryptionModule (CDM) promise rejections. | 10 // This is used for ContentDecryptionModule (CDM) promise rejections. |
11 // Note: This can also be used for session errors in prefixed API. | 11 // Note: This can also be used for session errors in prefixed API. |
12 enum CdmException { | 12 enum CdmException { |
13 NOT_SUPPORTED_ERROR, | 13 NOT_SUPPORTED_ERROR, |
14 INVALID_STATE_ERROR, | 14 INVALID_STATE_ERROR, |
15 INVALID_ACCESS_ERROR, | 15 INVALID_ACCESS_ERROR, |
16 QUOTA_EXCEEDED_ERROR, | 16 QUOTA_EXCEEDED_ERROR, |
17 UNKNOWN_ERROR, | 17 UNKNOWN_ERROR, |
18 CLIENT_ERROR, | 18 CLIENT_ERROR, |
19 OUTPUT_ERROR | 19 OUTPUT_ERROR |
20 }; | 20 }; |
21 | 21 |
| 22 // Transport layer of media::CdmKeyInformation::KeyStatus (see |
| 23 // media/base/cdm_key_information.h). This is used for indicating the status |
| 24 // of a specific key ID. |
| 25 enum CdmKeyStatus { |
| 26 USABLE, |
| 27 INTERNAL_ERROR, |
| 28 EXPIRED, |
| 29 OUTPUT_NOT_ALLOWED |
| 30 }; |
| 31 |
22 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h). | 32 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h). |
23 // - When |success| is true, the promise is resolved and all other fields should | 33 // - When |success| is true, the promise is resolved and all other fields should |
24 // be ignored. | 34 // be ignored. |
25 // - When |success| is false, the promise is rejected with |exception|, | 35 // - When |success| is false, the promise is rejected with |exception|, |
26 // |system_code| and |error_message|. | 36 // |system_code| and |error_message|. |
27 struct CdmPromiseResult { | 37 struct CdmPromiseResult { |
28 bool success; | 38 bool success; |
29 CdmException exception; | 39 CdmException exception; |
30 uint32 system_code; | 40 uint32 system_code; |
31 string error_message; | 41 string error_message; |
32 }; | 42 }; |
33 | 43 |
| 44 // Transport layer of media::CdmKeyInformation (see |
| 45 // media/base/cdm_key_information.h). It is used to specify a key_id and it's |
| 46 // associated status. |
| 47 struct CdmKeyInformation { |
| 48 array<uint8> key_id; |
| 49 CdmKeyStatus status; |
| 50 uint32 system_code; |
| 51 }; |
| 52 |
34 // An interface that represents a CDM in the Encrypted Media Extensions (EME) | 53 // An interface that represents a CDM in the Encrypted Media Extensions (EME) |
35 // spec (https://w3c.github.io/encrypted-media/). See media/base/media_keys.h. | 54 // spec (https://w3c.github.io/encrypted-media/). See media/base/media_keys.h. |
36 [Client=ContentDecryptionModuleClient] | 55 [Client=ContentDecryptionModuleClient] |
37 interface ContentDecryptionModule { | 56 interface ContentDecryptionModule { |
38 // See media::MediaKeys::SessionType. | 57 // See media::MediaKeys::SessionType. |
39 enum SessionType { | 58 enum SessionType { |
40 TEMPORARY_SESSION, | 59 TEMPORARY_SESSION, |
41 PERSISTENT_SESSION | 60 PERSISTENT_SESSION |
42 }; | 61 }; |
43 | 62 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Session callbacks. See media/base/media_keys.h for details. | 110 // Session callbacks. See media/base/media_keys.h for details. |
92 interface ContentDecryptionModuleClient { | 111 interface ContentDecryptionModuleClient { |
93 OnSessionMessage(string session_id, array<uint8> message, | 112 OnSessionMessage(string session_id, array<uint8> message, |
94 string destination_url); | 113 string destination_url); |
95 | 114 |
96 OnSessionClosed(string session_id); | 115 OnSessionClosed(string session_id); |
97 | 116 |
98 OnSessionError(string session_id, CdmException exception, | 117 OnSessionError(string session_id, CdmException exception, |
99 uint32 system_code, string error_message); | 118 uint32 system_code, string error_message); |
100 | 119 |
101 OnSessionKeysChange(string session_id, bool has_additional_usable_key); | 120 OnSessionKeysChange(string session_id, bool has_additional_usable_key, |
| 121 array<CdmKeyInformation> key_information); |
102 | 122 |
103 OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec); | 123 OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec); |
104 }; | 124 }; |
OLD | NEW |