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

Side by Side Diff: webrtc/test/fake_audio_device.h

Issue 2694203002: Low-bandwidth audio testing (Closed)
Patch Set: Move BoundedWavFileWriter and add unittests for it Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_ 10 #ifndef WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 std::string filename, int sampling_frequency_in_hz); 82 std::string filename, int sampling_frequency_in_hz);
83 83
84 // Returns a Capturer instance that gets its data from a file. 84 // Returns a Capturer instance that gets its data from a file.
85 // Automatically detects sample rate. 85 // Automatically detects sample rate.
86 static std::unique_ptr<Capturer> CreateWavFileReader(std::string filename); 86 static std::unique_ptr<Capturer> CreateWavFileReader(std::string filename);
87 87
88 // Returns a Renderer instance that writes its data to a file. 88 // Returns a Renderer instance that writes its data to a file.
89 static std::unique_ptr<Renderer> CreateWavFileWriter( 89 static std::unique_ptr<Renderer> CreateWavFileWriter(
90 std::string filename, int sampling_frequency_in_hz); 90 std::string filename, int sampling_frequency_in_hz);
91 91
92 // Returns a Renderer instance that writes its data to a file a WAV file,
stefan-webrtc 2017/03/20 14:40:10 "to a WAV file"
oprypin_webrtc 2017/03/20 15:09:16 Done.
93 // cutting off silence at the beginning (not necessarily perfect silence, see
94 // kAmplitudeThreshold) and at the end (only actual 0 samples in this case).
95 static std::unique_ptr<Renderer> CreateBoundedWavFileWriter(
96 std::string filename, int sampling_frequency_in_hz);
97
92 // Returns a Renderer instance that does nothing with the audio data. 98 // Returns a Renderer instance that does nothing with the audio data.
93 static std::unique_ptr<Renderer> CreateDiscardRenderer( 99 static std::unique_ptr<Renderer> CreateDiscardRenderer(
94 int sampling_frequency_in_hz); 100 int sampling_frequency_in_hz);
95 101
96 int32_t Init() override; 102 int32_t Init() override;
97 int32_t RegisterAudioCallback(AudioTransport* callback) override; 103 int32_t RegisterAudioCallback(AudioTransport* callback) override;
98 104
99 int32_t StartPlayout() override; 105 int32_t StartPlayout() override;
100 int32_t StopPlayout() override; 106 int32_t StopPlayout() override;
101 int32_t StartRecording() override; 107 int32_t StartRecording() override;
(...skipping 27 matching lines...) Expand all
129 std::vector<int16_t> playout_buffer_ GUARDED_BY(lock_); 135 std::vector<int16_t> playout_buffer_ GUARDED_BY(lock_);
130 rtc::BufferT<int16_t> recording_buffer_ GUARDED_BY(lock_); 136 rtc::BufferT<int16_t> recording_buffer_ GUARDED_BY(lock_);
131 137
132 std::unique_ptr<EventTimerWrapper> tick_; 138 std::unique_ptr<EventTimerWrapper> tick_;
133 rtc::PlatformThread thread_; 139 rtc::PlatformThread thread_;
134 }; 140 };
135 } // namespace test 141 } // namespace test
136 } // namespace webrtc 142 } // namespace webrtc
137 143
138 #endif // WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_ 144 #endif // WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698