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

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 nits. 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 (CDM), 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 CDM for
19 * v0.1 of the proposed Encrypted Media Extensions: http://goo.gl/rbdnR
20 */
21 interface PPP_ContentDecryptor_Private {
22 /**
23 * Generates a key request. key_system specifies the key or licensing system
24 * to use. init_data is a data buffer containing data for use in generating
25 * the request.
26 *
27 * Note: <code>GenerateKeyRequest()</code> must create the session ID used in
28 * other methods on this interface. The session ID must be provided to the
29 * browser by the CDM via <code>KeyMessage()</code> on the
30 * <code>PPB_ContentDecryptor_Private</code> interface.
31 *
32 * @param[in] key_system A <code>PP_Var</code> of type
33 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
34 *
35 * @param[in] init_data A <code>PP_Var</code> of type
36 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
37 * initialization data.
38 */
39 PP_Bool GenerateKeyRequest(
40 [in] PP_Instance instance,
41 [in] PP_Var key_system,
42 [in] PP_Var init_data);
43
44 /**
45 * Provides a key or license to the decryptor for decrypting media data.
46 *
47 * When the CDM needs more information to complete addition of the key it
48 * will call <code>KeyMessage()</code> on the
49 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser
50 * passes to the application by firing a <code>MediaKeyMessageEvent</code> at
ddorwin 2012/08/14 17:39:58 Remove everything after "application" from this se
Tom Finegan 2012/08/14 18:09:32 Done.
51 * the <code>HTMLMediaElement</code>. 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, which the browser
54 * passes to the application by firing a <code>MediaKeyCompleteEvent</code>
ddorwin 2012/08/14 17:39:58 same
Tom Finegan 2012/08/14 18:09:32 Done plus minor tweak to wording.
55 * at the <code>HTMLMediaElement</code>
56 *
57 * @param[in] session_id A <code>PP_Var</code> of type
58 * <code>PP_VARTYPE_STRING</code> containing the session ID.
59 *
60 * @param[in] key A <code>PP_Var</code> of type
61 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license,
62 * or other message for the given session ID.
63 */
64 PP_Bool AddKey(
65 [in] PP_Instance instance,
66 [in] PP_Var session_id,
67 [in] PP_Var key);
68
69 /**
70 * Cancels a pending key request for the specified session ID.
71 *
72 * @param[in] session_id A <code>PP_Var</code> of type
73 * <code>PP_VARTYPE_STRING</code> containing the session ID.
74 */
75 PP_Bool CancelKeyRequest(
76 [in] PP_Instance instance,
77 [in] PP_Var session_id);
78
79 /**
80 * Decrypts the block and returns the unencrypted block via
81 * <code>DeliverBlock()</code> on the
82 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block
83 * contains encoded data.
84 *
85 * @param[in] resource A <code>PP_Resource</code> corresponding to a
86 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
87 * block.
88 *
89 * @param[in] request_id A value used by the browser to associate data
90 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
91 * decryption method calls.
92 */
93 PP_Bool Decrypt(
94 [in] PP_Instance instance,
95 [in] PP_Resource encrypted_block,
96 [in] int32_t request_id);
97
98 /**
99 * Decrypts the block, decodes it, and returns the unencrypted uncompressed
100 * (decoded) media to the browser via the
101 * <code>PPB_ContentDecryptor_Private</code> interface.
102 *
103 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>,
104 * and decrypted and decoded audio samples are sent to
105 * <code>DeliverSamples()</code>.
106 *
107 * @param[in] resource A <code>PP_Resource</code> corresponding to a
108 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
109 * block.
110 *
111 * @param[in] request_id A value used by the browser to associate data
112 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
113 * decryption method calls.
114 */
115 PP_Bool DecryptAndDecode(
116 [in] PP_Instance instance,
117 [in] PP_Resource encrypted_block,
118 [in] int32_t request_id);
119 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698