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

Issue 11413078: Tab Audio Capture: Browser-side connect/disconnect functionality. (Closed)

Created:
8 years, 1 month ago by miu
Modified:
7 years, 11 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, feature-media-reviews_chromium.org, justinlin
Visibility:
Public.

Description

Tab Audio Mirroring/Capture: Browser-side connect/disconnect functionality: 1. Added new AudioMirroringManager to dynamically match/route "divertable" audio streams with mirroring destinations. 2. Modified AudioOutputController to provide "divert audio data" functionality. 3. Modified AudioRendererHost to notify AudioMirroringManager of all audio streams. The intention is, in a later change, to introduce a "WebContentsAudioInputStream" which will implement the AudioMirroringManager::MirroringDestination interface introduced in this change. WCAIS will represent the lifetime of a tab audio mirroring session, calling AudioMirroringManager::Start/StopMirroring() as appropriate. Testing: 1. Rewrote most of unit testing for AudioOutputController, addressing bug 112500. Also added testing for the new Divert functionality. 2. Added extensive unit testing for the new Start/StopMirroring functionality in AudioMirroringManager. 3. Minor testing clean-ups/additions elsewhere. BUG=153392, 112500 TEST=Run media_unittests and content_unittests. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176295

Patch Set 1 #

Total comments: 25

Patch Set 2 : Fixed WCAIS threading issue (methods called on audio thread). Addressed hclam's review comments. #

Total comments: 22

Patch Set 3 : Cleaned up threading and ref-counting issues, per Alpha's comments. Finished 'divert' impl in Audi… #

Patch Set 4 : Minor tweaks and added some useful comments. #

Total comments: 12

Patch Set 5 : Minor tweaks to threading, per Alpha's comments. #

Patch Set 6 : Rewrote tests for AOC (and bug 112500). Add tests for Start/StopMirroring in ARH. #

Patch Set 7 : Remove WCAudioInputStream changes (split into another change). #

Total comments: 34

Patch Set 8 : Address Dale's comments. Non-blocking pointer swapping in AOC. #

Patch Set 9 : Add done closure to MirroringDestination::RemoveInput(). #

Total comments: 10

Patch Set 10 : Moved Glue to cc file, and renamed to SourceSharingCallback. #

Total comments: 2

Patch Set 11 : Simplify! #

Total comments: 20

Patch Set 12 : Broke mirroring out of AudioRendererHost into separate AudioMirroringManager class. #

Total comments: 18

Patch Set 13 : Addressed tommi's comments (dependency injection for testing AudioMirroringManager). #

Total comments: 20

Patch Set 14 : Move Diverter interface into audio_io.h. Replace use of singleton with BrowserMainLoop. #

Total comments: 8

Patch Set 15 : AudioSourceDiverter now in its own file. Other tweaks, per Dale's comments. #

Total comments: 4

Patch Set 16 : media_observer_ can be NULL, sez every trybot. #

Patch Set 17 : Addressed Darin's comments. #

Patch Set 18 : Added guard against reentrancy in AudioMirroringManager methods. #

Total comments: 8

Patch Set 19 : Fix interface destructor link issue for win_aura. #

Patch Set 20 : Comment tweaks, per crogers@. #

Patch Set 21 : Disable mirroring on ios platform, since much of content is not compiled in. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1039 lines, -279 lines) Patch
M content/browser/browser_main_loop.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +9 lines, -0 lines 0 comments Download
A content/browser/renderer_host/media/audio_mirroring_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +108 lines, -0 lines 0 comments Download
A content/browser/renderer_host/media/audio_mirroring_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +164 lines, -0 lines 0 comments Download
A content/browser/renderer_host/media/audio_mirroring_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +234 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +11 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 6 chunks +38 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +51 lines, -57 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -1 line 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M content/test/webrtc_audio_device_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M content/test/webrtc_audio_device_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -2 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +14 lines, -3 lines 0 comments Download
M media/audio/audio_output_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +56 lines, -12 lines 0 comments Download
M media/audio/audio_output_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +293 lines, -197 lines 0 comments Download
A media/audio/audio_source_diverter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +40 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
Alpha Left Google
I don't see how WCAIS is created, can you elaborate on that? https://codereview.chromium.org/11413078/diff/1/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc ...
8 years, 1 month ago (2012-11-20 21:49:43 UTC) #1
miu
Hey Alpha, Thanks for the review comments. I believe I've addressed all of them. Some ...
8 years, 1 month ago (2012-11-21 08:27:48 UTC) #2
Alpha Left Google
https://codereview.chromium.org/11413078/diff/7001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/11413078/diff/7001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode71 content/browser/renderer_host/media/audio_renderer_host.cc:71: GlobalLookup& lookup = g_lookup.Get(); Make sure RegisterARG and DeregisterARH ...
8 years ago (2012-11-26 22:59:59 UTC) #3
miu
Addressed all your comments. Things are much cleaner now. Updated CL description to define the ...
8 years ago (2012-11-28 05:05:01 UTC) #4
Alpha Left Google
Some questions and comments on threading and ownership. I haven't looked at the implementation of ...
8 years ago (2012-11-28 20:02:25 UTC) #5
miu
Addressed your comments. PTAL. Thanks, Yuri https://codereview.chromium.org/11413078/diff/11007/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/11413078/diff/11007/content/browser/renderer_host/media/audio_renderer_host.cc#newcode260 content/browser/renderer_host/media/audio_renderer_host.cc:260: int render_process_id, int ...
8 years ago (2012-11-28 22:05:50 UTC) #6
Alpha Left Google
lgtm. Dale should have a close look at AOC.
8 years ago (2012-11-28 22:11:46 UTC) #7
miu
Dale/Chris, Would you PTAL also? Thanks, Yuri
8 years ago (2012-11-28 22:31:39 UTC) #8
DaleCurtis
I don't understand this change in relation to Justin's. He's already attaching virtual streams via ...
8 years ago (2012-11-28 23:55:48 UTC) #9
miu
On 2012/11/28 23:55:48, DaleCurtis wrote: > I don't understand this change in relation to Justin's. ...
8 years ago (2012-11-29 01:33:50 UTC) #10
miu
Hi all, I've addressed Alpha's and Dale's comments, and now believe this is change is ...
8 years ago (2012-12-04 22:51:23 UTC) #11
DaleCurtis
Nice tests! Looks mostly good. The one global concern I have is that you're making ...
8 years ago (2012-12-05 23:35:14 UTC) #12
miu
Dale, I've explained, in comment responses below, why so much of the "if checking" was ...
8 years ago (2012-12-11 02:30:45 UTC) #13
DaleCurtis
https://codereview.chromium.org/11413078/diff/24001/media/audio/audio_output_controller.cc File media/audio/audio_output_controller.cc (right): https://codereview.chromium.org/11413078/diff/24001/media/audio/audio_output_controller.cc#newcode306 media/audio/audio_output_controller.cc:306: void AudioOutputController::Glue::PassSoon(const scoped_refptr<Glue>& to) { This is all really ...
8 years ago (2012-12-12 01:29:15 UTC) #14
miu
Dale, Good design questions/concerns, which I've tried to explain further (below). If you're still not ...
8 years ago (2012-12-12 03:13:39 UTC) #15
DaleCurtis
https://codereview.chromium.org/11413078/diff/24001/media/audio/audio_output_controller.cc File media/audio/audio_output_controller.cc (right): https://codereview.chromium.org/11413078/diff/24001/media/audio/audio_output_controller.cc#newcode306 media/audio/audio_output_controller.cc:306: void AudioOutputController::Glue::PassSoon(const scoped_refptr<Glue>& to) { On 2012/12/12 03:13:39, Yuri ...
8 years ago (2012-12-12 20:38:38 UTC) #16
miu
Dale, Things got a ton simpler. Is this what you had in mind? -Yuri https://codereview.chromium.org/11413078/diff/24001/media/audio/audio_output_controller.cc ...
8 years ago (2012-12-13 01:22:51 UTC) #17
DaleCurtis
https://codereview.chromium.org/11413078/diff/35002/content/browser/renderer_host/media/audio_renderer_host.h File content/browser/renderer_host/media/audio_renderer_host.h (right): https://codereview.chromium.org/11413078/diff/35002/content/browser/renderer_host/media/audio_renderer_host.h#newcode110 content/browser/renderer_host/media/audio_renderer_host.h:110: static void StartMirroring( I worry somewhat about what seems ...
8 years ago (2012-12-17 20:00:46 UTC) #18
tommi (sloooow) - chröme
https://codereview.chromium.org/11413078/diff/11008/content/browser/renderer_host/media/audio_renderer_host.h File content/browser/renderer_host/media/audio_renderer_host.h (right): https://codereview.chromium.org/11413078/diff/11008/content/browser/renderer_host/media/audio_renderer_host.h#newcode97 content/browser/renderer_host/media/audio_renderer_host.h:97: virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; is int32 needed or ...
8 years ago (2012-12-18 13:41:25 UTC) #19
miu
Dale/Tommi, PTAL. No rush, as I'll be out-of-office until Thu Dec 27th. Thanks, Yuri https://codereview.chromium.org/11413078/diff/11008/content/browser/renderer_host/media/audio_renderer_host.h ...
8 years ago (2012-12-19 00:22:56 UTC) #20
DaleCurtis
Haven't taken another look yet, but don't forget to add someone from the security team ...
8 years ago (2012-12-19 02:55:06 UTC) #21
tommi (sloooow) - chröme
https://codereview.chromium.org/11413078/diff/41001/content/browser/renderer_host/media/audio_mirroring_manager.cc File content/browser/renderer_host/media/audio_mirroring_manager.cc (right): https://codereview.chromium.org/11413078/diff/41001/content/browser/renderer_host/media/audio_mirroring_manager.cc#newcode132 content/browser/renderer_host/media/audio_mirroring_manager.cc:132: if (session_it == sessions_.end() || destination != session_it->second) { ...
8 years ago (2012-12-19 12:27:53 UTC) #22
miu
https://codereview.chromium.org/11413078/diff/41001/content/browser/renderer_host/media/audio_mirroring_manager.cc File content/browser/renderer_host/media/audio_mirroring_manager.cc (right): https://codereview.chromium.org/11413078/diff/41001/content/browser/renderer_host/media/audio_mirroring_manager.cc#newcode132 content/browser/renderer_host/media/audio_mirroring_manager.cc:132: if (session_it == sessions_.end() || destination != session_it->second) { ...
7 years, 12 months ago (2012-12-28 23:03:49 UTC) #23
miu
On 2012/12/19 02:55:06, DaleCurtis wrote: > Haven't taken another look yet, but don't forget to ...
7 years, 12 months ago (2012-12-28 23:05:45 UTC) #24
DaleCurtis
Still going over the AudioMirroringManager. https://codereview.chromium.org/11413078/diff/46003/content/browser/renderer_host/media/audio_mirroring_manager.h File content/browser/renderer_host/media/audio_mirroring_manager.h (right): https://codereview.chromium.org/11413078/diff/46003/content/browser/renderer_host/media/audio_mirroring_manager.h#newcode81 content/browser/renderer_host/media/audio_mirroring_manager.h:81: static AudioMirroringManager* GetInstance(); Instead ...
7 years, 11 months ago (2013-01-02 21:56:44 UTC) #25
miu
Rebased, and moved a few things around per suggestions. PTAL. Thanks, Yuri https://codereview.chromium.org/11413078/diff/46003/content/browser/renderer_host/media/audio_mirroring_manager.h File content/browser/renderer_host/media/audio_mirroring_manager.h ...
7 years, 11 months ago (2013-01-03 22:30:42 UTC) #26
DaleCurtis
lgtm % nits. Nice work Yuri! https://codereview.chromium.org/11413078/diff/55001/content/browser/renderer_host/media/audio_mirroring_manager_unittest.cc File content/browser/renderer_host/media/audio_mirroring_manager_unittest.cc (right): https://codereview.chromium.org/11413078/diff/55001/content/browser/renderer_host/media/audio_mirroring_manager_unittest.cc#newcode28 content/browser/renderer_host/media/audio_mirroring_manager_unittest.cc:28: class MockDiverter : ...
7 years, 11 months ago (2013-01-08 19:23:33 UTC) #27
miu
1. Addressed Dale's comments. 2. Need security review (added cdn@) for AudioRendererHost::OnAssociateStreamWithProducer(). 3. Need OWNER ...
7 years, 11 months ago (2013-01-09 02:19:41 UTC) #28
darin (slow to review)
https://codereview.chromium.org/11413078/diff/71001/content/browser/renderer_host/media/audio_mirroring_manager.cc File content/browser/renderer_host/media/audio_mirroring_manager.cc (right): https://codereview.chromium.org/11413078/diff/71001/content/browser/renderer_host/media/audio_mirroring_manager.cc#newcode100 content/browser/renderer_host/media/audio_mirroring_manager.cc:100: diverter->StartDiverting( What happens if a Diverter calls Add/RemoveDiverter inside ...
7 years, 11 months ago (2013-01-09 05:06:52 UTC) #29
miu
https://codereview.chromium.org/11413078/diff/71001/content/browser/renderer_host/media/audio_mirroring_manager.cc File content/browser/renderer_host/media/audio_mirroring_manager.cc (right): https://codereview.chromium.org/11413078/diff/71001/content/browser/renderer_host/media/audio_mirroring_manager.cc#newcode100 content/browser/renderer_host/media/audio_mirroring_manager.cc:100: diverter->StartDiverting( On 2013/01/09 05:06:53, darin wrote: > What happens ...
7 years, 11 months ago (2013-01-09 07:21:49 UTC) #30
darin (slow to review)
On Tue, Jan 8, 2013 at 11:21 PM, <miu@chromium.org> wrote: > > https://codereview.chromium.**org/11413078/diff/71001/** > content/browser/renderer_host/**media/audio_mirroring_manager.**cc<https://codereview.chromium.org/11413078/diff/71001/content/browser/renderer_host/media/audio_mirroring_manager.cc> ...
7 years, 11 months ago (2013-01-09 09:16:38 UTC) #31
miu
On 2013/01/09 09:16:38, darin wrote: > You should at least add a DCHECK. Seriously. Large ...
7 years, 11 months ago (2013-01-09 20:02:07 UTC) #32
darin (slow to review)
Thanks, LGTM.
7 years, 11 months ago (2013-01-09 20:19:24 UTC) #33
Chris Rogers
Yuri, this looks ok from a high-level. I've done some moderate review, but otherwise am ...
7 years, 11 months ago (2013-01-09 21:18:43 UTC) #34
Cris Neckar
IPC security audit LGTM
7 years, 11 months ago (2013-01-10 19:29:23 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/11413078/74023
7 years, 11 months ago (2013-01-10 20:10:33 UTC) #36
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 11 months ago (2013-01-10 20:31:30 UTC) #37
miu
https://codereview.chromium.org/11413078/diff/81002/content/browser/renderer_host/media/audio_mirroring_manager.h File content/browser/renderer_host/media/audio_mirroring_manager.h (right): https://codereview.chromium.org/11413078/diff/81002/content/browser/renderer_host/media/audio_mirroring_manager.h#newcode91 content/browser/renderer_host/media/audio_mirroring_manager.h:91: typedef std::pair<int, int> Target; On 2013/01/09 21:18:44, Chris Rogers ...
7 years, 11 months ago (2013-01-10 21:23:26 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/11413078/72027
7 years, 11 months ago (2013-01-10 21:24:36 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/11413078/78015
7 years, 11 months ago (2013-01-11 03:02:59 UTC) #40
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) nacl_integration
7 years, 11 months ago (2013-01-11 06:29:31 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/11413078/78015
7 years, 11 months ago (2013-01-11 06:54:32 UTC) #42
commit-bot: I haz the power
7 years, 11 months ago (2013-01-11 09:31:49 UTC) #43
Message was sent while issue was closed.
Change committed as 176295

Powered by Google App Engine
This is Rietveld 408576698