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

Side by Side Diff: webrtc/modules/audio_processing/test/test_utils.h

Issue 1423693008: Revert of Add aecdump support to audioproc_f. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 5 years, 1 month 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 10
(...skipping 25 matching lines...) Expand all
36 36
37 void WriteSamples(const int16_t* samples, size_t num_samples); 37 void WriteSamples(const int16_t* samples, size_t num_samples);
38 void WriteSamples(const float* samples, size_t num_samples); 38 void WriteSamples(const float* samples, size_t num_samples);
39 39
40 private: 40 private:
41 FILE* file_handle_; 41 FILE* file_handle_;
42 42
43 RTC_DISALLOW_COPY_AND_ASSIGN(RawFile); 43 RTC_DISALLOW_COPY_AND_ASSIGN(RawFile);
44 }; 44 };
45 45
46 // Reads ChannelBuffers from a provided WavReader.
47 class ChannelBufferWavReader final {
48 public:
49 explicit ChannelBufferWavReader(rtc::scoped_ptr<WavReader> file);
50
51 // Reads data from the file according to the |buffer| format. Returns false if
52 // a full buffer can't be read from the file.
53 bool Read(ChannelBuffer<float>* buffer);
54
55 private:
56 rtc::scoped_ptr<WavReader> file_;
57 std::vector<float> interleaved_;
58
59 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelBufferWavReader);
60 };
61
62 // Writes ChannelBuffers to a provided WavWriter.
63 class ChannelBufferWavWriter final {
64 public:
65 explicit ChannelBufferWavWriter(rtc::scoped_ptr<WavWriter> file);
66 void Write(const ChannelBuffer<float>& buffer);
67
68 private:
69 rtc::scoped_ptr<WavWriter> file_;
70 std::vector<float> interleaved_;
71
72 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelBufferWavWriter);
73 };
74
75 void WriteIntData(const int16_t* data, 46 void WriteIntData(const int16_t* data,
76 size_t length, 47 size_t length,
77 WavWriter* wav_file, 48 WavWriter* wav_file,
78 RawFile* raw_file); 49 RawFile* raw_file);
79 50
80 void WriteFloatData(const float* const* data, 51 void WriteFloatData(const float* const* data,
81 int samples_per_channel, 52 int samples_per_channel,
82 int num_channels, 53 int num_channels,
83 WavWriter* wav_file, 54 WavWriter* wav_file,
84 RawFile* raw_file); 55 RawFile* raw_file);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return values; 111 return values;
141 } 112 }
142 113
143 // Parses the array geometry from the command line. 114 // Parses the array geometry from the command line.
144 // 115 //
145 // If a vector with size != num_mics is returned, an error has occurred and an 116 // If a vector with size != num_mics is returned, an error has occurred and an
146 // appropriate error message has been printed to stdout. 117 // appropriate error message has been printed to stdout.
147 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions, 118 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions,
148 size_t num_mics); 119 size_t num_mics);
149 120
150 // Same as above, but without the num_mics check for when it isn't available.
151 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions);
152
153 } // namespace webrtc 121 } // namespace webrtc
154 122
155 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_TEST_UTILS_H_ 123 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/process_test.cc ('k') | webrtc/modules/audio_processing/test/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698