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

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

Issue 1702943002: Pass ownership of external encoders to the ACM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 case RentACodec::RegistrationResult::kSkip: 106 case RentACodec::RegistrationResult::kSkip:
107 break; 107 break;
108 } 108 }
109 109
110 if (IsOpus(send_codec)) { 110 if (IsOpus(send_codec)) {
111 // VAD/DTX not supported. 111 // VAD/DTX not supported.
112 codec_stack_params_.use_cng = false; 112 codec_stack_params_.use_cng = false;
113 } 113 }
114 114
115 send_codec_inst_ = rtc::Optional<CodecInst>(send_codec); 115 send_codec_inst_ = rtc::Optional<CodecInst>(send_codec);
116 codec_stack_params_.speech_encoder = nullptr; // Caller must recreate it. 116 codec_stack_params_.speech_encoder.reset(); // Caller must recreate it.
117 return true; 117 return true;
118 } 118 }
119 119
120 CodecInst CodecManager::ForgeCodecInst( 120 CodecInst CodecManager::ForgeCodecInst(
121 const AudioEncoder* external_speech_encoder) { 121 const AudioEncoder* external_speech_encoder) {
122 CodecInst ci; 122 CodecInst ci;
123 ci.channels = external_speech_encoder->NumChannels(); 123 ci.channels = external_speech_encoder->NumChannels();
124 ci.plfreq = external_speech_encoder->SampleRateHz(); 124 ci.plfreq = external_speech_encoder->SampleRateHz();
125 ci.pacsize = rtc::CheckedDivExact( 125 ci.pacsize = rtc::CheckedDivExact(
126 static_cast<int>(external_speech_encoder->Max10MsFramesInAPacket() * 126 static_cast<int>(external_speech_encoder->Max10MsFramesInAPacket() *
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 "Codec internal FEC and RED cannot be co-enabled."); 185 "Codec internal FEC and RED cannot be co-enabled.");
186 return false; 186 return false;
187 } 187 }
188 188
189 codec_stack_params_.use_codec_fec = enable_codec_fec; 189 codec_stack_params_.use_codec_fec = enable_codec_fec;
190 return true; 190 return true;
191 } 191 }
192 192
193 } // namespace acm2 193 } // namespace acm2
194 } // namespace webrtc 194 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698