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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 426873004: Pass decoded picture size from VDA to client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address ddorwin's comments 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
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.cc ('k') | media/video/picture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 16a33eae54c6fc3cdff4f65b09e773af14392a01..c7980bd71527e7fd9d60e0c8afefe7a86e67bc58 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -422,8 +422,21 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
}
const PictureBuffer& pb = it->second;
+ // Validate picture size from GPU
+ if (picture.size().IsEmpty() ||
+ !gfx::Rect(pb.size()).Contains(gfx::Rect(picture.size()))) {
+ NOTREACHED() << "Invalid picture size from VDA: "
+ << picture.size().ToString() << " should fit in "
+ << pb.size().ToString();
+ NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
+ return;
+ }
+
// Update frame's timestamp.
base::TimeDelta timestamp;
+ // Some of the VDAs don't support and thus don't provide us with visible
+ // size in picture.size, passing coded size instead, so drop it and use
ddorwin 2014/08/18 18:50:08 from previous PS: okay, just to be clear nit: ...
kcwu 2014/08/19 09:45:49 Done.
+ // config information instead.
gfx::Rect visible_rect;
gfx::Size natural_size;
GetBufferData(picture.bitstream_buffer_id(), &timestamp, &visible_rect,
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.cc ('k') | media/video/picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698