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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 1750213002: Fix Android black frames from MSE config changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback: Adding UpdatePictureBufferSize to strategy Created 4 years, 10 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/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 6801aafc069ad2dd60c66a573d2e7f4977b47e2e..e1a77e8ef8a8e8bd939605cb92f4eefc01c7b885 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -473,7 +473,18 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE);
return;
}
- const PictureBuffer& pb = it->second;
+ PictureBuffer& pb = it->second;
+ if (pb.size() != picture.visible_rect().size()) {
liberato (no reviews please) 2016/03/02 16:50:36 i don't think that you want to do this uncondition
chcunningham 2016/03/02 21:46:19 Ack, happy to add a flag. In our chat earlier I t
+ // Update the PictureBuffer size to match that of the Picture. Some VDA's
+ // (e.g. Android) will handle resolution changes internally without
+ // requesting new PictureBuffers. Sending a Picture of unmatched size is
+ // the signal that we should update the size of our PictureBuffer.
+ LOG(ERROR) << __FUNCTION__ << " Updating size of PictureBuffer[" << pb.id()
+ << "]"
+ << " from:" << pb.size().ToString()
+ << " to:" << picture.visible_rect().size().ToString();
+ pb.set_size(picture.visible_rect().size());
+ }
// Update frame's timestamp.
base::TimeDelta timestamp;

Powered by Google App Engine
This is Rietveld 408576698