| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 561 |
| 562 if (!file_player_) { | 562 if (!file_player_) { |
| 563 _engineStatisticsPtr->SetLastError( | 563 _engineStatisticsPtr->SetLastError( |
| 564 VE_INVALID_ARGUMENT, kTraceWarning, | 564 VE_INVALID_ARGUMENT, kTraceWarning, |
| 565 "StartPlayingFileAsMicrophone() filePlayer format isnot correct"); | 565 "StartPlayingFileAsMicrophone() filePlayer format isnot correct"); |
| 566 return -1; | 566 return -1; |
| 567 } | 567 } |
| 568 | 568 |
| 569 const uint32_t notificationTime(0); | 569 const uint32_t notificationTime(0); |
| 570 | 570 |
| 571 if (file_player_->StartPlayingFile( | 571 if (file_player_->StartPlayingFile(stream, startPosition, volumeScaling, |
| 572 (InStream&)*stream, startPosition, volumeScaling, notificationTime, | 572 notificationTime, stopPosition, |
| 573 stopPosition, (const CodecInst*)codecInst) != 0) { | 573 (const CodecInst*)codecInst) != 0) { |
| 574 _engineStatisticsPtr->SetLastError( | 574 _engineStatisticsPtr->SetLastError( |
| 575 VE_BAD_FILE, kTraceError, | 575 VE_BAD_FILE, kTraceError, |
| 576 "StartPlayingFile() failed to start file playout"); | 576 "StartPlayingFile() failed to start file playout"); |
| 577 file_player_->StopPlayingFile(); | 577 file_player_->StopPlayingFile(); |
| 578 file_player_.reset(); | 578 file_player_.reset(); |
| 579 return -1; | 579 return -1; |
| 580 } | 580 } |
| 581 file_player_->RegisterModuleFileCallback(this); | 581 file_player_->RegisterModuleFileCallback(this); |
| 582 _filePlaying = true; | 582 _filePlaying = true; |
| 583 | 583 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 736 |
| 737 file_recorder_ = FileRecorder::CreateFileRecorder( | 737 file_recorder_ = FileRecorder::CreateFileRecorder( |
| 738 _fileRecorderId, (const FileFormats)format); | 738 _fileRecorderId, (const FileFormats)format); |
| 739 if (!file_recorder_) { | 739 if (!file_recorder_) { |
| 740 _engineStatisticsPtr->SetLastError( | 740 _engineStatisticsPtr->SetLastError( |
| 741 VE_INVALID_ARGUMENT, kTraceError, | 741 VE_INVALID_ARGUMENT, kTraceError, |
| 742 "StartRecordingMicrophone() fileRecorder format isnot correct"); | 742 "StartRecordingMicrophone() fileRecorder format isnot correct"); |
| 743 return -1; | 743 return -1; |
| 744 } | 744 } |
| 745 | 745 |
| 746 if (file_recorder_->StartRecordingAudioFile(*stream, *codecInst, | 746 if (file_recorder_->StartRecordingAudioFile(stream, *codecInst, |
| 747 notificationTime) != 0) { | 747 notificationTime) != 0) { |
| 748 _engineStatisticsPtr->SetLastError( | 748 _engineStatisticsPtr->SetLastError( |
| 749 VE_BAD_FILE, kTraceError, | 749 VE_BAD_FILE, kTraceError, |
| 750 "StartRecordingAudioFile() failed to start file recording"); | 750 "StartRecordingAudioFile() failed to start file recording"); |
| 751 file_recorder_->StopRecording(); | 751 file_recorder_->StopRecording(); |
| 752 file_recorder_.reset(); | 752 file_recorder_.reset(); |
| 753 return -1; | 753 return -1; |
| 754 } | 754 } |
| 755 | 755 |
| 756 file_recorder_->RegisterModuleFileCallback(this); | 756 file_recorder_->RegisterModuleFileCallback(this); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 905 |
| 906 file_call_recorder_ = FileRecorder::CreateFileRecorder( | 906 file_call_recorder_ = FileRecorder::CreateFileRecorder( |
| 907 _fileCallRecorderId, (const FileFormats)format); | 907 _fileCallRecorderId, (const FileFormats)format); |
| 908 if (!file_call_recorder_) { | 908 if (!file_call_recorder_) { |
| 909 _engineStatisticsPtr->SetLastError( | 909 _engineStatisticsPtr->SetLastError( |
| 910 VE_INVALID_ARGUMENT, kTraceError, | 910 VE_INVALID_ARGUMENT, kTraceError, |
| 911 "StartRecordingCall() fileRecorder format isnot correct"); | 911 "StartRecordingCall() fileRecorder format isnot correct"); |
| 912 return -1; | 912 return -1; |
| 913 } | 913 } |
| 914 | 914 |
| 915 if (file_call_recorder_->StartRecordingAudioFile(*stream, *codecInst, | 915 if (file_call_recorder_->StartRecordingAudioFile(stream, *codecInst, |
| 916 notificationTime) != 0) { | 916 notificationTime) != 0) { |
| 917 _engineStatisticsPtr->SetLastError( | 917 _engineStatisticsPtr->SetLastError( |
| 918 VE_BAD_FILE, kTraceError, | 918 VE_BAD_FILE, kTraceError, |
| 919 "StartRecordingAudioFile() failed to start file recording"); | 919 "StartRecordingAudioFile() failed to start file recording"); |
| 920 file_call_recorder_->StopRecording(); | 920 file_call_recorder_->StopRecording(); |
| 921 file_call_recorder_.reset(); | 921 file_call_recorder_.reset(); |
| 922 return -1; | 922 return -1; |
| 923 } | 923 } |
| 924 | 924 |
| 925 file_call_recorder_->RegisterModuleFileCallback(this); | 925 file_call_recorder_->RegisterModuleFileCallback(this); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 size_t fileSamples(0); | 1089 size_t fileSamples(0); |
| 1090 { | 1090 { |
| 1091 rtc::CritScope cs(&_critSect); | 1091 rtc::CritScope cs(&_critSect); |
| 1092 if (!file_player_) { | 1092 if (!file_player_) { |
| 1093 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1), | 1093 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1), |
| 1094 "TransmitMixer::MixOrReplaceAudioWithFile()" | 1094 "TransmitMixer::MixOrReplaceAudioWithFile()" |
| 1095 "fileplayer doesnot exist"); | 1095 "fileplayer doesnot exist"); |
| 1096 return -1; | 1096 return -1; |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 if (file_player_->Get10msAudioFromFile(fileBuffer.get(), fileSamples, | 1099 if (file_player_->Get10msAudioFromFile(fileBuffer.get(), &fileSamples, |
| 1100 mixingFrequency) == -1) { | 1100 mixingFrequency) == -1) { |
| 1101 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1), | 1101 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1), |
| 1102 "TransmitMixer::MixOrReplaceAudioWithFile() file" | 1102 "TransmitMixer::MixOrReplaceAudioWithFile() file" |
| 1103 " mixing failed"); | 1103 " mixing failed"); |
| 1104 return -1; | 1104 return -1; |
| 1105 } | 1105 } |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 assert(_audioFrame.samples_per_channel_ == fileSamples); | 1108 assert(_audioFrame.samples_per_channel_ == fileSamples); |
| 1109 | 1109 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { | 1228 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { |
| 1229 swap_stereo_channels_ = enable; | 1229 swap_stereo_channels_ = enable; |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 bool TransmitMixer::IsStereoChannelSwappingEnabled() { | 1232 bool TransmitMixer::IsStereoChannelSwappingEnabled() { |
| 1233 return swap_stereo_channels_; | 1233 return swap_stereo_channels_; |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 } // namespace voe | 1236 } // namespace voe |
| 1237 } // namespace webrtc | 1237 } // namespace webrtc |
| OLD | NEW |