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

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

Issue 2973083002: TransmitMixer: Check GetSendCodec return value. (Closed)
Patch Set: More checking in channel.cc and added TODOs. Created 3 years, 5 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
« no previous file with comments | « webrtc/voice_engine/channel.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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 void TransmitMixer::GetSendCodecInfo(int* max_sample_rate, 241 void TransmitMixer::GetSendCodecInfo(int* max_sample_rate,
242 size_t* max_channels) { 242 size_t* max_channels) {
243 *max_sample_rate = 8000; 243 *max_sample_rate = 8000;
244 *max_channels = 1; 244 *max_channels = 1;
245 for (ChannelManager::Iterator it(_channelManagerPtr); it.IsValid(); 245 for (ChannelManager::Iterator it(_channelManagerPtr); it.IsValid();
246 it.Increment()) { 246 it.Increment()) {
247 Channel* channel = it.GetChannel(); 247 Channel* channel = it.GetChannel();
248 if (channel->Sending()) { 248 if (channel->Sending()) {
249 CodecInst codec; 249 CodecInst codec;
250 channel->GetSendCodec(codec); 250 // TODO(ossu): Investigate how this could happen. b/62909493
251 *max_sample_rate = std::max(*max_sample_rate, codec.plfreq); 251 if (channel->GetSendCodec(codec) == 0) {
252 *max_channels = std::max(*max_channels, codec.channels); 252 *max_sample_rate = std::max(*max_sample_rate, codec.plfreq);
253 *max_channels = std::max(*max_channels, codec.channels);
254 } else {
255 LOG(LS_WARNING) << "Unable to get send codec for channel "
256 << channel->ChannelId();
257 RTC_NOTREACHED();
258 }
253 } 259 }
254 } 260 }
255 } 261 }
256 262
257 int32_t 263 int32_t
258 TransmitMixer::PrepareDemux(const void* audioSamples, 264 TransmitMixer::PrepareDemux(const void* audioSamples,
259 size_t nSamples, 265 size_t nSamples,
260 size_t nChannels, 266 size_t nChannels,
261 uint32_t samplesPerSec, 267 uint32_t samplesPerSec,
262 uint16_t totalDelayMS, 268 uint16_t totalDelayMS,
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1022 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1017 swap_stereo_channels_ = enable; 1023 swap_stereo_channels_ = enable;
1018 } 1024 }
1019 1025
1020 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1026 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1021 return swap_stereo_channels_; 1027 return swap_stereo_channels_;
1022 } 1028 }
1023 1029
1024 } // namespace voe 1030 } // namespace voe
1025 } // namespace webrtc 1031 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698