summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/webrtc/voice_engine/transmit_mixer.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/webrtc/voice_engine/transmit_mixer.h')
-rw-r--r--chromium/third_party/webrtc/voice_engine/transmit_mixer.h41
1 files changed, 16 insertions, 25 deletions
diff --git a/chromium/third_party/webrtc/voice_engine/transmit_mixer.h b/chromium/third_party/webrtc/voice_engine/transmit_mixer.h
index d795eac265e..afeec3ac885 100644
--- a/chromium/third_party/webrtc/voice_engine/transmit_mixer.h
+++ b/chromium/third_party/webrtc/voice_engine/transmit_mixer.h
@@ -13,9 +13,11 @@
#include "webrtc/common_audio/resampler/include/push_resampler.h"
#include "webrtc/common_types.h"
+#include "webrtc/modules/audio_processing/typing_detection.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/modules/utility/interface/file_player.h"
#include "webrtc/modules/utility/interface/file_recorder.h"
+#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/voice_engine/include/voe_base.h"
#include "webrtc/voice_engine/level_indicator.h"
#include "webrtc/voice_engine/monitor_module.h"
@@ -35,9 +37,7 @@ class MixedAudio;
class Statistics;
class TransmitMixer : public MonitorObserver,
- public FileCallback
-
-{
+ public FileCallback {
public:
static int32_t Create(TransmitMixer*& mixer, uint32_t instanceId);
@@ -70,6 +70,7 @@ public:
// channels for encoding and sending to the network.
void EncodeAndSend(const int voe_channels[], int number_of_voe_channels);
+ // Must be called on the same thread as PrepareDemux().
uint32_t CaptureLevel() const;
int32_t StopSend();
@@ -116,8 +117,6 @@ public:
int IsPlayingFileAsMicrophone() const;
- int ScaleFileAsMicrophonePlayout(float scale);
-
int StartRecordingMicrophone(const char* fileName,
const CodecInst* codecInst);
@@ -173,19 +172,20 @@ private:
// sending codecs.
void GetSendCodecInfo(int* max_sample_rate, int* max_channels);
- int GenerateAudioFrame(const int16_t audioSamples[],
- int nSamples,
- int nChannels,
- int samplesPerSec);
+ void GenerateAudioFrame(const int16_t audioSamples[],
+ int nSamples,
+ int nChannels,
+ int samplesPerSec);
int32_t RecordAudioToFile(uint32_t mixingFrequency);
int32_t MixOrReplaceAudioWithFile(
int mixingFrequency);
- void ProcessAudio(int delay_ms, int clock_drift, int current_mic_level);
+ void ProcessAudio(int delay_ms, int clock_drift, int current_mic_level,
+ bool key_pressed);
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
- int TypingDetection(bool keyPressed);
+ void TypingDetection(bool keyPressed);
#endif
// uses
@@ -198,7 +198,7 @@ private:
// owns
MonitorModule _monitorModule;
AudioFrame _audioFrame;
- PushResampler resampler_; // ADM sample rate -> mixing rate
+ PushResampler<int16_t> resampler_; // ADM sample rate -> mixing rate
FilePlayer* _filePlayerPtr;
FileRecorder* _fileRecorderPtr;
FileRecorder* _fileCallRecorderPtr;
@@ -214,19 +214,9 @@ private:
CriticalSectionWrapper& _callbackCritSect;
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
- int32_t _timeActive;
- int32_t _timeSinceLastTyping;
- int32_t _penaltyCounter;
+ webrtc::TypingDetection _typingDetection;
bool _typingNoiseWarningPending;
bool _typingNoiseDetected;
-
- // Tunable treshold values
- int _timeWindow; // nr of10ms slots accepted to count as a hit.
- int _costPerTyping; // Penalty added for a typing + activity coincide.
- int _reportingThreshold; // Threshold for _penaltyCounter.
- int _penaltyDecay; // How much we reduce _penaltyCounter every 10 ms.
- int _typeEventDelay; // How old typing events we allow
-
#endif
bool _saturationWarning;
@@ -239,10 +229,11 @@ private:
int32_t _remainingMuteMicTimeMs;
bool stereo_codec_;
bool swap_stereo_channels_;
+ scoped_ptr<int16_t[]> mono_buffer_;
};
-#endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H
-
} // namespace voe
} // namespace webrtc
+
+#endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H