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

Side by Side Diff: ppapi/api/private/ppp_content_decryptor_private.idl

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /**
7 * This file defines the <code>PPP_ContentDecryptor_Private</code>
8 * interface. Note: This is a special interface, only to be used for Content
9 * Decryption Modules, not normal plugins.
10 */
11 label Chrome {
12 M23 = 0.1
13 };
14
15 /**
16 * <code>PPP_ContentDecryptor_Private</code> structure contains the function
17 * pointers the decryption plugin must implement to provide services needed by
18 * the browser. This interface provides the plugin side support for the Content
19 * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions:
20 * http://goo.gl/rbdnR
21 */
22 interface PPP_ContentDecryptor_Private {
23 /**
24 * Generates a key request. key_system specifies the key or licensing system
25 * to use. init_data is a data buffer containing data for use in generating
26 * the request.
27 *
28 * Note: <code>GenerateKeyRequest()</code> must create the session ID used in
29 * other methods on this interface. The session ID must be provided to the
30 * browser by the CDM via <code>KeyMessage()</code> on the
31 * <code>PPB_ContentDecryptor_Private</code> interface.
32 *
33 * @param[in] key_system A <code>PP_Var</code> of type
34 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
35 *
36 * @param[in] init_data A <code>PP_Var</code> of type
37 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
38 * initialization data.
39 */
40 PP_Bool GenerateKeyRequest(
41 [in] PP_Instance instance,
42 [in] PP_Var key_system,
43 [in] PP_Var init_data);
44
45 /**
46 * Provides a key or license to the decryptor for decrypting media data.
47 *
48 * When the CDM needs more information to complete addition of the key it
49 * will call <code>KeyMessage()</code> on the
50 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser
51 * passes to the application. When the key is ready to use, the CDM
52 * must call call <code>KeyAdded()</code> on the
53 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser
54 * must notify the web application.
55 *
56 * @param[in] session_id A <code>PP_Var</code> of type
57 * <code>PP_VARTYPE_STRING</code> containing the session ID.
58 *
59 * @param[in] key A <code>PP_Var</code> of type
60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license,
61 * or other message for the given session ID.
62 */
63 PP_Bool AddKey(
64 [in] PP_Instance instance,
65 [in] PP_Var session_id,
66 [in] PP_Var key);
67
68 /**
69 * Cancels a pending key request for the specified session ID.
70 *
71 * @param[in] session_id A <code>PP_Var</code> of type
72 * <code>PP_VARTYPE_STRING</code> containing the session ID.
73 */
74 PP_Bool CancelKeyRequest(
75 [in] PP_Instance instance,
76 [in] PP_Var session_id);
77
78 /**
79 * Decrypts the block and returns the unencrypted block via
80 * <code>DeliverBlock()</code> on the
81 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block
82 * contains encoded data.
83 *
84 * @param[in] resource A <code>PP_Resource</code> corresponding to a
85 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
86 * block.
87 *
88 * @param[in] request_id A value used by the browser to associate data
89 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
90 * decryption method calls.
91 */
92 PP_Bool Decrypt(
93 [in] PP_Instance instance,
94 [in] PP_Resource encrypted_block,
95 [in] int32_t request_id);
96
97 /**
98 * Decrypts the block, decodes it, and returns the unencrypted uncompressed
99 * (decoded) media to the browser via the
100 * <code>PPB_ContentDecryptor_Private</code> interface.
101 *
102 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>,
103 * and decrypted and decoded audio samples are sent to
104 * <code>DeliverSamples()</code>.
105 *
106 * @param[in] resource A <code>PP_Resource</code> corresponding to a
107 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
108 * block.
109 *
110 * @param[in] request_id A value used by the browser to associate data
111 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
112 * decryption method calls.
113 */
114 PP_Bool DecryptAndDecode(
115 [in] PP_Instance instance,
116 [in] PP_Resource encrypted_block,
117 [in] int32_t request_id);
118 };
OLDNEW
« no previous file with comments | « ppapi/api/private/ppb_content_decryptor_private.idl ('k') | ppapi/c/private/ppb_content_decryptor_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698