diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 23:43:55 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 23:43:55 +0000 |
commit | e9d3a102cbaf17358cce2c8322f10b6fbe6d48ab (patch) | |
tree | 5ca5dc199c132b2549f40f46984b12ffca13908a /ppapi/cpp | |
parent | ad0295d0bfb9244f3fca582c57f4328087483a39 (diff) | |
download | chromium_src-e9d3a102cbaf17358cce2c8322f10b6fbe6d48ab.zip chromium_src-e9d3a102cbaf17358cce2c8322f10b6fbe6d48ab.tar.gz chromium_src-e9d3a102cbaf17358cce2c8322f10b6fbe6d48ab.tar.bz2 |
Add PPAPI CDM video decoder initialization.
Updates PPB and PPP sides of PPAPI Content Decryptor interfaces
to support video decoder intialization. Adds support for decoder
initialization in the PPAPI proxy, plugin instance, and
the CDM wrapper.
Adds new PPAPI types PP_VideoCodecProfile and PP_VideoDecoderConfig.
Adds method InitializeVideoDecoder to PPP_ContentDecryptor_Private.
Adds method DecoderInitialized to PPB_ContentDecryptor_Private.
BUG=141780
TEST=
Review URL: https://chromiumcodereview.appspot.com/11013052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.cc | 29 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.h | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 7dbce34..3810a96 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -105,6 +105,23 @@ void Decrypt(PP_Instance instance, *encrypted_block_info); } +void InitializeVideoDecoder( + PP_Instance instance, + const PP_VideoDecoderConfig* 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)->InitializeVideoDecoder( + *decoder_config, + extra_data_buffer); +} + + void DecryptAndDecodeFrame( PP_Instance instance, PP_Resource encrypted_resource, @@ -126,6 +143,7 @@ const PPP_ContentDecryptor_Private ppp_content_decryptor = { &AddKey, &CancelKeyRequest, &Decrypt, + &InitializeVideoDecoder, &DecryptAndDecodeFrame }; @@ -220,6 +238,17 @@ void ContentDecryptor_Private::DeliverBlock( } } +void ContentDecryptor_Private::DecoderInitialized( + bool success, + uint32_t request_id) { + if (has_interface<PPB_ContentDecryptor_Private>()) { + get_interface<PPB_ContentDecryptor_Private>()->DecoderInitialized( + associated_instance_.pp_instance(), + PP_FromBool(success), + request_id); + } +} + void ContentDecryptor_Private::DeliverFrame( pp::Buffer_Dev decrypted_frame, const PP_DecryptedFrameInfo& decrypted_frame_info) { diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index 7a6189b..4bc0aba 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 InitializeVideoDecoder( + const PP_VideoDecoderConfig& decoder_config, + pp::Buffer_Dev extra_data_resource) = 0; virtual void DecryptAndDecodeFrame( pp::Buffer_Dev encrypted_frame, const PP_EncryptedVideoFrameInfo& encrypted_video_frame_info) = 0; @@ -57,6 +60,7 @@ 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 DeliverFrame(pp::Buffer_Dev decrypted_frame, const PP_DecryptedFrameInfo& decrypted_frame_info); void DeliverSamples(pp::Buffer_Dev decrypted_samples, |