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

Unified Diff: media/mojo/interfaces/content_decryption_module.mojom

Issue 763883006: Add Mojo CDM Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: media/mojo/interfaces/content_decryption_module.mojom
diff --git a/media/mojo/interfaces/content_decryption_module.mojom b/media/mojo/interfaces/content_decryption_module.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..e027630659264e0557b8576eece29f9fbf9eb86c
--- /dev/null
+++ b/media/mojo/interfaces/content_decryption_module.mojom
@@ -0,0 +1,88 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module mojo;
jamesr 2014/12/02 22:25:59 shouldn't this be in a media module? or perhaps so
xhwang 2014/12/03 01:23:42 The MediaRenderer interface is in mojo module and
+
+import "media/mojo/interfaces/decryptor.mojom";
+
+enum CdmException {
+ NOT_SUPPORTED_ERROR,
+ INVALID_STATE_ERROR,
+ INVALID_ACCESS_ERROR,
+ QUOTA_EXCEEDED_ERROR,
+ UNKNOWN_ERROR,
+ CLIENT_ERROR,
+ OUTPUT_ERROR
+};
+
+struct CdmContext {
+ Decryptor? decryptor;
jamesr 2014/12/02 22:25:59 can you add some comments to these guys? what does
xhwang 2014/12/03 01:23:42 Done.
+ int32 cdm_id;
+};
+
+struct CdmPromiseResult {
+ bool success;
+ CdmException exception_code;
+ uint32 system_code;
+ string error_message;
+};
+
+[Client=ContentDecryptionModuleClient]
+interface ContentDecryptionModule {
+ enum SessionType {
+ TEMPORARY_SESSION,
+ PERSISTENT_SESSION
+ };
+
+ // Provides a server certificate to be used to encrypt messages to the
+ // license server.
+ SetServerCertificate(array<uint8> certificate_data)
+ => (CdmPromiseResult result);
+
+ // Creates a session with the |init_data_type|, |init_data| and |session_type|
+ // provided.
+ CreateSession(string init_data_type,
+ array<uint8> init_data,
+ SessionType session_type)
+ => (CdmPromiseResult result, string? session_id);
+
+ // Loads a session with the |session_id| provided.
+ LoadSession(string session_id)
+ => (CdmPromiseResult result, string? session_id);
jamesr 2014/12/02 22:25:59 what does it mean for session_id to be null?
xhwang 2014/12/03 01:23:42 Done.
+
+ // Updates a session specified by |session_id| with |response|.
+ UpdateSession(string session_id, array<uint8> response)
+ => (CdmPromiseResult result);
+
+ // Closes the session specified by |session_id|.
+ CloseSession(string session_id) => (CdmPromiseResult result);
+
+ // Removes stored session data associated with the session specified by
+ // |session_id|.
+ RemoveSession(string session_id) => (CdmPromiseResult result);
+
+ // Retrieves the key IDs for keys in the session that the CDM knows are
+ // currently usable to decrypt media data.
+ GetUsableKeyIds(string session_id)
+ => (CdmPromiseResult result, array<array<uint8>>? usable_key_ids);
+
+ // Retrieves the CdmContext associated with this CDM instance.
+ GetCdmContext(CdmContext& cdm_context);
+};
+
+interface ContentDecryptionModuleClient {
+ OnSessionMessage(string session_id, array<uint8> message,
+ string destination_url);
+
+ OnSessionReady(string session_id);
+
+ OnSessionClosed(string session_id);
+
+ OnSessionError(string session_id, CdmException exception_code,
+ uint32 system_code, string error_message);
+
+ OnSessionKeysChange(string session_id, bool has_additional_usable_key);
+
+ OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec);
+};

Powered by Google App Engine
This is Rietveld 408576698