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

Issue 2642623002: Fix Vaapi VDA flush handling during resolution change (Closed)

Created:
3 years, 11 months ago by kcwu
Modified:
3 years, 11 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, piman+watch_chromium.org, feature-media-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix Vaapi VDA flush handling during resolution change Suppose VAVDA got client request Decode()*N and then a Flush(), they will be posted to decoder thread and handled by DecodeTask and FlushTask. Ideally DecodeTask will decode all N input, so no pending input remains when FlushTask starts. However, the DecodeTask() encountered a resolution change when it processes one of input buffer. It has to allocate new surfaces. So it post something to main thread and expect next DecodeTask will come back to finish inputs. During the main thread allocating new surfaces, the decode thread do next task in the queue --- FlushTask, which starts before all input buffers are done. The main idea of this CL is to enqueue a dummy buffer to indicate flushing instead of kFlush state. BUG=b:30617067, b:34317221 TEST=run ARC CTS test AdaptivePlaybackTest#testVP9_adaptiveDrcEarlyEos CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2642623002 Cr-Commit-Position: refs/heads/master@{#445951} Committed: https://chromium.googlesource.com/chromium/src/+/e87f2ba577b96a81dd994ff0cda70ec2c5fef332

Patch Set 1 #

Patch Set 2 : handle b/34317221 #

Patch Set 3 : queue a dummy flush buffer #

Total comments: 16

Patch Set 4 : allow multiple Flush #

Total comments: 6

Patch Set 5 : address owen's comment #

Total comments: 7

Patch Set 6 : address Pawel's comments #

Patch Set 7 : fix compile due to style check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -87 lines) Patch
M media/gpu/vaapi_video_decode_accelerator.h View 1 2 3 4 5 6 3 chunks +6 lines, -6 lines 0 comments Download
M media/gpu/vaapi_video_decode_accelerator.cc View 1 2 3 4 5 6 13 chunks +94 lines, -81 lines 0 comments Download

Messages

Total messages: 38 (17 generated)
kcwu
3 years, 11 months ago (2017-01-18 05:13:32 UTC) #3
kcwu
Updated my CL to handle the case of b/34317221. I'm doing more tests.
3 years, 11 months ago (2017-01-18 09:00:24 UTC) #6
Pawel Osciak
To make the flush flow simpler in general, could we perhaps use/queue a dummy flush ...
3 years, 11 months ago (2017-01-18 09:19:41 UTC) #7
kcwu
On 2017/01/18 09:19:41, Pawel Osciak wrote: > To make the flush flow simpler in general, ...
3 years, 11 months ago (2017-01-18 11:38:31 UTC) #8
johnylin1
Just verified this patch could also fix b/34317221. Thanks a lot
3 years, 11 months ago (2017-01-19 04:31:09 UTC) #10
johnylin1
On 2017/01/19 04:31:09, johnylin1 wrote: > Just verified this patch could also fix b/34317221. > ...
3 years, 11 months ago (2017-01-19 07:12:03 UTC) #11
Owen Lin
https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc#newcode476 media/gpu/vaapi_video_decode_accelerator.cc:476: // Skip empty buffers. Please see my comment below. ...
3 years, 11 months ago (2017-01-19 07:39:16 UTC) #12
kcwu
https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc#newcode586 media/gpu/vaapi_video_decode_accelerator.cc:586: bool VaapiVideoDecodeAccelerator::IsFlushPending_Locked() { On 2017/01/19 07:39:16, Owen Lin wrote: ...
3 years, 11 months ago (2017-01-19 08:26:10 UTC) #13
Owen Lin
https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc#newcode586 media/gpu/vaapi_video_decode_accelerator.cc:586: bool VaapiVideoDecodeAccelerator::IsFlushPending_Locked() { On 2017/01/19 08:26:10, kcwu wrote: > ...
3 years, 11 months ago (2017-01-20 02:20:06 UTC) #14
kcwu
https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/40001/media/gpu/vaapi_video_decode_accelerator.cc#newcode937 media/gpu/vaapi_video_decode_accelerator.cc:937: DCHECK(input_buffers_.empty()) << "Input buffers should be empty because" On ...
3 years, 11 months ago (2017-01-20 07:49:04 UTC) #16
Owen Lin
lgtm % nits https://codereview.chromium.org/2642623002/diff/80001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/80001/media/gpu/vaapi_video_decode_accelerator.cc#newcode466 media/gpu/vaapi_video_decode_accelerator.cc:466: DVLOG(4) << "Mapping new input buffer ...
3 years, 11 months ago (2017-01-23 05:49:59 UTC) #17
kcwu
https://codereview.chromium.org/2642623002/diff/80001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/80001/media/gpu/vaapi_video_decode_accelerator.cc#newcode466 media/gpu/vaapi_video_decode_accelerator.cc:466: DVLOG(4) << "Mapping new input buffer id: " << ...
3 years, 11 months ago (2017-01-23 05:57:31 UTC) #18
johnylin1
Have confirmed the latest patch with: 1. fix b/34317221. 2. cts: android.media.cts.AdaptivePlaybackTest 2. autotest: video_VideoSeek.h264, ...
3 years, 11 months ago (2017-01-23 06:23:44 UTC) #19
Pawel Osciak
https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc#newcode487 media/gpu/vaapi_video_decode_accelerator.cc:487: ++num_stream_bufs_at_decoder_; I think we should only increment for non-flush ...
3 years, 11 months ago (2017-01-24 07:10:33 UTC) #20
kcwu
https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc#newcode487 media/gpu/vaapi_video_decode_accelerator.cc:487: ++num_stream_bufs_at_decoder_; On 2017/01/24 07:10:33, Pawel Osciak wrote: > I ...
3 years, 11 months ago (2017-01-24 07:54:23 UTC) #21
Pawel Osciak
lgtm https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc File media/gpu/vaapi_video_decode_accelerator.cc (right): https://codereview.chromium.org/2642623002/diff/100001/media/gpu/vaapi_video_decode_accelerator.cc#newcode1013 media/gpu/vaapi_video_decode_accelerator.cc:1013: if (!input_buffer->is_flush()) On 2017/01/24 07:54:23, kcwu wrote: > ...
3 years, 11 months ago (2017-01-24 09:19:16 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642623002/120001
3 years, 11 months ago (2017-01-24 09:46:08 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/308641)
3 years, 11 months ago (2017-01-24 10:07:56 UTC) #27
kcwu
Owen, FYI, ctor and dtor are added back due to style check.
3 years, 11 months ago (2017-01-25 04:47:38 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642623002/140001
3 years, 11 months ago (2017-01-25 04:48:03 UTC) #35
commit-bot: I haz the power
3 years, 11 months ago (2017-01-25 04:54:21 UTC) #38
Message was sent while issue was closed.
Committed patchset #7 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/e87f2ba577b96a81dd994ff0cda7...

Powered by Google App Engine
This is Rietveld 408576698