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

Unified Diff: media/gpu/vp9_decoder.cc

Issue 2926593002: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client (Closed)
Patch Set: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client Created 3 years, 6 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: media/gpu/vp9_decoder.cc
diff --git a/media/gpu/vp9_decoder.cc b/media/gpu/vp9_decoder.cc
index b24f2466846e28485dd17b23372c2a57e0deb302..cc0fab5b2cd13940172a1ae231d17a60348f9aaa 100644
--- a/media/gpu/vp9_decoder.cc
+++ b/media/gpu/vp9_decoder.cc
@@ -138,6 +138,18 @@ VP9Decoder::DecodeResult VP9Decoder::Decode() {
if (!pic)
return kRanOutOfSurfaces;
+ gfx::Rect new_render_rect(curr_frame_hdr_->render_width,
+ curr_frame_hdr_->render_height);
+ // For safety, check the validity of render size or leave it as (0, 0).
+ if (!gfx::Rect(pic_size_).Contains(new_render_rect)) {
+ DVLOG(2) << "Render size exceeds picture size. render size: "
Pawel Osciak 2017/06/19 06:27:40 s/2/1/ please.
johnylin1 2017/06/19 07:13:28 Done.
+ << new_render_rect.ToString()
+ << ", picture size: " << pic_size_.ToString();
+ new_render_rect = gfx::Rect();
+ }
+ DVLOG(2) << "Render resolution: " << new_render_rect.ToString();
+
+ pic->visible_rect = new_render_rect;
pic->frame_hdr.reset(curr_frame_hdr_.release());
if (!DecodeAndOutputPicture(pic)) {
« media/gpu/vp8_decoder.cc ('K') | « media/gpu/vp8_picture.h ('k') | media/gpu/vp9_picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698