Chromium Code Reviews| Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| index 785217674f2e6cdfa2cac2ea7b65690e60777061..944fb30b13cbb4fe5b6e3106c5c36b41ff2a3cdd 100644 |
| --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| @@ -1544,25 +1544,43 @@ bool PluginInstance::Decrypt( |
| return true; |
| } |
| -bool PluginInstance::DecryptAndDecode( |
| - const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| +bool PluginInstance::DecryptAndDecodeFrame( |
| + const scoped_refptr<media::DecoderBuffer>& encrypted_frame, |
| const media::Decryptor::DecryptCB& decrypt_cb) { |
| if (!LoadContentDecryptorInterface()) |
| return false; |
| ScopedPPResource encrypted_resource(MakeBufferResource( |
| pp_instance(), |
| - encrypted_buffer->GetData(), |
| - encrypted_buffer->GetDataSize())); |
| + encrypted_frame->GetData(), |
| + encrypted_frame->GetDataSize())); |
| if (!encrypted_resource.get()) |
| return false; |
| - PP_EncryptedBlockInfo block_info; |
| + const uint32_t request_id = next_decryption_request_id_++; |
| + |
| + // TODO(tomfinegan): Need to get the video format information here somehow. |
| + PP_EncryptedVideoFrameInfo frame_info; |
| + frame_info.width = 0; |
| + frame_info.height = 0; |
| + frame_info.format = PP_DECRYPTEDFRAMEFORMAT_UNKNOWN; |
| + frame_info.codec = PP_VIDEOCODEC_UNKNOWN; |
| + |
| + DCHECK(encrypted_frame->GetDecryptConfig()); |
|
ddorwin
2012/10/01 00:48:10
There must be a config, but the frame doesn't need
Tom Finegan
2012/10/02 02:42:26
Added short notes above PPP_ methods in ppapi_plug
|
| + if (!MakeEncryptedBlockInfo(*encrypted_frame->GetDecryptConfig(), |
| + encrypted_frame->GetTimestamp().InMicroseconds(), |
| + request_id, |
| + &frame_info.encrypted_frame_info)) { |
| + return false; |
| + } |
| + |
| + DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); |
| + pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); |
| // TODO(tomfinegan): Store callback and ID in a map, and pass ID to decryptor. |
| - plugin_decryption_interface_->DecryptAndDecode(pp_instance(), |
| - encrypted_resource, |
| - &block_info); |
| + plugin_decryption_interface_->DecryptAndDecodeFrame(pp_instance(), |
| + encrypted_resource, |
| + &frame_info); |
| return true; |
| } |