| Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| index 2d638cbcb565ee632b7db0947df44818c9e94f44..1a46f1eb0afabce07169543181470838748e71eb 100644
|
| --- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| @@ -206,7 +206,7 @@
|
|
|
| void VaapiVideoDecodeAccelerator::NotifyError(Error error) {
|
| if (message_loop_ != base::MessageLoop::current()) {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| message_loop_->PostTask(FROM_HERE, base::Bind(
|
| &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error));
|
| return;
|
| @@ -307,7 +307,7 @@
|
| }
|
|
|
| CHECK(decoder_thread_.Start());
|
| - decoder_thread_task_runner_ = decoder_thread_.task_runner();
|
| + decoder_thread_proxy_ = decoder_thread_.message_loop_proxy();
|
|
|
| state_ = kIdle;
|
| return true;
|
| @@ -399,7 +399,7 @@
|
| }
|
|
|
| bool VaapiVideoDecodeAccelerator::GetInputBuffer_Locked() {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| lock_.AssertAcquired();
|
|
|
| if (curr_input_buffer_.get())
|
| @@ -445,7 +445,7 @@
|
|
|
| void VaapiVideoDecodeAccelerator::ReturnCurrInputBuffer_Locked() {
|
| lock_.AssertAcquired();
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| DCHECK(curr_input_buffer_.get());
|
|
|
| int32 id = curr_input_buffer_->id;
|
| @@ -463,7 +463,7 @@
|
| // surfaces, and reschedule DecodeTask instead.
|
| bool VaapiVideoDecodeAccelerator::WaitForSurfaces_Locked() {
|
| lock_.AssertAcquired();
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
|
|
| while (available_va_surfaces_.empty() &&
|
| (state_ == kDecoding || state_ == kFlushing || state_ == kIdle)) {
|
| @@ -477,7 +477,7 @@
|
| }
|
|
|
| void VaapiVideoDecodeAccelerator::DecodeTask() {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| TRACE_EVENT0("Video Decoder", "VAVDA::DecodeTask");
|
| base::AutoLock auto_lock(lock_);
|
|
|
| @@ -610,9 +610,9 @@
|
| switch (state_) {
|
| case kIdle:
|
| state_ = kDecoding;
|
| - decoder_thread_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind(
|
| + &VaapiVideoDecodeAccelerator::DecodeTask,
|
| + base::Unretained(this)));
|
| break;
|
|
|
| case kDecoding:
|
| @@ -693,9 +693,8 @@
|
| }
|
|
|
| state_ = kDecoding;
|
| - decoder_thread_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind(
|
| + &VaapiVideoDecodeAccelerator::DecodeTask, base::Unretained(this)));
|
| }
|
|
|
| void VaapiVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
|
| @@ -711,7 +710,7 @@
|
| }
|
|
|
| void VaapiVideoDecodeAccelerator::FlushTask() {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| DVLOG(1) << "Flush task";
|
|
|
| // First flush all the pictures that haven't been outputted, notifying the
|
| @@ -734,9 +733,8 @@
|
| base::AutoLock auto_lock(lock_);
|
| state_ = kFlushing;
|
| // Queue a flush task after all existing decoding tasks to clean up.
|
| - decoder_thread_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::FlushTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind(
|
| + &VaapiVideoDecodeAccelerator::FlushTask, base::Unretained(this)));
|
|
|
| input_ready_.Signal();
|
| surfaces_available_.Signal();
|
| @@ -769,7 +767,7 @@
|
| }
|
|
|
| void VaapiVideoDecodeAccelerator::ResetTask() {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| DVLOG(1) << "ResetTask";
|
|
|
| // All the decoding tasks from before the reset request from client are done
|
| @@ -805,9 +803,8 @@
|
| input_buffers_.pop();
|
| }
|
|
|
| - decoder_thread_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::ResetTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind(
|
| + &VaapiVideoDecodeAccelerator::ResetTask, base::Unretained(this)));
|
|
|
| input_ready_.Signal();
|
| surfaces_available_.Signal();
|
| @@ -850,9 +847,9 @@
|
| // that we are back in kDecoding state.
|
| if (!input_buffers_.empty()) {
|
| state_ = kDecoding;
|
| - decoder_thread_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind(
|
| + &VaapiVideoDecodeAccelerator::DecodeTask,
|
| + base::Unretained(this)));
|
| }
|
|
|
| DVLOG(1) << "Reset finished";
|
| @@ -932,7 +929,7 @@
|
|
|
| scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>
|
| VaapiVideoDecodeAccelerator::CreateSurface() {
|
| - DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(decoder_thread_proxy_->BelongsToCurrentThread());
|
| base::AutoLock auto_lock(lock_);
|
|
|
| if (available_va_surfaces_.empty())
|
|
|