OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/ppp_content_decryptor_private_proxy.h" | 5 #include "ppapi/proxy/ppp_content_decryptor_private_proxy.h" |
6 | 6 |
7 #include "base/platform_file.h" | 7 #include "base/platform_file.h" |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/ppb_core.h" | 9 #include "ppapi/c/ppb_core.h" |
10 #include "ppapi/proxy/content_decryptor_private_serializer.h" | 10 #include "ppapi/proxy/content_decryptor_private_serializer.h" |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 PP_Instance instance, | 493 PP_Instance instance, |
494 const std::string& serialized_decoder_config, | 494 const std::string& serialized_decoder_config, |
495 const PPPDecryptor_Buffer& extra_data_buffer) { | 495 const PPPDecryptor_Buffer& extra_data_buffer) { |
496 | 496 |
497 PP_VideoDecoderConfig decoder_config; | 497 PP_VideoDecoderConfig decoder_config; |
498 if (!DeserializeBlockInfo(serialized_decoder_config, &decoder_config)) | 498 if (!DeserializeBlockInfo(serialized_decoder_config, &decoder_config)) |
499 return; | 499 return; |
500 | 500 |
501 if (ppp_decryptor_impl_) { | 501 if (ppp_decryptor_impl_) { |
502 PP_Resource plugin_resource = 0; | 502 PP_Resource plugin_resource = 0; |
503 if (extra_data_buffer.size > 0) { | 503 if (extra_data_buffer.resource.host_resource() != 0) { |
504 plugin_resource = | 504 plugin_resource = |
505 PPB_Buffer_Proxy::AddProxyResource(extra_data_buffer.resource, | 505 PPB_Buffer_Proxy::AddProxyResource(extra_data_buffer.resource, |
506 extra_data_buffer.handle, | 506 extra_data_buffer.handle, |
507 extra_data_buffer.size); | 507 extra_data_buffer.size); |
508 } | 508 } |
509 | 509 |
510 CallWhileUnlocked( | 510 CallWhileUnlocked( |
511 ppp_decryptor_impl_->InitializeVideoDecoder, | 511 ppp_decryptor_impl_->InitializeVideoDecoder, |
512 instance, | 512 instance, |
513 const_cast<const PP_VideoDecoderConfig*>(&decoder_config), | 513 const_cast<const PP_VideoDecoderConfig*>(&decoder_config), |
(...skipping 26 matching lines...) Expand all Loading... |
540 request_id); | 540 request_id); |
541 } | 541 } |
542 } | 542 } |
543 | 543 |
544 void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecode( | 544 void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecode( |
545 PP_Instance instance, | 545 PP_Instance instance, |
546 PP_DecryptorStreamType decoder_type, | 546 PP_DecryptorStreamType decoder_type, |
547 const PPPDecryptor_Buffer& encrypted_buffer, | 547 const PPPDecryptor_Buffer& encrypted_buffer, |
548 const std::string& serialized_block_info) { | 548 const std::string& serialized_block_info) { |
549 if (ppp_decryptor_impl_) { | 549 if (ppp_decryptor_impl_) { |
550 PP_Resource plugin_resource = | |
551 PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, | |
552 encrypted_buffer.handle, | |
553 encrypted_buffer.size); | |
554 PP_EncryptedBlockInfo block_info; | 550 PP_EncryptedBlockInfo block_info; |
555 if (!DeserializeBlockInfo(serialized_block_info, &block_info)) | 551 if (!DeserializeBlockInfo(serialized_block_info, &block_info)) |
556 return; | 552 return; |
| 553 |
| 554 PP_Resource plugin_resource = 0; |
| 555 if (encrypted_buffer.resource.host_resource() != 0) { |
| 556 plugin_resource = |
| 557 PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, |
| 558 encrypted_buffer.handle, |
| 559 encrypted_buffer.size); |
| 560 } |
| 561 |
557 CallWhileUnlocked( | 562 CallWhileUnlocked( |
558 ppp_decryptor_impl_->DecryptAndDecode, | 563 ppp_decryptor_impl_->DecryptAndDecode, |
559 instance, | 564 instance, |
560 decoder_type, | 565 decoder_type, |
561 plugin_resource, | 566 plugin_resource, |
562 const_cast<const PP_EncryptedBlockInfo*>(&block_info)); | 567 const_cast<const PP_EncryptedBlockInfo*>(&block_info)); |
563 } | 568 } |
564 } | 569 } |
565 | 570 |
566 } // namespace proxy | 571 } // namespace proxy |
567 } // namespace ppapi | 572 } // namespace ppapi |
OLD | NEW |