Index: content/common/gpu/media/v4l2_image_processor.cc |
diff --git a/content/common/gpu/media/v4l2_image_processor.cc b/content/common/gpu/media/v4l2_image_processor.cc |
index 4063e4c402aef3584271ae5f50bf62d74ec6cd0f..88946615877fff817e72e85e3b67f34f336b1146 100644 |
--- a/content/common/gpu/media/v4l2_image_processor.cc |
+++ b/content/common/gpu/media/v4l2_image_processor.cc |
@@ -12,6 +12,7 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
#include "base/callback.h" |
+#include "base/message_loop/message_loop_proxy.h" |
#include "base/numerics/safe_conversions.h" |
#include "content/common/gpu/media/v4l2_image_processor.h" |
#include "media/base/bind_to_current_loop.h" |
@@ -70,7 +71,7 @@ |
output_format_fourcc_(0), |
input_planes_count_(0), |
output_planes_count_(0), |
- child_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
+ child_message_loop_proxy_(base::MessageLoopProxy::current()), |
device_(device), |
device_thread_("V4L2ImageProcessorThread"), |
device_poll_thread_("V4L2ImageProcessorDevicePollThread"), |
@@ -82,7 +83,7 @@ |
} |
V4L2ImageProcessor::~V4L2ImageProcessor() { |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
DCHECK(!device_thread_.IsRunning()); |
DCHECK(!device_poll_thread_.IsRunning()); |
@@ -91,8 +92,8 @@ |
} |
void V4L2ImageProcessor::NotifyError() { |
- if (!child_task_runner_->BelongsToCurrentThread()) |
- child_task_runner_->PostTask(FROM_HERE, error_cb_); |
+ if (!child_message_loop_proxy_->BelongsToCurrentThread()) |
+ child_message_loop_proxy_->PostTask(FROM_HERE, error_cb_); |
else |
error_cb_.Run(); |
} |
@@ -194,7 +195,7 @@ |
void V4L2ImageProcessor::Destroy() { |
DVLOG(3) << __func__; |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
// If the device thread is running, destroy using posted task. |
if (device_thread_.IsRunning()) { |
@@ -223,7 +224,7 @@ |
bool V4L2ImageProcessor::CreateInputBuffers() { |
DVLOG(3) << __func__; |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
DCHECK(!input_streamon_); |
struct v4l2_control control; |
@@ -294,7 +295,7 @@ |
bool V4L2ImageProcessor::CreateOutputBuffers() { |
DVLOG(3) << __func__; |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
DCHECK(!output_streamon_); |
struct v4l2_format format; |
@@ -357,7 +358,7 @@ |
} |
void V4L2ImageProcessor::DestroyInputBuffers() { |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
DCHECK(!input_streamon_); |
struct v4l2_requestbuffers reqbufs; |
@@ -372,7 +373,7 @@ |
} |
void V4L2ImageProcessor::DestroyOutputBuffers() { |
- DCHECK(child_task_runner_->BelongsToCurrentThread()); |
+ DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
DCHECK(!output_streamon_); |
for (size_t buf = 0; buf < output_buffer_map_.size(); ++buf) { |
@@ -569,7 +570,7 @@ |
DVLOG(3) << "Processing finished, returning frame, ts=" |
<< output_frame->timestamp().InMilliseconds(); |
- child_task_runner_->PostTask( |
+ child_message_loop_proxy_->PostTask( |
FROM_HERE, base::Bind(job_record->ready_cb, output_frame)); |
} |
} |