Index: ppapi/c/dev/ppp_content_decryptor_dev.h |
diff --git a/ppapi/c/dev/ppp_content_decryptor_dev.h b/ppapi/c/dev/ppp_content_decryptor_dev.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9b27d4fcde6d67e610a9b7d5f1cb9f142a37e433 |
--- /dev/null |
+++ b/ppapi/c/dev/ppp_content_decryptor_dev.h |
@@ -0,0 +1,115 @@ |
+/* Copyright (c) 2012 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. |
+ */ |
+ |
+/* From dev/ppp_content_decryptor_dev.idl modified Wed Aug 8 11:53:37 2012. */ |
+ |
+#ifndef PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_ |
+#define PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_ |
+ |
+#include "ppapi/c/pp_bool.h" |
+#include "ppapi/c/pp_instance.h" |
+#include "ppapi/c/pp_macros.h" |
+#include "ppapi/c/pp_resource.h" |
+#include "ppapi/c/pp_stdint.h" |
+#include "ppapi/c/pp_var.h" |
+ |
+#define PPP_CONTENTDECRYPTOR_DEV_INTERFACE_0_1 "PPP_ContentDecryptor(Dev);0.1" |
+#define PPP_CONTENTDECRYPTOR_DEV_INTERFACE \ |
+ PPP_CONTENTDECRYPTOR_DEV_INTERFACE_0_1 |
+ |
+/** |
+ * @file |
+ * This file defines the <code>PPP_ContentDecryptor_Dev</code> |
+ * interface. |
+ */ |
+ |
+ |
+/** |
+ * @addtogroup Interfaces |
+ * @{ |
+ */ |
+/** |
+ * <code>PPP_ContentDecryptor_Dev</code> structure contains the function |
+ * pointers the decryption plugin MUST implement to provide services needed by |
+ * the media stack. This interface provides the plugin side support for v0.1 of |
+ * the proposed Encrypted Media Extensions: http://goo.gl/rbdnR |
+ */ |
+struct PPP_ContentDecryptor_Dev_0_1 { |
+ /** |
+ * Generates a key request. key_system specifies the key or licensing system |
+ * from which to request the key when the plugin provides access to multiple |
+ * systems. init_data is a data buffer containing initialization data from |
+ * the media data that is required for use of the plugin's key system(s). |
+ * Note: <code>GenerateKeyRequest</code> is responsible for creating the |
+ * session ID. |
+ * |
+ * @param[in] key_system A <code>PP_Var</code> of type |
+ * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
+ * |
+ * @param[in] init_data A <code>PP_Var</code> of type |
+ * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific |
+ * initialization data. |
+ */ |
+ PP_Bool (*GenerateKeyRequest)(PP_Instance instance, |
+ struct PP_Var key_system, |
+ struct PP_Var init_data); |
+ /** |
+ * Provides a key or license to use for decrypting media data for session_id. |
+ * |
+ * @param[in] session_id A <code>PP_Var</code> of type |
+ * <code>PP_VARTYPE_STRING</code> containing the session ID. |
+ * |
+ * @param[in] key A <code>PP_Var</code> of type |
+ * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key for the |
+ * given session ID. |
+ */ |
+ PP_Bool (*AddKey)(PP_Instance instance, |
+ struct PP_Var session_id, |
+ struct PP_Var key); |
+ /** |
+ * Cancels a pending key request for session_id. |
+ * |
+ * @param[in] session_id A <code>PP_Var</code> of type |
+ * <code>PP_VARTYPE_STRING</code> containing the session ID. |
+ */ |
+ PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); |
+ /** |
+ * Decrypts the block and returns the unencrypted block via |
+ * <code>DeliverBlock</code> on the <code>PPB_ContentDecryptor_Dev</code> |
+ * interface. In the case of media, the block contains encoded data. |
+ * |
+ * @param[in] resource A <code>PP_Resource</code> corresponding to a |
+ * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
+ * block. |
+ * |
+ * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to |
+ * match returned decrypted data to a callback sent from the media stack. |
+ */ |
+ PP_Bool (*Decrypt)(PP_Instance instance, |
+ PP_Resource encrypted_block, |
+ uint64_t request_id); |
+ /** |
+ * Decrypts the block then decodes it and returns the unencrypted raw |
+ * (decoded) frame. |
+ * |
+ * @param[in] resource A <code>PP_Resource</code> corresponding to a |
+ * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
+ * block. |
+ * |
+ * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to |
+ * match returned decrypted data to a callback sent from the media stack. |
+ */ |
+ PP_Bool (*DecryptAndDecode)(PP_Instance instance, |
+ PP_Resource encrypted_block, |
+ uint64_t request_id); |
+}; |
+ |
+typedef struct PPP_ContentDecryptor_Dev_0_1 PPP_ContentDecryptor_Dev; |
+/** |
+ * @} |
+ */ |
+ |
+#endif /* PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_ */ |
+ |