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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module.cc

Issue 2177263002: Regression test for issue where Opus DTX status was being forgotten. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Initial version. Created 4 years, 4 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) 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 int SetOpusApplication(OpusApplicationMode application) override; 173 int SetOpusApplication(OpusApplicationMode application) override;
174 174
175 // If current send codec is Opus, informs it about the maximum playback rate 175 // If current send codec is Opus, informs it about the maximum playback rate
176 // the receiver will render. 176 // the receiver will render.
177 int SetOpusMaxPlaybackRate(int frequency_hz) override; 177 int SetOpusMaxPlaybackRate(int frequency_hz) override;
178 178
179 int EnableOpusDtx() override; 179 int EnableOpusDtx() override;
180 180
181 int DisableOpusDtx() override; 181 int DisableOpusDtx() override;
182 182
183 int GetOpusDtx(bool* enabled) override;
184
183 int UnregisterReceiveCodec(uint8_t payload_type) override; 185 int UnregisterReceiveCodec(uint8_t payload_type) override;
184 186
185 int EnableNack(size_t max_nack_list_size) override; 187 int EnableNack(size_t max_nack_list_size) override;
186 188
187 void DisableNack() override; 189 void DisableNack() override;
188 190
189 std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override; 191 std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override;
190 192
191 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const override; 193 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const override;
192 194
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 } 1200 }
1199 1201
1200 int AudioCodingModuleImpl::DisableOpusDtx() { 1202 int AudioCodingModuleImpl::DisableOpusDtx() {
1201 rtc::CritScope lock(&acm_crit_sect_); 1203 rtc::CritScope lock(&acm_crit_sect_);
1202 if (!HaveValidEncoder("DisableOpusDtx")) { 1204 if (!HaveValidEncoder("DisableOpusDtx")) {
1203 return -1; 1205 return -1;
1204 } 1206 }
1205 return encoder_stack_->SetDtx(false) ? 0 : -1; 1207 return encoder_stack_->SetDtx(false) ? 0 : -1;
1206 } 1208 }
1207 1209
1210 int AudioCodingModuleImpl::GetOpusDtx(bool* enabled) {
1211 rtc::CritScope lock(&acm_crit_sect_);
1212 if (!HaveValidEncoder("GetOpusDtx")) {
1213 return -1;
1214 }
1215 *enabled = encoder_stack_->GetDtx();
1216 return 0;
1217 }
1218
1208 int32_t AudioCodingModuleImpl::PlayoutTimestamp(uint32_t* timestamp) { 1219 int32_t AudioCodingModuleImpl::PlayoutTimestamp(uint32_t* timestamp) {
1209 rtc::Optional<uint32_t> ts = PlayoutTimestamp(); 1220 rtc::Optional<uint32_t> ts = PlayoutTimestamp();
1210 if (!ts) 1221 if (!ts)
1211 return -1; 1222 return -1;
1212 *timestamp = *ts; 1223 *timestamp = *ts;
1213 return 0; 1224 return 0;
1214 } 1225 }
1215 1226
1216 rtc::Optional<uint32_t> AudioCodingModuleImpl::PlayoutTimestamp() { 1227 rtc::Optional<uint32_t> AudioCodingModuleImpl::PlayoutTimestamp() {
1217 return receiver_.GetPlayoutTimestamp(); 1228 return receiver_.GetPlayoutTimestamp();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 // Checks the validity of the parameters of the given codec 1344 // Checks the validity of the parameters of the given codec
1334 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { 1345 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
1335 bool valid = acm2::RentACodec::IsCodecValid(codec); 1346 bool valid = acm2::RentACodec::IsCodecValid(codec);
1336 if (!valid) 1347 if (!valid)
1337 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, 1348 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1,
1338 "Invalid codec setting"); 1349 "Invalid codec setting");
1339 return valid; 1350 return valid;
1340 } 1351 }
1341 1352
1342 } // namespace webrtc 1353 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698