Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11087044: Generalize Pepper CDM API decrypt and decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 return false; 1624 return false;
1625 1625
1626 // TODO(tomfinegan): Add decoder reset request tracking, and get 1626 // TODO(tomfinegan): Add decoder reset request tracking, and get
1627 // stream type from media stack. 1627 // stream type from media stack.
1628 plugin_decryption_interface_->ResetDecoder(pp_instance(), 1628 plugin_decryption_interface_->ResetDecoder(pp_instance(),
1629 PP_DECRYPTORSTREAMTYPE_VIDEO, 1629 PP_DECRYPTORSTREAMTYPE_VIDEO,
1630 0); 1630 0);
1631 return true; 1631 return true;
1632 } 1632 }
1633 1633
1634 bool PluginInstance::DecryptAndDecodeFrame( 1634 bool PluginInstance::DecryptAndDecode(
1635 const scoped_refptr<media::DecoderBuffer>& encrypted_frame, 1635 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
1636 const media::Decryptor::DecryptCB& decrypt_cb) { 1636 const media::Decryptor::DecryptCB& decrypt_cb) {
1637 if (!LoadContentDecryptorInterface()) 1637 if (!LoadContentDecryptorInterface())
1638 return false; 1638 return false;
1639 1639
1640 ScopedPPResource encrypted_resource(MakeBufferResource( 1640 ScopedPPResource encrypted_resource(MakeBufferResource(
1641 pp_instance(), 1641 pp_instance(),
1642 encrypted_frame->GetData(), 1642 encrypted_buffer->GetData(),
1643 encrypted_frame->GetDataSize())); 1643 encrypted_buffer->GetDataSize()));
1644 if (!encrypted_resource.get()) 1644 if (!encrypted_resource.get())
1645 return false; 1645 return false;
1646 1646
1647 const uint32_t request_id = next_decryption_request_id_++; 1647 const uint32_t request_id = next_decryption_request_id_++;
1648 1648
1649 // TODO(tomfinegan): Need to get the video format information here somehow. 1649 PP_EncryptedBlockInfo block_info;
1650 PP_EncryptedVideoFrameInfo frame_info; 1650 DCHECK(encrypted_buffer->GetDecryptConfig());
1651 frame_info.width = 0; 1651 if (!MakeEncryptedBlockInfo(*encrypted_buffer->GetDecryptConfig(),
1652 frame_info.height = 0; 1652 encrypted_buffer->GetTimestamp().InMicroseconds(),
1653 frame_info.format = PP_DECRYPTEDFRAMEFORMAT_UNKNOWN;
1654 frame_info.codec = PP_VIDEOCODEC_UNKNOWN;
1655
1656 DCHECK(encrypted_frame->GetDecryptConfig());
1657 if (!MakeEncryptedBlockInfo(*encrypted_frame->GetDecryptConfig(),
1658 encrypted_frame->GetTimestamp().InMicroseconds(),
1659 request_id, 1653 request_id,
1660 &frame_info.encryption_info)) { 1654 &block_info)) {
1661 return false; 1655 return false;
1662 } 1656 }
1663 1657
1664 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); 1658 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id));
1665 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); 1659 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb));
1666 1660
1667 plugin_decryption_interface_->DecryptAndDecodeFrame(pp_instance(), 1661 // TODO(tomfinegan): Need to get stream type from media stack.
1668 encrypted_resource, 1662 plugin_decryption_interface_->DecryptAndDecode(pp_instance(),
1669 &frame_info); 1663 PP_DECRYPTORSTREAMTYPE_VIDEO,
1664 encrypted_resource,
1665 &block_info);
1670 return true; 1666 return true;
1671 } 1667 }
1672 1668
1673 bool PluginInstance::FlashIsFullscreenOrPending() { 1669 bool PluginInstance::FlashIsFullscreenOrPending() {
1674 return fullscreen_container_ != NULL; 1670 return fullscreen_container_ != NULL;
1675 } 1671 }
1676 1672
1677 bool PluginInstance::IsFullscreenOrPending() { 1673 bool PluginInstance::IsFullscreenOrPending() {
1678 return desired_fullscreen_state_; 1674 return desired_fullscreen_state_;
1679 } 1675 }
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 screen_size_for_fullscreen_ = gfx::Size(); 2823 screen_size_for_fullscreen_ = gfx::Size();
2828 WebElement element = container_->element(); 2824 WebElement element = container_->element();
2829 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2825 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2830 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2826 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2831 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2827 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2832 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2828 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2833 } 2829 }
2834 2830
2835 } // namespace ppapi 2831 } // namespace ppapi
2836 } // namespace webkit 2832 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698