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

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 753713002: Remove reliance on VideoToolbox frame ordering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vt_pic_order
Patch Set: Created 6 years, 1 month 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: content/common/gpu/media/vt_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
index a64fb7ab681022527702243d6991c874ea1fddc5..cd5db84e73aa37dc1eeb4ef745d2c6cd5e0fb29d 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -505,10 +505,10 @@ void VTVideoDecodeAccelerator::Output(
void VTVideoDecodeAccelerator::DecodeDone(Frame* frame) {
DCHECK(gpu_thread_checker_.CalledOnValidThread());
- DCHECK_EQ(frame->bitstream_id, pending_frames_.front()->bitstream_id);
+ DCHECK_EQ(1u, pending_frames_.count(frame));
Task task(TASK_FRAME);
- task.frame = pending_frames_.front();
- pending_frames_.pop();
+ task.frame = pending_frames_[frame];
+ pending_frames_.erase(frame);
task_queue_.push(task);
ProcessWorkQueues();
}
@@ -531,10 +531,10 @@ void VTVideoDecodeAccelerator::FlushDone(TaskType type) {
void VTVideoDecodeAccelerator::Decode(const media::BitstreamBuffer& bitstream) {
DCHECK(gpu_thread_checker_.CalledOnValidThread());
- DCHECK_EQ(assigned_bitstream_ids_.count(bitstream.id()), 0u);
+ DCHECK_EQ(0u, assigned_bitstream_ids_.count(bitstream.id()));
assigned_bitstream_ids_.insert(bitstream.id());
Frame* frame = new Frame(bitstream.id());
- pending_frames_.push(make_linked_ptr(frame));
+ pending_frames_[frame] = make_linked_ptr(frame);
decoder_thread_.message_loop_proxy()->PostTask(FROM_HERE, base::Bind(
&VTVideoDecodeAccelerator::DecodeTask, base::Unretained(this),
bitstream, frame));

Powered by Google App Engine
This is Rietveld 408576698