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

Issue 2508053002: media: Do a TimedWait() for video surface teardown in AVDA (Closed)

Created:
4 years, 1 month ago by watk
Modified:
4 years, 1 month ago
CC:
DaleCurtis, apacible+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, miu+watch_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Do a TimedWait() for video surface teardown in AVDA In OnSurfaceDestroyed() we have to release the MediaCodec synchronously to avoid crashing or hanging. Previously we did the release asynchronously because we post MediaCodec release to another thread. Now that SurfaceDestroyed messages are enabled on all Android API levels, and we don't have deferred error reporting this change makes the teardown more robust by waiting for MediaCodecs to be released before returning from OnSurfaceDestroyed(). * AVDACodecAllocator now tracks the allocation of surfaces to AVDAs. * AVDACodecAllocator now allocates and releases codecs. When a codec with an attached surface is released, it tracks the completion of the async release task so that it can wait on it. * AVDASurfaceTracker is gone. Now OnSurfaceDestroyed messages are routed through AVDACodecAllocator. BUG=662599 TEST=new tests, manual fullscreen transitions 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 Committed: https://crrev.com/8b00de4de08282a2a667fb6a04c753f0964cc67e Cr-Commit-Position: refs/heads/master@{#434038}

Patch Set 1 #

Total comments: 8

Patch Set 2 : cleanup/couple more tests #

Total comments: 3

Patch Set 3 : bugs #

Total comments: 5

Patch Set 4 : addressed comments + added some comments #

Total comments: 4

Patch Set 5 : fix comments #

Patch Set 6 : change timeout to 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+590 lines, -455 lines) Patch
M content/gpu/gpu_child_thread.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M media/gpu/BUILD.gn View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M media/gpu/android_video_decode_accelerator.h View 1 2 8 chunks +9 lines, -71 lines 0 comments Download
M media/gpu/android_video_decode_accelerator.cc View 1 2 3 4 17 chunks +89 lines, -194 lines 0 comments Download
M media/gpu/avda_codec_allocator.h View 1 2 3 6 chunks +148 lines, -27 lines 0 comments Download
M media/gpu/avda_codec_allocator.cc View 1 2 3 4 5 7 chunks +209 lines, -17 lines 0 comments Download
M media/gpu/avda_codec_allocator_unittest.cc View 1 12 chunks +133 lines, -41 lines 0 comments Download
D media/gpu/avda_surface_tracker.h View 1 chunk +0 lines, -52 lines 0 comments Download
D media/gpu/avda_surface_tracker.cc View 1 chunk +0 lines, -49 lines 0 comments Download

Messages

Total messages: 51 (33 generated)
watk
I'm sending this for an early review because branch cut is tomorrow and this should ...
4 years, 1 month ago (2016-11-17 01:41:01 UTC) #4
DaleCurtis
I think some of this is a good cleanup either way. The problem is that ...
4 years, 1 month ago (2016-11-17 02:04:24 UTC) #6
liberato (no reviews please)
i haven't done an in-depth review of it for correctness. tl;dr: i like the refactor. ...
4 years, 1 month ago (2016-11-17 07:28:19 UTC) #7
watk
Thanks! Re looking for dev crashes: good idea. I'll try that. It's in 56.0.2919.3 which ...
4 years, 1 month ago (2016-11-17 20:37:06 UTC) #8
watk
Alright, this is ready now. PTAL. https://codereview.chromium.org/2508053002/diff/20001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2508053002/diff/20001/media/gpu/android_video_decode_accelerator.cc#newcode1151 media/gpu/android_video_decode_accelerator.cc:1151: AVDACodecAllocator::Get().DeallocateSurface(this, config_.surface_id); This ...
4 years, 1 month ago (2016-11-18 01:24:44 UTC) #20
watk
ping
4 years, 1 month ago (2016-11-21 23:52:17 UTC) #25
DaleCurtis
lgtm https://codereview.chromium.org/2508053002/diff/100001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (left): https://codereview.chromium.org/2508053002/diff/100001/media/gpu/android_video_decode_accelerator.cc#oldcode1008 media/gpu/android_video_decode_accelerator.cc:1008: ReleaseMediaCodec(); You dropped this. If media_codec_ will always ...
4 years, 1 month ago (2016-11-22 01:10:25 UTC) #26
watk
Thanks! Comments addressed minus the count() one because these are std::maps. liberato@ do you want ...
4 years, 1 month ago (2016-11-22 02:03:26 UTC) #29
liberato (no reviews please)
On 2016/11/22 02:03:26, watk wrote: > Thanks! Comments addressed minus the count() one because these ...
4 years, 1 month ago (2016-11-22 18:39:16 UTC) #32
liberato (no reviews please)
lgtm % nits. also a nice refactor even without the bug fix. -fl https://codereview.chromium.org/2508053002/diff/120001/media/gpu/android_video_decode_accelerator.cc File ...
4 years, 1 month ago (2016-11-22 18:49:22 UTC) #33
watk
Thanks, I changed the timeout to 2 seconds. cqing https://codereview.chromium.org/2508053002/diff/120001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2508053002/diff/120001/media/gpu/android_video_decode_accelerator.cc#newcode1512 media/gpu/android_video_decode_accelerator.cc:1512: ...
4 years, 1 month ago (2016-11-22 20:21:38 UTC) #36
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/2508053002/160001
4 years, 1 month ago (2016-11-22 20:22:40 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/310797)
4 years, 1 month ago (2016-11-22 20:40:57 UTC) #41
watk
jbauman@chromium.org: Please review changes in gpu_child_thread.cc.
4 years, 1 month ago (2016-11-22 23:16:06 UTC) #43
jbauman
content/gpu lgtm
4 years, 1 month ago (2016-11-22 23:30:55 UTC) #44
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/2508053002/160001
4 years, 1 month ago (2016-11-22 23:33:58 UTC) #46
commit-bot: I haz the power
Committed patchset #6 (id:160001)
4 years, 1 month ago (2016-11-23 00:46:17 UTC) #49
commit-bot: I haz the power
4 years, 1 month ago (2016-11-23 00:48:17 UTC) #51
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/8b00de4de08282a2a667fb6a04c753f0964cc67e
Cr-Commit-Position: refs/heads/master@{#434038}

Powered by Google App Engine
This is Rietveld 408576698