| OLD | NEW |
| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 float right_pan = 1.0f; | 671 float right_pan = 1.0f; |
| 672 { | 672 { |
| 673 rtc::CritScope cs(&volume_settings_critsect_); | 673 rtc::CritScope cs(&volume_settings_critsect_); |
| 674 output_gain = _outputGain; | 674 output_gain = _outputGain; |
| 675 left_pan = _panLeft; | 675 left_pan = _panLeft; |
| 676 right_pan = _panRight; | 676 right_pan = _panRight; |
| 677 } | 677 } |
| 678 | 678 |
| 679 // Output volume scaling | 679 // Output volume scaling |
| 680 if (output_gain < 0.99f || output_gain > 1.01f) { | 680 if (output_gain < 0.99f || output_gain > 1.01f) { |
| 681 AudioFrameOperations::ScaleWithSat(output_gain, *audioFrame); | 681 AudioFrameOperations::ScaleWithSat(output_gain, audioFrame); |
| 682 } | 682 } |
| 683 | 683 |
| 684 // Scale left and/or right channel(s) if stereo and master balance is | 684 // Scale left and/or right channel(s) if stereo and master balance is |
| 685 // active | 685 // active |
| 686 | 686 |
| 687 if (left_pan != 1.0f || right_pan != 1.0f) { | 687 if (left_pan != 1.0f || right_pan != 1.0f) { |
| 688 if (audioFrame->num_channels_ == 1) { | 688 if (audioFrame->num_channels_ == 1) { |
| 689 // Emulate stereo mode since panning is active. | 689 // Emulate stereo mode since panning is active. |
| 690 // The mono signal is copied to both left and right channels here. | 690 // The mono signal is copied to both left and right channels here. |
| 691 AudioFrameOperations::MonoToStereo(audioFrame); | 691 AudioFrameOperations::MonoToStereo(audioFrame); |
| 692 } | 692 } |
| 693 // For true stereo mode (when we are receiving a stereo signal), no | 693 // For true stereo mode (when we are receiving a stereo signal), no |
| 694 // action is needed. | 694 // action is needed. |
| 695 | 695 |
| 696 // Do the panning operation (the audio frame contains stereo at this | 696 // Do the panning operation (the audio frame contains stereo at this |
| 697 // stage) | 697 // stage) |
| 698 AudioFrameOperations::Scale(left_pan, right_pan, *audioFrame); | 698 AudioFrameOperations::Scale(left_pan, right_pan, audioFrame); |
| 699 } | 699 } |
| 700 | 700 |
| 701 // Mix decoded PCM output with file if file mixing is enabled | 701 // Mix decoded PCM output with file if file mixing is enabled |
| 702 if (state.output_file_playing) { | 702 if (state.output_file_playing) { |
| 703 MixAudioWithFile(*audioFrame, audioFrame->sample_rate_hz_); | 703 MixAudioWithFile(*audioFrame, audioFrame->sample_rate_hz_); |
| 704 muted = false; // We may have added non-zero samples. | 704 muted = false; // We may have added non-zero samples. |
| 705 } | 705 } |
| 706 | 706 |
| 707 // Record playout if enabled | 707 // Record playout if enabled |
| 708 { | 708 { |
| (...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3064 int64_t min_rtt = 0; | 3064 int64_t min_rtt = 0; |
| 3065 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3065 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3066 0) { | 3066 0) { |
| 3067 return 0; | 3067 return 0; |
| 3068 } | 3068 } |
| 3069 return rtt; | 3069 return rtt; |
| 3070 } | 3070 } |
| 3071 | 3071 |
| 3072 } // namespace voe | 3072 } // namespace voe |
| 3073 } // namespace webrtc | 3073 } // namespace webrtc |
| OLD | NEW |