diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-04 04:36:14 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-04 04:36:14 +0000 |
commit | d40797ca4daebb6d54d7a298068c0d69fdc746cd (patch) | |
tree | 866bf8c6fab71a1659e08213f66f5635d0b663cf /ppapi | |
parent | 82d9d8c509ffab45f75de7f9bd86cf921405ab39 (diff) | |
download | chromium_src-d40797ca4daebb6d54d7a298068c0d69fdc746cd.zip chromium_src-d40797ca4daebb6d54d7a298068c0d69fdc746cd.tar.gz chromium_src-d40797ca4daebb6d54d7a298068c0d69fdc746cd.tar.bz2 |
Update PPP side of Pepper CDM API to support video decoding.
This adds the PPP half of the video decoding support changes.
Adds the following pepper types:
- PP_VideoCodec
- PP_DecryptedFrameFormat
- PP_EncryptedVideoFrameInfo
Replaces PPP_ContentDecryptor_Private::DecryptAndDecode with
DecryptAndDecodeFrame.
BUG=141780
TEST=
Review URL: https://chromiumcodereview.appspot.com/11023004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/private/pp_content_decryptor.idl | 65 | ||||
-rw-r--r-- | ppapi/api/private/ppp_content_decryptor_private.idl | 29 | ||||
-rw-r--r-- | ppapi/c/private/pp_content_decryptor.h | 77 | ||||
-rw-r--r-- | ppapi/c/private/ppp_content_decryptor_private.h | 39 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.cc | 17 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.h | 6 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 36 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.cc | 54 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.h | 6 |
10 files changed, 212 insertions, 119 deletions
diff --git a/ppapi/api/private/pp_content_decryptor.idl b/ppapi/api/private/pp_content_decryptor.idl index 8fb33a5..248b735 100644 --- a/ppapi/api/private/pp_content_decryptor.idl +++ b/ppapi/api/private/pp_content_decryptor.idl @@ -114,6 +114,60 @@ struct PP_EncryptedBlockInfo { }; /** + * <code>PP_DecryptedFrameFormat</code> contains video frame formats. + */ +[assert_size(4)] +enum PP_DecryptedFrameFormat { + PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1, + PP_DECRYPTEDFRAMEFORMAT_YV12 = 2, + PP_DECRYPTEDFRAMEFORMAT_I420 = 3 +}; + +/** + * <code>PP_VideoCodec</code> contains video codec type constants. + */ +[assert_size(4)] +enum PP_VideoCodec { + PP_VIDEOCODEC_UNKNOWN = 0, + PP_VIDEOCODEC_VP8 = 1 +}; + +/** + * <code>PP_EncryptedVideoFrameInfo</code> contains the information required + * to decrypt and decode a video frame. + * TODO(tomfinegan): Revisit necessity of including format information in this + * struct once we decide how to implement video decoder initialization. + */ +[assert_size(256)] +struct PP_EncryptedVideoFrameInfo { + /** + * The decoded video frame format. + */ + PP_DecryptedFrameFormat format; + + /** + * The video frame codec type. + */ + PP_VideoCodec codec; + + /** + * Video frame width in pixels. + */ + int32_t width; + + /** + * Video frame height in pixels. + */ + int32_t height; + + /** + * Information required to decrypt the frame. + */ + PP_EncryptedBlockInfo encryption_info; +}; + +/** * The <code>PP_DecryptResult</code> enum contains decryption and decoding * result constants. */ @@ -154,17 +208,6 @@ struct PP_DecryptedBlockInfo { }; /** - * <code>PP_DecryptedFrameFormat</code> contains video frame formats. - */ -[assert_size(4)] -enum PP_DecryptedFrameFormat { - PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, - PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1, - PP_DECRYPTEDFRAMEFORMAT_YV12 = 2, - PP_DECRYPTEDFRAMEFORMAT_I420 = 3 -}; - -/** * <code>PP_DecryptedFramePlanes</code> provides YUV plane index values for * accessing plane offsets stored in <code>PP_DecryptedFrameInfo</code>. */ diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 458e46a..3f9b412 100644 --- a/ppapi/api/private/ppp_content_decryptor_private.idl +++ b/ppapi/api/private/ppp_content_decryptor_private.idl @@ -9,7 +9,7 @@ * Decryption Modules, not normal plugins. */ label Chrome { - M23 = 0.1 + M23 = 0.2 }; /** @@ -100,24 +100,21 @@ interface PPP_ContentDecryptor_Private { [in] PP_EncryptedBlockInfo encrypted_block_info); /** - * Decrypts the block, decodes it, and returns the unencrypted uncompressed - * (decoded) media to the browser via the + * Decrypts encrypted_video_frame, decodes it, and returns the unencrypted + * uncompressed (decoded) video frame to the browser via the + * <code>DeliverFrame()</code> method on 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] encrypted_video_frame A <code>PP_Resource</code> corresponding + * to a <code>PPB_Buffer_Dev</code> resource that contains an encrypted video + * 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] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that - * contains all auxiliary information needed for decryption of the - * <code>encrypted_block</code>. + * @param[in] encrypted_video_frame_info A + * <code>PP_EncryptedVideoFrameInfo</code> that contains all information + * needed to decrypt and decode <code>encrypted_video_frame</code>. */ - void DecryptAndDecode( + void DecryptAndDecodeFrame( [in] PP_Instance instance, - [in] PP_Resource encrypted_block, - [in] PP_EncryptedBlockInfo encrypted_block_info); + [in] PP_Resource encrypted_video_frame, + [in] PP_EncryptedVideoFrameInfo encrypted_video_frame_info); }; diff --git a/ppapi/c/private/pp_content_decryptor.h b/ppapi/c/private/pp_content_decryptor.h index 6d0d81b..8467e9f 100644 --- a/ppapi/c/private/pp_content_decryptor.h +++ b/ppapi/c/private/pp_content_decryptor.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/pp_content_decryptor.idl modified Wed Oct 3 12:52:47 2012. */ +/* From private/pp_content_decryptor.idl modified Wed Oct 3 16:16:49 2012. */ #ifndef PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ #define PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ @@ -129,6 +129,70 @@ PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedBlockInfo, 240); * @{ */ /** + * <code>PP_DecryptedFrameFormat</code> contains video frame formats. + */ +typedef enum { + PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1, + PP_DECRYPTEDFRAMEFORMAT_YV12 = 2, + PP_DECRYPTEDFRAMEFORMAT_I420 = 3 +} PP_DecryptedFrameFormat; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4); + +/** + * <code>PP_VideoCodec</code> contains video codec type constants. + */ +typedef enum { + PP_VIDEOCODEC_UNKNOWN = 0, + PP_VIDEOCODEC_VP8 = 1 +} PP_VideoCodec; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodec, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * <code>PP_EncryptedVideoFrameInfo</code> contains the information required + * to decrypt and decode a video frame. + * TODO(tomfinegan): Revisit necessity of including format information in this + * struct once we decide how to implement video decoder initialization. + */ +struct PP_EncryptedVideoFrameInfo { + /** + * The decoded video frame format. + */ + PP_DecryptedFrameFormat format; + /** + * The video frame codec type. + */ + PP_VideoCodec codec; + /** + * Video frame width in pixels. + */ + int32_t width; + /** + * Video frame height in pixels. + */ + int32_t height; + /** + * Information required to decrypt the frame. + */ + struct PP_EncryptedBlockInfo encryption_info; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedVideoFrameInfo, 256); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** * The <code>PP_DecryptResult</code> enum contains decryption and decoding * result constants. */ @@ -181,17 +245,6 @@ PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedBlockInfo, 24); * @{ */ /** - * <code>PP_DecryptedFrameFormat</code> contains video frame formats. - */ -typedef enum { - PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, - PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1, - PP_DECRYPTEDFRAMEFORMAT_YV12 = 2, - PP_DECRYPTEDFRAMEFORMAT_I420 = 3 -} PP_DecryptedFrameFormat; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4); - -/** * <code>PP_DecryptedFramePlanes</code> provides YUV plane index values for * accessing plane offsets stored in <code>PP_DecryptedFrameInfo</code>. */ diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index d988d98..4c43b27 100644 --- a/ppapi/c/private/ppp_content_decryptor_private.h +++ b/ppapi/c/private/ppp_content_decryptor_private.h @@ -4,7 +4,7 @@ */ /* From private/ppp_content_decryptor_private.idl, - * modified Mon Sep 10 20:05:13 2012. + * modified Mon Oct 01 20:27:29 2012. */ #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ @@ -18,10 +18,10 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_content_decryptor.h" -#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 \ - "PPP_ContentDecryptor_Private;0.1" +#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_2 \ + "PPP_ContentDecryptor_Private;0.2" #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 + PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_2 /** * @file @@ -42,7 +42,7 @@ * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: * http://goo.gl/rbdnR */ -struct PPP_ContentDecryptor_Private_0_1 { +struct PPP_ContentDecryptor_Private_0_2 { /** * 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 @@ -114,29 +114,26 @@ struct PPP_ContentDecryptor_Private_0_1 { PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info); /** - * Decrypts the block, decodes it, and returns the unencrypted uncompressed - * (decoded) media to the browser via the + * Decrypts encrypted_video_frame, decodes it, and returns the unencrypted + * uncompressed (decoded) video frame to the browser via the + * <code>DeliverFrame()</code> method on 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] encrypted_video_frame A <code>PP_Resource</code> corresponding + * to a <code>PPB_Buffer_Dev</code> resource that contains an encrypted video + * 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] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that - * contains all auxiliary information needed for decryption of the - * <code>encrypted_block</code>. + * @param[in] encrypted_video_frame_info A + * <code>PP_EncryptedVideoFrameInfo</code> that contains all information + * needed to decrypt and decode <code>encrypted_video_frame</code>. */ - void (*DecryptAndDecode)( + void (*DecryptAndDecodeFrame)( PP_Instance instance, - PP_Resource encrypted_block, - const struct PP_EncryptedBlockInfo* encrypted_block_info); + PP_Resource encrypted_video_frame, + const struct PP_EncryptedVideoFrameInfo* encrypted_video_frame_info); }; -typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; +typedef struct PPP_ContentDecryptor_Private_0_2 PPP_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 585f1fb..7dbce34 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -105,19 +105,20 @@ void Decrypt(PP_Instance instance, *encrypted_block_info); } -void DecryptAndDecode(PP_Instance instance, - PP_Resource encrypted_resource, - const PP_EncryptedBlockInfo* encrypted_block_info) { +void DecryptAndDecodeFrame( + PP_Instance instance, + PP_Resource encrypted_resource, + const PP_EncryptedVideoFrameInfo* encrypted_video_frame_info) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Buffer_Dev encrypted_block(pp::PassRef(), encrypted_resource); + pp::Buffer_Dev encrypted_frame(pp::PassRef(), encrypted_resource); - static_cast<ContentDecryptor_Private*>(object)->DecryptAndDecode( - encrypted_block, - *encrypted_block_info); + static_cast<ContentDecryptor_Private*>(object)->DecryptAndDecodeFrame( + encrypted_frame, + *encrypted_video_frame_info); } const PPP_ContentDecryptor_Private ppp_content_decryptor = { @@ -125,7 +126,7 @@ const PPP_ContentDecryptor_Private ppp_content_decryptor = { &AddKey, &CancelKeyRequest, &Decrypt, - &DecryptAndDecode + &DecryptAndDecodeFrame }; template <> const char* interface_name<PPB_ContentDecryptor_Private>() { diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index 3a88876..7a6189b 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -36,9 +36,9 @@ class ContentDecryptor_Private { virtual void CancelKeyRequest(const std::string& session_id) = 0; virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo& encrypted_block_info) = 0; - virtual void DecryptAndDecode( - pp::Buffer_Dev encrypted_buffer, - const PP_EncryptedBlockInfo& encrypted_block_info) = 0; + virtual void DecryptAndDecodeFrame( + pp::Buffer_Dev encrypted_frame, + const PP_EncryptedVideoFrameInfo& encrypted_video_frame_info) = 0; // PPB_ContentDecryptor_Private methods for passing data from the decryptor // to the browser. diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index b870c48..24089d2 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* Last generated from IDL: Wed Oct 3 12:53:07 2012. */ +/* Last generated from IDL: Wed Oct 3 16:17:09 2012. */ #include "ppapi/generators/pnacl_shim.h" #include "ppapi/c/ppb.h" @@ -230,7 +230,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_3; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_3; @@ -3302,39 +3302,39 @@ struct PP_Var Pnacl_M19_PPB_X509Certificate_Private_GetField(PP_Resource resourc /* End wrapper methods for PPB_X509Certificate_Private_0_1 */ -/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_1 */ +/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_2 */ static void Pnacl_M23_PPP_ContentDecryptor_Private_GenerateKeyRequest(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_1 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1.real_iface; + const struct PPP_ContentDecryptor_Private_0_2 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data))iface->GenerateKeyRequest); temp_fp(instance, key_system, init_data); } static void Pnacl_M23_PPP_ContentDecryptor_Private_AddKey(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_1 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1.real_iface; + const struct PPP_ContentDecryptor_Private_0_2 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data))iface->AddKey); temp_fp(instance, session_id, key, init_data); } static void Pnacl_M23_PPP_ContentDecryptor_Private_CancelKeyRequest(PP_Instance instance, struct PP_Var session_id) { - const struct PPP_ContentDecryptor_Private_0_1 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1.real_iface; + const struct PPP_ContentDecryptor_Private_0_2 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, struct PP_Var session_id) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, struct PP_Var session_id))iface->CancelKeyRequest); temp_fp(instance, session_id); } static void Pnacl_M23_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_1 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1.real_iface; + const struct PPP_ContentDecryptor_Private_0_2 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->Decrypt); temp_fp(instance, encrypted_block, encrypted_block_info); } -static void Pnacl_M23_PPP_ContentDecryptor_Private_DecryptAndDecode(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_1 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1.real_iface; - void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->DecryptAndDecode); - temp_fp(instance, encrypted_block, encrypted_block_info); +static void Pnacl_M23_PPP_ContentDecryptor_Private_DecryptAndDecodeFrame(PP_Instance instance, PP_Resource encrypted_video_frame, const struct PP_EncryptedVideoFrameInfo* encrypted_video_frame_info) { + const struct PPP_ContentDecryptor_Private_0_2 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2.real_iface; + void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_Resource encrypted_video_frame, const struct PP_EncryptedVideoFrameInfo* encrypted_video_frame_info) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_Resource encrypted_video_frame, const struct PP_EncryptedVideoFrameInfo* encrypted_video_frame_info))iface->DecryptAndDecodeFrame); + temp_fp(instance, encrypted_video_frame, encrypted_video_frame_info); } -/* End wrapper methods for PPP_ContentDecryptor_Private_0_1 */ +/* End wrapper methods for PPP_ContentDecryptor_Private_0_2 */ /* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ @@ -4102,12 +4102,12 @@ struct PPB_X509Certificate_Private_0_1 Pnacl_Wrappers_PPB_X509Certificate_Privat .GetField = (struct PP_Var (*)(PP_Resource resource, PP_X509Certificate_Private_Field field))&Pnacl_M19_PPB_X509Certificate_Private_GetField }; -struct PPP_ContentDecryptor_Private_0_1 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_1 = { +struct PPP_ContentDecryptor_Private_0_2 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_2 = { .GenerateKeyRequest = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data))&Pnacl_M23_PPP_ContentDecryptor_Private_GenerateKeyRequest, .AddKey = (void (*)(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data))&Pnacl_M23_PPP_ContentDecryptor_Private_AddKey, .CancelKeyRequest = (void (*)(PP_Instance instance, struct PP_Var session_id))&Pnacl_M23_PPP_ContentDecryptor_Private_CancelKeyRequest, .Decrypt = (void (*)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))&Pnacl_M23_PPP_ContentDecryptor_Private_Decrypt, - .DecryptAndDecode = (void (*)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))&Pnacl_M23_PPP_ContentDecryptor_Private_DecryptAndDecode + .DecryptAndDecodeFrame = (void (*)(PP_Instance instance, PP_Resource encrypted_video_frame, const struct PP_EncryptedVideoFrameInfo* encrypted_video_frame_info))&Pnacl_M23_PPP_ContentDecryptor_Private_DecryptAndDecodeFrame }; /* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_0 */ @@ -4842,9 +4842,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0 .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1 = { - .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_1, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2 = { + .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_2, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_2, .real_iface = NULL }; @@ -4992,7 +4992,7 @@ static struct __PnaclWrapperInfo *s_ppp_wrappers[] = { &Pnacl_WrapperInfo_PPP_VideoDecoder_Dev_0_11, &Pnacl_WrapperInfo_PPP_Widget_Dev_0_2, &Pnacl_WrapperInfo_PPP_Zoom_Dev_0_3, - &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_1, + &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2, &Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_0, &Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_2, &Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_3, diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 46be53d..8ac0886 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -624,7 +624,7 @@ IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt, PP_Instance /* instance */, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, std::string /* serialized_block_info */) -IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_DecryptAndDecode, +IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame, PP_Instance /* instance */, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, std::string /* serialized_block_info */) diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 836f2d0..91d8115 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -185,30 +185,31 @@ void Decrypt(PP_Instance instance, serialized_block_info)); } -void DecryptAndDecode(PP_Instance instance, - PP_Resource encrypted_block, - const PP_EncryptedBlockInfo* encrypted_block_info) { +void DecryptAndDecodeFrame( + PP_Instance instance, + PP_Resource encrypted_frame, + const PP_EncryptedVideoFrameInfo* encrypted_video_frame_info) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - if (!AddRefResourceForPlugin(dispatcher, encrypted_block)) { + if (!AddRefResourceForPlugin(dispatcher, encrypted_frame)) { NOTREACHED(); return; } HostResource host_resource; - host_resource.SetHostResource(instance, encrypted_block); + host_resource.SetHostResource(instance, encrypted_frame); uint32_t size = 0; - if (DescribeHostBufferResource(encrypted_block, &size) == PP_FALSE) + if (DescribeHostBufferResource(encrypted_frame, &size) == PP_FALSE) return; base::SharedMemoryHandle handle; if (ShareHostBufferResourceToPlugin(dispatcher, - encrypted_block, + encrypted_frame, &handle) == PP_FALSE) return; @@ -217,16 +218,16 @@ void DecryptAndDecode(PP_Instance instance, buffer.handle = handle; buffer.size = size; - std::string serialized_block_info; - if (!SerializeBlockInfo(*encrypted_block_info, &serialized_block_info)) + std::string serialized_frame_info; + if (!SerializeBlockInfo(*encrypted_video_frame_info, &serialized_frame_info)) return; dispatcher->Send( - new PpapiMsg_PPPContentDecryptor_DecryptAndDecode( + new PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, buffer, - serialized_block_info)); + serialized_frame_info)); } static const PPP_ContentDecryptor_Private content_decryptor_interface = { @@ -234,7 +235,7 @@ static const PPP_ContentDecryptor_Private content_decryptor_interface = { &AddKey, &CancelKeyRequest, &Decrypt, - &DecryptAndDecode + &DecryptAndDecodeFrame }; } // namespace @@ -271,8 +272,8 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( OnMsgCancelKeyRequest) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, OnMsgDecrypt) - IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecode, - OnMsgDecryptAndDecode) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame, + OnMsgDecryptAndDecodeFrame) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() DCHECK(handled); @@ -334,22 +335,23 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgDecrypt( } } -void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecode( +void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecodeFrame( PP_Instance instance, - const PPPDecryptor_Buffer& encrypted_buffer, - const std::string& serialized_block_info) { + const PPPDecryptor_Buffer& encrypted_frame, + const std::string& serialized_frame_info) { if (ppp_decryptor_impl_) { PP_Resource plugin_resource = - PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, - encrypted_buffer.handle, - encrypted_buffer.size); - PP_EncryptedBlockInfo block_info; - if (!DeserializeBlockInfo(serialized_block_info, &block_info)) + PPB_Buffer_Proxy::AddProxyResource(encrypted_frame.resource, + encrypted_frame.handle, + encrypted_frame.size); + PP_EncryptedVideoFrameInfo frame_info; + if (!DeserializeBlockInfo(serialized_frame_info, &frame_info)) return; - CallWhileUnlocked(ppp_decryptor_impl_->DecryptAndDecode, - instance, - plugin_resource, - const_cast<const PP_EncryptedBlockInfo*>(&block_info)); + CallWhileUnlocked( + ppp_decryptor_impl_->DecryptAndDecodeFrame, + instance, + plugin_resource, + const_cast<const PP_EncryptedVideoFrameInfo*>(&frame_info)); } } diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index a9a8f22..db7c51b 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -42,10 +42,10 @@ class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy { void OnMsgDecrypt(PP_Instance instance, const PPPDecryptor_Buffer& encrypted_buffer, const std::string& serialized_encrypted_block_info); - void OnMsgDecryptAndDecode( + void OnMsgDecryptAndDecodeFrame( PP_Instance instance, - const PPPDecryptor_Buffer& encrypted_buffer, - const std::string& serialized_encrypted_block_info); + const PPPDecryptor_Buffer& encrypted_frame, + const std::string& serialized_encrypted_frame_info); const PPP_ContentDecryptor_Private* ppp_decryptor_impl_; |