Index: content/common/gpu/media/android_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc |
index 0f23cefc87289e7e34c7f238a9af54433d37ca9f..ff35431dd4d3fc993ce7d38e891ac36e343f39d8 100644 |
--- a/content/common/gpu/media/android_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc |
@@ -502,13 +502,14 @@ void AndroidVideoDecodeAccelerator::SetCdm(int cdm_id) { |
void AndroidVideoDecodeAccelerator::DoIOTask(bool start_timer) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
TRACE_EVENT0("media", "AVDA::DoIOTask"); |
- if (state_ == ERROR || state_ == WAITING_FOR_CODEC) { |
+ if (state_ == ERROR || state_ == WAITING_FOR_CODEC) |
return; |
- } |
+ strategy_->MaybeRenderEarly(pictures_out_for_display_); |
bool did_work = QueueInput(); |
while (DequeueOutput()) |
did_work = true; |
+ strategy_->MaybeRenderEarly(pictures_out_for_display_); |
liberato (no reviews please)
2016/04/22 00:51:05
i see why you'd want to call this periodically, bu
DaleCurtis
2016/04/22 01:33:58
I was thinking that there may be work after Dequeu
|
ManageTimer(did_work || start_timer); |
} |
@@ -819,6 +820,8 @@ void AndroidVideoDecodeAccelerator::SendDecodedFrameToClient( |
return; |
} |
+ pictures_out_for_display_.push_back(picture_buffer_id); |
+ |
bool size_changed = false; |
if (i->second.size() != size_) { |
// Size may have changed due to resolution change since the last time this |
@@ -829,7 +832,8 @@ void AndroidVideoDecodeAccelerator::SendDecodedFrameToClient( |
// Connect the PictureBuffer to the decoded frame, via whatever |
// mechanism the strategy likes. |
- strategy_->UseCodecBufferForPictureBuffer(codec_buffer_index, i->second); |
+ strategy_->UseCodecBufferForPictureBuffer(codec_buffer_index, i->second, |
+ pictures_out_for_display_); |
const bool allow_overlay = strategy_->ArePicturesOverlayable(); |
@@ -918,6 +922,10 @@ void AndroidVideoDecodeAccelerator::ReusePictureBuffer( |
DCHECK(thread_checker_.CalledOnValidThread()); |
free_picture_ids_.push(picture_buffer_id); |
+ pictures_out_for_display_.erase( |
+ std::remove(pictures_out_for_display_.begin(), |
+ pictures_out_for_display_.end(), picture_buffer_id), |
+ pictures_out_for_display_.end()); |
TRACE_COUNTER1("media", "AVDA::FreePictureIds", free_picture_ids_.size()); |
OutputBufferMap::const_iterator i = |
@@ -928,7 +936,7 @@ void AndroidVideoDecodeAccelerator::ReusePictureBuffer( |
return; |
} |
- strategy_->ReuseOnePictureBuffer(i->second); |
+ strategy_->ReuseOnePictureBuffer(i->second, pictures_out_for_display_); |
DoIOTask(true); |
} |