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

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
« no previous file with comments | « media/gpu/vp8_picture.h ('k') | media/gpu/vp9_picture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/vp9_decoder.cc
diff --git a/media/gpu/vp9_decoder.cc b/media/gpu/vp9_decoder.cc
index b24f2466846e28485dd17b23372c2a57e0deb302..be7fd85b3d9b642172feaeab799b56d5cc257118 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(1) << "Render size exceeds picture size. render size: "
+ << 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)) {
« no previous file with comments | « 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