OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 void RunAgc() { | 86 void RunAgc() { |
87 test::TraceToStderr trace_to_stderr(true); | 87 test::TraceToStderr trace_to_stderr(true); |
88 FILE* in_file = fopen(FLAGS_in.c_str(), "rb"); | 88 FILE* in_file = fopen(FLAGS_in.c_str(), "rb"); |
89 ASSERT_TRUE(in_file != NULL); | 89 ASSERT_TRUE(in_file != NULL); |
90 FILE* out_file = fopen(FLAGS_out.c_str(), "wb"); | 90 FILE* out_file = fopen(FLAGS_out.c_str(), "wb"); |
91 ASSERT_TRUE(out_file != NULL); | 91 ASSERT_TRUE(out_file != NULL); |
92 | 92 |
93 int gain_map[256]; | 93 int gain_map[256]; |
94 if (FLAGS_gain_file != "") { | 94 if (!FLAGS_gain_file.empty()) { |
95 FILE* gain_file = fopen(FLAGS_gain_file.c_str(), "rt"); | 95 FILE* gain_file = fopen(FLAGS_gain_file.c_str(), "rt"); |
96 ASSERT_TRUE(gain_file != NULL); | 96 ASSERT_TRUE(gain_file != NULL); |
97 ReadGainMapFromFile(gain_file, FLAGS_gain_offset, gain_map); | 97 ReadGainMapFromFile(gain_file, FLAGS_gain_offset, gain_map); |
98 fclose(gain_file); | 98 fclose(gain_file); |
99 } else { | 99 } else { |
100 CalculateGainMap(FLAGS_mic_gain, FLAGS_gain_offset, gain_map); | 100 CalculateGainMap(FLAGS_mic_gain, FLAGS_gain_offset, gain_map); |
101 } | 101 } |
102 | 102 |
103 FakeVoEExternalMedia media; | 103 FakeVoEExternalMedia media; |
104 MockVoEVolumeControl volume; | 104 MockVoEVolumeControl volume; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 } // namespace | 147 } // namespace |
148 } // namespace webrtc | 148 } // namespace webrtc |
149 | 149 |
150 int main(int argc, char* argv[]) { | 150 int main(int argc, char* argv[]) { |
151 google::SetUsageMessage(webrtc::kUsage); | 151 google::SetUsageMessage(webrtc::kUsage); |
152 google::ParseCommandLineFlags(&argc, &argv, true); | 152 google::ParseCommandLineFlags(&argc, &argv, true); |
153 webrtc::RunAgc(); | 153 webrtc::RunAgc(); |
154 return 0; | 154 return 0; |
155 } | 155 } |
OLD | NEW |