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

Issue 2813303003: Add AndroidVideoSurfaceChooser to manage overlays. (Closed)

Created:
3 years, 8 months ago by liberato (no reviews please)
Modified:
3 years, 7 months ago
Reviewers:
watk, tguilbert, DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org, watk
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add AndroidVideoSurfaceChooser to manage overlays. This CL abstracts out much of the surface-switching logic from AVDA into AndroidVideoSurfaceChooser. It also handles talking to overlay factories that will be provided by the renderer. AndroidVideoSurfaceChooser notifies AVDA about when to transition to / from an overlay. Currently, this is based only on whether the renderer has provided an overlay factory or not. In the future, this will look at compositor feedback and other hints to decide. This CL also adds lots of tests for this behavior. Previously, it wasn't easy to test surface transitions since (a) they were bundled into AVDA itself, and (b) they directly depended on hard-to-mock classes like ScopedJavaSurface. Now, AndroidVideoSurfaceChooser abstracts the logic, and AVDA no longer directly deals with any of those hard-to-mock objects. BUG=710204 TEST=AndroidVideoDecodeAcceleratorTest, AndroidVideoSurfaceChooserImplTest CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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/2813303003 Cr-Commit-Position: refs/heads/master@{#468916} Committed: https://chromium.googlesource.com/chromium/src/+/9432ee01aaa7821c3ea5cbff746a969a0725a34b

Patch Set 1 #

Patch Set 2 : lots of fixes #

Patch Set 3 : more cleanup #

Patch Set 4 : rebased. #

Patch Set 5 : added avda tests #

Patch Set 6 : avda tests, removed debug. #

Patch Set 7 : overlay helper tests #

Patch Set 8 : more overlay helper tests #

Patch Set 9 : added media/base/android::test_support target #

Patch Set 10 : gn fixes for non-android #

Total comments: 42

Patch Set 11 : cl feedback. #

Total comments: 20

Patch Set 12 : removed most weak factories #

Total comments: 10

Patch Set 13 : GetWeakPtr => weak_this_factory_.GetWeakPtr #

Patch Set 14 : factored out DestructionObserver for MediaCodec too. #

Patch Set 15 : GetWeakPtr => GetWeakPtrForTesting #

Patch Set 16 : simplified avda tests #

Patch Set 17 : from ps11 #

Total comments: 41

Patch Set 18 : std::move for callbacks #

Patch Set 19 : watk's feedback from ps17 #

Patch Set 20 : OnOverlayTransition => OnSurfaceTransition #

Total comments: 8

Patch Set 21 : cl feedback #

Patch Set 22 : fixed AVDAManager comment #

Total comments: 16

Patch Set 23 : cl feedback #

Total comments: 10

Patch Set 24 : cl feedback #

Patch Set 25 : fixed dereference of base::Optional #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1817 lines, -229 lines) Patch
M media/base/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +19 lines, -2 lines 0 comments Download
A media/base/android/mock_android_overlay.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +64 lines, -0 lines 0 comments Download
A media/base/android/mock_android_overlay.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +48 lines, -0 lines 0 comments Download
M media/base/android/mock_media_codec_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +3 lines, -1 line 0 comments Download
A media/base/android/test_destruction_observable.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +99 lines, -0 lines 0 comments Download
A media/base/android/test_destruction_observable.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +74 lines, -0 lines 0 comments Download
M media/gpu/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +7 lines, -0 lines 0 comments Download
M media/gpu/android_video_decode_accelerator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +49 lines, -32 lines 0 comments Download
M media/gpu/android_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 30 chunks +205 lines, -139 lines 0 comments Download
M media/gpu/android_video_decode_accelerator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +585 lines, -37 lines 0 comments Download
A media/gpu/android_video_surface_chooser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +57 lines, -0 lines 0 comments Download
A media/gpu/android_video_surface_chooser_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +63 lines, -0 lines 0 comments Download
A media/gpu/android_video_surface_chooser_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +141 lines, -0 lines 0 comments Download
A media/gpu/android_video_surface_chooser_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +330 lines, -0 lines 0 comments Download
M media/gpu/avda_codec_allocator.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M media/gpu/avda_surface_bundle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +7 lines, -13 lines 0 comments Download
M media/gpu/avda_surface_bundle.cc View 1 chunk +2 lines, -1 line 0 comments Download
A media/gpu/content_video_view_overlay_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +31 lines, -0 lines 0 comments Download
A media/gpu/content_video_view_overlay_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +26 lines, -0 lines 0 comments Download
M media/gpu/gpu_video_decode_accelerator_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 60 (33 generated)
liberato (no reviews please)
sorry that this is a big review. of the 1600 lines, ~1000 are tests and ...
3 years, 8 months ago (2017-04-20 18:22:29 UTC) #18
DaleCurtis
Just a bunch of style nits and WeakPtr complaints, didn't have time for a deep ...
3 years, 8 months ago (2017-04-20 19:10:43 UTC) #19
liberato (no reviews please)
thanks for the feedback. thanks -fl https://codereview.chromium.org/2813303003/diff/180001/media/base/android/mock_android_overlay.h File media/base/android/mock_android_overlay.h (right): https://codereview.chromium.org/2813303003/diff/180001/media/base/android/mock_android_overlay.h#newcode5 media/base/android/mock_android_overlay.h:5: #ifndef MEDIA_BASE_ANDROID_MOCK_ANDROID_OVERLAY_H_ On ...
3 years, 8 months ago (2017-04-20 22:01:39 UTC) #20
DaleCurtis
Will take a closer look tomorrow to provide suggestions, but the WeakPtr stuff is probably ...
3 years, 8 months ago (2017-04-20 22:32:26 UTC) #23
DaleCurtis
I think a lot of your WeakPtr usage can be switched out in favor of ...
3 years, 8 months ago (2017-04-21 22:02:57 UTC) #26
liberato (no reviews please)
On 2017/04/21 22:02:57, DaleCurtis wrote: > I think a lot of your WeakPtr usage can ...
3 years, 8 months ago (2017-04-21 22:15:19 UTC) #27
tguilbert
Tiny nits. Will keep ingesting this whenever you send the next version. https://codereview.chromium.org/2813303003/diff/200001/media/gpu/android_video_decode_accelerator.h File media/gpu/android_video_decode_accelerator.h ...
3 years, 8 months ago (2017-04-21 22:55:46 UTC) #28
watk
Will continue going through this tomorrow, but wanted to post my comments so far. Generally ...
3 years, 8 months ago (2017-04-22 00:29:08 UTC) #30
liberato (no reviews please)
this PS only tries to remove some weak factories. it doesn't address other feedback. i'm ...
3 years, 8 months ago (2017-04-25 22:13:11 UTC) #31
DaleCurtis
As indicated, I'm still a bit confused on exactly why you need the WeakPtrs. If ...
3 years, 8 months ago (2017-04-25 23:25:33 UTC) #32
liberato (no reviews please)
inlined GetWeakPtr() on avda and mock_android_overlay. i don't really feel strongly either way. for the ...
3 years, 8 months ago (2017-04-26 17:53:58 UTC) #34
DaleCurtis
RawPtr+clear lifetime documentation is preferred to WeakPtr. https://codereview.chromium.org/2813303003/diff/220001/media/base/android/mock_android_overlay.h File media/base/android/mock_android_overlay.h (right): https://codereview.chromium.org/2813303003/diff/220001/media/base/android/mock_android_overlay.h#newcode38 media/base/android/mock_android_overlay.h:38: On 2017/04/26 ...
3 years, 8 months ago (2017-04-26 18:28:10 UTC) #35
liberato (no reviews please)
here's a bunch of changes: - most exposed weak refs are gone. there's one or ...
3 years, 7 months ago (2017-04-27 18:30:13 UTC) #36
DaleCurtis
Just skimmed to get some Qs out. Will finish review today. https://codereview.chromium.org/2813303003/diff/340001/media/base/android/BUILD.gn File media/base/android/BUILD.gn (right): ...
3 years, 7 months ago (2017-04-27 18:57:38 UTC) #37
liberato (no reviews please)
https://codereview.chromium.org/2813303003/diff/340001/media/base/android/BUILD.gn File media/base/android/BUILD.gn (right): https://codereview.chromium.org/2813303003/diff/340001/media/base/android/BUILD.gn#newcode102 media/base/android/BUILD.gn:102: static_library("test_support") { On 2017/04/27 18:57:37, DaleCurtis wrote: > source_set ...
3 years, 7 months ago (2017-04-27 20:05:02 UTC) #38
watk
Another incomplete review round :) https://codereview.chromium.org/2813303003/diff/340001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2813303003/diff/340001/media/gpu/android_video_decode_accelerator.cc#newcode434 media/gpu/android_video_decode_accelerator.cc:434: void AndroidVideoDecodeAccelerator::OnTransitionToOrFromOverlay( On 2017/04/27 ...
3 years, 7 months ago (2017-04-27 20:33:10 UTC) #39
liberato (no reviews please)
thanks for the feedback. -fl https://codereview.chromium.org/2813303003/diff/340001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2813303003/diff/340001/media/gpu/android_video_decode_accelerator.cc#newcode434 media/gpu/android_video_decode_accelerator.cc:434: void AndroidVideoDecodeAccelerator::OnTransitionToOrFromOverlay( On 2017/04/27 ...
3 years, 7 months ago (2017-04-27 21:31:44 UTC) #40
DaleCurtis
lgtm % nits. I contend you could still do w/o the destruction observer + WeakPtrs ...
3 years, 7 months ago (2017-04-27 22:01:12 UTC) #41
liberato (no reviews please)
thanks for the feedback. -fl https://codereview.chromium.org/2813303003/diff/400001/media/base/android/mock_media_codec_bridge.h File media/base/android/mock_media_codec_bridge.h (right): https://codereview.chromium.org/2813303003/diff/400001/media/base/android/mock_media_codec_bridge.h#newcode8 media/base/android/mock_media_codec_bridge.h:8: #include "base/memory/weak_ptr.h" On 2017/04/27 ...
3 years, 7 months ago (2017-04-27 23:17:05 UTC) #42
watk
https://codereview.chromium.org/2813303003/diff/400001/media/base/android/mock_android_overlay.h File media/base/android/mock_android_overlay.h (right): https://codereview.chromium.org/2813303003/diff/400001/media/base/android/mock_android_overlay.h#newcode17 media/base/android/mock_android_overlay.h:17: // AndroidOverlay implementation that supports weak ptrs. The weak ...
3 years, 7 months ago (2017-05-02 21:00:01 UTC) #44
liberato (no reviews please)
thanks for the feedback. -fl https://codereview.chromium.org/2813303003/diff/440001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2813303003/diff/440001/media/gpu/android_video_decode_accelerator.cc#newcode366 media/gpu/android_video_decode_accelerator.cc:366: StartOverlayHelper(); On 2017/05/02 21:00:01, ...
3 years, 7 months ago (2017-05-02 21:50:05 UTC) #47
watk
lgtm with remaining naming nits https://codereview.chromium.org/2813303003/diff/460001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2813303003/diff/460001/media/gpu/android_video_decode_accelerator.cc#newcode376 media/gpu/android_video_decode_accelerator.cc:376: // If we're trying ...
3 years, 7 months ago (2017-05-02 22:04:31 UTC) #48
liberato (no reviews please)
https://codereview.chromium.org/2813303003/diff/460001/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2813303003/diff/460001/media/gpu/android_video_decode_accelerator.cc#newcode376 media/gpu/android_video_decode_accelerator.cc:376: // If we're trying to defer surface creation, then ...
3 years, 7 months ago (2017-05-02 22:31:38 UTC) #51
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/2813303003/480001
3 years, 7 months ago (2017-05-02 22:32:30 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/443926)
3 years, 7 months ago (2017-05-02 23:23:46 UTC) #54
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/2813303003/500001
3 years, 7 months ago (2017-05-03 05:11:01 UTC) #57
commit-bot: I haz the power
3 years, 7 months ago (2017-05-03 07:18:32 UTC) #60
Message was sent while issue was closed.
Committed patchset #25 (id:500001) as
https://chromium.googlesource.com/chromium/src/+/9432ee01aaa7821c3ea5cbff746a...

Powered by Google App Engine
This is Rietveld 408576698