Chromium Code Reviews

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 1406123011: Let AudioCodingModule::SendCodec return Maybe<CodecInst> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « webrtc/modules/audio_coding/main/test/iSACTest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1224 matching lines...)
1235 "DeRegisterVoiceEngineObserver() observer already disabled"); 1235 "DeRegisterVoiceEngineObserver() observer already disabled");
1236 return 0; 1236 return 0;
1237 } 1237 }
1238 _voiceEngineObserverPtr = NULL; 1238 _voiceEngineObserverPtr = NULL;
1239 return 0; 1239 return 0;
1240 } 1240 }
1241 1241
1242 int32_t 1242 int32_t
1243 Channel::GetSendCodec(CodecInst& codec) 1243 Channel::GetSendCodec(CodecInst& codec)
1244 { 1244 {
1245 return (audio_coding_->SendCodec(&codec)); 1245 auto send_codec = audio_coding_->SendCodec();
1246 if (send_codec)
1247 codec = *send_codec;
the sun 2015/11/03 10:13:42 nit: less indent + braxies
kwiberg-webrtc 2015/11/03 12:23:53 I was trying to keep with the style of the rest of
the sun 2015/11/03 12:38:21 just fix the indent, but this function would read
kwiberg-webrtc 2015/11/03 13:08:19 Done.
1248 return send_codec ? 0 : -1;
1246 } 1249 }
1247 1250
1248 int32_t 1251 int32_t
1249 Channel::GetRecCodec(CodecInst& codec) 1252 Channel::GetRecCodec(CodecInst& codec)
1250 { 1253 {
1251 return (audio_coding_->ReceiveCodec(&codec)); 1254 return (audio_coding_->ReceiveCodec(&codec));
1252 } 1255 }
1253 1256
1254 int32_t 1257 int32_t
1255 Channel::SetSendCodec(const CodecInst& codec) 1258 Channel::SetSendCodec(const CodecInst& codec)
(...skipping 2674 matching lines...)
3930 int64_t min_rtt = 0; 3933 int64_t min_rtt = 0;
3931 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) 3934 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt)
3932 != 0) { 3935 != 0) {
3933 return 0; 3936 return 0;
3934 } 3937 }
3935 return rtt; 3938 return rtt;
3936 } 3939 }
3937 3940
3938 } // namespace voe 3941 } // namespace voe
3939 } // namespace webrtc 3942 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/test/iSACTest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine