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

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: Rebase Created 4 years, 9 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/common/gpu/media/media_messages.h ('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 aa052dd67e377be75f8d9cec54a2b4b140f6bd52..0109dc7dae39901d94d3fb7a493da6aa722941bd 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -476,13 +476,24 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE);
return;
}
- const PictureBuffer& pb = it->second;
+ PictureBuffer& pb = it->second;
+ if (picture.size_changed()) {
+ // 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.
+ DCHECK(pb.size() != picture.visible_rect().size());
+ DVLOG(3) << __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;
- // Some of the VDAs like DXVA, AVDA, and VTVDA don't support and thus don't
- // provide us with visible size in picture.size, passing (0, 0) instead, so
- // for those cases drop it and use config information instead.
+ // Some of the VDAs like DXVA, and VTVDA don't support and thus don't provide
+ // us with visible size in picture.size, passing (0, 0) instead, so for those
+ // cases drop it and use 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/common/gpu/media/media_messages.h ('k') | media/video/picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698