Chromium Code Reviews| 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1537 | 1537 |
| 1538 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); | 1538 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); |
| 1539 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); | 1539 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); |
| 1540 | 1540 |
| 1541 plugin_decryption_interface_->Decrypt(pp_instance(), | 1541 plugin_decryption_interface_->Decrypt(pp_instance(), |
| 1542 encrypted_resource, | 1542 encrypted_resource, |
| 1543 &block_info); | 1543 &block_info); |
| 1544 return true; | 1544 return true; |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 bool PluginInstance::DecryptAndDecode( | 1547 bool PluginInstance::DecryptAndDecodeFrame( |
| 1548 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 1548 const scoped_refptr<media::DecoderBuffer>& encrypted_frame, |
| 1549 const media::Decryptor::DecryptCB& decrypt_cb) { | 1549 const media::Decryptor::DecryptCB& decrypt_cb) { |
| 1550 if (!LoadContentDecryptorInterface()) | 1550 if (!LoadContentDecryptorInterface()) |
| 1551 return false; | 1551 return false; |
| 1552 | 1552 |
| 1553 ScopedPPResource encrypted_resource(MakeBufferResource( | 1553 ScopedPPResource encrypted_resource(MakeBufferResource( |
| 1554 pp_instance(), | 1554 pp_instance(), |
| 1555 encrypted_buffer->GetData(), | 1555 encrypted_frame->GetData(), |
| 1556 encrypted_buffer->GetDataSize())); | 1556 encrypted_frame->GetDataSize())); |
| 1557 if (!encrypted_resource.get()) | 1557 if (!encrypted_resource.get()) |
| 1558 return false; | 1558 return false; |
| 1559 | 1559 |
| 1560 PP_EncryptedBlockInfo block_info; | 1560 const uint32_t request_id = next_decryption_request_id_++; |
| 1561 | |
| 1562 // TODO(tomfinegan): Need to get the video format information here somehow. | |
| 1563 PP_EncryptedVideoFrameInfo frame_info; | |
| 1564 frame_info.width = 0; | |
| 1565 frame_info.height = 0; | |
| 1566 frame_info.format = PP_DECRYPTEDFRAMEFORMAT_UNKNOWN; | |
| 1567 frame_info.codec = PP_VIDEOCODEC_UNKNOWN; | |
| 1568 | |
| 1569 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
| |
| 1570 if (!MakeEncryptedBlockInfo(*encrypted_frame->GetDecryptConfig(), | |
| 1571 encrypted_frame->GetTimestamp().InMicroseconds(), | |
| 1572 request_id, | |
| 1573 &frame_info.encrypted_frame_info)) { | |
| 1574 return false; | |
| 1575 } | |
| 1576 | |
| 1577 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); | |
| 1578 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); | |
| 1561 | 1579 |
| 1562 // TODO(tomfinegan): Store callback and ID in a map, and pass ID to decryptor. | 1580 // TODO(tomfinegan): Store callback and ID in a map, and pass ID to decryptor. |
| 1563 plugin_decryption_interface_->DecryptAndDecode(pp_instance(), | 1581 plugin_decryption_interface_->DecryptAndDecodeFrame(pp_instance(), |
| 1564 encrypted_resource, | 1582 encrypted_resource, |
| 1565 &block_info); | 1583 &frame_info); |
| 1566 return true; | 1584 return true; |
| 1567 } | 1585 } |
| 1568 | 1586 |
| 1569 bool PluginInstance::FlashIsFullscreenOrPending() { | 1587 bool PluginInstance::FlashIsFullscreenOrPending() { |
| 1570 return fullscreen_container_ != NULL; | 1588 return fullscreen_container_ != NULL; |
| 1571 } | 1589 } |
| 1572 | 1590 |
| 1573 bool PluginInstance::IsFullscreenOrPending() { | 1591 bool PluginInstance::IsFullscreenOrPending() { |
| 1574 return desired_fullscreen_state_; | 1592 return desired_fullscreen_state_; |
| 1575 } | 1593 } |
| (...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2688 screen_size_for_fullscreen_ = gfx::Size(); | 2706 screen_size_for_fullscreen_ = gfx::Size(); |
| 2689 WebElement element = container_->element(); | 2707 WebElement element = container_->element(); |
| 2690 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2708 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2691 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2709 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2692 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2710 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2693 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2711 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2694 } | 2712 } |
| 2695 | 2713 |
| 2696 } // namespace ppapi | 2714 } // namespace ppapi |
| 2697 } // namespace webkit | 2715 } // namespace webkit |
| OLD | NEW |