diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:31:43 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:31:43 +0000 |
commit | bf5f16885c4ab420986fcdf3f9364b9f714e1e4e (patch) | |
tree | 18625398b0ca9ed40da98192c22c99e1db42548a /ppapi/proxy/ppb_instance_proxy.cc | |
parent | 8ccddf61312b0f0c514be035cd7754b3474c6aef (diff) | |
download | chromium_src-bf5f16885c4ab420986fcdf3f9364b9f714e1e4e.zip chromium_src-bf5f16885c4ab420986fcdf3f9364b9f714e1e4e.tar.gz chromium_src-bf5f16885c4ab420986fcdf3f9364b9f714e1e4e.tar.bz2 |
Add CDM video decoder.
Add FFmpeg CDM video decoder, and fix bugs with passing emtpy resources through DecryptAndDecode, DeliverFrame, and Deliversamples.
TBR=brettw,viettrungluu
BUG=141780
TEST=*ExternalClearKey* browser tests pass
Review URL: https://chromiumcodereview.appspot.com/10899021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_instance_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index e3070fc..9419741 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -585,10 +585,16 @@ void PPB_Instance_Proxy::DecoderResetDone(PP_Instance instance, void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, const PP_DecryptedFrameInfo* frame_info) { - Resource* object = - PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); - if (!object || object->pp_instance() != instance) - return; + PP_Resource host_resource = 0; + if (decrypted_frame != 0) { + ResourceTracker* tracker = PpapiGlobals::Get()->GetResourceTracker(); + Resource* object = tracker->GetResource(decrypted_frame); + + if (!object || object->pp_instance() != instance) + return; + + host_resource = object->host_resource().host_resource(); + } std::string serialized_block_info; if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) @@ -597,19 +603,25 @@ void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame( API_ID_PPB_INSTANCE, instance, - object->host_resource().host_resource(), + host_resource, serialized_block_info)); } // TODO(tomfinegan): Handle null audio_frames after landing other patches. void PPB_Instance_Proxy::DeliverSamples( PP_Instance instance, - PP_Resource audio_frames, + PP_Resource decrypted_samples, const PP_DecryptedBlockInfo* block_info) { - Resource* object = - PpapiGlobals::Get()->GetResourceTracker()->GetResource(audio_frames); - if (!object || object->pp_instance() != instance) - return; + PP_Resource host_resource = 0; + if (decrypted_samples != 0) { + ResourceTracker* tracker = PpapiGlobals::Get()->GetResourceTracker(); + Resource* object = tracker->GetResource(decrypted_samples); + + if (!object || object->pp_instance() != instance) + return; + + host_resource = object->host_resource().host_resource(); + } std::string serialized_block_info; if (!SerializeBlockInfo(*block_info, &serialized_block_info)) @@ -619,7 +631,7 @@ void PPB_Instance_Proxy::DeliverSamples( new PpapiHostMsg_PPBInstance_DeliverSamples( API_ID_PPB_INSTANCE, instance, - object->host_resource().host_resource(), + host_resource, serialized_block_info)); } #endif // !defined(OS_NACL) |