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

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: Fix TODO. Created 5 years, 9 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 UpdateSession(string session_id, array<uint8> response) 96 UpdateSession(string session_id, array<uint8> response)
97 => (CdmPromiseResult result); 97 => (CdmPromiseResult result);
98 98
99 // Closes the session specified by |session_id|. 99 // Closes the session specified by |session_id|.
100 CloseSession(string session_id) => (CdmPromiseResult result); 100 CloseSession(string session_id) => (CdmPromiseResult result);
101 101
102 // Removes stored session data associated with the active session specified by 102 // Removes stored session data associated with the active session specified by
103 // |session_id|. 103 // |session_id|.
104 RemoveSession(string session_id) => (CdmPromiseResult result); 104 RemoveSession(string session_id) => (CdmPromiseResult result);
105 105
106 // Assigns the |cdm_id| to the CDM, and retrieves the |decryptor| associated 106 // Retrieves the |decryptor| associated with this CDM instance.
107 // with this CDM instance. 107 // If the returned |decryptor| is not null, it will be used by the client
108 // A CDM implementation must choose to support either an explicit or implicit 108 // (e.g. media pipeline) directly to decrypt (and decode) encrypted buffers.
109 // decryptor: 109 GetDecryptor(Decryptor&? decryptor);
110 // - Explicit (non-null) decryptor: The client (e.g. media pipeline) will use
111 // the |decryptor| directly to decrypt (and decode) encrypted buffers.
112 // - Implicit (null) decryptor: The client (e.g. media pipeline) will use the
113 // |cdm_id| to locate a decryptor and associate it with the client.
114 // Note: In Chromium GetCdmContext() is a sync call. But we don't have an easy
115 // way to support sync calls on a mojo interface. Instead the client should
116 // generate a client side ID and pass it to the service.
117 GetCdmContext(int32 cdm_id, Decryptor&? decryptor);
118 }; 110 };
119 111
120 // Session callbacks. See media/base/media_keys.h for details. 112 // Session callbacks. See media/base/media_keys.h for details.
121 interface ContentDecryptionModuleClient { 113 interface ContentDecryptionModuleClient {
122 OnSessionMessage(string session_id, CdmMessageType message_type, 114 OnSessionMessage(string session_id, CdmMessageType message_type,
123 array<uint8> message, string legacy_destination_url); 115 array<uint8> message, string legacy_destination_url);
124 116
125 OnSessionClosed(string session_id); 117 OnSessionClosed(string session_id);
126 118
127 OnSessionError(string session_id, CdmException exception, 119 OnSessionError(string session_id, CdmException exception,
128 uint32 system_code, string error_message); 120 uint32 system_code, string error_message);
129 121
130 OnSessionKeysChange(string session_id, bool has_additional_usable_key, 122 OnSessionKeysChange(string session_id, bool has_additional_usable_key,
131 array<CdmKeyInformation> key_information); 123 array<CdmKeyInformation> key_information);
132 124
133 OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec); 125 OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec);
134 }; 126 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698