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

Unified Diff: ppapi/c/private/ppp_content_decryptor_private.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed last nit. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/private/ppb_content_decryptor_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/private/ppp_content_decryptor_private.h
diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..56b5d856f6472f0396b17f4aaa96894f61a4cf06
--- /dev/null
+++ b/ppapi/c/private/ppp_content_decryptor_private.h
@@ -0,0 +1,138 @@
+/* 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 private/ppp_content_decryptor_private.idl,
+ * modified Tue Aug 14 11:06:05 2012.
+ */
+
+#ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_
+#define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_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_PRIVATE_INTERFACE_0_1 \
+ "PPP_ContentDecryptor_Private;0.1"
+#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \
+ PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1
+
+/**
+ * @file
+ * This file defines the <code>PPP_ContentDecryptor_Private</code>
+ * interface. Note: This is a special interface, only to be used for Content
+ * Decryption Modules, not normal plugins.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/**
+ * <code>PPP_ContentDecryptor_Private</code> structure contains the function
+ * pointers the decryption plugin must implement to provide services needed by
+ * the browser. This interface provides the plugin side support for the Content
+ * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions:
+ * http://goo.gl/rbdnR
+ */
+struct PPP_ContentDecryptor_Private_0_1 {
+ /**
+ * Generates a key request. key_system specifies the key or licensing system
+ * to use. init_data is a data buffer containing data for use in generating
+ * the request.
+ *
+ * Note: <code>GenerateKeyRequest()</code> must create the session ID used in
+ * other methods on this interface. The session ID must be provided to the
+ * browser by the CDM via <code>KeyMessage()</code> on the
+ * <code>PPB_ContentDecryptor_Private</code> interface.
+ *
+ * @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 container 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 the decryptor for decrypting media data.
+ *
+ * When the CDM needs more information to complete addition of the key it
+ * will call <code>KeyMessage()</code> on the
+ * <code>PPB_ContentDecryptor_Private</code> interface, which the browser
+ * passes to the application. When the key is ready to use, the CDM
+ * must call call <code>KeyAdded()</code> on the
+ * <code>PPB_ContentDecryptor_Private</code> interface, and the browser
+ * must notify the web application.
+ *
+ * @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, license,
+ * or other message 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 the specified 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_Private</code> interface. The returned 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 by the browser to associate data
+ * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
+ * decryption method calls.
+ */
+ PP_Bool (*Decrypt)(PP_Instance instance,
+ PP_Resource encrypted_block,
+ int32_t request_id);
+ /**
+ * Decrypts the block, decodes it, and returns the unencrypted uncompressed
+ * (decoded) media to the browser via the
+ * <code>PPB_ContentDecryptor_Private</code> interface.
+ *
+ * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>,
+ * and decrypted and decoded audio samples are sent to
+ * <code>DeliverSamples()</code>.
+ *
+ * @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 by the browser to associate data
+ * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
+ * decryption method calls.
+ */
+ PP_Bool (*DecryptAndDecode)(PP_Instance instance,
+ PP_Resource encrypted_block,
+ int32_t request_id);
+};
+
+typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private;
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */
+
« no previous file with comments | « ppapi/c/private/ppb_content_decryptor_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698