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

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: Fix pointer dereference. 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
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62658fb70dfd64018f7a1c6a256adde726639372..2bef6931ba062eea1800c4d2039ce2f19383ba60 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -504,10 +504,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->bitstream_id));
Task task(TASK_FRAME);
- task.frame = pending_frames_.front();
- pending_frames_.pop();
+ task.frame = pending_frames_[frame->bitstream_id];
+ pending_frames_.erase(frame->bitstream_id);
task_queue_.push(task);
ProcessWorkQueues();
}
@@ -530,10 +530,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->bitstream_id] = make_linked_ptr(frame);
decoder_thread_.message_loop_proxy()->PostTask(FROM_HERE, base::Bind(
&VTVideoDecodeAccelerator::DecodeTask, base::Unretained(this),
bitstream, frame));
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698