| 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 media.mojom; | 5 module media.mojom; |
| 6 | 6 |
| 7 import "media/mojo/interfaces/decryptor.mojom"; | 7 import "media/mojo/interfaces/decryptor.mojom"; |
| 8 import "url/mojo/url.mojom"; | 8 import "url/mojo/url.mojom"; |
| 9 | 9 |
| 10 // See media::EmeInitDataType. | 10 // See media::EmeInitDataType. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 struct CdmKeyInformation { | 40 struct CdmKeyInformation { |
| 41 [Native] | 41 [Native] |
| 42 enum KeyStatus; | 42 enum KeyStatus; |
| 43 | 43 |
| 44 array<uint8> key_id; | 44 array<uint8> key_id; |
| 45 KeyStatus status; | 45 KeyStatus status; |
| 46 uint32 system_code; | 46 uint32 system_code; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // An interface that represents a CDM in the Encrypted Media Extensions (EME) | 49 // An interface that represents a CDM in the Encrypted Media Extensions (EME) |
| 50 // spec (https://w3c.github.io/encrypted-media/). See media/base/media_keys.h. | 50 // spec (https://w3c.github.io/encrypted-media/). |
| 51 // See media/base/content_decryption_module.h |
| 51 interface ContentDecryptionModule { | 52 interface ContentDecryptionModule { |
| 52 // See media::MediaKeys::SessionType | 53 // See media::ContentDecryptionModule::SessionType |
| 53 [Native] | 54 [Native] |
| 54 enum SessionType; | 55 enum SessionType; |
| 55 | 56 |
| 56 // Sets ContentDecryptionModuleClient. Must be called before any other calls. | 57 // Sets ContentDecryptionModuleClient. Must be called before any other calls. |
| 57 SetClient(ContentDecryptionModuleClient client); | 58 SetClient(ContentDecryptionModuleClient client); |
| 58 | 59 |
| 59 // Initializes the CDM. If initialization failed (e.g. |key_system| or | 60 // Initializes the CDM. If initialization failed (e.g. |key_system| or |
| 60 // |cdm_config| is not supported), |result.success| will be false and |cdm_id| | 61 // |cdm_config| is not supported), |result.success| will be false and |cdm_id| |
| 61 // will be zero. Upon success, |cdm_id| will be non-zero and will later be | 62 // will be zero. Upon success, |cdm_id| will be non-zero and will later be |
| 62 // used to locate the CDM at the remote side. |decryptor| is the remote | 63 // used to locate the CDM at the remote side. |decryptor| is the remote |
| (...skipping 28 matching lines...) Expand all Loading... |
| 91 => (CdmPromiseResult result); | 92 => (CdmPromiseResult result); |
| 92 | 93 |
| 93 // Closes the session specified by |session_id|. | 94 // Closes the session specified by |session_id|. |
| 94 CloseSession(string session_id) => (CdmPromiseResult result); | 95 CloseSession(string session_id) => (CdmPromiseResult result); |
| 95 | 96 |
| 96 // Removes stored session data associated with the active session specified by | 97 // Removes stored session data associated with the active session specified by |
| 97 // |session_id|. | 98 // |session_id|. |
| 98 RemoveSession(string session_id) => (CdmPromiseResult result); | 99 RemoveSession(string session_id) => (CdmPromiseResult result); |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 // Session callbacks. See media/base/media_keys.h for details. | 102 // Session callbacks. See media/base/content_decryption_module.h for details. |
| 102 interface ContentDecryptionModuleClient { | 103 interface ContentDecryptionModuleClient { |
| 103 // See media::MediaKeys::MessageType | 104 // See media::ContentDecryptionModule::MessageType |
| 104 [Native] | 105 [Native] |
| 105 enum MessageType; | 106 enum MessageType; |
| 106 | 107 |
| 107 OnSessionMessage(string session_id, MessageType message_type, | 108 OnSessionMessage(string session_id, MessageType message_type, |
| 108 array<uint8> message); | 109 array<uint8> message); |
| 109 | 110 |
| 110 OnSessionClosed(string session_id); | 111 OnSessionClosed(string session_id); |
| 111 | 112 |
| 112 OnSessionKeysChange(string session_id, bool has_additional_usable_key, | 113 OnSessionKeysChange(string session_id, bool has_additional_usable_key, |
| 113 array<CdmKeyInformation> keys_info); | 114 array<CdmKeyInformation> keys_info); |
| 114 | 115 |
| 115 // Provide session expiration update for |session_id|. | 116 // Provide session expiration update for |session_id|. |
| 116 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970). | 117 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970). |
| 117 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec); | 118 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec); |
| 118 }; | 119 }; |
| OLD | NEW |