| OLD | NEW |
| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 int output_freq_hz, | 105 int output_freq_hz, |
| 106 NumOutputChannels exptected_output_channels) | 106 NumOutputChannels exptected_output_channels) |
| 107 : clock_(0), | 107 : clock_(0), |
| 108 acm_(webrtc::AudioCodingModule::Create(0, &clock_)), | 108 acm_(webrtc::AudioCodingModule::Create(0, &clock_)), |
| 109 packet_source_(packet_source), | 109 packet_source_(packet_source), |
| 110 audio_sink_(audio_sink), | 110 audio_sink_(audio_sink), |
| 111 output_freq_hz_(output_freq_hz), | 111 output_freq_hz_(output_freq_hz), |
| 112 exptected_output_channels_(exptected_output_channels) { | 112 exptected_output_channels_(exptected_output_channels) { |
| 113 } | 113 } |
| 114 | 114 |
| 115 AcmReceiveTestOldApi::~AcmReceiveTestOldApi() = default; |
| 116 |
| 115 void AcmReceiveTestOldApi::RegisterDefaultCodecs() { | 117 void AcmReceiveTestOldApi::RegisterDefaultCodecs() { |
| 116 CodecInst my_codec_param; | 118 CodecInst my_codec_param; |
| 117 for (int n = 0; n < acm_->NumberOfCodecs(); n++) { | 119 for (int n = 0; n < acm_->NumberOfCodecs(); n++) { |
| 118 ASSERT_EQ(0, acm_->Codec(n, &my_codec_param)) << "Failed to get codec."; | 120 ASSERT_EQ(0, acm_->Codec(n, &my_codec_param)) << "Failed to get codec."; |
| 119 if (ModifyAndUseThisCodec(&my_codec_param)) { | 121 if (ModifyAndUseThisCodec(&my_codec_param)) { |
| 120 ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param)) | 122 ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param)) |
| 121 << "Couldn't register receive codec.\n"; | 123 << "Couldn't register receive codec.\n"; |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 } | 126 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 if (clock_.TimeInMilliseconds() >= last_toggle_time_ms_ + toggle_period_ms_) { | 220 if (clock_.TimeInMilliseconds() >= last_toggle_time_ms_ + toggle_period_ms_) { |
| 219 output_freq_hz_ = (output_freq_hz_ == output_freq_hz_1_) | 221 output_freq_hz_ = (output_freq_hz_ == output_freq_hz_1_) |
| 220 ? output_freq_hz_2_ | 222 ? output_freq_hz_2_ |
| 221 : output_freq_hz_1_; | 223 : output_freq_hz_1_; |
| 222 last_toggle_time_ms_ = clock_.TimeInMilliseconds(); | 224 last_toggle_time_ms_ = clock_.TimeInMilliseconds(); |
| 223 } | 225 } |
| 224 } | 226 } |
| 225 | 227 |
| 226 } // namespace test | 228 } // namespace test |
| 227 } // namespace webrtc | 229 } // namespace webrtc |
| OLD | NEW |