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

Issue 922663002: Moved the fake input stream's processing onto the audio worker thread. (Closed)

Created:
5 years, 10 months ago by phoglund_chromium
Modified:
5 years, 10 months ago
Reviewers:
DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Moved the fake input stream's processing onto the audio worker thread. The reason for this is that the fake input stream would not work on Mac where the audio non-worker code runs on the UI thread. Therefore, the fake input stream would get starved for instance in the WebRTC audio quality tests and not play any audio (those tests block the UI thread while recording). This patch introduces a worker precisely like the fake audio consumer used by the fake output stream. BUG=453907, 446859 Committed: https://crrev.com/9e0a7c10163c9c22adad3135a1d9fc5c3682a592 Cr-Commit-Position: refs/heads/master@{#317557}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Refactored out a audio provider to make unit testing easier / cleaner code #

Patch Set 4 : #

Patch Set 5 : Moved flag logic from provider to input stream, added unit test #

Total comments: 1

Patch Set 6 : Moving browser test updates to a separate patch (this one is big enough) #

Total comments: 4

Patch Set 7 : #

Total comments: 16

Patch Set 8 : Actually deleted fake audio consumer, fixed dependencies, moved sources #

Patch Set 9 : void Callback -> Closure #

Patch Set 10 : Removed unused bus. #

Patch Set 11 : Updating GN files #

Total comments: 49

Patch Set 12 : Addressing comments #

Patch Set 13 : Fixed win compile issue and bug in automatic beep mode #

Total comments: 2

Patch Set 14 : Removing SimpleSource, minor cleanup #

Patch Set 15 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+484 lines, -798 lines) Patch
M content/browser/media/capture/web_contents_audio_muter.cc View 1 2 3 4 5 6 7 3 chunks +11 lines, -8 lines 0 comments Download
M media/audio/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -3 lines 0 comments Download
M media/audio/audio_io.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -3 lines 0 comments Download
D media/audio/fake_audio_consumer.h View 1 2 3 4 5 6 1 chunk +0 lines, -55 lines 0 comments Download
D media/audio/fake_audio_consumer.cc View 1 2 3 4 5 6 1 chunk +0 lines, -163 lines 0 comments Download
M media/audio/fake_audio_consumer_unittest.cc View 1 2 3 4 5 6 1 chunk +0 lines, -142 lines 0 comments Download
M media/audio/fake_audio_input_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +21 lines, -45 lines 0 comments Download
M media/audio/fake_audio_input_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +45 lines, -250 lines 0 comments Download
M media/audio/fake_audio_output_stream.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M media/audio/fake_audio_output_stream.cc View 1 2 3 4 5 6 3 chunks +7 lines, -5 lines 0 comments Download
A + media/audio/fake_audio_worker.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +16 lines, -17 lines 0 comments Download
A + media/audio/fake_audio_worker.cc View 1 2 3 4 5 6 7 8 9 4 chunks +39 lines, -44 lines 0 comments Download
A + media/audio/fake_audio_worker_unittest.cc View 1 2 3 4 5 6 4 chunks +34 lines, -35 lines 0 comments Download
M media/audio/null_audio_sink.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -3 lines 0 comments Download
M media/audio/null_audio_sink.cc View 1 2 3 4 5 6 7 6 chunks +10 lines, -9 lines 0 comments Download
M media/audio/simple_sources.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +53 lines, -1 line 0 comments Download
M media/audio/simple_sources.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +220 lines, -0 lines 0 comments Download
M media/audio/virtual_audio_input_stream.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -3 lines 0 comments Download
M media/audio/virtual_audio_input_stream.cc View 1 2 3 4 5 6 7 3 chunks +7 lines, -6 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (3 generated)
phoglund_chromium
5 years, 10 months ago (2015-02-12 13:51:05 UTC) #2
DaleCurtis
Please add a unittest similar to FakeAudioConsumerUnittest, this is tricky code to get right, so ...
5 years, 10 months ago (2015-02-12 19:28:23 UTC) #3
phoglund_chromium
On 2015/02/12 19:28:23, DaleCurtis wrote: > Please add a unittest similar to FakeAudioConsumerUnittest, this is ...
5 years, 10 months ago (2015-02-13 15:41:56 UTC) #4
phoglund_chromium
All right, PTAL https://codereview.chromium.org/922663002/diff/80001/media/audio/fake_audio_provider_unittest.cc File media/audio/fake_audio_provider_unittest.cc (right): https://codereview.chromium.org/922663002/diff/80001/media/audio/fake_audio_provider_unittest.cc#newcode20 media/audio/fake_audio_provider_unittest.cc:20: class FakeAudioProviderTest : public ::testing::TestWithParam<bool> { ...
5 years, 10 months ago (2015-02-17 09:50:06 UTC) #5
DaleCurtis
Thinking more generically, I wonder if we should rename FakeAudioConsumer to FakeAudioWorker or something similar ...
5 years, 10 months ago (2015-02-17 23:27:50 UTC) #6
phoglund_chromium
On 2015/02/17 23:27:50, DaleCurtis wrote: > Thinking more generically, I wonder if we should rename ...
5 years, 10 months ago (2015-02-18 10:21:58 UTC) #7
phoglund_chromium
https://codereview.chromium.org/922663002/diff/100001/media/audio/fake_audio_provider.cc File media/audio/fake_audio_provider.cc (right): https://codereview.chromium.org/922663002/diff/100001/media/audio/fake_audio_provider.cc#newcode130 media/audio/fake_audio_provider.cc:130: void LoadWavFileIntoWorker(const base::FilePath& wav_filename); On 2015/02/17 23:27:49, DaleCurtis wrote: ...
5 years, 10 months ago (2015-02-18 10:22:06 UTC) #8
phoglund_chromium
PTAL https://codereview.chromium.org/922663002/diff/120001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/922663002/diff/120001/media/audio/fake_audio_input_stream.cc#newcode109 media/audio/fake_audio_input_stream.cc:109: class FakeAudioInputStream::FileSource : public AudioConverter::InputCallback, It felt wrong ...
5 years, 10 months ago (2015-02-18 16:38:15 UTC) #9
DaleCurtis
Looking good, don't forget to update the BUILD.gn files too. https://codereview.chromium.org/922663002/diff/120001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/922663002/diff/120001/media/audio/fake_audio_input_stream.cc#newcode109 ...
5 years, 10 months ago (2015-02-18 19:04:50 UTC) #10
phoglund_chromium
Turns out the fake audio consumer was used in some other places I missed so ...
5 years, 10 months ago (2015-02-19 15:44:11 UTC) #11
DaleCurtis
https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.cc#newcode97 media/audio/fake_audio_input_stream.cc:97: if (audio_source_.get() == nullptr) { just use if (!audio_source_) ...
5 years, 10 months ago (2015-02-19 19:54:54 UTC) #12
phoglund_chromium
PTAL https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.cc#newcode97 media/audio/fake_audio_input_stream.cc:97: if (audio_source_.get() == nullptr) { On 2015/02/19 19:54:52, ...
5 years, 10 months ago (2015-02-20 14:22:01 UTC) #13
DaleCurtis
lgtm % removing SimpleSource and making the AudioSourceCallback destructor public. https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.h File media/audio/fake_audio_input_stream.h (right): https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.h#newcode23 ...
5 years, 10 months ago (2015-02-20 18:45:06 UTC) #14
phoglund_chromium
https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.h File media/audio/fake_audio_input_stream.h (right): https://codereview.chromium.org/922663002/diff/200001/media/audio/fake_audio_input_stream.h#newcode23 media/audio/fake_audio_input_stream.h:23: class SimpleSource; On 2015/02/20 18:45:05, DaleCurtis wrote: > On ...
5 years, 10 months ago (2015-02-23 09:16:41 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/922663002/270001
5 years, 10 months ago (2015-02-23 09:26:58 UTC) #18
commit-bot: I haz the power
Committed patchset #15 (id:270001)
5 years, 10 months ago (2015-02-23 10:20:16 UTC) #19
commit-bot: I haz the power
5 years, 10 months ago (2015-02-23 10:20:41 UTC) #20
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/9e0a7c10163c9c22adad3135a1d9fc5c3682a592
Cr-Commit-Position: refs/heads/master@{#317557}

Powered by Google App Engine
This is Rietveld 408576698