Chromium Code Reviews| Index: ppapi/api/dev/ppp_content_decryptor_dev.idl |
| diff --git a/ppapi/api/dev/ppp_content_decryptor_dev.idl b/ppapi/api/dev/ppp_content_decryptor_dev.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f3169abe7bc2fa2ce41ab5662316af0ffddf0de |
| --- /dev/null |
| +++ b/ppapi/api/dev/ppp_content_decryptor_dev.idl |
| @@ -0,0 +1,63 @@ |
| +/* 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. |
| + */ |
| + |
| +/** |
| + * This file defines the <code>PPP_ContentDecryptor_Dev</code> |
| + * interface. |
| + */ |
| +label Chrome { |
| + M22 = 0.1 |
| +}; |
| + |
| +/** |
| + * <code>PPP_ContentDecryptor_Dev</code> structure contains the function |
| + * pointers the decryption plugin MUST implement to provide services needed by |
| + * the media stack. |
| + */ |
| +interface PPP_ContentDecryptor_Dev { |
|
dmichael (off chromium)
2012/07/31 03:36:31
We're trying to get away from defining new PPP int
Tom Finegan
2012/08/01 04:19:22
So the PPB interface would have an OnCreate method
dmichael (off chromium)
2012/08/08 03:38:10
Yes. You can use the same struct and typename, it
|
| + /** |
| + * 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 |
|
dmichael (off chromium)
2012/07/31 03:36:31
Maybe it's just that I'm ignorant of content decry
Tom Finegan
2012/08/01 04:19:22
Sure, here are two examples from webkit/media/cryp
dmichael (off chromium)
2012/08/08 03:38:10
I meant in the documentation :-)
|
| + * the media data that is required for use of the plugin's key system(s). |
| + */ |
| + PP_Bool GenerateKeyRequest( |
| + [in] PP_Instance instance, |
| + [in] PP_Var key_system, /* String. */ |
| + [in] PP_Resource init_data); /* PPB_Buffer. */ |
|
dmichael (off chromium)
2012/07/31 03:36:31
FYI: Another option is an ArrayBuffer var. ArrayBu
Tom Finegan
2012/08/01 04:19:22
We're not really sure what the maximum size of ini
|
| + |
| + /** |
| + * Provides a key or license to use for decrypting media data for session_id. |
| + */ |
| + PP_Bool AddKey( |
| + [in] PP_Instance instance, |
| + [in] PP_Var session_id, /* String. */ |
| + [in] PP_Resource key); /* PPB_Buffer. */ |
| + |
| + /** |
| + * Cancels a key request for session_id. |
| + */ |
| + PP_Bool CancelKeyRequest( |
| + [in] PP_Instance instance, |
| + [in] PP_Var session_id); /* String. */ |
| + |
| + /** |
| + * Decrypts the block and returns the unencrypted block. In the case of |
| + * media, the block contains encoded data. |
| + */ |
| + PP_Bool Decrypt( |
| + [in] PP_Instance instance, |
| + [in] PP_Resource encrypted_block, /* PPB_Buffer. */ |
| + [in] PP_CompletionCallback callback); |
|
dmichael (off chromium)
2012/07/31 03:36:31
We've never used a PP_CompletionCallback in the pl
Tom Finegan
2012/08/01 04:19:22
In brief:
1) Media stack calls Decrypt on webkit:
|
| + |
| + /** |
| + * Decrypts the block then decodes it and returns the unencrypted raw |
| + * (decoded) frame. |
| + */ |
| + PP_Bool DecryptAndDecode( |
| + [in] PP_Instance instance, |
| + [in] PP_Resource encrypted_block, /* PPB_Buffer. */ |
| + [in] PP_CompletionCallback callback); |
| +}; |