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

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

Issue 2424173003: Move functionality out from AudioFrame and into AudioFrameOperations. (Closed)
Patch Set: Created 4 years, 2 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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 MixWithSat(_audioFrame.data_, 1114 MixWithSat(_audioFrame.data_,
1115 _audioFrame.num_channels_, 1115 _audioFrame.num_channels_,
1116 fileBuffer.get(), 1116 fileBuffer.get(),
1117 1, 1117 1,
1118 fileSamples); 1118 fileSamples);
1119 } else 1119 } else
1120 { 1120 {
1121 // Replace ACM audio with file. 1121 // Replace ACM audio with file.
1122 // Currently file stream is always mono. 1122 // Currently file stream is always mono.
1123 // TODO(xians): Change the code when FilePlayer supports real stereo. 1123 // TODO(xians): Change the code when FilePlayer supports real stereo.
1124 _audioFrame.UpdateFrame(-1, 1124 AudioFrameOperations::UpdateFrame(
1125 0xFFFFFFFF, 1125 -1, 0xFFFFFFFF, fileBuffer.get(), fileSamples, mixingFrequency,
1126 fileBuffer.get(), 1126 AudioFrame::kNormalSpeech, AudioFrame::kVadUnknown, 1,
1127 fileSamples, 1127 &_audioFrame);
1128 mixingFrequency,
1129 AudioFrame::kNormalSpeech,
1130 AudioFrame::kVadUnknown,
1131 1);
1132 } 1128 }
1133 return 0; 1129 return 0;
1134 } 1130 }
1135 1131
1136 void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, 1132 void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift,
1137 int current_mic_level, bool key_pressed) { 1133 int current_mic_level, bool key_pressed) {
1138 if (audioproc_->set_stream_delay_ms(delay_ms) != 0) { 1134 if (audioproc_->set_stream_delay_ms(delay_ms) != 0) {
1139 // Silently ignore this failure to avoid flooding the logs. 1135 // Silently ignore this failure to avoid flooding the logs.
1140 } 1136 }
1141 1137
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1224 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1229 swap_stereo_channels_ = enable; 1225 swap_stereo_channels_ = enable;
1230 } 1226 }
1231 1227
1232 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1228 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1233 return swap_stereo_channels_; 1229 return swap_stereo_channels_;
1234 } 1230 }
1235 1231
1236 } // namespace voe 1232 } // namespace voe
1237 } // namespace webrtc 1233 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698