Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: media/mojo/interfaces/content_decryption_module.mojom

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only; compiles but needs more polish... Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.
(...skipping 20 matching lines...) Expand all
31 31
32 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h). 32 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h).
33 // - 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
34 // be ignored. 34 // be ignored.
35 // - When |success| is false, the promise is rejected with |exception|, 35 // - When |success| is false, the promise is rejected with |exception|,
36 // |system_code| and |error_message|. 36 // |system_code| and |error_message|.
37 struct CdmPromiseResult { 37 struct CdmPromiseResult {
38 bool success; 38 bool success;
39 CdmException exception; 39 CdmException exception;
40 uint32 system_code; 40 uint32 system_code;
41 string error_message; 41 string? error_message;
42 }; 42 };
43 43
44 // Transport layer of media::CdmKeyInformation (see 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 45 // media/base/cdm_key_information.h). It is used to specify a key_id and it's
46 // associated status. 46 // associated status.
47 struct CdmKeyInformation { 47 struct CdmKeyInformation {
48 array<uint8> key_id; 48 array<uint8> key_id;
49 CdmKeyStatus status; 49 CdmKeyStatus status;
50 uint32 system_code; 50 uint32 system_code;
51 }; 51 };
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 UpdateSession(string session_id, array<uint8> response) 104 UpdateSession(string session_id, array<uint8> response)
105 => (CdmPromiseResult result); 105 => (CdmPromiseResult result);
106 106
107 // Closes the session specified by |session_id|. 107 // Closes the session specified by |session_id|.
108 CloseSession(string session_id) => (CdmPromiseResult result); 108 CloseSession(string session_id) => (CdmPromiseResult result);
109 109
110 // Removes stored session data associated with the active session specified by 110 // Removes stored session data associated with the active session specified by
111 // |session_id|. 111 // |session_id|.
112 RemoveSession(string session_id) => (CdmPromiseResult result); 112 RemoveSession(string session_id) => (CdmPromiseResult result);
113 113
114 // Assigns the |cdm_id| to the CDM, and retrieves the |decryptor| associated 114 // Retrieves the |decryptor| associated with this CDM instance.
115 // with this CDM instance. 115 // If the returned |decryptor| is not null, it will be used by the client
116 // A CDM implementation must choose to support either an explicit or implicit 116 // (e.g. media pipeline) directly to decrypt (and decode) encrypted buffers.
117 // decryptor: 117 GetDecryptor(Decryptor&? decryptor);
118 // - Explicit (non-null) decryptor: The client (e.g. media pipeline) will use
119 // the |decryptor| directly to decrypt (and decode) encrypted buffers.
120 // - Implicit (null) decryptor: The client (e.g. media pipeline) will use the
121 // |cdm_id| to locate a decryptor and associate it with the client.
122 // Note: In Chromium GetCdmContext() is a sync call. But we don't have an easy
123 // way to support sync calls on a mojo interface. Instead the client should
124 // generate a client side ID and pass it to the service.
125 GetCdmContext(int32 cdm_id, Decryptor&? decryptor);
126 }; 118 };
127 119
128 // Session callbacks. See media/base/media_keys.h for details. 120 // Session callbacks. See media/base/media_keys.h for details.
129 interface ContentDecryptionModuleClient { 121 interface ContentDecryptionModuleClient {
130 OnSessionMessage(string session_id, CdmMessageType message_type, 122 OnSessionMessage(string session_id, CdmMessageType message_type,
131 array<uint8> message, string legacy_destination_url); 123 array<uint8> message, string legacy_destination_url);
132 124
133 OnSessionClosed(string session_id); 125 OnSessionClosed(string session_id);
134 126
135 OnLegacySessionError(string session_id, CdmException exception, 127 OnLegacySessionError(string session_id, CdmException exception,
136 uint32 system_code, string error_message); 128 uint32 system_code, string error_message);
137 129
138 OnSessionKeysChange(string session_id, bool has_additional_usable_key, 130 OnSessionKeysChange(string session_id, bool has_additional_usable_key,
139 array<CdmKeyInformation> key_information); 131 array<CdmKeyInformation> key_information);
140 132
141 // Provide session expiration update for |session_id|. 133 // Provide session expiration update for |session_id|.
142 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970). 134 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970).
143 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec); 135 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec);
144 }; 136 };
OLDNEW
« no previous file with comments | « media/mojo/interfaces/BUILD.gn ('k') | media/mojo/interfaces/content_decryption_module_factory.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698