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

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

Issue 2544123003: Move WEBRTC_VOICE_ENGINE_TYPING_DETECTION to transmit_mixer.h (Closed)
Patch Set: Created 4 years 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/transmit_mixer.cc ('k') | webrtc/voice_engine_configurations.h » ('j') | 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 _shared->SetLastError(VE_NOT_INITED, kTraceError); 674 _shared->SetLastError(VE_NOT_INITED, kTraceError);
675 return -1; 675 return -1;
676 } 676 }
677 677
678 return _shared->audio_processing()->StopDebugRecording(); 678 return _shared->audio_processing()->StopDebugRecording();
679 } 679 }
680 680
681 int VoEAudioProcessingImpl::SetTypingDetectionStatus(bool enable) { 681 int VoEAudioProcessingImpl::SetTypingDetectionStatus(bool enable) {
682 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 682 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
683 "SetTypingDetectionStatus()"); 683 "SetTypingDetectionStatus()");
684 #if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION) 684 #if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
685 NOT_SUPPORTED(_shared->statistics()); 685 NOT_SUPPORTED(_shared->statistics());
686 #else 686 #else
687 if (!_shared->statistics().Initialized()) { 687 if (!_shared->statistics().Initialized()) {
688 _shared->SetLastError(VE_NOT_INITED, kTraceError); 688 _shared->SetLastError(VE_NOT_INITED, kTraceError);
689 return -1; 689 return -1;
690 } 690 }
691 691
692 // Just use the VAD state to determine if we should enable typing detection 692 // Just use the VAD state to determine if we should enable typing detection
693 // or not 693 // or not
694 694
(...skipping 21 matching lines...) Expand all
716 } 716 }
717 // Just use the VAD state to determine if we should enable typing 717 // Just use the VAD state to determine if we should enable typing
718 // detection or not 718 // detection or not
719 719
720 enabled = _shared->audio_processing()->voice_detection()->is_enabled(); 720 enabled = _shared->audio_processing()->voice_detection()->is_enabled();
721 721
722 return 0; 722 return 0;
723 } 723 }
724 724
725 int VoEAudioProcessingImpl::TimeSinceLastTyping(int& seconds) { 725 int VoEAudioProcessingImpl::TimeSinceLastTyping(int& seconds) {
726 #if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION) 726 #if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
727 NOT_SUPPORTED(_shared->statistics()); 727 NOT_SUPPORTED(_shared->statistics());
728 #else 728 #else
729 if (!_shared->statistics().Initialized()) { 729 if (!_shared->statistics().Initialized()) {
730 _shared->SetLastError(VE_NOT_INITED, kTraceError); 730 _shared->SetLastError(VE_NOT_INITED, kTraceError);
731 return -1; 731 return -1;
732 } 732 }
733 // Check if typing detection is enabled 733 // Check if typing detection is enabled
734 bool enabled = _shared->audio_processing()->voice_detection()->is_enabled(); 734 bool enabled = _shared->audio_processing()->voice_detection()->is_enabled();
735 if (enabled) { 735 if (enabled) {
736 _shared->transmit_mixer()->TimeSinceLastTyping(seconds); 736 _shared->transmit_mixer()->TimeSinceLastTyping(seconds);
737 return 0; 737 return 0;
738 } else { 738 } else {
739 _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError, 739 _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
740 "SetTypingDetectionStatus is not enabled"); 740 "SetTypingDetectionStatus is not enabled");
741 return -1; 741 return -1;
742 } 742 }
743 #endif 743 #endif
744 } 744 }
745 745
746 int VoEAudioProcessingImpl::SetTypingDetectionParameters(int timeWindow, 746 int VoEAudioProcessingImpl::SetTypingDetectionParameters(int timeWindow,
747 int costPerTyping, 747 int costPerTyping,
748 int reportingThreshold, 748 int reportingThreshold,
749 int penaltyDecay, 749 int penaltyDecay,
750 int typeEventDelay) { 750 int typeEventDelay) {
751 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 751 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
752 "SetTypingDetectionParameters()"); 752 "SetTypingDetectionParameters()");
753 #if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION) 753 #if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
754 NOT_SUPPORTED(_shared->statistics()); 754 NOT_SUPPORTED(_shared->statistics());
755 #else 755 #else
756 if (!_shared->statistics().Initialized()) { 756 if (!_shared->statistics().Initialized()) {
757 _shared->statistics().SetLastError(VE_NOT_INITED, kTraceError); 757 _shared->statistics().SetLastError(VE_NOT_INITED, kTraceError);
758 return -1; 758 return -1;
759 } 759 }
760 return (_shared->transmit_mixer()->SetTypingDetectionParameters( 760 return (_shared->transmit_mixer()->SetTypingDetectionParameters(
761 timeWindow, costPerTyping, reportingThreshold, penaltyDecay, 761 timeWindow, costPerTyping, reportingThreshold, penaltyDecay,
762 typeEventDelay)); 762 typeEventDelay));
763 #endif 763 #endif
764 } 764 }
765 765
766 void VoEAudioProcessingImpl::EnableStereoChannelSwapping(bool enable) { 766 void VoEAudioProcessingImpl::EnableStereoChannelSwapping(bool enable) {
767 _shared->transmit_mixer()->EnableStereoChannelSwapping(enable); 767 _shared->transmit_mixer()->EnableStereoChannelSwapping(enable);
768 } 768 }
769 769
770 bool VoEAudioProcessingImpl::IsStereoChannelSwappingEnabled() { 770 bool VoEAudioProcessingImpl::IsStereoChannelSwappingEnabled() {
771 return _shared->transmit_mixer()->IsStereoChannelSwappingEnabled(); 771 return _shared->transmit_mixer()->IsStereoChannelSwappingEnabled();
772 } 772 }
773 773
774 } // namespace webrtc 774 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.cc ('k') | webrtc/voice_engine_configurations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698