diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 22:33:46 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 22:33:46 +0000 |
commit | c999b3b75419fa519b0e1d9dc0555e99c0fd6cc9 (patch) | |
tree | 9743ca0d35dfd50a465e2cec34445653b2c05e93 /ppapi | |
parent | 32eaac1d3ef86437237860cca64b4ec66cbc7d0c (diff) | |
download | chromium_src-c999b3b75419fa519b0e1d9dc0555e99c0fd6cc9.zip chromium_src-c999b3b75419fa519b0e1d9dc0555e99c0fd6cc9.tar.gz chromium_src-c999b3b75419fa519b0e1d9dc0555e99c0fd6cc9.tar.bz2 |
Add pepper content decryption audio decoding API.
BUG=141780
TEST=
Review URL: https://chromiumcodereview.appspot.com/11144011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163079 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/ppb_content_decryptor_private.idl | 28 | ||||
-rw-r--r-- | ppapi/api/private/ppp_content_decryptor_private.idl | 30 | ||||
-rw-r--r-- | ppapi/c/private/pp_content_decryptor.h | 77 | ||||
-rw-r--r-- | ppapi/c/private/ppb_content_decryptor_private.h | 38 | ||||
-rw-r--r-- | ppapi/c/private/ppp_content_decryptor_private.h | 40 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.cc | 35 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.h | 9 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 89 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 14 | ||||
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 44 | ||||
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.h | 19 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.cc | 62 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.h | 4 | ||||
-rw-r--r-- | ppapi/thunk/interfaces_ppb_private.h | 4 | ||||
-rw-r--r-- | ppapi/thunk/ppb_content_decryptor_private_thunk.cc | 23 | ||||
-rw-r--r-- | ppapi/thunk/ppb_instance_api.h | 9 |
17 files changed, 445 insertions, 145 deletions
diff --git a/ppapi/api/private/pp_content_decryptor.idl b/ppapi/api/private/pp_content_decryptor.idl index 24059d42..01ea3bf 100644 --- a/ppapi/api/private/pp_content_decryptor.idl +++ b/ppapi/api/private/pp_content_decryptor.idl @@ -125,15 +125,6 @@ enum PP_DecryptedFrameFormat { }; /** - * <code>PP_VideoCodec</code> contains video codec type constants. - */ -[assert_size(4)] -enum PP_VideoCodec { - PP_VIDEOCODEC_UNKNOWN = 0, - PP_VIDEOCODEC_VP8 = 1 -}; - -/** * The <code>PP_DecryptResult</code> enum contains decryption and decoding * result constants. */ @@ -228,6 +219,62 @@ struct PP_DecryptedFrameInfo { }; /** + * <code>PP_AudioCodec</code> contains audio codec type constants. + */ +[assert_size(4)] +enum PP_AudioCodec { + PP_AUDIOCODEC_UNKNOWN = 0, + PP_AUDIOCODEC_VORBIS = 1 +}; + +/** + * <code>PP_AudioDecoderConfig</code> contains audio decoder configuration + * information required to initialize audio decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When <code>codec</code> requires extra data for + * initialization, the data is sent as a <code>PP_Resource</code> carried + * alongside <code>PP_AudioDecoderConfig</code>. + */ + [assert_size(20)] +struct PP_AudioDecoderConfig { + /** + * The audio codec to initialize. + */ + PP_AudioCodec codec; + + /** + * Number of audio channels. + */ + int32_t channel_count; + + /** + * Size of each audio channel. + */ + int32_t bits_per_channel; + + /** + * Audio sampling rate. + */ + int32_t samples_per_second; + + /** + * Client-specified identifier for the associated audio decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; + +/** + * <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_VideoCodecProfile</code> contains video codec profile type * constants required for video decoder configuration. *. diff --git a/ppapi/api/private/ppb_content_decryptor_private.idl b/ppapi/api/private/ppb_content_decryptor_private.idl index 021c8ea..b362a9e 100644 --- a/ppapi/api/private/ppb_content_decryptor_private.idl +++ b/ppapi/api/private/ppb_content_decryptor_private.idl @@ -9,7 +9,7 @@ * Decryption Modules, not normal plugins. */ label Chrome { - M24 = 0.3 + M24 = 0.4 }; /** @@ -155,15 +155,19 @@ interface PPB_ContentDecryptor_Private { * <code>PP_TRUE</code> when the decoder initialization request associated * with <code>request_id</code> was successful. * + * @param[in] decoder_type A <code>PP_DecryptorStreamType</code> identifying + * the decoder type for which this initialization status response was sent. + * * @param[in] request_id The <code>request_id</code> value passed to * <code>InitializeAudioDecoder</code> or <code>InitializeVideoDecoder</code> * in <code>PP_AudioDecoderConfig</code> or * <code>PP_VideoDecoderConfig</code>. */ - void DecoderInitialized( + void DecoderInitializeDone( [in] PP_Instance instance, - [in] PP_Bool success, - [in] uint32_t request_id); + [in] PP_DecryptorStreamType decoder_type, + [in] uint32_t request_id, + [in] PP_Bool success); /** * Called after the <code>DeinitializeDecoder()</code> method on the @@ -220,7 +224,19 @@ interface PPB_ContentDecryptor_Private { * deliver a buffer of decrypted and decoded audio samples to the browser for * rendering. * - * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a + * <code>audio_frames</code> can contain multiple audio output buffers. Each + * buffer is serialized in this format: + * + * |<------------------- serialized audio buffer ------------------->| + * | int64_t timestamp | int64_t length | length bytes of audio data | + * + * For example, with three audio output buffers, |audio_frames| will look + * like this: + * + * |<---------------- audio_frames ------------------>| + * | audio buffer 0 | audio buffer 1 | audio buffer 2 | + * + * @param[in] audio_frames A <code>PP_Resource</code> corresponding to a * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer * of decoded audio samples. * @@ -230,6 +246,6 @@ interface PPB_ContentDecryptor_Private { */ void DeliverSamples( [in] PP_Instance instance, - [in] PP_Resource decrypted_samples, + [in] PP_Resource audio_frames, [in] PP_DecryptedBlockInfo decrypted_block_info); }; diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 1e9c4d2..0fa19ae 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 { - M24 = 0.3 + M24 = 0.4 }; /** @@ -100,14 +100,36 @@ interface PPP_ContentDecryptor_Private { [in] PP_EncryptedBlockInfo encrypted_block_info); /** - * Initializes the video decoder using codec and settings in + * Initializes the audio decoder using codec and settings in * <code>decoder_config</code>, and returns the result of the initialization - * request to the browser using the <code>DecoderInitialized()</code> method + * request to the browser using the <code>DecoderInitializeDone()</code> method * on the <code>PPB_ContentDecryptor_Private</code> interface. * + * @param[in] decoder_config A <code>PP_AudioDecoderConfig</code> that + * contains audio decoder settings and a request ID. The request ID is passed + * to the <code>DecoderInitializeDone()</code> method on the + * <code>PPB_ContentDecryptor_Private</code> interface to allow clients to + * associate the result with a audio decoder initialization request. + * + * @param[in] codec_extra_data A <code>PP_Resource</code> corresponding to a + * <code>PPB_Buffer_Dev</code> resource containing codec setup data required + * by some codecs. It should be set to 0 when the codec being initialized + * does not require it. + */ + void InitializeAudioDecoder( + [in] PP_Instance instance, + [in] PP_AudioDecoderConfig decoder_config, + [in] PP_Resource codec_extra_data); + + /** + * Initializes the video decoder using codec and settings in + * <code>decoder_config</code>, and returns the result of the initialization + * request to the browser using the <code>DecoderInitializeDone()</code> + * method on the <code>PPB_ContentDecryptor_Private</code> interface. + * * @param[in] decoder_config A <code>PP_VideoDecoderConfig</code> that * contains video decoder settings and a request ID. The request ID is passed - * to the <code>DecoderInitialized()</code> method on the + * to the <code>DecoderInitializeDone()</code> method on the * <code>PPB_ContentDecryptor_Private</code> interface to allow clients to * associate the result with a video decoder initialization request. * diff --git a/ppapi/c/private/pp_content_decryptor.h b/ppapi/c/private/pp_content_decryptor.h index 2ddc107..65e69b8 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 Thu Oct 11 22:13:01 2012. */ +/* From private/pp_content_decryptor.idl modified Tue Oct 16 23:14:26 2012. */ #ifndef PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ #define PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ @@ -140,15 +140,6 @@ typedef enum { 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); - -/** * The <code>PP_DecryptResult</code> enum contains decryption and decoding * result constants. */ @@ -263,6 +254,72 @@ PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56); * @{ */ /** + * <code>PP_AudioCodec</code> contains audio codec type constants. + */ +typedef enum { + PP_AUDIOCODEC_UNKNOWN = 0, + PP_AUDIOCODEC_VORBIS = 1 +} PP_AudioCodec; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_AudioCodec, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * <code>PP_AudioDecoderConfig</code> contains audio decoder configuration + * information required to initialize audio decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When <code>codec</code> requires extra data for + * initialization, the data is sent as a <code>PP_Resource</code> carried + * alongside <code>PP_AudioDecoderConfig</code>. + */ +struct PP_AudioDecoderConfig { + /** + * The audio codec to initialize. + */ + PP_AudioCodec codec; + /** + * Number of audio channels. + */ + int32_t channel_count; + /** + * Size of each audio channel. + */ + int32_t bits_per_channel; + /** + * Audio sampling rate. + */ + int32_t samples_per_second; + /** + * Client-specified identifier for the associated audio decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_AudioDecoderConfig, 20); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * <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); + +/** * <code>PP_VideoCodecProfile</code> contains video codec profile type * constants required for video decoder configuration. *. diff --git a/ppapi/c/private/ppb_content_decryptor_private.h b/ppapi/c/private/ppb_content_decryptor_private.h index 0d9af4e..8b00d22 100644 --- a/ppapi/c/private/ppb_content_decryptor_private.h +++ b/ppapi/c/private/ppb_content_decryptor_private.h @@ -4,7 +4,7 @@ */ /* From private/ppb_content_decryptor_private.idl, - * modified Thu Oct 11 20:30:13 2012. + * modified Fri Oct 19 10:45:02 2012. */ #ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ @@ -18,10 +18,10 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_content_decryptor.h" -#define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3 \ - "PPB_ContentDecryptor_Private;0.3" +#define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4 \ + "PPB_ContentDecryptor_Private;0.4" #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3 + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4 /** * @file @@ -42,7 +42,7 @@ * browser side support for the Content Decryption Module (CDM) for v0.1 of the * proposed Encrypted Media Extensions: http://goo.gl/rbdnR */ -struct PPB_ContentDecryptor_Private_0_3 { +struct PPB_ContentDecryptor_Private_0_4 { /** * The decryptor requires a key that has not been provided. * @@ -169,14 +169,18 @@ struct PPB_ContentDecryptor_Private_0_3 { * <code>PP_TRUE</code> when the decoder initialization request associated * with <code>request_id</code> was successful. * + * @param[in] decoder_type A <code>PP_DecryptorStreamType</code> identifying + * the decoder type for which this initialization status response was sent. + * * @param[in] request_id The <code>request_id</code> value passed to * <code>InitializeAudioDecoder</code> or <code>InitializeVideoDecoder</code> * in <code>PP_AudioDecoderConfig</code> or * <code>PP_VideoDecoderConfig</code>. */ - void (*DecoderInitialized)(PP_Instance instance, - PP_Bool success, - uint32_t request_id); + void (*DecoderInitializeDone)(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success); /** * Called after the <code>DeinitializeDecoder()</code> method on the * <code>PPP_ContentDecryptor_Private</code> interface completes to report @@ -227,7 +231,19 @@ struct PPB_ContentDecryptor_Private_0_3 { * deliver a buffer of decrypted and decoded audio samples to the browser for * rendering. * - * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a + * <code>audio_frames</code> can contain multiple audio output buffers. Each + * buffer is serialized in this format: + * + * |<------------------- serialized audio buffer ------------------->| + * | int64_t timestamp | int64_t length | length bytes of audio data | + * + * For example, with three audio output buffers, |audio_frames| will look + * like this: + * + * |<---------------- audio_frames ------------------>| + * | audio buffer 0 | audio buffer 1 | audio buffer 2 | + * + * @param[in] audio_frames A <code>PP_Resource</code> corresponding to a * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer * of decoded audio samples. * @@ -237,11 +253,11 @@ struct PPB_ContentDecryptor_Private_0_3 { */ void (*DeliverSamples)( PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const struct PP_DecryptedBlockInfo* decrypted_block_info); }; -typedef struct PPB_ContentDecryptor_Private_0_3 PPB_ContentDecryptor_Private; +typedef struct PPB_ContentDecryptor_Private_0_4 PPB_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index da30fa9..c25470a 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 Thu Oct 11 22:28:01 2012. + * modified Fri Oct 19 10:45:02 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_3 \ - "PPP_ContentDecryptor_Private;0.3" +#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4 \ + "PPP_ContentDecryptor_Private;0.4" #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3 + PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4 /** * @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_3 { +struct PPP_ContentDecryptor_Private_0_4 { /** * 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,14 +114,36 @@ struct PPP_ContentDecryptor_Private_0_3 { PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info); /** - * Initializes the video decoder using codec and settings in + * Initializes the audio decoder using codec and settings in * <code>decoder_config</code>, and returns the result of the initialization - * request to the browser using the <code>DecoderInitialized()</code> method + * request to the browser using the <code>DecoderInitializeDone( + )</code> method * on the <code>PPB_ContentDecryptor_Private</code> interface. * + * @param[in] decoder_config A <code>PP_AudioDecoderConfig</code> that + * contains audio decoder settings and a request ID. The request ID is passed + * to the <code>DecoderInitializeDone()</code> method on the + * <code>PPB_ContentDecryptor_Private</code> interface to allow clients to + * associate the result with a audio decoder initialization request. + * + * @param[in] codec_extra_data A <code>PP_Resource</code> corresponding to a + * <code>PPB_Buffer_Dev</code> resource containing codec setup data required + * by some codecs. It should be set to 0 when the codec being initialized + * does not require it. + */ + void (*InitializeAudioDecoder)( + PP_Instance instance, + const struct PP_AudioDecoderConfig* decoder_config, + PP_Resource codec_extra_data); + /** + * Initializes the video decoder using codec and settings in + * <code>decoder_config</code>, and returns the result of the initialization + * request to the browser using the <code>DecoderInitializeDone()</code> + * method on the <code>PPB_ContentDecryptor_Private</code> interface. + * * @param[in] decoder_config A <code>PP_VideoDecoderConfig</code> that * contains video decoder settings and a request ID. The request ID is passed - * to the <code>DecoderInitialized()</code> method on the + * to the <code>DecoderInitializeDone()</code> method on the * <code>PPB_ContentDecryptor_Private</code> interface to allow clients to * associate the result with a video decoder initialization request. * @@ -200,7 +222,7 @@ struct PPP_ContentDecryptor_Private_0_3 { const struct PP_EncryptedBlockInfo* encrypted_block_info); }; -typedef struct PPP_ContentDecryptor_Private_0_3 PPP_ContentDecryptor_Private; +typedef struct PPP_ContentDecryptor_Private_0_4 PPP_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 15f3688..90842c3 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -105,6 +105,22 @@ void Decrypt(PP_Instance instance, *encrypted_block_info); } +void InitializeAudioDecoder( + PP_Instance instance, + const PP_AudioDecoderConfig* decoder_config, + PP_Resource extra_data_resource) { + void* object = + Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); + if (!object) + return; + + pp::Buffer_Dev extra_data_buffer(pp::PASS_REF, extra_data_resource); + + static_cast<ContentDecryptor_Private*>(object)->InitializeAudioDecoder( + *decoder_config, + extra_data_buffer); +} + void InitializeVideoDecoder( PP_Instance instance, const PP_VideoDecoderConfig* decoder_config, @@ -166,6 +182,7 @@ const PPP_ContentDecryptor_Private ppp_content_decryptor = { &AddKey, &CancelKeyRequest, &Decrypt, + &InitializeAudioDecoder, &InitializeVideoDecoder, &DeinitializeDecoder, &ResetDecoder, @@ -263,14 +280,16 @@ void ContentDecryptor_Private::DeliverBlock( } } -void ContentDecryptor_Private::DecoderInitialized( - bool success, - uint32_t request_id) { +void ContentDecryptor_Private::DecoderInitializeDone( + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + bool success) { if (has_interface<PPB_ContentDecryptor_Private>()) { - get_interface<PPB_ContentDecryptor_Private>()->DecoderInitialized( + get_interface<PPB_ContentDecryptor_Private>()->DecoderInitializeDone( associated_instance_.pp_instance(), - PP_FromBool(success), - request_id); + decoder_type, + request_id, + PP_FromBool(success)); } } @@ -308,12 +327,12 @@ void ContentDecryptor_Private::DeliverFrame( } void ContentDecryptor_Private::DeliverSamples( - pp::Buffer_Dev decrypted_samples, + pp::Buffer_Dev audio_frames, const PP_DecryptedBlockInfo& decrypted_block_info) { if (has_interface<PPB_ContentDecryptor_Private>()) { get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples( associated_instance_.pp_instance(), - decrypted_samples.pp_resource(), + audio_frames.pp_resource(), &decrypted_block_info); } } diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index be70158..08b31a3 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -36,6 +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 InitializeAudioDecoder( + const PP_AudioDecoderConfig& decoder_config, + pp::Buffer_Dev extra_data_resource) = 0; virtual void InitializeVideoDecoder( const PP_VideoDecoderConfig& decoder_config, pp::Buffer_Dev extra_data_resource) = 0; @@ -66,14 +69,16 @@ class ContentDecryptor_Private { int32_t system_code); void DeliverBlock(pp::Buffer_Dev decrypted_block, const PP_DecryptedBlockInfo& decrypted_block_info); - void DecoderInitialized(bool status, uint32_t request_id); + void DecoderInitializeDone(PP_DecryptorStreamType decoder_type, + uint32_t request_id, + bool status); void DecoderDeinitializeDone(PP_DecryptorStreamType decoder_type, uint32_t request_id); void DecoderResetDone(PP_DecryptorStreamType decoder_type, uint32_t request_id); void DeliverFrame(pp::Buffer_Dev decrypted_frame, const PP_DecryptedFrameInfo& decrypted_frame_info); - void DeliverSamples(pp::Buffer_Dev decrypted_samples, + void DeliverSamples(pp::Buffer_Dev audio_frames, const PP_DecryptedBlockInfo& decrypted_block_info); private: 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 eb3cb77..2f3bb66 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 17 11:39:28 2012. */ +/* Last generated from IDL: Fri Oct 19 10:45:30 2012. */ #include "ppapi/generators/pnacl_shim.h" #include "ppapi/c/ppb.h" @@ -203,7 +203,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_VideoDecoder_Dev_0_10; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_VideoDecoder_Dev_0_11; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Widget_Dev_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Zoom_Dev_0_3; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRefPrivate_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_12_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_12_1; @@ -238,7 +238,7 @@ 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_UMA_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4; 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; @@ -1955,69 +1955,69 @@ void Pnacl_M14_PPB_VideoDecoder_Dev_Destroy(PP_Resource video_decoder) { /* Not generating wrapper methods for PPP_Zoom_Dev_0_3 */ -/* Begin wrapper methods for PPB_ContentDecryptor_Private_0_3 */ +/* Begin wrapper methods for PPB_ContentDecryptor_Private_0_4 */ static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_NeedKey(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var init_data) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->NeedKey(instance, key_system, session_id, init_data); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_KeyAdded(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->KeyAdded(instance, key_system, session_id); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, PP_Resource message, struct PP_Var default_url) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->KeyMessage(instance, key_system, session_id, message, default_url); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_KeyError(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, int32_t media_error, int32_t system_code) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->KeyError(instance, key_system, session_id, media_error, system_code); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->DeliverBlock(instance, decrypted_block, decrypted_block_info); } static __attribute__((pnaclcall)) -void Pnacl_M24_PPB_ContentDecryptor_Private_DecoderInitialized(PP_Instance instance, PP_Bool success, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; - iface->DecoderInitialized(instance, success, request_id); +void Pnacl_M24_PPB_ContentDecryptor_Private_DecoderInitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success) { + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; + iface->DecoderInitializeDone(instance, decoder_type, request_id, success); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->DecoderDeinitializeDone(instance, decoder_type, request_id); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_DecoderResetDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->DecoderResetDone(instance, decoder_type, request_id); } static __attribute__((pnaclcall)) void Pnacl_M24_PPB_ContentDecryptor_Private_DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; iface->DeliverFrame(instance, decrypted_frame, decrypted_frame_info); } static __attribute__((pnaclcall)) -void Pnacl_M24_PPB_ContentDecryptor_Private_DeliverSamples(PP_Instance instance, PP_Resource decrypted_samples, const struct PP_DecryptedBlockInfo* decrypted_block_info) { - const struct PPB_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3.real_iface; - iface->DeliverSamples(instance, decrypted_samples, decrypted_block_info); +void Pnacl_M24_PPB_ContentDecryptor_Private_DeliverSamples(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedBlockInfo* decrypted_block_info) { + const struct PPB_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4.real_iface; + iface->DeliverSamples(instance, audio_frames, decrypted_block_info); } -/* End wrapper methods for PPB_ContentDecryptor_Private_0_3 */ +/* End wrapper methods for PPB_ContentDecryptor_Private_0_4 */ /* Begin wrapper methods for PPB_FileRefPrivate_0_1 */ @@ -3437,57 +3437,63 @@ 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_3 */ +/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_4 */ static void Pnacl_M24_PPP_ContentDecryptor_Private_GenerateKeyRequest(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.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_M24_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_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.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_M24_PPP_ContentDecryptor_Private_CancelKeyRequest(PP_Instance instance, struct PP_Var session_id) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.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_M24_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.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_M24_PPP_ContentDecryptor_Private_InitializeAudioDecoder(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) { + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.real_iface; + void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeAudioDecoder); + temp_fp(instance, decoder_config, codec_extra_data); +} + static void Pnacl_M24_PPP_ContentDecryptor_Private_InitializeVideoDecoder(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeVideoDecoder); temp_fp(instance, decoder_config, codec_extra_data); } static void Pnacl_M24_PPP_ContentDecryptor_Private_DeinitializeDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->DeinitializeDecoder); temp_fp(instance, decoder_type, request_id); } static void Pnacl_M24_PPP_ContentDecryptor_Private_ResetDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->ResetDecoder); temp_fp(instance, decoder_type, request_id); } static void Pnacl_M24_PPP_ContentDecryptor_Private_DecryptAndDecode(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_3 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3.real_iface; + const struct PPP_ContentDecryptor_Private_0_4 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4.real_iface; void (__attribute__((pnaclcall)) *temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (__attribute__((pnaclcall)) *)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->DecryptAndDecode); temp_fp(instance, decoder_type, encrypted_buffer, encrypted_block_info); } -/* End wrapper methods for PPP_ContentDecryptor_Private_0_3 */ +/* End wrapper methods for PPP_ContentDecryptor_Private_0_4 */ /* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ @@ -3970,17 +3976,17 @@ struct PPB_VideoDecoder_Dev_0_16 Pnacl_Wrappers_PPB_VideoDecoder_Dev_0_16 = { /* Not generating wrapper interface for PPP_Zoom_Dev_0_3 */ -struct PPB_ContentDecryptor_Private_0_3 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_3 = { +struct PPB_ContentDecryptor_Private_0_4 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_4 = { .NeedKey = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var init_data))&Pnacl_M24_PPB_ContentDecryptor_Private_NeedKey, .KeyAdded = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyAdded, .KeyMessage = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, PP_Resource message, struct PP_Var default_url))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage, .KeyError = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, int32_t media_error, int32_t system_code))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyError, .DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M24_PPB_ContentDecryptor_Private_DeliverBlock, - .DecoderInitialized = (void (*)(PP_Instance instance, PP_Bool success, uint32_t request_id))&Pnacl_M24_PPB_ContentDecryptor_Private_DecoderInitialized, + .DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M24_PPB_ContentDecryptor_Private_DecoderInitializeDone, .DecoderDeinitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M24_PPB_ContentDecryptor_Private_DecoderDeinitializeDone, .DecoderResetDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M24_PPB_ContentDecryptor_Private_DecoderResetDone, .DeliverFrame = (void (*)(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info))&Pnacl_M24_PPB_ContentDecryptor_Private_DeliverFrame, - .DeliverSamples = (void (*)(PP_Instance instance, PP_Resource decrypted_samples, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M24_PPB_ContentDecryptor_Private_DeliverSamples + .DeliverSamples = (void (*)(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M24_PPB_ContentDecryptor_Private_DeliverSamples }; struct PPB_FileRefPrivate_0_1 Pnacl_Wrappers_PPB_FileRefPrivate_0_1 = { @@ -4294,11 +4300,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_3 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_3 = { +struct PPP_ContentDecryptor_Private_0_4 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_4 = { .GenerateKeyRequest = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var init_data))&Pnacl_M24_PPP_ContentDecryptor_Private_GenerateKeyRequest, .AddKey = (void (*)(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data))&Pnacl_M24_PPP_ContentDecryptor_Private_AddKey, .CancelKeyRequest = (void (*)(PP_Instance instance, struct PP_Var session_id))&Pnacl_M24_PPP_ContentDecryptor_Private_CancelKeyRequest, .Decrypt = (void (*)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))&Pnacl_M24_PPP_ContentDecryptor_Private_Decrypt, + .InitializeAudioDecoder = (void (*)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data))&Pnacl_M24_PPP_ContentDecryptor_Private_InitializeAudioDecoder, .InitializeVideoDecoder = (void (*)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data))&Pnacl_M24_PPP_ContentDecryptor_Private_InitializeVideoDecoder, .DeinitializeDecoder = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M24_PPP_ContentDecryptor_Private_DeinitializeDecoder, .ResetDecoder = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M24_PPP_ContentDecryptor_Private_ResetDecoder, @@ -4855,9 +4862,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Zoom_Dev_0_3 = { .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3 = { - .iface_macro = PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_3, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4 = { + .iface_macro = PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_4, .real_iface = NULL }; @@ -5065,9 +5072,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0 .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_3 = { - .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_3, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4 = { + .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_4, .real_iface = NULL }; @@ -5172,7 +5179,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_Widget_Dev_0_3, &Pnacl_WrapperInfo_PPB_Widget_Dev_0_4, &Pnacl_WrapperInfo_PPB_Zoom_Dev_0_2, - &Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_3, + &Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_4, &Pnacl_WrapperInfo_PPB_FileRefPrivate_0_1, &Pnacl_WrapperInfo_PPB_Flash_12_0, &Pnacl_WrapperInfo_PPB_Flash_12_1, @@ -5225,7 +5232,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_3, + &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_4, &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 113c526..361c19e 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -647,6 +647,11 @@ IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, std::string /* serialized_block_info */) IPC_MESSAGE_ROUTED3( + PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, + PP_Instance /* instance */, + std::string /* serialized_decoder_config */, + ppapi::proxy::PPPDecryptor_Buffer /* extra_data_buffer */) +IPC_MESSAGE_ROUTED3( PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder, PP_Instance /* instance */, std::string /* serialized_decoder_config */, @@ -1246,10 +1251,11 @@ IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverBlock, PP_Instance /* instance */, PP_Resource /* decrypted_block, PPB_Buffer_Dev */, std::string /* serialized_block_info */) -IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DecoderInitialized, +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_DecoderInitializeDone, PP_Instance /* instance */, - PP_Bool /* success */, - uint32_t /* request_id */) + PP_DecryptorStreamType /* decoder_type */, + uint32_t /* request_id */, + PP_Bool /* success */) IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, PP_Instance /* instance */, PP_DecryptorStreamType /* decoder_type */, @@ -1264,7 +1270,7 @@ IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverFrame, std::string /* serialized_block_info */) IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverSamples, PP_Instance /* instance */, - PP_Resource /* decrypted_samples, PPB_Buffer_Dev */, + PP_Resource /* audio_frames, PPB_Buffer_Dev */, std::string /* serialized_block_info */) #endif // !defined(OS_NACL) && !defined(NACL_WIN64) diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 1f35ccd..90dd586 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -167,8 +167,8 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { OnHostMsgKeyError) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, OnHostMsgDeliverBlock) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitialized, - OnHostMsgDecoderInitialized) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitializeDone, + OnHostMsgDecoderInitializeDone) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, OnHostMsgDecoderDeinitializeDone) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderResetDone, @@ -544,15 +544,18 @@ void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance, serialized_block_info)); } -void PPB_Instance_Proxy::DecoderInitialized(PP_Instance instance, - PP_Bool success, - uint32_t request_id) { +void PPB_Instance_Proxy::DecoderInitializeDone( + PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success) { dispatcher()->Send( - new PpapiHostMsg_PPBInstance_DecoderInitialized( + new PpapiHostMsg_PPBInstance_DecoderInitializeDone( API_ID_PPB_INSTANCE, instance, - success, - request_id)); + decoder_type, + request_id, + success)); } void PPB_Instance_Proxy::DecoderDeinitializeDone( @@ -598,13 +601,13 @@ void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, serialized_block_info)); } -// TODO(tomfinegan): Handle null decrypted_samples after landing other patches. +// TODO(tomfinegan): Handle null audio_frames after landing other patches. void PPB_Instance_Proxy::DeliverSamples( PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const PP_DecryptedBlockInfo* block_info) { Resource* object = - PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples); + PpapiGlobals::Get()->GetResourceTracker()->GetResource(audio_frames); if (!object || object->pp_instance() != instance) return; @@ -1001,13 +1004,18 @@ void PPB_Instance_Proxy::OnHostMsgDeliverBlock( enter.functions()->DeliverBlock(instance, decrypted_block, &block_info); } -void PPB_Instance_Proxy::OnHostMsgDecoderInitialized( +void PPB_Instance_Proxy::OnHostMsgDecoderInitializeDone( PP_Instance instance, - PP_Bool success, - uint32_t request_id) { + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success) { EnterInstanceNoLock enter(instance); - if (enter.succeeded()) - enter.functions()->DecoderInitialized(instance, success, request_id); + if (enter.succeeded()) { + enter.functions()->DecoderInitializeDone(instance, + decoder_type, + request_id, + success); + } } void PPB_Instance_Proxy::OnHostMsgDecoderDeinitializeDone( @@ -1045,7 +1053,7 @@ void PPB_Instance_Proxy::OnHostMsgDeliverFrame( void PPB_Instance_Proxy::OnHostMsgDeliverSamples( PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const std::string& serialized_block_info) { PP_DecryptedBlockInfo block_info; if (!DeserializeBlockInfo(serialized_block_info, &block_info)) @@ -1053,7 +1061,7 @@ void PPB_Instance_Proxy::OnHostMsgDeliverSamples( EnterInstanceNoLock enter(instance); if (enter.succeeded()) - enter.functions()->DeliverSamples(instance, decrypted_samples, &block_info); + enter.functions()->DeliverSamples(instance, audio_frames, &block_info); } #endif // !defined(OS_NACL) diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h index a36d40c..a30797cd 100644 --- a/ppapi/proxy/ppb_instance_proxy.h +++ b/ppapi/proxy/ppb_instance_proxy.h @@ -137,9 +137,10 @@ class PPB_Instance_Proxy : public InterfaceProxy, virtual void DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) OVERRIDE; - virtual void DecoderInitialized(PP_Instance instance, - PP_Bool success, - uint32_t request_id) OVERRIDE; + virtual void DecoderInitializeDone(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success) OVERRIDE; virtual void DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) OVERRIDE; @@ -150,7 +151,7 @@ class PPB_Instance_Proxy : public InterfaceProxy, PP_Resource decrypted_frame, const PP_DecryptedFrameInfo* frame_info) OVERRIDE; virtual void DeliverSamples(PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const PP_DecryptedBlockInfo* block_info) OVERRIDE; #endif // !defined(OS_NACL) @@ -240,9 +241,11 @@ class PPB_Instance_Proxy : public InterfaceProxy, SerializedVarReceiveInput session_id, int32_t media_error, int32_t system_code); - virtual void OnHostMsgDecoderInitialized(PP_Instance instance, - PP_Bool success, - uint32_t request_id); + virtual void OnHostMsgDecoderInitializeDone( + PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success); virtual void OnHostMsgDecoderDeinitializeDone( PP_Instance instance, PP_DecryptorStreamType decoder_type, @@ -258,7 +261,7 @@ class PPB_Instance_Proxy : public InterfaceProxy, const std::string& serialized_block_info); virtual void OnHostMsgDeliverSamples( PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const std::string& serialized_block_info); #endif // !defined(OS_NACL) diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 29190af..a5fccd2 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -211,6 +211,39 @@ void Decrypt(PP_Instance instance, serialized_block_info)); } +void InitializeAudioDecoder( + PP_Instance instance, + const PP_AudioDecoderConfig* decoder_config, + PP_Resource extra_data_buffer) { + HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); + if (!dispatcher) { + NOTREACHED(); + return; + } + + std::string serialized_decoder_config; + if (!SerializeBlockInfo(*decoder_config, &serialized_decoder_config)) { + NOTREACHED(); + return; + } + + PPPDecryptor_Buffer buffer; + if (!InitializePppDecryptorBuffer(instance, + dispatcher, + extra_data_buffer, + &buffer)) { + NOTREACHED(); + return; + } + + dispatcher->Send( + new PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder( + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, + instance, + serialized_decoder_config, + buffer)); +} + void InitializeVideoDecoder( PP_Instance instance, const PP_VideoDecoderConfig* decoder_config, @@ -318,6 +351,7 @@ static const PPP_ContentDecryptor_Private content_decryptor_interface = { &AddKey, &CancelKeyRequest, &Decrypt, + &InitializeAudioDecoder, &InitializeVideoDecoder, &DeinitializeDecoder, &ResetDecoder, @@ -358,6 +392,8 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( OnMsgCancelKeyRequest) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, OnMsgDecrypt) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, + OnMsgInitializeAudioDecoder) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder, OnMsgInitializeVideoDecoder) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DeinitializeDecoder, @@ -427,6 +463,32 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgDecrypt( } } +void PPP_ContentDecryptor_Private_Proxy::OnMsgInitializeAudioDecoder( + PP_Instance instance, + const std::string& serialized_decoder_config, + const PPPDecryptor_Buffer& extra_data_buffer) { + + PP_AudioDecoderConfig decoder_config; + if (!DeserializeBlockInfo(serialized_decoder_config, &decoder_config)) + return; + + if (ppp_decryptor_impl_) { + PP_Resource plugin_resource = 0; + if (extra_data_buffer.size > 0) { + plugin_resource = + PPB_Buffer_Proxy::AddProxyResource(extra_data_buffer.resource, + extra_data_buffer.handle, + extra_data_buffer.size); + } + + CallWhileUnlocked( + ppp_decryptor_impl_->InitializeAudioDecoder, + instance, + const_cast<const PP_AudioDecoderConfig*>(&decoder_config), + plugin_resource); + } +} + void PPP_ContentDecryptor_Private_Proxy::OnMsgInitializeVideoDecoder( PP_Instance instance, const std::string& serialized_decoder_config, diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index 337196b..ccbbf6d 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -42,6 +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 OnMsgInitializeAudioDecoder( + PP_Instance instance, + const std::string& decoder_config, + const PPPDecryptor_Buffer& extra_data_buffer); void OnMsgInitializeVideoDecoder( PP_Instance instance, const std::string& decoder_config, diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h index e262d81..8e8b986 100644 --- a/ppapi/thunk/interfaces_ppb_private.h +++ b/ppapi/thunk/interfaces_ppb_private.h @@ -49,8 +49,8 @@ PROXIED_IFACE(PPB_Broker, PPB_BROKER_TRUSTED_INTERFACE_0_2, PROXIED_IFACE(PPB_Instance, PPB_BROWSERFONT_TRUSTED_INTERFACE_1_0, PPB_BrowserFont_Trusted_1_0) PROXIED_IFACE(PPB_Instance, - PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_3, - PPB_ContentDecryptor_Private_0_3) + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_4, + PPB_ContentDecryptor_Private_0_4) PROXIED_IFACE(PPB_Instance, PPB_CHARSET_TRUSTED_INTERFACE_1_0, PPB_CharSet_Trusted_1_0) PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5, diff --git a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc index da77d6e..bef4537 100644 --- a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc +++ b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc @@ -61,12 +61,17 @@ void DeliverBlock(PP_Instance instance, enter.functions()->DeliverBlock(instance, decrypted_block, block_info); } -void DecoderInitialized(PP_Instance instance, - PP_Bool success, - uint32_t request_id) { +void DecoderInitializeDone(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success) { EnterInstance enter(instance); - if (enter.succeeded()) - enter.functions()->DecoderInitialized(instance, success, request_id); + if (enter.succeeded()) { + enter.functions()->DecoderInitializeDone(instance, + decoder_type, + request_id, + success); + } } void DecoderDeinitializeDone(PP_Instance instance, @@ -97,11 +102,11 @@ void DeliverFrame(PP_Instance instance, } void DeliverSamples(PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const PP_DecryptedBlockInfo* block_info) { EnterInstance enter(instance); if (enter.succeeded()) - enter.functions()->DeliverSamples(instance, decrypted_samples, block_info); + enter.functions()->DeliverSamples(instance, audio_frames, block_info); } const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { @@ -110,7 +115,7 @@ const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { &KeyMessage, &KeyError, &DeliverBlock, - &DecoderInitialized, + &DecoderInitializeDone, &DecoderDeinitializeDone, &DecoderResetDone, &DeliverFrame, @@ -120,7 +125,7 @@ const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { } // namespace const PPB_ContentDecryptor_Private* - GetPPB_ContentDecryptor_Private_0_3_Thunk() { + GetPPB_ContentDecryptor_Private_0_4_Thunk() { return &g_ppb_decryption_thunk; } diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index dc32b79..f91febd 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -165,9 +165,10 @@ class PPB_Instance_API { virtual void DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) = 0; - virtual void DecoderInitialized(PP_Instance instance, - PP_Bool success, - uint32_t request_id) = 0; + virtual void DecoderInitializeDone(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success) = 0; virtual void DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = 0; @@ -178,7 +179,7 @@ class PPB_Instance_API { PP_Resource decrypted_frame, const PP_DecryptedFrameInfo* frame_info) = 0; virtual void DeliverSamples(PP_Instance instance, - PP_Resource decrypted_samples, + PP_Resource audio_frames, const PP_DecryptedBlockInfo* block_info) = 0; // URLUtil. |