Chromium Code Reviews| Index: media/filters/gpu_video_decoder.cc |
| diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc |
| index 260bfaabb3e6777e42f6d3a823589101190ae587..e3a3a14245e9548c61d84be33104d3a57f015289 100644 |
| --- a/media/filters/gpu_video_decoder.cc |
| +++ b/media/filters/gpu_video_decoder.cc |
| @@ -476,7 +476,18 @@ 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()); |
|
jbauman
2016/03/07 23:53:50
Hmm, should it be using the coded size instead? I'
chcunningham
2016/03/08 03:19:36
I had the same concern, but Frank convinced me thi
|
| + } |
| // Update frame's timestamp. |
| base::TimeDelta timestamp; |