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

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed)

Created:
8 years, 1 month ago by justinlin
Modified:
8 years ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, jam, joi+watch-content_chromium.org, darin-cc_chromium.org, Chris Rogers, Alpha Left Google, mark a. foltz
Visibility:
Public.

Description

Goal: Provide browser-wide audio mirroring for the TabCapture API. This CL introduces VirtualAudio{Input,Output}Streams to handle redirecting audio output from Chrome into a virtual input stream to be used as "fake" microphone input. That stream could then be used through WebRTC peer connection, essentially playing back audio from the browser remotely. Limitations: Currently, only one VirtualAudioInputStream is supported, so we can only capture browser-wide audio once. Subsequent requests for audio through the TabCapture API will result in no audio for that stream. Overview: When a VirtualAudioInputStream is created (which is triggered by the Chrome TabCapture API), we trigger a device change event which will cause all currently active output streams to be recreated as VirtualAudioOutputStreams. These will attach to the virtual input stream when they start/resume playback. When the VirtualAudioInputStream is to be released, it triggers another device change event to revert all the output streams back to output to sound hardware. The VirtualAudioOutputStreams must detach from the VirtualAudioInputStream when they are stopped, thus VirtualAudioInputStream must outlive all VirtualAudioOutputStreams. BUG=153392 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170892

Patch Set 1 #

Total comments: 12

Patch Set 2 : Checkpoint, still crashy for some reason #

Patch Set 3 : Relevant files only. #

Total comments: 4

Patch Set 4 : Cleaned up! #

Patch Set 5 : Fix TabCapture API test #

Total comments: 57

Patch Set 6 : Adress comments #

Total comments: 16

Patch Set 7 : Review comments, some unit tests, move attach/detach into virtual audio output stream #

Total comments: 61

Patch Set 8 : Review comments, finish unit_tests #

Total comments: 6

Patch Set 9 : Adress nits #

Total comments: 36

Patch Set 10 : Adress Dale's comments #

Patch Set 11 : Tests for VAOS, more tests for VAIS, some nit fixes #

Patch Set 12 : Fix more nits, disable for ios #

Total comments: 52

Patch Set 13 : Adress nits and comments #

Patch Set 14 : last nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1017 lines, -7 lines) Patch
M content/browser/renderer_host/media/audio_input_renderer_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/web_contents_capture_util.h View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/web_contents_capture_util.cc View 1 2 3 4 5 6 7 1 chunk +30 lines, -1 line 0 comments Download
M media/audio/audio_manager_base.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M media/audio/audio_manager_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +51 lines, -3 lines 0 comments Download
M media/audio/audio_parameters.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_input_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +101 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_input_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +173 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_input_stream_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +335 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_output_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +71 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_output_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +79 lines, -0 lines 0 comments Download
A media/audio/virtual_audio_output_stream_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +129 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
DaleCurtis
http://codereview.chromium.org/11298006/diff/1/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): http://codereview.chromium.org/11298006/diff/1/media/audio/audio_manager_base.cc#newcode112 media/audio/audio_manager_base.cc:112: audio_thread_->message_loop()->PostTask(FROM_HERE, base::Bind( I believe this is already on the ...
8 years, 1 month ago (2012-11-07 23:34:17 UTC) #1
justinlin
Hi Dale, please take another look at the changes in media/audio/. Note that I'll remove ...
8 years, 1 month ago (2012-11-20 08:56:10 UTC) #2
DaleCurtis
For the sake of time, what exactly is final in this review? The rough outline ...
8 years, 1 month ago (2012-11-20 20:00:46 UTC) #3
justinlin
Pretty much everything except that part, the Register/Unregister output streams and the hack in audio_manager_base.cc ...
8 years, 1 month ago (2012-11-20 20:11:45 UTC) #4
DaleCurtis
Meant to go over this today, but was attacked by bugs. I'll take a look ...
8 years, 1 month ago (2012-11-21 00:53:25 UTC) #5
wjia(left Chromium)
I didn't look into audio stuff (leaving it to audio experts). content/*/media lgtm.
8 years, 1 month ago (2012-11-21 01:37:49 UTC) #6
miu
Noticed this one thing while I was taking a quick glance at things. I plan ...
8 years, 1 month ago (2012-11-21 07:29:48 UTC) #7
justinlin
Good thing you guys didn't have time to look at it Today. Cleaned up the ...
8 years, 1 month ago (2012-11-21 08:09:53 UTC) #8
DaleCurtis
This needs at least one combined unittest. Preferably unit tests for both the input and ...
8 years, 1 month ago (2012-11-21 23:45:42 UTC) #9
miu
BTW, you should change the CL description: Remove the word "tab" since this is browser-wide ...
8 years, 1 month ago (2012-11-22 00:53:49 UTC) #10
justinlin
Adressed comments. Will add unit tests next. I'm seeing a weird issue sometimes where I ...
8 years ago (2012-11-26 20:19:20 UTC) #11
miu
https://codereview.chromium.org/11298006/diff/20001/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): https://codereview.chromium.org/11298006/diff/20001/media/audio/audio_manager_base.cc#newcode143 media/audio/audio_manager_base.cc:143: // tab, so subsequent tab capture requests will just ...
8 years ago (2012-11-26 21:14:55 UTC) #12
no longer working on chromium
Some initial comments, and will take another look at the rest of files tomorrow. https://codereview.chromium.org/11298006/diff/20001/content/browser/renderer_host/media/media_stream_manager.cc ...
8 years ago (2012-11-26 22:20:06 UTC) #13
no longer working on chromium
+1 on adding unittests for such a CL. I can do more reviewing after having ...
8 years ago (2012-11-27 12:36:15 UTC) #14
justinlin
Thanks for all the comments! Still working on adding more/improving the unit tests (kind of ...
8 years ago (2012-11-27 22:26:12 UTC) #15
Alpha Left Google
I like the high level approach of having only one VirtualAudioOuptutStream and have all AudioOutputStreams ...
8 years ago (2012-11-28 01:04:46 UTC) #16
justinlin
thanks for the fresh look on things Alpha! addressed all the comments, tried to make ...
8 years ago (2012-11-28 14:30:31 UTC) #17
Alpha Left Google
Much cleaner now. Some more nits and lgtm. Owners should review this file. https://codereview.chromium.org/11298006/diff/20008/media/audio/audio_manager_base.cc File ...
8 years ago (2012-11-28 21:26:50 UTC) #18
DaleCurtis
https://codereview.chromium.org/11298006/diff/15014/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/11298006/diff/15014/media/audio/audio_parameters.h#newcode29 media/audio/audio_parameters.h:29: enum Format { On 2012/11/26 20:19:20, justinlin wrote: > ...
8 years ago (2012-11-28 23:43:18 UTC) #19
miu
https://codereview.chromium.org/11298006/diff/19002/media/audio/virtual_audio_input_stream.cc File media/audio/virtual_audio_input_stream.cc (right): https://codereview.chromium.org/11298006/diff/19002/media/audio/virtual_audio_input_stream.cc#newcode49 media/audio/virtual_audio_input_stream.cc:49: * base::Time::kMillisecondsPerSecond On 2012/11/28 23:43:18, DaleCurtis wrote: > operators ...
8 years ago (2012-11-29 01:57:40 UTC) #20
justinlin
Thanks for the review Dale and Yuri! Addressed all the comments. More tests coming.. https://codereview.chromium.org/11298006/diff/15014/media/audio/audio_parameters.h ...
8 years ago (2012-11-29 10:08:32 UTC) #21
justinlin
https://codereview.chromium.org/11298006/diff/19002/media/audio/virtual_audio_output_stream.h File media/audio/virtual_audio_output_stream.h (right): https://codereview.chromium.org/11298006/diff/19002/media/audio/virtual_audio_output_stream.h#newcode42 media/audio/virtual_audio_output_stream.h:42: virtual ~VirtualAudioOutputStream(); On 2012/11/28 23:43:18, DaleCurtis wrote: > Hmm ...
8 years ago (2012-11-29 10:22:01 UTC) #22
henrika (OOO until Aug 14)
I assume that this CL requires a substantial amount of manual tests as well to ...
8 years ago (2012-11-29 12:16:21 UTC) #23
no longer working on chromium
Hi Justin, I am currently quite busy with some UI work, if you don't mind, ...
8 years ago (2012-11-29 15:54:50 UTC) #24
justinlin
Added more tests. Please take another look Dale, when possible. Also, I removed the DCHECK's ...
8 years ago (2012-11-29 23:24:34 UTC) #25
DaleCurtis
Mostly style nits, but some concerns with CalledOnAudioThread(). https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc#newcode146 media/audio/audio_manager_base.cc:146: #if ...
8 years ago (2012-12-03 19:27:28 UTC) #26
justinlin
Thanks! Sorry, I misunderstood part of the style guide. I thought that when you 4-space ...
8 years ago (2012-12-03 21:18:42 UTC) #27
DaleCurtis
lgtm https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc#newcode163 media/audio/audio_manager_base.cc:163: &AudioManagerBase::NotifyAllOutputDeviceChangeListeners, On 2012/12/03 21:18:42, justinlin wrote: > On ...
8 years ago (2012-12-03 21:30:56 UTC) #28
justinlin
Thanks! https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): https://codereview.chromium.org/11298006/diff/12013/media/audio/audio_manager_base.cc#newcode163 media/audio/audio_manager_base.cc:163: &AudioManagerBase::NotifyAllOutputDeviceChangeListeners, On 2012/12/03 21:30:56, DaleCurtis wrote: > On ...
8 years ago (2012-12-03 22:01:48 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/11298006/18079
8 years ago (2012-12-03 22:04:36 UTC) #30
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests
8 years ago (2012-12-04 03:13:50 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/11298006/18079
8 years ago (2012-12-04 03:22:16 UTC) #32
commit-bot: I haz the power
8 years ago (2012-12-04 06:16:25 UTC) #33
Message was sent while issue was closed.
Change committed as 170892

Powered by Google App Engine
This is Rietveld 408576698