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

Unified Diff: webkit/plugins/ppapi/content_decryptor_delegate.cc

Issue 11414226: Encrypted Media: Support natural size in video decrypt-and-decode path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve comments Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/content_decryptor_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/content_decryptor_delegate.cc
diff --git a/webkit/plugins/ppapi/content_decryptor_delegate.cc b/webkit/plugins/ppapi/content_decryptor_delegate.cc
index e62fca497573070fe7eb80ed3d107ce39438351c..84a58b651b8dec84fd451cb4200b828e366f967e 100644
--- a/webkit/plugins/ppapi/content_decryptor_delegate.cc
+++ b/webkit/plugins/ppapi/content_decryptor_delegate.cc
@@ -20,6 +20,7 @@
#include "ppapi/shared_impl/var_tracker.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_buffer_api.h"
+#include "ui/gfx/rect.h"
#include "webkit/plugins/ppapi/ppb_buffer_impl.h"
using ppapi::PpapiGlobals;
@@ -475,6 +476,8 @@ bool ContentDecryptorDelegate::InitializeVideoDecoder(
pending_video_decoder_init_request_id_ = pp_decoder_config.request_id;
pending_video_decoder_init_cb_ = init_cb;
+ natural_size_ = decoder_config.natural_size();
+
plugin_decryption_interface_->InitializeVideoDecoder(pp_instance_,
&pp_decoder_config,
extra_data_resource);
@@ -486,6 +489,8 @@ bool ContentDecryptorDelegate::DeinitializeDecoder(
media::Decryptor::StreamType stream_type) {
CancelDecode(stream_type);
+ natural_size_ = gfx::Size();
+
// TODO(tomfinegan): Add decoder deinitialize request tracking, and get
// stream type from media stack.
plugin_decryption_interface_->DeinitializeDecoder(
@@ -702,6 +707,9 @@ void ContentDecryptorDelegate::DecoderInitializeDone(
request_id != pending_video_decoder_init_request_id_)
return;
+ if (!success)
+ natural_size_ = gfx::Size();
+
DCHECK(!pending_video_decoder_init_cb_.is_null());
pending_video_decoder_init_request_id_ = 0;
base::ResetAndReturn(
@@ -828,12 +836,10 @@ void ContentDecryptorDelegate::DeliverFrame(
gfx::Size frame_size(frame_info->width, frame_info->height);
DCHECK_EQ(frame_info->format, PP_DECRYPTEDFRAMEFORMAT_YV12);
- // TODO(xhwang): Support visible_rect and natural_size in EME video decoding
- // implementations.
scoped_refptr<media::VideoFrame> decoded_frame =
media::VideoFrame::WrapExternalYuvData(
media::VideoFrame::YV12,
- frame_size, gfx::Rect(frame_size), frame_size,
+ frame_size, gfx::Rect(frame_size), natural_size_,
frame_info->strides[PP_DECRYPTEDFRAMEPLANES_Y],
frame_info->strides[PP_DECRYPTEDFRAMEPLANES_U],
frame_info->strides[PP_DECRYPTEDFRAMEPLANES_V],
« no previous file with comments | « webkit/plugins/ppapi/content_decryptor_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698