Skip to content

Commit 3527d48

Browse files
rosetta-jpnPawel Osciak
authored andcommitted
media/gpu/v4l2vda: Execute NotifyFlushDone for Flush if input stream is off
VDA client can request Flush() after Reset() and waits for NotifyFlushDone(). After FinishReset() is done, input stream becomes off. Even doing V4L2_DEC_CMD_STOP at this time, the buffer with V4L2_BUF_FLAG_LAST will never be returned from driver. As a result, NotifyFlushDone() will not be invoked and client waits permanently. To avoid this, V4L2VDA is changed as it tries to call NotifyFlushDone if input stream is off. BUG=chromium:833223, chromium:833221 TEST=Change resolution manually on crosvideo.appspot.com TEST=VDA unittest on hana TEST=CtsMediaTestCases on hana 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;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I4245bdcee1e537dc7061e7833530ae59fc4aecb7 Reviewed-on: https://chromium-review.googlesource.com/1013802 Reviewed-by: Pawel Osciak <posciak@chromium.org> Cr-Commit-Position: refs/branch-heads/3396@{#67} Cr-Branched-From: 9ef2aa8-refs/heads/master@{#550428}
1 parent 5f50097 commit 3527d48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

media/gpu/v4l2/v4l2_video_decode_accelerator.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,11 +1275,13 @@ void V4L2VideoDecodeAccelerator::Enqueue() {
12751275
input_ready_queue_.pop();
12761276
free_input_buffers_.push_back(buffer);
12771277
input_record.input_id = -1;
1278-
if (coded_size_.IsEmpty()) {
1279-
// If coded_size_.IsEmpty(), no output buffer could have been
1278+
if (coded_size_.IsEmpty() || !input_streamon_) {
1279+
// (1) If coded_size_.IsEmpty(), no output buffer could have been
12801280
// allocated and there is nothing to flush. We can NotifyFlushDone()
12811281
// immediately, without requesting flush to the driver via
12821282
// SendDecoderCmdStop().
1283+
// (2) If input stream is off, we will never get the output buffer
1284+
// with V4L2_BUF_FLAG_LAST. We should NotifyFlushDone().
12831285
NotifyFlushDoneIfNeeded();
12841286
} else if (!SendDecoderCmdStop()) {
12851287
return;

0 commit comments

Comments
 (0)