Move WEBRTC_VOICE_ENGINE_TYPING_DETECTION to transmit_mixer.h
BUG=webrtc:6506 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.chromium.mac:mac_chromium_rel_ng,ios-device;master.tryserver.chromium.win:win_chromium_rel_ng;master.tryserver.chromium.android:android_compile_dbg,linux_android_rel_ng Review-Url: https://codereview.webrtc.org/2544123003 Cr-Commit-Position: refs/heads/master@{#15414}
This commit is contained in:
parent
6321b49a0d
commit
f00082da37
@ -34,7 +34,7 @@ TransmitMixer::OnPeriodicProcess()
|
||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||
"TransmitMixer::OnPeriodicProcess()");
|
||||
|
||||
#if defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
bool send_typing_noise_warning = false;
|
||||
bool typing_noise_detected = false;
|
||||
{
|
||||
@ -191,7 +191,7 @@ TransmitMixer::TransmitMixer(uint32_t instanceId) :
|
||||
_fileRecording(false),
|
||||
_fileCallRecording(false),
|
||||
_audioLevel(),
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
_typingNoiseWarningPending(false),
|
||||
_typingNoiseDetected(false),
|
||||
#endif
|
||||
@ -342,7 +342,7 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
||||
AudioFrameOperations::SwapStereoChannels(&_audioFrame);
|
||||
|
||||
// --- Annoying typing detection (utilizes the APM/VAD decision)
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
TypingDetection(keyPressed);
|
||||
#endif
|
||||
|
||||
@ -1167,7 +1167,7 @@ void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift,
|
||||
_saturationWarning |= agc->stream_is_saturated();
|
||||
}
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
void TransmitMixer::TypingDetection(bool keyPressed)
|
||||
{
|
||||
// We let the VAD determine if we're using this feature or not.
|
||||
@ -1198,7 +1198,7 @@ int TransmitMixer::GetMixingFrequency()
|
||||
return _audioFrame.sample_rate_hz_;
|
||||
}
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
int TransmitMixer::TimeSinceLastTyping(int &seconds)
|
||||
{
|
||||
// We check in VoEAudioProcessingImpl that this is only called when
|
||||
@ -1208,7 +1208,7 @@ int TransmitMixer::TimeSinceLastTyping(int &seconds)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
int TransmitMixer::SetTypingDetectionParameters(int timeWindow,
|
||||
int costPerTyping,
|
||||
int reportingThreshold,
|
||||
|
||||
@ -25,6 +25,12 @@
|
||||
#include "webrtc/voice_engine/monitor_module.h"
|
||||
#include "webrtc/voice_engine/voice_engine_defines.h"
|
||||
|
||||
#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS)
|
||||
#define WEBRTC_VOICE_ENGINE_TYPING_DETECTION 1
|
||||
#else
|
||||
#define WEBRTC_VOICE_ENGINE_TYPING_DETECTION 0
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class AudioProcessing;
|
||||
@ -151,7 +157,7 @@ public:
|
||||
|
||||
void RecordFileEnded(int32_t id);
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
// Typing detection
|
||||
int TimeSinceLastTyping(int &seconds);
|
||||
int SetTypingDetectionParameters(int timeWindow,
|
||||
@ -183,7 +189,7 @@ private:
|
||||
void ProcessAudio(int delay_ms, int clock_drift, int current_mic_level,
|
||||
bool key_pressed);
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
void TypingDetection(bool keyPressed);
|
||||
#endif
|
||||
|
||||
@ -212,7 +218,7 @@ private:
|
||||
rtc::CriticalSection _critSect;
|
||||
rtc::CriticalSection _callbackCritSect;
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
webrtc::TypingDetection _typingDetection;
|
||||
bool _typingNoiseWarningPending;
|
||||
bool _typingNoiseDetected;
|
||||
|
||||
@ -681,7 +681,7 @@ int VoEAudioProcessingImpl::StopDebugRecording() {
|
||||
int VoEAudioProcessingImpl::SetTypingDetectionStatus(bool enable) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetTypingDetectionStatus()");
|
||||
#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
|
||||
#if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
NOT_SUPPORTED(_shared->statistics());
|
||||
#else
|
||||
if (!_shared->statistics().Initialized()) {
|
||||
@ -723,7 +723,7 @@ int VoEAudioProcessingImpl::GetTypingDetectionStatus(bool& enabled) {
|
||||
}
|
||||
|
||||
int VoEAudioProcessingImpl::TimeSinceLastTyping(int& seconds) {
|
||||
#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
|
||||
#if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
NOT_SUPPORTED(_shared->statistics());
|
||||
#else
|
||||
if (!_shared->statistics().Initialized()) {
|
||||
@ -750,7 +750,7 @@ int VoEAudioProcessingImpl::SetTypingDetectionParameters(int timeWindow,
|
||||
int typeEventDelay) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetTypingDetectionParameters()");
|
||||
#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
|
||||
#if !WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||
NOT_SUPPORTED(_shared->statistics());
|
||||
#else
|
||||
if (!_shared->statistics().Initialized()) {
|
||||
|
||||
@ -13,16 +13,4 @@
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
// ============================================================================
|
||||
// VoiceEngine
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Settings for VoiceEngine
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS)
|
||||
#define WEBRTC_VOICE_ENGINE_TYPING_DETECTION // Typing detection
|
||||
#endif
|
||||
|
||||
#endif // WEBRTC_VOICE_ENGINE_CONFIGURATIONS_H_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user