Commit 00aefbd4 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

V4L2VEA: Execute flush callback by GPU main child thread

Correct V4L2VEA to execute flush callback by GPU main child thread.

BUG=b:71882314
TEST=video_encode_accelerator_unittest

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: If6eb0c8f87dcd59a0006c811514f230e8a023f0e
Reviewed-on: https://chromium-review.googlesource.com/989873Reviewed-by: default avatarKuang-che Wu <kcwu@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548016}
parent ff824d22
......@@ -386,7 +386,8 @@ void V4L2VideoEncodeAccelerator::FlushTask(FlushCallback flush_callback) {
VLOGF(1) << "Flush failed: there is a pending flush, "
<< "or VEA is not in kEncoding state";
NOTIFY_ERROR(kIllegalStateError);
std::move(flush_callback).Run(false);
child_task_runner_->PostTask(
FROM_HERE, base::BindOnce(std::move(flush_callback), false));
return;
}
flush_callback_ = std::move(flush_callback);
......@@ -628,7 +629,8 @@ void V4L2VideoEncodeAccelerator::Enqueue() {
// nothing left to process, so we can return flush success back to the
// client.
if (!input_streamon_) {
std::move(flush_callback_).Run(true);
child_task_runner_->PostTask(
FROM_HERE, base::BindOnce(std::move(flush_callback_), true));
return;
}
struct v4l2_encoder_cmd cmd;
......@@ -637,7 +639,8 @@ void V4L2VideoEncodeAccelerator::Enqueue() {
if (device_->Ioctl(VIDIOC_ENCODER_CMD, &cmd) != 0) {
VPLOGF(1) << "ioctl() failed: VIDIOC_ENCODER_CMD";
NOTIFY_ERROR(kPlatformFailureError);
std::move(flush_callback_).Run(false);
child_task_runner_->PostTask(
FROM_HERE, base::BindOnce(std::move(flush_callback_), false));
return;
}
encoder_state_ = kFlushing;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment