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

Issue 734993002: Makes the WebRTC fake device capable of playing audio from a file. (Closed)

Created:
6 years, 1 month ago by phoglund_chromium
Modified:
6 years, 1 month 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
Project:
chromium
Visibility:
Public.

Description

Makes the WebRTC fake device capable of playing audio from a file. The purpose of this patch is to be able to do advanced audio testing, such as AGC testing and (if possible) AEC testing. The patch adds a new flag --use-file-for-fake-audio-capture, similar to --use-file-for-fake-video-capture on the video side. It takes as argument a file to play back on the fake devices instead of the default generated beep sound. The new flag is to be used together with --use-fake-devices-for-media-stream (if the new flag isn't specified, the former flag will play beep sounds as usual). I think adding a new flag makes sense for now, but we could look at coalescing these flags in a later patch since more flags = bad. As for the implementation, I considered creating a new file fake input stream on the side of the old one, and have audio_manager_base.cc choose between the two implementations depending on how the flags were set. I ended up not doing since the two classes would have a lot in common, notably all the timing code. Another option could be to pull beeping/playing from file into a new abstraction which the fake input call stream calls into. I think the current implementation is reasonable though. Also, this patch will require the audio file to be in exactly the same format as the audio bus on the system. We may want to add resampling support later if this turns out to be a problem on the bots. Developed together with xians@. BUG=421054 R=dalecurtis@chromium.org Committed: https://crrev.com/4cdbc38ac425f5f66467c1290f11aa0e7e98c6a3 Cr-Commit-Position: refs/heads/master@{#305195}

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 22

Patch Set 3 : Addressed comments. #

Patch Set 4 : Fixing bug which broke the beep mode. #

Total comments: 2

Patch Set 5 : Addressed second batch of comments. #

Patch Set 6 : #

Patch Set 7 : Fixed compile errors :) #

Total comments: 2

Patch Set 8 : output -> input #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -15 lines) Patch
M media/audio/fake_audio_input_stream.h View 1 2 3 4 5 3 chunks +17 lines, -4 lines 0 comments Download
M media/audio/fake_audio_input_stream.cc View 1 2 3 4 5 6 7 chunks +107 lines, -10 lines 0 comments Download
M media/base/media_switches.h View 1 chunk +1 line, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -1 line 0 comments Download

Messages

Total messages: 15 (1 generated)
phoglund_chromium
Hi Dale! Shijing suggested you'd be a good reviewer for this patch. Let me know ...
6 years, 1 month ago (2014-11-18 12:30:42 UTC) #1
DaleCurtis
https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc#newcode70 media/audio/fake_audio_input_stream.cc:70: return scoped_ptr<char[]>(); Does nullptr work? https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc#newcode75 media/audio/fake_audio_input_stream.cc:75: CHECK(wav_file_length < ...
6 years, 1 month ago (2014-11-18 21:59:17 UTC) #2
DaleCurtis
I see your comment in the body about bot format, I think this will definitely ...
6 years, 1 month ago (2014-11-18 22:00:42 UTC) #3
phoglund_chromium
On 2014/11/18 22:00:42, DaleCurtis wrote: > I see your comment in the body about bot ...
6 years, 1 month ago (2014-11-19 09:56:00 UTC) #4
phoglund_chromium
https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc#newcode70 media/audio/fake_audio_input_stream.cc:70: return scoped_ptr<char[]>(); On 2014/11/18 21:59:17, DaleCurtis wrote: > Does ...
6 years, 1 month ago (2014-11-19 09:56:09 UTC) #5
phoglund_chromium
Friendly ping :)
6 years, 1 month ago (2014-11-20 12:13:24 UTC) #6
DaleCurtis
So long as there are no main waterfall bots enabling this in tests, I think ...
6 years, 1 month ago (2014-11-20 19:13:47 UTC) #7
phoglund_chromium
PTAL https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/734993002/diff/20001/media/audio/fake_audio_input_stream.cc#newcode226 media/audio/fake_audio_input_stream.cc:226: wav_file_read_pos_ += bytes_written; On 2014/11/20 19:13:47, DaleCurtis wrote: ...
6 years, 1 month ago (2014-11-20 19:48:31 UTC) #8
DaleCurtis
https://codereview.chromium.org/734993002/diff/120001/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/734993002/diff/120001/media/base/media_switches.cc#newcode102 media/base/media_switches.cc:102: // sampling frequency as the system's output device. input ...
6 years, 1 month ago (2014-11-20 20:30:42 UTC) #9
DaleCurtis
Also lgtm % clarity.
6 years, 1 month ago (2014-11-20 20:30:57 UTC) #10
phoglund_chromium
https://codereview.chromium.org/734993002/diff/120001/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/734993002/diff/120001/media/base/media_switches.cc#newcode102 media/base/media_switches.cc:102: // sampling frequency as the system's output device. On ...
6 years, 1 month ago (2014-11-21 08:47:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/734993002/140001
6 years, 1 month ago (2014-11-21 08:48:32 UTC) #13
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years, 1 month ago (2014-11-21 10:17:53 UTC) #14
commit-bot: I haz the power
6 years, 1 month ago (2014-11-21 10:18:40 UTC) #15
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/4cdbc38ac425f5f66467c1290f11aa0e7e98c6a3
Cr-Commit-Position: refs/heads/master@{#305195}

Powered by Google App Engine
This is Rietveld 408576698