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

Unified Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 426873004: Pass decoded picture size from VDA to client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl format Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/video_decoder_shim.cc
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index c52c285a10291e218bf3db516f915aa50fc8244e..8f46cb84ff706205d621410c7bea1b4a77077cbd 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -47,11 +47,14 @@ VideoDecoderShim::PendingDecode::~PendingDecode() {
struct VideoDecoderShim::PendingFrame {
explicit PendingFrame(uint32_t decode_id);
- PendingFrame(uint32_t decode_id, const gfx::Size& size);
+ PendingFrame(uint32_t decode_id,
+ const gfx::Size& size,
+ const gfx::Rect& rect);
~PendingFrame();
const uint32_t decode_id;
const gfx::Size size;
+ const gfx::Rect rect;
Pawel Osciak 2014/08/12 08:50:41 Please give more informative names. coded_size, vi
kcwu 2014/08/13 14:27:19 Done.
std::vector<uint8_t> argb_pixels;
private:
@@ -64,9 +67,11 @@ VideoDecoderShim::PendingFrame::PendingFrame(uint32_t decode_id)
}
VideoDecoderShim::PendingFrame::PendingFrame(uint32_t decode_id,
- const gfx::Size& size)
+ const gfx::Size& size,
+ const gfx::Rect& rect)
: decode_id(decode_id),
size(size),
+ rect(rect),
argb_pixels(size.width() * size.height() * 4) {
}
@@ -258,7 +263,8 @@ void VideoDecoderShim::DecoderImpl::OnOutputComplete(
const scoped_refptr<media::VideoFrame>& frame) {
scoped_ptr<PendingFrame> pending_frame;
if (!frame->end_of_stream()) {
- pending_frame.reset(new PendingFrame(decode_id_, frame->coded_size()));
+ pending_frame.reset(new PendingFrame(
+ decode_id_, frame->coded_size(), frame->visible_rect()));
// Convert the VideoFrame pixels to ABGR to match VideoDecodeAccelerator.
libyuv::I420ToABGR(frame->data(media::VideoFrame::kYPlane),
frame->stride(media::VideoFrame::kYPlane),
@@ -527,7 +533,8 @@ void VideoDecoderShim::SendPictures() {
GL_UNSIGNED_BYTE,
&frame->argb_pixels.front());
- host_->PictureReady(media::Picture(texture_id, frame->decode_id));
+ host_->PictureReady(
+ media::Picture(texture_id, frame->decode_id, frame->rect.size()));
pending_frames_.pop();
}

Powered by Google App Engine
This is Rietveld 408576698