WebRtc_Word32 -> int32_t in voice_engine/
BUG=314 Review URL: https://webrtc-codereview.appspot.com/1305004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3792 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -71,12 +71,12 @@ public:
|
|||||||
enum {KNumberOfSocketBuffers = 8};
|
enum {KNumberOfSocketBuffers = 8};
|
||||||
public:
|
public:
|
||||||
virtual ~Channel();
|
virtual ~Channel();
|
||||||
static WebRtc_Word32 CreateChannel(Channel*& channel,
|
static int32_t CreateChannel(Channel*& channel,
|
||||||
const WebRtc_Word32 channelId,
|
const int32_t channelId,
|
||||||
const WebRtc_UWord32 instanceId);
|
const uint32_t instanceId);
|
||||||
Channel(const WebRtc_Word32 channelId, const WebRtc_UWord32 instanceId);
|
Channel(const int32_t channelId, const uint32_t instanceId);
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
WebRtc_Word32 SetEngineInformation(
|
int32_t SetEngineInformation(
|
||||||
Statistics& engineStatistics,
|
Statistics& engineStatistics,
|
||||||
OutputMixer& outputMixer,
|
OutputMixer& outputMixer,
|
||||||
TransmitMixer& transmitMixer,
|
TransmitMixer& transmitMixer,
|
||||||
@@ -84,44 +84,42 @@ public:
|
|||||||
AudioDeviceModule& audioDeviceModule,
|
AudioDeviceModule& audioDeviceModule,
|
||||||
VoiceEngineObserver* voiceEngineObserver,
|
VoiceEngineObserver* voiceEngineObserver,
|
||||||
CriticalSectionWrapper* callbackCritSect);
|
CriticalSectionWrapper* callbackCritSect);
|
||||||
WebRtc_Word32 UpdateLocalTimeStamp();
|
int32_t UpdateLocalTimeStamp();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// API methods
|
// API methods
|
||||||
|
|
||||||
// VoEBase
|
// VoEBase
|
||||||
WebRtc_Word32 StartPlayout();
|
int32_t StartPlayout();
|
||||||
WebRtc_Word32 StopPlayout();
|
int32_t StopPlayout();
|
||||||
WebRtc_Word32 StartSend();
|
int32_t StartSend();
|
||||||
WebRtc_Word32 StopSend();
|
int32_t StopSend();
|
||||||
WebRtc_Word32 StartReceiving();
|
int32_t StartReceiving();
|
||||||
WebRtc_Word32 StopReceiving();
|
int32_t StopReceiving();
|
||||||
|
|
||||||
WebRtc_Word32 SetNetEQPlayoutMode(NetEqModes mode);
|
int32_t SetNetEQPlayoutMode(NetEqModes mode);
|
||||||
WebRtc_Word32 GetNetEQPlayoutMode(NetEqModes& mode);
|
int32_t GetNetEQPlayoutMode(NetEqModes& mode);
|
||||||
WebRtc_Word32 SetOnHoldStatus(bool enable, OnHoldModes mode);
|
int32_t SetOnHoldStatus(bool enable, OnHoldModes mode);
|
||||||
WebRtc_Word32 GetOnHoldStatus(bool& enabled, OnHoldModes& mode);
|
int32_t GetOnHoldStatus(bool& enabled, OnHoldModes& mode);
|
||||||
WebRtc_Word32 RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
|
int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
|
||||||
WebRtc_Word32 DeRegisterVoiceEngineObserver();
|
int32_t DeRegisterVoiceEngineObserver();
|
||||||
|
|
||||||
// VoECodec
|
// VoECodec
|
||||||
WebRtc_Word32 GetSendCodec(CodecInst& codec);
|
int32_t GetSendCodec(CodecInst& codec);
|
||||||
WebRtc_Word32 GetRecCodec(CodecInst& codec);
|
int32_t GetRecCodec(CodecInst& codec);
|
||||||
WebRtc_Word32 SetSendCodec(const CodecInst& codec);
|
int32_t SetSendCodec(const CodecInst& codec);
|
||||||
WebRtc_Word32 SetVADStatus(bool enableVAD, ACMVADMode mode,
|
int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX);
|
||||||
bool disableDTX);
|
int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX);
|
||||||
WebRtc_Word32 GetVADStatus(bool& enabledVAD, ACMVADMode& mode,
|
int32_t SetRecPayloadType(const CodecInst& codec);
|
||||||
bool& disabledDTX);
|
int32_t GetRecPayloadType(CodecInst& codec);
|
||||||
WebRtc_Word32 SetRecPayloadType(const CodecInst& codec);
|
int32_t SetAMREncFormat(AmrMode mode);
|
||||||
WebRtc_Word32 GetRecPayloadType(CodecInst& codec);
|
int32_t SetAMRDecFormat(AmrMode mode);
|
||||||
WebRtc_Word32 SetAMREncFormat(AmrMode mode);
|
int32_t SetAMRWbEncFormat(AmrMode mode);
|
||||||
WebRtc_Word32 SetAMRDecFormat(AmrMode mode);
|
int32_t SetAMRWbDecFormat(AmrMode mode);
|
||||||
WebRtc_Word32 SetAMRWbEncFormat(AmrMode mode);
|
int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency);
|
||||||
WebRtc_Word32 SetAMRWbDecFormat(AmrMode mode);
|
int32_t SetISACInitTargetRate(int rateBps, bool useFixedFrameSize);
|
||||||
WebRtc_Word32 SetSendCNPayloadType(int type, PayloadFrequencies frequency);
|
int32_t SetISACMaxRate(int rateBps);
|
||||||
WebRtc_Word32 SetISACInitTargetRate(int rateBps, bool useFixedFrameSize);
|
int32_t SetISACMaxPayloadSize(int sizeBytes);
|
||||||
WebRtc_Word32 SetISACMaxRate(int rateBps);
|
|
||||||
WebRtc_Word32 SetISACMaxPayloadSize(int sizeBytes);
|
|
||||||
|
|
||||||
// VoE dual-streaming.
|
// VoE dual-streaming.
|
||||||
int SetSecondarySendCodec(const CodecInst& codec, int red_payload_type);
|
int SetSecondarySendCodec(const CodecInst& codec, int red_payload_type);
|
||||||
@@ -129,21 +127,16 @@ public:
|
|||||||
int GetSecondarySendCodec(CodecInst* codec);
|
int GetSecondarySendCodec(CodecInst* codec);
|
||||||
|
|
||||||
// VoENetwork
|
// VoENetwork
|
||||||
WebRtc_Word32 RegisterExternalTransport(Transport& transport);
|
int32_t RegisterExternalTransport(Transport& transport);
|
||||||
WebRtc_Word32 DeRegisterExternalTransport();
|
int32_t DeRegisterExternalTransport();
|
||||||
WebRtc_Word32 ReceivedRTPPacket(const WebRtc_Word8* data,
|
int32_t ReceivedRTPPacket(const int8_t* data, int32_t length);
|
||||||
WebRtc_Word32 length);
|
int32_t ReceivedRTCPPacket(const int8_t* data, int32_t length);
|
||||||
WebRtc_Word32 ReceivedRTCPPacket(const WebRtc_Word8* data,
|
int32_t SetPacketTimeoutNotification(bool enable, int timeoutSeconds);
|
||||||
WebRtc_Word32 length);
|
int32_t GetPacketTimeoutNotification(bool& enabled, int& timeoutSeconds);
|
||||||
WebRtc_Word32 SetPacketTimeoutNotification(bool enable, int timeoutSeconds);
|
int32_t RegisterDeadOrAliveObserver(VoEConnectionObserver& observer);
|
||||||
WebRtc_Word32 GetPacketTimeoutNotification(bool& enabled,
|
int32_t DeRegisterDeadOrAliveObserver();
|
||||||
int& timeoutSeconds);
|
int32_t SetPeriodicDeadOrAliveStatus(bool enable, int sampleTimeSeconds);
|
||||||
WebRtc_Word32 RegisterDeadOrAliveObserver(VoEConnectionObserver& observer);
|
int32_t GetPeriodicDeadOrAliveStatus(bool& enabled, int& sampleTimeSeconds);
|
||||||
WebRtc_Word32 DeRegisterDeadOrAliveObserver();
|
|
||||||
WebRtc_Word32 SetPeriodicDeadOrAliveStatus(bool enable,
|
|
||||||
int sampleTimeSeconds);
|
|
||||||
WebRtc_Word32 GetPeriodicDeadOrAliveStatus(bool& enabled,
|
|
||||||
int& sampleTimeSeconds);
|
|
||||||
|
|
||||||
// VoEFile
|
// VoEFile
|
||||||
int StartPlayingFileLocally(const char* fileName, const bool loop,
|
int StartPlayingFileLocally(const char* fileName, const bool loop,
|
||||||
@@ -190,8 +183,8 @@ public:
|
|||||||
int SetExternalMixing(bool enabled);
|
int SetExternalMixing(bool enabled);
|
||||||
|
|
||||||
// VoEVolumeControl
|
// VoEVolumeControl
|
||||||
int GetSpeechOutputLevel(WebRtc_UWord32& level) const;
|
int GetSpeechOutputLevel(uint32_t& level) const;
|
||||||
int GetSpeechOutputLevelFullRange(WebRtc_UWord32& level) const;
|
int GetSpeechOutputLevelFullRange(uint32_t& level) const;
|
||||||
int SetMute(const bool enable);
|
int SetMute(const bool enable);
|
||||||
bool Mute() const;
|
bool Mute() const;
|
||||||
int SetOutputVolumePan(float left, float right);
|
int SetOutputVolumePan(float left, float right);
|
||||||
@@ -290,66 +283,65 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// From AudioPacketizationCallback in the ACM
|
// From AudioPacketizationCallback in the ACM
|
||||||
WebRtc_Word32 SendData(FrameType frameType,
|
int32_t SendData(FrameType frameType,
|
||||||
WebRtc_UWord8 payloadType,
|
uint8_t payloadType,
|
||||||
WebRtc_UWord32 timeStamp,
|
uint32_t timeStamp,
|
||||||
const WebRtc_UWord8* payloadData,
|
const uint8_t* payloadData,
|
||||||
WebRtc_UWord16 payloadSize,
|
uint16_t payloadSize,
|
||||||
const RTPFragmentationHeader* fragmentation);
|
const RTPFragmentationHeader* fragmentation);
|
||||||
// From ACMVADCallback in the ACM
|
// From ACMVADCallback in the ACM
|
||||||
WebRtc_Word32 InFrameType(WebRtc_Word16 frameType);
|
int32_t InFrameType(int16_t frameType);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebRtc_Word32 OnRxVadDetected(const int vadDecision);
|
int32_t OnRxVadDetected(const int vadDecision);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From RtpData in the RTP/RTCP module
|
// From RtpData in the RTP/RTCP module
|
||||||
WebRtc_Word32 OnReceivedPayloadData(const WebRtc_UWord8* payloadData,
|
int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
||||||
const WebRtc_UWord16 payloadSize,
|
const uint16_t payloadSize,
|
||||||
const WebRtcRTPHeader* rtpHeader);
|
const WebRtcRTPHeader* rtpHeader);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From RtpFeedback in the RTP/RTCP module
|
// From RtpFeedback in the RTP/RTCP module
|
||||||
WebRtc_Word32 OnInitializeDecoder(
|
int32_t OnInitializeDecoder(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const WebRtc_Word8 payloadType,
|
const int8_t payloadType,
|
||||||
const char payloadName[RTP_PAYLOAD_NAME_SIZE],
|
const char payloadName[RTP_PAYLOAD_NAME_SIZE],
|
||||||
const int frequency,
|
const int frequency,
|
||||||
const WebRtc_UWord8 channels,
|
const uint8_t channels,
|
||||||
const WebRtc_UWord32 rate);
|
const uint32_t rate);
|
||||||
|
|
||||||
void OnPacketTimeout(const WebRtc_Word32 id);
|
void OnPacketTimeout(const int32_t id);
|
||||||
|
|
||||||
void OnReceivedPacket(const WebRtc_Word32 id,
|
void OnReceivedPacket(const int32_t id, const RtpRtcpPacketType packetType);
|
||||||
const RtpRtcpPacketType packetType);
|
|
||||||
|
|
||||||
void OnPeriodicDeadOrAlive(const WebRtc_Word32 id,
|
void OnPeriodicDeadOrAlive(const int32_t id,
|
||||||
const RTPAliveType alive);
|
const RTPAliveType alive);
|
||||||
|
|
||||||
void OnIncomingSSRCChanged(const WebRtc_Word32 id,
|
void OnIncomingSSRCChanged(const int32_t id,
|
||||||
const WebRtc_UWord32 SSRC);
|
const uint32_t SSRC);
|
||||||
|
|
||||||
void OnIncomingCSRCChanged(const WebRtc_Word32 id,
|
void OnIncomingCSRCChanged(const int32_t id,
|
||||||
const WebRtc_UWord32 CSRC, const bool added);
|
const uint32_t CSRC, const bool added);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From RtcpFeedback in the RTP/RTCP module
|
// From RtcpFeedback in the RTP/RTCP module
|
||||||
void OnApplicationDataReceived(const WebRtc_Word32 id,
|
void OnApplicationDataReceived(const int32_t id,
|
||||||
const WebRtc_UWord8 subType,
|
const uint8_t subType,
|
||||||
const WebRtc_UWord32 name,
|
const uint32_t name,
|
||||||
const WebRtc_UWord16 length,
|
const uint16_t length,
|
||||||
const WebRtc_UWord8* data);
|
const uint8_t* data);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From RtpAudioFeedback in the RTP/RTCP module
|
// From RtpAudioFeedback in the RTP/RTCP module
|
||||||
void OnReceivedTelephoneEvent(const WebRtc_Word32 id,
|
void OnReceivedTelephoneEvent(const int32_t id,
|
||||||
const WebRtc_UWord8 event,
|
const uint8_t event,
|
||||||
const bool endOfEvent);
|
const bool endOfEvent);
|
||||||
|
|
||||||
void OnPlayTelephoneEvent(const WebRtc_Word32 id,
|
void OnPlayTelephoneEvent(const int32_t id,
|
||||||
const WebRtc_UWord8 event,
|
const uint8_t event,
|
||||||
const WebRtc_UWord16 lengthMs,
|
const uint16_t lengthMs,
|
||||||
const WebRtc_UWord8 volume);
|
const uint8_t volume);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From Transport (called by the RTP/RTCP module)
|
// From Transport (called by the RTP/RTCP module)
|
||||||
@@ -358,9 +350,8 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// From MixerParticipant
|
// From MixerParticipant
|
||||||
WebRtc_Word32 GetAudioFrame(const WebRtc_Word32 id,
|
int32_t GetAudioFrame(const int32_t id, AudioFrame& audioFrame);
|
||||||
AudioFrame& audioFrame);
|
int32_t NeededFrequency(const int32_t id);
|
||||||
WebRtc_Word32 NeededFrequency(const WebRtc_Word32 id);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// From MonitorObserver
|
// From MonitorObserver
|
||||||
@@ -368,19 +359,19 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// From FileCallback
|
// From FileCallback
|
||||||
void PlayNotification(const WebRtc_Word32 id,
|
void PlayNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs);
|
const uint32_t durationMs);
|
||||||
void RecordNotification(const WebRtc_Word32 id,
|
void RecordNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs);
|
const uint32_t durationMs);
|
||||||
void PlayFileEnded(const WebRtc_Word32 id);
|
void PlayFileEnded(const int32_t id);
|
||||||
void RecordFileEnded(const WebRtc_Word32 id);
|
void RecordFileEnded(const int32_t id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebRtc_UWord32 InstanceId() const
|
uint32_t InstanceId() const
|
||||||
{
|
{
|
||||||
return _instanceId;
|
return _instanceId;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 ChannelId() const
|
int32_t ChannelId() const
|
||||||
{
|
{
|
||||||
return _channelId;
|
return _channelId;
|
||||||
}
|
}
|
||||||
@@ -420,25 +411,24 @@ public:
|
|||||||
{
|
{
|
||||||
return _rtpRtcpModule.get();
|
return _rtpRtcpModule.get();
|
||||||
}
|
}
|
||||||
WebRtc_Word8 OutputEnergyLevel() const
|
int8_t OutputEnergyLevel() const
|
||||||
{
|
{
|
||||||
return _outputAudioLevel.Level();
|
return _outputAudioLevel.Level();
|
||||||
}
|
}
|
||||||
WebRtc_UWord32 Demultiplex(const AudioFrame& audioFrame);
|
uint32_t Demultiplex(const AudioFrame& audioFrame);
|
||||||
WebRtc_UWord32 PrepareEncodeAndSend(int mixingFrequency);
|
uint32_t PrepareEncodeAndSend(int mixingFrequency);
|
||||||
WebRtc_UWord32 EncodeAndSend();
|
uint32_t EncodeAndSend();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int InsertInbandDtmfTone();
|
int InsertInbandDtmfTone();
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MixOrReplaceAudioWithFile(const int mixingFrequency);
|
MixOrReplaceAudioWithFile(const int mixingFrequency);
|
||||||
WebRtc_Word32 MixAudioWithFile(AudioFrame& audioFrame,
|
int32_t MixAudioWithFile(AudioFrame& audioFrame, const int mixingFrequency);
|
||||||
const int mixingFrequency);
|
int32_t GetPlayoutTimeStamp(uint32_t& playoutTimestamp);
|
||||||
WebRtc_Word32 GetPlayoutTimeStamp(WebRtc_UWord32& playoutTimestamp);
|
|
||||||
void UpdateDeadOrAliveCounters(bool alive);
|
void UpdateDeadOrAliveCounters(bool alive);
|
||||||
WebRtc_Word32 SendPacketRaw(const void *data, int len, bool RTCP);
|
int32_t SendPacketRaw(const void *data, int len, bool RTCP);
|
||||||
WebRtc_Word32 UpdatePacketDelay(const WebRtc_UWord32 timestamp,
|
int32_t UpdatePacketDelay(const uint32_t timestamp,
|
||||||
const WebRtc_UWord16 sequenceNumber);
|
const uint16_t sequenceNumber);
|
||||||
void RegisterReceiveCodecsToRTPModule();
|
void RegisterReceiveCodecsToRTPModule();
|
||||||
int ApmProcessRx(AudioFrame& audioFrame);
|
int ApmProcessRx(AudioFrame& audioFrame);
|
||||||
|
|
||||||
@@ -446,8 +436,8 @@ private:
|
|||||||
private:
|
private:
|
||||||
CriticalSectionWrapper& _fileCritSect;
|
CriticalSectionWrapper& _fileCritSect;
|
||||||
CriticalSectionWrapper& _callbackCritSect;
|
CriticalSectionWrapper& _callbackCritSect;
|
||||||
WebRtc_UWord32 _instanceId;
|
uint32_t _instanceId;
|
||||||
WebRtc_Word32 _channelId;
|
int32_t _channelId;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
scoped_ptr<RtpRtcp> _rtpRtcpModule;
|
scoped_ptr<RtpRtcp> _rtpRtcpModule;
|
||||||
@@ -458,7 +448,7 @@ private:
|
|||||||
AudioLevel _outputAudioLevel;
|
AudioLevel _outputAudioLevel;
|
||||||
bool _externalTransport;
|
bool _externalTransport;
|
||||||
AudioFrame _audioFrame;
|
AudioFrame _audioFrame;
|
||||||
WebRtc_UWord8 _audioLevel_dBov;
|
uint8_t _audioLevel_dBov;
|
||||||
FilePlayer* _inputFilePlayerPtr;
|
FilePlayer* _inputFilePlayerPtr;
|
||||||
FilePlayer* _outputFilePlayerPtr;
|
FilePlayer* _outputFilePlayerPtr;
|
||||||
FileRecorder* _outputFileRecorderPtr;
|
FileRecorder* _outputFileRecorderPtr;
|
||||||
@@ -474,15 +464,15 @@ private:
|
|||||||
bool _outputExternalMedia;
|
bool _outputExternalMedia;
|
||||||
VoEMediaProcess* _inputExternalMediaCallbackPtr;
|
VoEMediaProcess* _inputExternalMediaCallbackPtr;
|
||||||
VoEMediaProcess* _outputExternalMediaCallbackPtr;
|
VoEMediaProcess* _outputExternalMediaCallbackPtr;
|
||||||
WebRtc_UWord8* _encryptionRTPBufferPtr;
|
uint8_t* _encryptionRTPBufferPtr;
|
||||||
WebRtc_UWord8* _decryptionRTPBufferPtr;
|
uint8_t* _decryptionRTPBufferPtr;
|
||||||
WebRtc_UWord8* _encryptionRTCPBufferPtr;
|
uint8_t* _encryptionRTCPBufferPtr;
|
||||||
WebRtc_UWord8* _decryptionRTCPBufferPtr;
|
uint8_t* _decryptionRTCPBufferPtr;
|
||||||
WebRtc_UWord32 _timeStamp;
|
uint32_t _timeStamp;
|
||||||
WebRtc_UWord8 _sendTelephoneEventPayloadType;
|
uint8_t _sendTelephoneEventPayloadType;
|
||||||
WebRtc_UWord32 _playoutTimeStampRTP;
|
uint32_t _playoutTimeStampRTP;
|
||||||
WebRtc_UWord32 _playoutTimeStampRTCP;
|
uint32_t _playoutTimeStampRTCP;
|
||||||
WebRtc_UWord32 _numberOfDiscardedPackets;
|
uint32_t _numberOfDiscardedPackets;
|
||||||
private:
|
private:
|
||||||
// uses
|
// uses
|
||||||
Statistics* _engineStatisticsPtr;
|
Statistics* _engineStatisticsPtr;
|
||||||
@@ -497,8 +487,8 @@ private:
|
|||||||
scoped_ptr<AudioProcessing> _rtpAudioProc;
|
scoped_ptr<AudioProcessing> _rtpAudioProc;
|
||||||
AudioProcessing* _rxAudioProcessingModulePtr; // far end AudioProcessing
|
AudioProcessing* _rxAudioProcessingModulePtr; // far end AudioProcessing
|
||||||
VoERxVadCallback* _rxVadObserverPtr;
|
VoERxVadCallback* _rxVadObserverPtr;
|
||||||
WebRtc_Word32 _oldVadDecision;
|
int32_t _oldVadDecision;
|
||||||
WebRtc_Word32 _sendFrameType; // Send data is voice, 1-voice, 0-otherwise
|
int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise
|
||||||
VoERTPObserver* _rtpObserverPtr;
|
VoERTPObserver* _rtpObserverPtr;
|
||||||
VoERTCPObserver* _rtcpObserverPtr;
|
VoERTCPObserver* _rtcpObserverPtr;
|
||||||
private:
|
private:
|
||||||
@@ -525,27 +515,27 @@ private:
|
|||||||
bool _playOutbandDtmfEvent;
|
bool _playOutbandDtmfEvent;
|
||||||
bool _playInbandDtmfEvent;
|
bool _playInbandDtmfEvent;
|
||||||
// VoeRTP_RTCP
|
// VoeRTP_RTCP
|
||||||
WebRtc_UWord8 _extraPayloadType;
|
uint8_t _extraPayloadType;
|
||||||
bool _insertExtraRTPPacket;
|
bool _insertExtraRTPPacket;
|
||||||
bool _extraMarkerBit;
|
bool _extraMarkerBit;
|
||||||
WebRtc_UWord32 _lastLocalTimeStamp;
|
uint32_t _lastLocalTimeStamp;
|
||||||
uint32_t _lastRemoteTimeStamp;
|
uint32_t _lastRemoteTimeStamp;
|
||||||
WebRtc_Word8 _lastPayloadType;
|
int8_t _lastPayloadType;
|
||||||
bool _includeAudioLevelIndication;
|
bool _includeAudioLevelIndication;
|
||||||
// VoENetwork
|
// VoENetwork
|
||||||
bool _rtpPacketTimedOut;
|
bool _rtpPacketTimedOut;
|
||||||
bool _rtpPacketTimeOutIsEnabled;
|
bool _rtpPacketTimeOutIsEnabled;
|
||||||
WebRtc_UWord32 _rtpTimeOutSeconds;
|
uint32_t _rtpTimeOutSeconds;
|
||||||
bool _connectionObserver;
|
bool _connectionObserver;
|
||||||
VoEConnectionObserver* _connectionObserverPtr;
|
VoEConnectionObserver* _connectionObserverPtr;
|
||||||
WebRtc_UWord32 _countAliveDetections;
|
uint32_t _countAliveDetections;
|
||||||
WebRtc_UWord32 _countDeadDetections;
|
uint32_t _countDeadDetections;
|
||||||
AudioFrame::SpeechType _outputSpeechType;
|
AudioFrame::SpeechType _outputSpeechType;
|
||||||
// VoEVideoSync
|
// VoEVideoSync
|
||||||
WebRtc_UWord32 _averageDelayMs;
|
uint32_t _averageDelayMs;
|
||||||
WebRtc_UWord16 _previousSequenceNumber;
|
uint16_t _previousSequenceNumber;
|
||||||
WebRtc_UWord32 _previousTimestamp;
|
uint32_t _previousTimestamp;
|
||||||
WebRtc_UWord16 _recPacketDelayMs;
|
uint16_t _recPacketDelayMs;
|
||||||
// VoEAudioProcessing
|
// VoEAudioProcessing
|
||||||
bool _RxVadDetection;
|
bool _RxVadDetection;
|
||||||
bool _rxApmIsEnabled;
|
bool _rxApmIsEnabled;
|
||||||
|
@@ -17,7 +17,7 @@ namespace webrtc
|
|||||||
namespace voe
|
namespace voe
|
||||||
{
|
{
|
||||||
|
|
||||||
ChannelManager::ChannelManager(const WebRtc_UWord32 instanceId) :
|
ChannelManager::ChannelManager(const uint32_t instanceId) :
|
||||||
ChannelManagerBase(),
|
ChannelManagerBase(),
|
||||||
_instanceId(instanceId)
|
_instanceId(instanceId)
|
||||||
{
|
{
|
||||||
@@ -28,12 +28,12 @@ ChannelManager::~ChannelManager()
|
|||||||
ChannelManagerBase::DestroyAllItems();
|
ChannelManagerBase::DestroyAllItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChannelManager::CreateChannel(WebRtc_Word32& channelId)
|
bool ChannelManager::CreateChannel(int32_t& channelId)
|
||||||
{
|
{
|
||||||
return ChannelManagerBase::CreateItem(channelId);
|
return ChannelManagerBase::CreateItem(channelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ChannelManager::DestroyChannel(const WebRtc_Word32 channelId)
|
int32_t ChannelManager::DestroyChannel(const int32_t channelId)
|
||||||
{
|
{
|
||||||
Channel* deleteChannel =
|
Channel* deleteChannel =
|
||||||
static_cast<Channel*> (ChannelManagerBase::RemoveItem(channelId));
|
static_cast<Channel*> (ChannelManagerBase::RemoveItem(channelId));
|
||||||
@@ -45,17 +45,17 @@ WebRtc_Word32 ChannelManager::DestroyChannel(const WebRtc_Word32 channelId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ChannelManager::NumOfChannels() const
|
int32_t ChannelManager::NumOfChannels() const
|
||||||
{
|
{
|
||||||
return ChannelManagerBase::NumOfItems();
|
return ChannelManagerBase::NumOfItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ChannelManager::MaxNumOfChannels() const
|
int32_t ChannelManager::MaxNumOfChannels() const
|
||||||
{
|
{
|
||||||
return ChannelManagerBase::MaxNumOfItems();
|
return ChannelManagerBase::MaxNumOfItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void* ChannelManager::NewItem(WebRtc_Word32 itemID)
|
void* ChannelManager::NewItem(int32_t itemID)
|
||||||
{
|
{
|
||||||
Channel* channel;
|
Channel* channel;
|
||||||
if (Channel::CreateChannel(channel, itemID, _instanceId) == -1)
|
if (Channel::CreateChannel(channel, itemID, _instanceId) == -1)
|
||||||
@@ -71,7 +71,7 @@ void ChannelManager::DeleteItem(void* item)
|
|||||||
delete deleteItem;
|
delete deleteItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel* ChannelManager::GetChannel(const WebRtc_Word32 channelId) const
|
Channel* ChannelManager::GetChannel(const int32_t channelId) const
|
||||||
{
|
{
|
||||||
return static_cast<Channel*> (ChannelManagerBase::GetItem(channelId));
|
return static_cast<Channel*> (ChannelManagerBase::GetItem(channelId));
|
||||||
}
|
}
|
||||||
@@ -81,8 +81,8 @@ void ChannelManager::ReleaseChannel()
|
|||||||
ChannelManagerBase::ReleaseItem();
|
ChannelManagerBase::ReleaseItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelManager::GetChannelIds(WebRtc_Word32* channelsArray,
|
void ChannelManager::GetChannelIds(int32_t* channelsArray,
|
||||||
WebRtc_Word32& numOfChannels) const
|
int32_t& numOfChannels) const
|
||||||
{
|
{
|
||||||
ChannelManagerBase::GetItemIds(channelsArray, numOfChannels);
|
ChannelManagerBase::GetItemIds(channelsArray, numOfChannels);
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ ScopedChannel::ScopedChannel(ChannelManager& chManager) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScopedChannel::ScopedChannel(ChannelManager& chManager,
|
ScopedChannel::ScopedChannel(ChannelManager& chManager,
|
||||||
WebRtc_Word32 channelId) :
|
int32_t channelId) :
|
||||||
_chManager(chManager),
|
_chManager(chManager),
|
||||||
_channelPtr(NULL)
|
_channelPtr(NULL)
|
||||||
{
|
{
|
||||||
|
@@ -28,18 +28,18 @@ class ChannelManager: private ChannelManagerBase
|
|||||||
friend class ScopedChannel;
|
friend class ScopedChannel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool CreateChannel(WebRtc_Word32& channelId);
|
bool CreateChannel(int32_t& channelId);
|
||||||
|
|
||||||
WebRtc_Word32 DestroyChannel(const WebRtc_Word32 channelId);
|
int32_t DestroyChannel(const int32_t channelId);
|
||||||
|
|
||||||
WebRtc_Word32 MaxNumOfChannels() const;
|
int32_t MaxNumOfChannels() const;
|
||||||
|
|
||||||
WebRtc_Word32 NumOfChannels() const;
|
int32_t NumOfChannels() const;
|
||||||
|
|
||||||
void GetChannelIds(WebRtc_Word32* channelsArray,
|
void GetChannelIds(int32_t* channelsArray,
|
||||||
WebRtc_Word32& numOfChannels) const;
|
int32_t& numOfChannels) const;
|
||||||
|
|
||||||
ChannelManager(const WebRtc_UWord32 instanceId);
|
ChannelManager(const uint32_t instanceId);
|
||||||
|
|
||||||
~ChannelManager();
|
~ChannelManager();
|
||||||
|
|
||||||
@@ -48,17 +48,17 @@ private:
|
|||||||
|
|
||||||
ChannelManager& operator=(const ChannelManager&);
|
ChannelManager& operator=(const ChannelManager&);
|
||||||
|
|
||||||
Channel* GetChannel(const WebRtc_Word32 channelId) const;
|
Channel* GetChannel(const int32_t channelId) const;
|
||||||
|
|
||||||
void GetChannels(MapWrapper& channels) const;
|
void GetChannels(MapWrapper& channels) const;
|
||||||
|
|
||||||
void ReleaseChannel();
|
void ReleaseChannel();
|
||||||
|
|
||||||
virtual void* NewItem(WebRtc_Word32 itemID);
|
virtual void* NewItem(int32_t itemID);
|
||||||
|
|
||||||
virtual void DeleteItem(void* item);
|
virtual void DeleteItem(void* item);
|
||||||
|
|
||||||
WebRtc_UWord32 _instanceId;
|
uint32_t _instanceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScopedChannel
|
class ScopedChannel
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
// Can only be created by the channel manager
|
// Can only be created by the channel manager
|
||||||
ScopedChannel(ChannelManager& chManager);
|
ScopedChannel(ChannelManager& chManager);
|
||||||
|
|
||||||
ScopedChannel(ChannelManager& chManager, WebRtc_Word32 channelId);
|
ScopedChannel(ChannelManager& chManager, int32_t channelId);
|
||||||
|
|
||||||
Channel* ChannelPtr();
|
Channel* ChannelPtr();
|
||||||
|
|
||||||
|
@@ -44,10 +44,10 @@ ChannelManagerBase::~ChannelManagerBase()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChannelManagerBase::GetFreeItemId(WebRtc_Word32& itemId)
|
bool ChannelManagerBase::GetFreeItemId(int32_t& itemId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_itemsCritSectPtr);
|
CriticalSectionScoped cs(_itemsCritSectPtr);
|
||||||
WebRtc_Word32 i(0);
|
int32_t i(0);
|
||||||
while (i < kVoiceEngineMaxNumChannels)
|
while (i < kVoiceEngineMaxNumChannels)
|
||||||
{
|
{
|
||||||
if (_freeItemIds[i])
|
if (_freeItemIds[i])
|
||||||
@@ -61,7 +61,7 @@ bool ChannelManagerBase::GetFreeItemId(WebRtc_Word32& itemId)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelManagerBase::AddFreeItemId(WebRtc_Word32 itemId)
|
void ChannelManagerBase::AddFreeItemId(int32_t itemId)
|
||||||
{
|
{
|
||||||
assert(itemId < kVoiceEngineMaxNumChannels);
|
assert(itemId < kVoiceEngineMaxNumChannels);
|
||||||
_freeItemIds[itemId] = true;
|
_freeItemIds[itemId] = true;
|
||||||
@@ -75,7 +75,7 @@ void ChannelManagerBase::RemoveFreeItemIds()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChannelManagerBase::CreateItem(WebRtc_Word32& itemId)
|
bool ChannelManagerBase::CreateItem(int32_t& itemId)
|
||||||
{
|
{
|
||||||
_itemsCritSectPtr->Enter();
|
_itemsCritSectPtr->Enter();
|
||||||
void* itemPtr;
|
void* itemPtr;
|
||||||
@@ -98,7 +98,7 @@ bool ChannelManagerBase::CreateItem(WebRtc_Word32& itemId)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelManagerBase::InsertItem(WebRtc_Word32 itemId, void* item)
|
void ChannelManagerBase::InsertItem(int32_t itemId, void* item)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_itemsCritSectPtr);
|
CriticalSectionScoped cs(_itemsCritSectPtr);
|
||||||
assert(!_items.Find(itemId));
|
assert(!_items.Find(itemId));
|
||||||
@@ -106,7 +106,7 @@ void ChannelManagerBase::InsertItem(WebRtc_Word32 itemId, void* item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void*
|
void*
|
||||||
ChannelManagerBase::RemoveItem(WebRtc_Word32 itemId)
|
ChannelManagerBase::RemoveItem(int32_t itemId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_itemsCritSectPtr);
|
CriticalSectionScoped cs(_itemsCritSectPtr);
|
||||||
WriteLockScoped wlock(*_itemsRWLockPtr);
|
WriteLockScoped wlock(*_itemsRWLockPtr);
|
||||||
@@ -135,18 +135,18 @@ void ChannelManagerBase::DestroyAllItems()
|
|||||||
RemoveFreeItemIds();
|
RemoveFreeItemIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ChannelManagerBase::NumOfItems() const
|
int32_t ChannelManagerBase::NumOfItems() const
|
||||||
{
|
{
|
||||||
return _items.Size();
|
return _items.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ChannelManagerBase::MaxNumOfItems() const
|
int32_t ChannelManagerBase::MaxNumOfItems() const
|
||||||
{
|
{
|
||||||
return static_cast<WebRtc_Word32> (kVoiceEngineMaxNumChannels);
|
return static_cast<int32_t> (kVoiceEngineMaxNumChannels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void*
|
void*
|
||||||
ChannelManagerBase::GetItem(WebRtc_Word32 itemId) const
|
ChannelManagerBase::GetItem(int32_t itemId) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_itemsCritSectPtr);
|
CriticalSectionScoped cs(_itemsCritSectPtr);
|
||||||
MapItem* it = _items.Find(itemId);
|
MapItem* it = _items.Find(itemId);
|
||||||
@@ -195,8 +195,8 @@ void ChannelManagerBase::ReleaseItem()
|
|||||||
_itemsRWLockPtr->ReleaseLockShared();
|
_itemsRWLockPtr->ReleaseLockShared();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelManagerBase::GetItemIds(WebRtc_Word32* channelsArray,
|
void ChannelManagerBase::GetItemIds(int32_t* channelsArray,
|
||||||
WebRtc_Word32& numOfChannels) const
|
int32_t& numOfChannels) const
|
||||||
{
|
{
|
||||||
MapItem* it = _items.First();
|
MapItem* it = _items.First();
|
||||||
numOfChannels = (numOfChannels <= _items.Size()) ?
|
numOfChannels = (numOfChannels <= _items.Size()) ?
|
||||||
|
@@ -29,13 +29,13 @@ class Channel;
|
|||||||
class ChannelManagerBase
|
class ChannelManagerBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
bool CreateItem(WebRtc_Word32& itemId);
|
bool CreateItem(int32_t& itemId);
|
||||||
|
|
||||||
void InsertItem(WebRtc_Word32 itemId, void* item);
|
void InsertItem(int32_t itemId, void* item);
|
||||||
|
|
||||||
void* RemoveItem(WebRtc_Word32 itemId);
|
void* RemoveItem(int32_t itemId);
|
||||||
|
|
||||||
void* GetItem(WebRtc_Word32 itemId) const;
|
void* GetItem(int32_t itemId) const;
|
||||||
|
|
||||||
void* GetFirstItem(void*& iterator) const ;
|
void* GetFirstItem(void*& iterator) const ;
|
||||||
|
|
||||||
@@ -43,24 +43,24 @@ protected:
|
|||||||
|
|
||||||
void ReleaseItem();
|
void ReleaseItem();
|
||||||
|
|
||||||
void AddFreeItemId(WebRtc_Word32 itemId);
|
void AddFreeItemId(int32_t itemId);
|
||||||
|
|
||||||
bool GetFreeItemId(WebRtc_Word32& itemId);
|
bool GetFreeItemId(int32_t& itemId);
|
||||||
|
|
||||||
void RemoveFreeItemIds();
|
void RemoveFreeItemIds();
|
||||||
|
|
||||||
void DestroyAllItems();
|
void DestroyAllItems();
|
||||||
|
|
||||||
WebRtc_Word32 NumOfItems() const;
|
int32_t NumOfItems() const;
|
||||||
|
|
||||||
WebRtc_Word32 MaxNumOfItems() const;
|
int32_t MaxNumOfItems() const;
|
||||||
|
|
||||||
void GetItemIds(WebRtc_Word32* channelsArray,
|
void GetItemIds(int32_t* channelsArray,
|
||||||
WebRtc_Word32& numOfChannels) const;
|
int32_t& numOfChannels) const;
|
||||||
|
|
||||||
void GetChannels(MapWrapper& channels) const;
|
void GetChannels(MapWrapper& channels) const;
|
||||||
|
|
||||||
virtual void* NewItem(WebRtc_Word32 itemId) = 0;
|
virtual void* NewItem(int32_t itemId) = 0;
|
||||||
|
|
||||||
virtual void DeleteItem(void* item) = 0;
|
virtual void DeleteItem(void* item) = 0;
|
||||||
|
|
||||||
|
@@ -16,43 +16,43 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_a_times2Tab8Khz[8]=
|
const int16_t Dtmf_a_times2Tab8Khz[8]=
|
||||||
{
|
{
|
||||||
27978, 26956, 25701, 24219,
|
27978, 26956, 25701, 24219,
|
||||||
19073, 16325, 13085, 9314
|
19073, 16325, 13085, 9314
|
||||||
};
|
};
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_a_times2Tab16Khz[8]=
|
const int16_t Dtmf_a_times2Tab16Khz[8]=
|
||||||
{
|
{
|
||||||
31548, 31281, 30951, 30556,
|
31548, 31281, 30951, 30556,
|
||||||
29144, 28361, 27409, 26258
|
29144, 28361, 27409, 26258
|
||||||
};
|
};
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_a_times2Tab32Khz[8]=
|
const int16_t Dtmf_a_times2Tab32Khz[8]=
|
||||||
{
|
{
|
||||||
32462,32394, 32311, 32210, 31849, 31647, 31400, 31098
|
32462,32394, 32311, 32210, 31849, 31647, 31400, 31098
|
||||||
};
|
};
|
||||||
|
|
||||||
// Second table is sin(2*pi*f/fs) in Q14
|
// Second table is sin(2*pi*f/fs) in Q14
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_ym2Tab8Khz[8]=
|
const int16_t Dtmf_ym2Tab8Khz[8]=
|
||||||
{
|
{
|
||||||
8527, 9315, 10163, 11036,
|
8527, 9315, 10163, 11036,
|
||||||
13322, 14206, 15021, 15708
|
13322, 14206, 15021, 15708
|
||||||
};
|
};
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_ym2Tab16Khz[8]=
|
const int16_t Dtmf_ym2Tab16Khz[8]=
|
||||||
{
|
{
|
||||||
4429, 4879, 5380, 5918,
|
4429, 4879, 5380, 5918,
|
||||||
7490, 8207, 8979, 9801
|
7490, 8207, 8979, 9801
|
||||||
};
|
};
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_ym2Tab32Khz[8]=
|
const int16_t Dtmf_ym2Tab32Khz[8]=
|
||||||
{
|
{
|
||||||
2235, 2468, 2728, 3010, 3853, 4249, 4685, 5164
|
2235, 2468, 2728, 3010, 3853, 4249, 4685, 5164
|
||||||
};
|
};
|
||||||
|
|
||||||
const WebRtc_Word16 Dtmf_dBm0kHz[37]=
|
const int16_t Dtmf_dBm0kHz[37]=
|
||||||
{
|
{
|
||||||
16141, 14386, 12821, 11427, 10184, 9077,
|
16141, 14386, 12821, 11427, 10184, 9077,
|
||||||
8090, 7210, 6426, 5727, 5104, 4549,
|
8090, 7210, 6426, 5727, 5104, 4549,
|
||||||
@@ -64,7 +64,7 @@ const WebRtc_Word16 Dtmf_dBm0kHz[37]=
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
DtmfInband::DtmfInband(const WebRtc_Word32 id) :
|
DtmfInband::DtmfInband(const int32_t id) :
|
||||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_id(id),
|
_id(id),
|
||||||
_outputFrequencyHz(8000),
|
_outputFrequencyHz(8000),
|
||||||
@@ -87,7 +87,7 @@ DtmfInband::~DtmfInband()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInband::SetSampleRate(const WebRtc_UWord16 frequency)
|
DtmfInband::SetSampleRate(const uint16_t frequency)
|
||||||
{
|
{
|
||||||
if (frequency != 8000 &&
|
if (frequency != 8000 &&
|
||||||
frequency != 16000 &&
|
frequency != 16000 &&
|
||||||
@@ -102,7 +102,7 @@ DtmfInband::SetSampleRate(const WebRtc_UWord16 frequency)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInband::GetSampleRate(WebRtc_UWord16& frequency)
|
DtmfInband::GetSampleRate(uint16_t& frequency)
|
||||||
{
|
{
|
||||||
frequency = _outputFrequencyHz;
|
frequency = _outputFrequencyHz;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -125,9 +125,9 @@ DtmfInband::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInband::AddTone(const WebRtc_UWord8 eventCode,
|
DtmfInband::AddTone(const uint8_t eventCode,
|
||||||
WebRtc_Word32 lengthMs,
|
int32_t lengthMs,
|
||||||
WebRtc_Word32 attenuationDb)
|
int32_t attenuationDb)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_critSect);
|
CriticalSectionScoped lock(&_critSect);
|
||||||
|
|
||||||
@@ -145,10 +145,10 @@ DtmfInband::AddTone(const WebRtc_UWord8 eventCode,
|
|||||||
|
|
||||||
ReInit();
|
ReInit();
|
||||||
|
|
||||||
_frameLengthSamples = static_cast<WebRtc_Word16> (_outputFrequencyHz / 100);
|
_frameLengthSamples = static_cast<int16_t> (_outputFrequencyHz / 100);
|
||||||
_eventCode = static_cast<WebRtc_Word16> (eventCode);
|
_eventCode = static_cast<int16_t> (eventCode);
|
||||||
_attenuationDb = static_cast<WebRtc_Word16> (attenuationDb);
|
_attenuationDb = static_cast<int16_t> (attenuationDb);
|
||||||
_remainingSamples = static_cast<WebRtc_Word32>
|
_remainingSamples = static_cast<int32_t>
|
||||||
(lengthMs * (_outputFrequencyHz / 1000));
|
(lengthMs * (_outputFrequencyHz / 1000));
|
||||||
_lengthMs = lengthMs;
|
_lengthMs = lengthMs;
|
||||||
|
|
||||||
@@ -162,16 +162,16 @@ DtmfInband::ResetTone()
|
|||||||
|
|
||||||
ReInit();
|
ReInit();
|
||||||
|
|
||||||
_frameLengthSamples = static_cast<WebRtc_Word16> (_outputFrequencyHz / 100);
|
_frameLengthSamples = static_cast<int16_t> (_outputFrequencyHz / 100);
|
||||||
_remainingSamples = static_cast<WebRtc_Word32>
|
_remainingSamples = static_cast<int32_t>
|
||||||
(_lengthMs * (_outputFrequencyHz / 1000));
|
(_lengthMs * (_outputFrequencyHz / 1000));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInband::StartTone(const WebRtc_UWord8 eventCode,
|
DtmfInband::StartTone(const uint8_t eventCode,
|
||||||
WebRtc_Word32 attenuationDb)
|
int32_t attenuationDb)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_critSect);
|
CriticalSectionScoped lock(&_critSect);
|
||||||
|
|
||||||
@@ -188,9 +188,9 @@ DtmfInband::StartTone(const WebRtc_UWord8 eventCode,
|
|||||||
|
|
||||||
ReInit();
|
ReInit();
|
||||||
|
|
||||||
_frameLengthSamples = static_cast<WebRtc_Word16> (_outputFrequencyHz / 100);
|
_frameLengthSamples = static_cast<int16_t> (_outputFrequencyHz / 100);
|
||||||
_eventCode = static_cast<WebRtc_Word16> (eventCode);
|
_eventCode = static_cast<int16_t> (eventCode);
|
||||||
_attenuationDb = static_cast<WebRtc_Word16> (attenuationDb);
|
_attenuationDb = static_cast<int16_t> (attenuationDb);
|
||||||
_playing = true;
|
_playing = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -226,8 +226,8 @@ DtmfInband::IsAddingTone()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInband::Get10msTone(WebRtc_Word16 output[320],
|
DtmfInband::Get10msTone(int16_t output[320],
|
||||||
WebRtc_UWord16& outputSizeInSamples)
|
uint16_t& outputSizeInSamples)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_critSect);
|
CriticalSectionScoped lock(&_critSect);
|
||||||
if (DtmfFix_generate(output,
|
if (DtmfFix_generate(output,
|
||||||
@@ -255,22 +255,22 @@ DtmfInband::UpdateDelaySinceLastTone()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32
|
uint32_t
|
||||||
DtmfInband::DelaySinceLastTone() const
|
DtmfInband::DelaySinceLastTone() const
|
||||||
{
|
{
|
||||||
return _delaySinceLastToneMS;
|
return _delaySinceLastToneMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word16
|
int16_t
|
||||||
DtmfInband::DtmfFix_generate(WebRtc_Word16 *decoded,
|
DtmfInband::DtmfFix_generate(int16_t *decoded,
|
||||||
const WebRtc_Word16 value,
|
const int16_t value,
|
||||||
const WebRtc_Word16 volume,
|
const int16_t volume,
|
||||||
const WebRtc_Word16 frameLen,
|
const int16_t frameLen,
|
||||||
const WebRtc_Word16 fs)
|
const int16_t fs)
|
||||||
{
|
{
|
||||||
const WebRtc_Word16 *a_times2Tbl;
|
const int16_t *a_times2Tbl;
|
||||||
const WebRtc_Word16 *y2_Table;
|
const int16_t *y2_Table;
|
||||||
WebRtc_Word16 a1_times2 = 0, a2_times2 = 0;
|
int16_t a1_times2 = 0, a2_times2 = 0;
|
||||||
|
|
||||||
if (fs==8000) {
|
if (fs==8000) {
|
||||||
a_times2Tbl=Dtmf_a_times2Tab8Khz;
|
a_times2Tbl=Dtmf_a_times2Tab8Khz;
|
||||||
@@ -347,24 +347,24 @@ DtmfInband::DtmfFix_generate(WebRtc_Word16 *decoded,
|
|||||||
frameLen));
|
frameLen));
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word16
|
int16_t
|
||||||
DtmfInband::DtmfFix_generateSignal(const WebRtc_Word16 a1_times2,
|
DtmfInband::DtmfFix_generateSignal(const int16_t a1_times2,
|
||||||
const WebRtc_Word16 a2_times2,
|
const int16_t a2_times2,
|
||||||
const WebRtc_Word16 volume,
|
const int16_t volume,
|
||||||
WebRtc_Word16 *signal,
|
int16_t *signal,
|
||||||
const WebRtc_Word16 length)
|
const int16_t length)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Generate Signal */
|
/* Generate Signal */
|
||||||
for (i=0;i<length;i++) {
|
for (i=0;i<length;i++) {
|
||||||
WebRtc_Word32 tempVal;
|
int32_t tempVal;
|
||||||
WebRtc_Word16 tempValLow, tempValHigh;
|
int16_t tempValLow, tempValHigh;
|
||||||
|
|
||||||
/* Use recursion formula y[n] = a*2*y[n-1] - y[n-2] */
|
/* Use recursion formula y[n] = a*2*y[n-1] - y[n-2] */
|
||||||
tempValLow = (WebRtc_Word16)(((( (WebRtc_Word32)(a1_times2 *
|
tempValLow = (int16_t)(((( (int32_t)(a1_times2 *
|
||||||
_oldOutputLow[1])) + 8192) >> 14) - _oldOutputLow[0]);
|
_oldOutputLow[1])) + 8192) >> 14) - _oldOutputLow[0]);
|
||||||
tempValHigh = (WebRtc_Word16)(((( (WebRtc_Word32)(a2_times2 *
|
tempValHigh = (int16_t)(((( (int32_t)(a2_times2 *
|
||||||
_oldOutputHigh[1])) + 8192) >> 14) - _oldOutputHigh[0]);
|
_oldOutputHigh[1])) + 8192) >> 14) - _oldOutputHigh[0]);
|
||||||
|
|
||||||
/* Update memory */
|
/* Update memory */
|
||||||
@@ -373,14 +373,14 @@ DtmfInband::DtmfFix_generateSignal(const WebRtc_Word16 a1_times2,
|
|||||||
_oldOutputHigh[0]=_oldOutputHigh[1];
|
_oldOutputHigh[0]=_oldOutputHigh[1];
|
||||||
_oldOutputHigh[1]=tempValHigh;
|
_oldOutputHigh[1]=tempValHigh;
|
||||||
|
|
||||||
tempVal = (WebRtc_Word32)(kDtmfAmpLow * tempValLow) +
|
tempVal = (int32_t)(kDtmfAmpLow * tempValLow) +
|
||||||
(WebRtc_Word32)(kDtmfAmpHigh * tempValHigh);
|
(int32_t)(kDtmfAmpHigh * tempValHigh);
|
||||||
|
|
||||||
/* Norm the signal to Q14 */
|
/* Norm the signal to Q14 */
|
||||||
tempVal=(tempVal+16384)>>15;
|
tempVal=(tempVal+16384)>>15;
|
||||||
|
|
||||||
/* Scale the signal to correct dbM0 value */
|
/* Scale the signal to correct dbM0 value */
|
||||||
signal[i]=(WebRtc_Word16)((tempVal*Dtmf_dBm0kHz[volume]+8192)>>14);
|
signal[i]=(int16_t)((tempVal*Dtmf_dBm0kHz[volume]+8192)>>14);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@@ -24,68 +24,66 @@ class CriticalSectionWrapper;
|
|||||||
class DtmfInband
|
class DtmfInband
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DtmfInband(const WebRtc_Word32 id);
|
DtmfInband(const int32_t id);
|
||||||
|
|
||||||
virtual ~DtmfInband();
|
virtual ~DtmfInband();
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
int SetSampleRate(const WebRtc_UWord16 frequency);
|
int SetSampleRate(const uint16_t frequency);
|
||||||
|
|
||||||
int GetSampleRate(WebRtc_UWord16& frequency);
|
int GetSampleRate(uint16_t& frequency);
|
||||||
|
|
||||||
int AddTone(const WebRtc_UWord8 eventCode,
|
int AddTone(const uint8_t eventCode,
|
||||||
WebRtc_Word32 lengthMs,
|
int32_t lengthMs,
|
||||||
WebRtc_Word32 attenuationDb);
|
int32_t attenuationDb);
|
||||||
|
|
||||||
int ResetTone();
|
int ResetTone();
|
||||||
int StartTone(const WebRtc_UWord8 eventCode,
|
int StartTone(const uint8_t eventCode, int32_t attenuationDb);
|
||||||
WebRtc_Word32 attenuationDb);
|
|
||||||
|
|
||||||
int StopTone();
|
int StopTone();
|
||||||
|
|
||||||
bool IsAddingTone();
|
bool IsAddingTone();
|
||||||
|
|
||||||
int Get10msTone(WebRtc_Word16 output[320],
|
int Get10msTone(int16_t output[320], uint16_t& outputSizeInSamples);
|
||||||
WebRtc_UWord16& outputSizeInSamples);
|
|
||||||
|
|
||||||
WebRtc_UWord32 DelaySinceLastTone() const;
|
uint32_t DelaySinceLastTone() const;
|
||||||
|
|
||||||
void UpdateDelaySinceLastTone();
|
void UpdateDelaySinceLastTone();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ReInit();
|
void ReInit();
|
||||||
WebRtc_Word16 DtmfFix_generate(WebRtc_Word16* decoded,
|
int16_t DtmfFix_generate(int16_t* decoded,
|
||||||
const WebRtc_Word16 value,
|
const int16_t value,
|
||||||
const WebRtc_Word16 volume,
|
const int16_t volume,
|
||||||
const WebRtc_Word16 frameLen,
|
const int16_t frameLen,
|
||||||
const WebRtc_Word16 fs);
|
const int16_t fs);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {kDtmfFrameSizeMs = 10};
|
enum {kDtmfFrameSizeMs = 10};
|
||||||
enum {kDtmfAmpHigh = 32768};
|
enum {kDtmfAmpHigh = 32768};
|
||||||
enum {kDtmfAmpLow = 23171}; // 3 dB lower than the high frequency
|
enum {kDtmfAmpLow = 23171}; // 3 dB lower than the high frequency
|
||||||
|
|
||||||
WebRtc_Word16 DtmfFix_generateSignal(const WebRtc_Word16 a1_times2,
|
int16_t DtmfFix_generateSignal(const int16_t a1_times2,
|
||||||
const WebRtc_Word16 a2_times2,
|
const int16_t a2_times2,
|
||||||
const WebRtc_Word16 volume,
|
const int16_t volume,
|
||||||
WebRtc_Word16* signal,
|
int16_t* signal,
|
||||||
const WebRtc_Word16 length);
|
const int16_t length);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CriticalSectionWrapper& _critSect;
|
CriticalSectionWrapper& _critSect;
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
WebRtc_UWord16 _outputFrequencyHz; // {8000, 16000, 32000}
|
uint16_t _outputFrequencyHz; // {8000, 16000, 32000}
|
||||||
WebRtc_Word16 _oldOutputLow[2]; // Data needed for oscillator model
|
int16_t _oldOutputLow[2]; // Data needed for oscillator model
|
||||||
WebRtc_Word16 _oldOutputHigh[2]; // Data needed for oscillator model
|
int16_t _oldOutputHigh[2]; // Data needed for oscillator model
|
||||||
WebRtc_Word16 _frameLengthSamples; // {80, 160, 320}
|
int16_t _frameLengthSamples; // {80, 160, 320}
|
||||||
WebRtc_Word32 _remainingSamples;
|
int32_t _remainingSamples;
|
||||||
WebRtc_Word16 _eventCode; // [0, 15]
|
int16_t _eventCode; // [0, 15]
|
||||||
WebRtc_Word16 _attenuationDb; // [0, 36]
|
int16_t _attenuationDb; // [0, 36]
|
||||||
WebRtc_Word32 _lengthMs;
|
int32_t _lengthMs;
|
||||||
bool _reinit; // 'true' if the oscillator should be reinit for next event
|
bool _reinit; // 'true' if the oscillator should be reinit for next event
|
||||||
bool _playing;
|
bool _playing;
|
||||||
WebRtc_UWord32 _delaySinceLastToneMS; // time since last generated tone [ms]
|
uint32_t _delaySinceLastToneMS; // time since last generated tone [ms]
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
DtmfInbandQueue::DtmfInbandQueue(const WebRtc_Word32 id):
|
DtmfInbandQueue::DtmfInbandQueue(const int32_t id):
|
||||||
_id(id),
|
_id(id),
|
||||||
_DtmfCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
_DtmfCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_nextEmptyIndex(0)
|
_nextEmptyIndex(0)
|
||||||
@@ -29,9 +29,7 @@ DtmfInbandQueue::~DtmfInbandQueue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DtmfInbandQueue::AddDtmf(WebRtc_UWord8 key,
|
DtmfInbandQueue::AddDtmf(uint8_t key, uint16_t len, uint8_t level)
|
||||||
WebRtc_UWord16 len,
|
|
||||||
WebRtc_UWord8 level)
|
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_DtmfCritsect);
|
CriticalSectionScoped lock(&_DtmfCritsect);
|
||||||
|
|
||||||
@@ -41,7 +39,7 @@ DtmfInbandQueue::AddDtmf(WebRtc_UWord8 key,
|
|||||||
"DtmfInbandQueue::AddDtmf() unable to add Dtmf tone");
|
"DtmfInbandQueue::AddDtmf() unable to add Dtmf tone");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 index = _nextEmptyIndex;
|
int32_t index = _nextEmptyIndex;
|
||||||
_DtmfKey[index] = key;
|
_DtmfKey[index] = key;
|
||||||
_DtmfLen[index] = len;
|
_DtmfLen[index] = len;
|
||||||
_DtmfLevel[index] = level;
|
_DtmfLevel[index] = level;
|
||||||
@@ -49,8 +47,8 @@ DtmfInbandQueue::AddDtmf(WebRtc_UWord8 key,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word8
|
int8_t
|
||||||
DtmfInbandQueue::NextDtmf(WebRtc_UWord16* len, WebRtc_UWord8* level)
|
DtmfInbandQueue::NextDtmf(uint16_t* len, uint8_t* level)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_DtmfCritsect);
|
CriticalSectionScoped lock(&_DtmfCritsect);
|
||||||
|
|
||||||
@@ -58,16 +56,16 @@ DtmfInbandQueue::NextDtmf(WebRtc_UWord16* len, WebRtc_UWord8* level)
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word8 nextDtmf = _DtmfKey[0];
|
int8_t nextDtmf = _DtmfKey[0];
|
||||||
*len=_DtmfLen[0];
|
*len=_DtmfLen[0];
|
||||||
*level=_DtmfLevel[0];
|
*level=_DtmfLevel[0];
|
||||||
|
|
||||||
memmove(&(_DtmfKey[0]), &(_DtmfKey[1]),
|
memmove(&(_DtmfKey[0]), &(_DtmfKey[1]),
|
||||||
_nextEmptyIndex*sizeof(WebRtc_UWord8));
|
_nextEmptyIndex*sizeof(uint8_t));
|
||||||
memmove(&(_DtmfLen[0]), &(_DtmfLen[1]),
|
memmove(&(_DtmfLen[0]), &(_DtmfLen[1]),
|
||||||
_nextEmptyIndex*sizeof(WebRtc_UWord16));
|
_nextEmptyIndex*sizeof(uint16_t));
|
||||||
memmove(&(_DtmfLevel[0]), &(_DtmfLevel[1]),
|
memmove(&(_DtmfLevel[0]), &(_DtmfLevel[1]),
|
||||||
_nextEmptyIndex*sizeof(WebRtc_UWord8));
|
_nextEmptyIndex*sizeof(uint8_t));
|
||||||
|
|
||||||
_nextEmptyIndex--;
|
_nextEmptyIndex--;
|
||||||
return nextDtmf;
|
return nextDtmf;
|
||||||
|
@@ -22,15 +22,13 @@ class DtmfInbandQueue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DtmfInbandQueue(const WebRtc_Word32 id);
|
DtmfInbandQueue(const int32_t id);
|
||||||
|
|
||||||
virtual ~DtmfInbandQueue();
|
virtual ~DtmfInbandQueue();
|
||||||
|
|
||||||
int AddDtmf(WebRtc_UWord8 DtmfKey,
|
int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level);
|
||||||
WebRtc_UWord16 len,
|
|
||||||
WebRtc_UWord8 level);
|
|
||||||
|
|
||||||
WebRtc_Word8 NextDtmf(WebRtc_UWord16* len, WebRtc_UWord8* level);
|
int8_t NextDtmf(uint16_t* len, uint8_t* level);
|
||||||
|
|
||||||
bool PendingDtmf();
|
bool PendingDtmf();
|
||||||
|
|
||||||
@@ -39,12 +37,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
enum {kDtmfInbandMax = 20};
|
enum {kDtmfInbandMax = 20};
|
||||||
|
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _DtmfCritsect;
|
CriticalSectionWrapper& _DtmfCritsect;
|
||||||
WebRtc_UWord8 _nextEmptyIndex;
|
uint8_t _nextEmptyIndex;
|
||||||
WebRtc_UWord8 _DtmfKey[kDtmfInbandMax];
|
uint8_t _DtmfKey[kDtmfInbandMax];
|
||||||
WebRtc_UWord16 _DtmfLen[kDtmfInbandMax];
|
uint16_t _DtmfLen[kDtmfInbandMax];
|
||||||
WebRtc_UWord8 _DtmfLevel[kDtmfInbandMax];
|
uint8_t _DtmfLevel[kDtmfInbandMax];
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@@ -38,10 +38,10 @@ class FakeVoEExternalMedia : public VoEExternalMedia {
|
|||||||
WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
|
WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
|
||||||
WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
|
WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
|
||||||
WEBRTC_STUB(ExternalRecordingInsertData,
|
WEBRTC_STUB(ExternalRecordingInsertData,
|
||||||
(const WebRtc_Word16 speechData10ms[], int lengthSamples,
|
(const int16_t speechData10ms[], int lengthSamples,
|
||||||
int samplingFreqHz, int current_delay_ms));
|
int samplingFreqHz, int current_delay_ms));
|
||||||
WEBRTC_STUB(ExternalPlayoutGetData,
|
WEBRTC_STUB(ExternalPlayoutGetData,
|
||||||
(WebRtc_Word16 speechData10ms[], int samplingFreqHz,
|
(int16_t speechData10ms[], int samplingFreqHz,
|
||||||
int current_delay_ms, int& lengthSamples));
|
int current_delay_ms, int& lengthSamples));
|
||||||
WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
|
WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
|
||||||
AudioFrame* frame));
|
AudioFrame* frame));
|
||||||
|
@@ -52,7 +52,7 @@ public:
|
|||||||
// If |isStereo| is true, audio10ms will contain 16-bit PCM data
|
// If |isStereo| is true, audio10ms will contain 16-bit PCM data
|
||||||
// samples in interleaved stereo format (L0,R0,L1,R1,...).
|
// samples in interleaved stereo format (L0,R0,L1,R1,...).
|
||||||
virtual void Process(const int channel, const ProcessingTypes type,
|
virtual void Process(const int channel, const ProcessingTypes type,
|
||||||
WebRtc_Word16 audio10ms[], const int length,
|
int16_t audio10ms[], const int length,
|
||||||
const int samplingFreq, const bool isStereo) = 0;
|
const int samplingFreq, const bool isStereo) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
// this method should be called at as regular an interval as possible
|
// this method should be called at as regular an interval as possible
|
||||||
// with frames of corresponding size.
|
// with frames of corresponding size.
|
||||||
virtual int ExternalRecordingInsertData(
|
virtual int ExternalRecordingInsertData(
|
||||||
const WebRtc_Word16 speechData10ms[], int lengthSamples,
|
const int16_t speechData10ms[], int lengthSamples,
|
||||||
int samplingFreqHz, int current_delay_ms) = 0;
|
int samplingFreqHz, int current_delay_ms) = 0;
|
||||||
|
|
||||||
// This function gets audio for an external playout sink.
|
// This function gets audio for an external playout sink.
|
||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
// be 160, 320, 440 or 480 samples (for 16, 32, 44 or 48 kHz sampling
|
// be 160, 320, 440 or 480 samples (for 16, 32, 44 or 48 kHz sampling
|
||||||
// rates respectively).
|
// rates respectively).
|
||||||
virtual int ExternalPlayoutGetData(
|
virtual int ExternalPlayoutGetData(
|
||||||
WebRtc_Word16 speechData10ms[], int samplingFreqHz,
|
int16_t speechData10ms[], int samplingFreqHz,
|
||||||
int current_delay_ms, int& lengthSamples) = 0;
|
int current_delay_ms, int& lengthSamples) = 0;
|
||||||
|
|
||||||
// Pulls an audio frame from the specified |channel| for external mixing.
|
// Pulls an audio frame from the specified |channel| for external mixing.
|
||||||
|
@@ -20,7 +20,7 @@ namespace voe {
|
|||||||
// Number of bars on the indicator.
|
// Number of bars on the indicator.
|
||||||
// Note that the number of elements is specified because we are indexing it
|
// Note that the number of elements is specified because we are indexing it
|
||||||
// in the range of 0-32
|
// in the range of 0-32
|
||||||
const WebRtc_Word8 permutation[33] =
|
const int8_t permutation[33] =
|
||||||
{0,1,2,3,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,9,9,9,9,9,9,9};
|
{0,1,2,3,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,9,9,9,9,9,9,9};
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ void AudioLevel::Clear()
|
|||||||
|
|
||||||
void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
|
void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
|
||||||
{
|
{
|
||||||
WebRtc_Word16 absValue(0);
|
int16_t absValue(0);
|
||||||
|
|
||||||
// Check speech level (works for 2 channels as well)
|
// Check speech level (works for 2 channels as well)
|
||||||
absValue = WebRtcSpl_MaxAbsValueW16(
|
absValue = WebRtcSpl_MaxAbsValueW16(
|
||||||
@@ -68,10 +68,10 @@ void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
|
|||||||
|
|
||||||
_count = 0;
|
_count = 0;
|
||||||
|
|
||||||
// Highest value for a WebRtc_Word16 is 0x7fff = 32767
|
// Highest value for a int16_t is 0x7fff = 32767
|
||||||
// Divide with 1000 to get in the range of 0-32 which is the range of
|
// Divide with 1000 to get in the range of 0-32 which is the range of
|
||||||
// the permutation vector
|
// the permutation vector
|
||||||
WebRtc_Word32 position = _absMax/1000;
|
int32_t position = _absMax/1000;
|
||||||
|
|
||||||
// Make it less likely that the bar stays at position 0. I.e. only if
|
// Make it less likely that the bar stays at position 0. I.e. only if
|
||||||
// its in the range 0-250 (instead of 0-1000)
|
// its in the range 0-250 (instead of 0-1000)
|
||||||
@@ -86,13 +86,13 @@ void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word8 AudioLevel::Level() const
|
int8_t AudioLevel::Level() const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return _currentLevel;
|
return _currentLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word16 AudioLevel::LevelFullRange() const
|
int16_t AudioLevel::LevelFullRange() const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return _currentLevelFullRange;
|
return _currentLevelFullRange;
|
||||||
|
@@ -28,8 +28,8 @@ public:
|
|||||||
|
|
||||||
// Called on "API thread(s)" from APIs like VoEBase::CreateChannel(),
|
// Called on "API thread(s)" from APIs like VoEBase::CreateChannel(),
|
||||||
// VoEBase::StopSend(), VoEVolumeControl::GetSpeechOutputLevel().
|
// VoEBase::StopSend(), VoEVolumeControl::GetSpeechOutputLevel().
|
||||||
WebRtc_Word8 Level() const;
|
int8_t Level() const;
|
||||||
WebRtc_Word16 LevelFullRange() const;
|
int16_t LevelFullRange() const;
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
// Called on a native capture audio thread (platform dependent) from the
|
// Called on a native capture audio thread (platform dependent) from the
|
||||||
@@ -42,10 +42,10 @@ private:
|
|||||||
|
|
||||||
CriticalSectionWrapper& _critSect;
|
CriticalSectionWrapper& _critSect;
|
||||||
|
|
||||||
WebRtc_Word16 _absMax;
|
int16_t _absMax;
|
||||||
WebRtc_Word16 _count;
|
int16_t _count;
|
||||||
WebRtc_Word8 _currentLevel;
|
int8_t _currentLevel;
|
||||||
WebRtc_Word16 _currentLevelFullRange;
|
int16_t _currentLevelFullRange;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace voe
|
} // namespace voe
|
||||||
|
@@ -28,7 +28,7 @@ MonitorModule::~MonitorModule()
|
|||||||
delete &_callbackCritSect;
|
delete &_callbackCritSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::RegisterObserver(MonitorObserver& observer)
|
MonitorModule::RegisterObserver(MonitorObserver& observer)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_callbackCritSect);
|
CriticalSectionScoped lock(&_callbackCritSect);
|
||||||
@@ -40,7 +40,7 @@ MonitorModule::RegisterObserver(MonitorObserver& observer)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::DeRegisterObserver()
|
MonitorModule::DeRegisterObserver()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(&_callbackCritSect);
|
CriticalSectionScoped lock(&_callbackCritSect);
|
||||||
@@ -52,30 +52,30 @@ MonitorModule::DeRegisterObserver()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::Version(char* version,
|
MonitorModule::Version(char* version,
|
||||||
WebRtc_UWord32& remainingBufferInBytes,
|
uint32_t& remainingBufferInBytes,
|
||||||
WebRtc_UWord32& position) const
|
uint32_t& position) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::ChangeUniqueId(const WebRtc_Word32 id)
|
MonitorModule::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::TimeUntilNextProcess()
|
MonitorModule::TimeUntilNextProcess()
|
||||||
{
|
{
|
||||||
WebRtc_UWord32 now = TickTime::MillisecondTimestamp();
|
uint32_t now = TickTime::MillisecondTimestamp();
|
||||||
WebRtc_Word32 timeToNext =
|
int32_t timeToNext =
|
||||||
kAverageProcessUpdateTimeMs - (now - _lastProcessTime);
|
kAverageProcessUpdateTimeMs - (now - _lastProcessTime);
|
||||||
return (timeToNext);
|
return (timeToNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
MonitorModule::Process()
|
MonitorModule::Process()
|
||||||
{
|
{
|
||||||
_lastProcessTime = TickTime::MillisecondTimestamp();
|
_lastProcessTime = TickTime::MillisecondTimestamp();
|
||||||
|
@@ -32,28 +32,28 @@ namespace voe {
|
|||||||
class MonitorModule : public Module
|
class MonitorModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WebRtc_Word32 RegisterObserver(MonitorObserver& observer);
|
int32_t RegisterObserver(MonitorObserver& observer);
|
||||||
|
|
||||||
WebRtc_Word32 DeRegisterObserver();
|
int32_t DeRegisterObserver();
|
||||||
|
|
||||||
MonitorModule();
|
MonitorModule();
|
||||||
|
|
||||||
virtual ~MonitorModule();
|
virtual ~MonitorModule();
|
||||||
public: // module
|
public: // module
|
||||||
WebRtc_Word32 Version(char* version,
|
int32_t Version(char* version,
|
||||||
WebRtc_UWord32& remainingBufferInBytes,
|
uint32_t& remainingBufferInBytes,
|
||||||
WebRtc_UWord32& position) const;
|
uint32_t& position) const;
|
||||||
|
|
||||||
WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
WebRtc_Word32 TimeUntilNextProcess();
|
int32_t TimeUntilNextProcess();
|
||||||
|
|
||||||
WebRtc_Word32 Process();
|
int32_t Process();
|
||||||
private:
|
private:
|
||||||
enum { kAverageProcessUpdateTimeMs = 1000 };
|
enum { kAverageProcessUpdateTimeMs = 1000 };
|
||||||
MonitorObserver* _observerPtr;
|
MonitorObserver* _observerPtr;
|
||||||
CriticalSectionWrapper& _callbackCritSect;
|
CriticalSectionWrapper& _callbackCritSect;
|
||||||
WebRtc_Word32 _lastProcessTime;
|
int32_t _lastProcessTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace voe
|
} // namespace voe
|
||||||
|
@@ -24,10 +24,10 @@ namespace webrtc {
|
|||||||
namespace voe {
|
namespace voe {
|
||||||
|
|
||||||
void
|
void
|
||||||
OutputMixer::NewMixedAudio(const WebRtc_Word32 id,
|
OutputMixer::NewMixedAudio(const int32_t id,
|
||||||
const AudioFrame& generalAudioFrame,
|
const AudioFrame& generalAudioFrame,
|
||||||
const AudioFrame** uniqueAudioFrames,
|
const AudioFrame** uniqueAudioFrames,
|
||||||
const WebRtc_UWord32 size)
|
const uint32_t size)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::NewMixedAudio(id=%d, size=%u)", id, size);
|
"OutputMixer::NewMixedAudio(id=%d, size=%u)", id, size);
|
||||||
@@ -37,33 +37,29 @@ OutputMixer::NewMixedAudio(const WebRtc_Word32 id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::MixedParticipants(
|
void OutputMixer::MixedParticipants(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const ParticipantStatistics* participantStatistics,
|
const ParticipantStatistics* participantStatistics,
|
||||||
const WebRtc_UWord32 size)
|
const uint32_t size)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::MixedParticipants(id=%d, size=%u)", id, size);
|
"OutputMixer::MixedParticipants(id=%d, size=%u)", id, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::VADPositiveParticipants(
|
void OutputMixer::VADPositiveParticipants(const int32_t id,
|
||||||
const WebRtc_Word32 id,
|
const ParticipantStatistics* participantStatistics, const uint32_t size)
|
||||||
const ParticipantStatistics* participantStatistics,
|
|
||||||
const WebRtc_UWord32 size)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::VADPositiveParticipants(id=%d, size=%u)",
|
"OutputMixer::VADPositiveParticipants(id=%d, size=%u)",
|
||||||
id, size);
|
id, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::MixedAudioLevel(const WebRtc_Word32 id,
|
void OutputMixer::MixedAudioLevel(const int32_t id, const uint32_t level)
|
||||||
const WebRtc_UWord32 level)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::MixedAudioLevel(id=%d, level=%u)", id, level);
|
"OutputMixer::MixedAudioLevel(id=%d, level=%u)", id, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::PlayNotification(const WebRtc_Word32 id,
|
void OutputMixer::PlayNotification(const int32_t id, const uint32_t durationMs)
|
||||||
const WebRtc_UWord32 durationMs)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::PlayNotification(id=%d, durationMs=%d)",
|
"OutputMixer::PlayNotification(id=%d, durationMs=%d)",
|
||||||
@@ -71,8 +67,8 @@ void OutputMixer::PlayNotification(const WebRtc_Word32 id,
|
|||||||
// Not implement yet
|
// Not implement yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::RecordNotification(const WebRtc_Word32 id,
|
void OutputMixer::RecordNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs)
|
const uint32_t durationMs)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::RecordNotification(id=%d, durationMs=%d)",
|
"OutputMixer::RecordNotification(id=%d, durationMs=%d)",
|
||||||
@@ -81,7 +77,7 @@ void OutputMixer::RecordNotification(const WebRtc_Word32 id,
|
|||||||
// Not implement yet
|
// Not implement yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::PlayFileEnded(const WebRtc_Word32 id)
|
void OutputMixer::PlayFileEnded(const int32_t id)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::PlayFileEnded(id=%d)", id);
|
"OutputMixer::PlayFileEnded(id=%d)", id);
|
||||||
@@ -89,7 +85,7 @@ void OutputMixer::PlayFileEnded(const WebRtc_Word32 id)
|
|||||||
// not needed
|
// not needed
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputMixer::RecordFileEnded(const WebRtc_Word32 id)
|
void OutputMixer::RecordFileEnded(const int32_t id)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::RecordFileEnded(id=%d)", id);
|
"OutputMixer::RecordFileEnded(id=%d)", id);
|
||||||
@@ -102,8 +98,8 @@ void OutputMixer::RecordFileEnded(const WebRtc_Word32 id)
|
|||||||
"output file recorder module is shutdown");
|
"output file recorder module is shutdown");
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::Create(OutputMixer*& mixer, const WebRtc_UWord32 instanceId)
|
OutputMixer::Create(OutputMixer*& mixer, const uint32_t instanceId)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceMemory, kTraceVoice, instanceId,
|
WEBRTC_TRACE(kTraceMemory, kTraceVoice, instanceId,
|
||||||
"OutputMixer::Create(instanceId=%d)", instanceId);
|
"OutputMixer::Create(instanceId=%d)", instanceId);
|
||||||
@@ -118,7 +114,7 @@ OutputMixer::Create(OutputMixer*& mixer, const WebRtc_UWord32 instanceId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputMixer::OutputMixer(const WebRtc_UWord32 instanceId) :
|
OutputMixer::OutputMixer(const uint32_t instanceId) :
|
||||||
_callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
_callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
_fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_mixerModule(*AudioConferenceMixer::Create(instanceId)),
|
_mixerModule(*AudioConferenceMixer::Create(instanceId)),
|
||||||
@@ -182,7 +178,7 @@ OutputMixer::~OutputMixer()
|
|||||||
delete &_fileCritSect;
|
delete &_fileCritSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::SetEngineInformation(voe::Statistics& engineStatistics)
|
OutputMixer::SetEngineInformation(voe::Statistics& engineStatistics)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
@@ -191,9 +187,8 @@ OutputMixer::SetEngineInformation(voe::Statistics& engineStatistics)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::SetAudioProcessingModule(
|
OutputMixer::SetAudioProcessingModule(AudioProcessing* audioProcessingModule)
|
||||||
AudioProcessing* audioProcessingModule)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"OutputMixer::SetAudioProcessingModule("
|
"OutputMixer::SetAudioProcessingModule("
|
||||||
@@ -227,7 +222,7 @@ int OutputMixer::DeRegisterExternalMediaProcessing()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int OutputMixer::PlayDtmfTone(WebRtc_UWord8 eventCode, int lengthMs,
|
int OutputMixer::PlayDtmfTone(uint8_t eventCode, int lengthMs,
|
||||||
int attenuationDb)
|
int attenuationDb)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -242,7 +237,7 @@ int OutputMixer::PlayDtmfTone(WebRtc_UWord8 eventCode, int lengthMs,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int OutputMixer::StartPlayingDtmfTone(WebRtc_UWord8 eventCode,
|
int OutputMixer::StartPlayingDtmfTone(uint8_t eventCode,
|
||||||
int attenuationDb)
|
int attenuationDb)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -265,41 +260,41 @@ int OutputMixer::StopPlayingDtmfTone()
|
|||||||
return (_dtmfGenerator.StopTone());
|
return (_dtmfGenerator.StopTone());
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::SetMixabilityStatus(MixerParticipant& participant,
|
OutputMixer::SetMixabilityStatus(MixerParticipant& participant,
|
||||||
const bool mixable)
|
const bool mixable)
|
||||||
{
|
{
|
||||||
return _mixerModule.SetMixabilityStatus(participant, mixable);
|
return _mixerModule.SetMixabilityStatus(participant, mixable);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::SetAnonymousMixabilityStatus(MixerParticipant& participant,
|
OutputMixer::SetAnonymousMixabilityStatus(MixerParticipant& participant,
|
||||||
const bool mixable)
|
const bool mixable)
|
||||||
{
|
{
|
||||||
return _mixerModule.SetAnonymousMixabilityStatus(participant,mixable);
|
return _mixerModule.SetAnonymousMixabilityStatus(participant,mixable);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::MixActiveChannels()
|
OutputMixer::MixActiveChannels()
|
||||||
{
|
{
|
||||||
return _mixerModule.Process();
|
return _mixerModule.Process();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
OutputMixer::GetSpeechOutputLevel(WebRtc_UWord32& level)
|
OutputMixer::GetSpeechOutputLevel(uint32_t& level)
|
||||||
{
|
{
|
||||||
WebRtc_Word8 currentLevel = _audioLevel.Level();
|
int8_t currentLevel = _audioLevel.Level();
|
||||||
level = static_cast<WebRtc_UWord32> (currentLevel);
|
level = static_cast<uint32_t> (currentLevel);
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"GetSpeechOutputLevel() => level=%u", level);
|
"GetSpeechOutputLevel() => level=%u", level);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
OutputMixer::GetSpeechOutputLevelFullRange(WebRtc_UWord32& level)
|
OutputMixer::GetSpeechOutputLevelFullRange(uint32_t& level)
|
||||||
{
|
{
|
||||||
WebRtc_Word16 currentLevel = _audioLevel.LevelFullRange();
|
int16_t currentLevel = _audioLevel.LevelFullRange();
|
||||||
level = static_cast<WebRtc_UWord32> (currentLevel);
|
level = static_cast<uint32_t> (currentLevel);
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"GetSpeechOutputLevelFullRange() => level=%u", level);
|
"GetSpeechOutputLevelFullRange() => level=%u", level);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -340,7 +335,7 @@ int OutputMixer::StartRecordingPlayout(const char* fileName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0);
|
const uint32_t notificationTime(0);
|
||||||
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
|
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
|
||||||
|
|
||||||
if ((codecInst != NULL) &&
|
if ((codecInst != NULL) &&
|
||||||
@@ -421,7 +416,7 @@ int OutputMixer::StartRecordingPlayout(OutStream* stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0);
|
const uint32_t notificationTime(0);
|
||||||
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
|
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
|
||||||
|
|
||||||
if (codecInst != NULL && codecInst->channels != 1)
|
if (codecInst != NULL && codecInst->channels != 1)
|
||||||
@@ -536,7 +531,7 @@ int OutputMixer::GetMixedAudio(int sample_rate_hz,
|
|||||||
return RemixAndResample(_audioFrame, &_resampler, frame);
|
return RemixAndResample(_audioFrame, &_resampler, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
OutputMixer::DoOperationsOnCombinedSignal()
|
OutputMixer::DoOperationsOnCombinedSignal()
|
||||||
{
|
{
|
||||||
if (_audioFrame.sample_rate_hz_ != _mixingFrequencyHz)
|
if (_audioFrame.sample_rate_hz_ != _mixingFrequencyHz)
|
||||||
@@ -584,7 +579,7 @@ OutputMixer::DoOperationsOnCombinedSignal()
|
|||||||
_externalMediaCallbackPtr->Process(
|
_externalMediaCallbackPtr->Process(
|
||||||
-1,
|
-1,
|
||||||
kPlaybackAllChannelsMixed,
|
kPlaybackAllChannelsMixed,
|
||||||
(WebRtc_Word16*)_audioFrame.data_,
|
(int16_t*)_audioFrame.data_,
|
||||||
_audioFrame.samples_per_channel_,
|
_audioFrame.samples_per_channel_,
|
||||||
_audioFrame.sample_rate_hz_,
|
_audioFrame.sample_rate_hz_,
|
||||||
isStereo);
|
isStereo);
|
||||||
@@ -619,19 +614,19 @@ void OutputMixer::APMAnalyzeReverseStream() {
|
|||||||
int
|
int
|
||||||
OutputMixer::InsertInbandDtmfTone()
|
OutputMixer::InsertInbandDtmfTone()
|
||||||
{
|
{
|
||||||
WebRtc_UWord16 sampleRate(0);
|
uint16_t sampleRate(0);
|
||||||
_dtmfGenerator.GetSampleRate(sampleRate);
|
_dtmfGenerator.GetSampleRate(sampleRate);
|
||||||
if (sampleRate != _audioFrame.sample_rate_hz_)
|
if (sampleRate != _audioFrame.sample_rate_hz_)
|
||||||
{
|
{
|
||||||
// Update sample rate of Dtmf tone since the mixing frequency changed.
|
// Update sample rate of Dtmf tone since the mixing frequency changed.
|
||||||
_dtmfGenerator.SetSampleRate(
|
_dtmfGenerator.SetSampleRate(
|
||||||
(WebRtc_UWord16)(_audioFrame.sample_rate_hz_));
|
(uint16_t)(_audioFrame.sample_rate_hz_));
|
||||||
// Reset the tone to be added taking the new sample rate into account.
|
// Reset the tone to be added taking the new sample rate into account.
|
||||||
_dtmfGenerator.ResetTone();
|
_dtmfGenerator.ResetTone();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word16 toneBuffer[320];
|
int16_t toneBuffer[320];
|
||||||
WebRtc_UWord16 toneSamples(0);
|
uint16_t toneSamples(0);
|
||||||
if (_dtmfGenerator.Get10msTone(toneBuffer, toneSamples) == -1)
|
if (_dtmfGenerator.Get10msTone(toneBuffer, toneSamples) == -1)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -644,7 +639,7 @@ OutputMixer::InsertInbandDtmfTone()
|
|||||||
if (_audioFrame.num_channels_ == 1)
|
if (_audioFrame.num_channels_ == 1)
|
||||||
{
|
{
|
||||||
// mono
|
// mono
|
||||||
memcpy(_audioFrame.data_, toneBuffer, sizeof(WebRtc_Word16)
|
memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t)
|
||||||
* toneSamples);
|
* toneSamples);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@@ -36,14 +36,13 @@ class OutputMixer : public AudioMixerOutputReceiver,
|
|||||||
public FileCallback
|
public FileCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static WebRtc_Word32 Create(OutputMixer*& mixer,
|
static int32_t Create(OutputMixer*& mixer, const uint32_t instanceId);
|
||||||
const WebRtc_UWord32 instanceId);
|
|
||||||
|
|
||||||
static void Destroy(OutputMixer*& mixer);
|
static void Destroy(OutputMixer*& mixer);
|
||||||
|
|
||||||
WebRtc_Word32 SetEngineInformation(Statistics& engineStatistics);
|
int32_t SetEngineInformation(Statistics& engineStatistics);
|
||||||
|
|
||||||
WebRtc_Word32 SetAudioProcessingModule(
|
int32_t SetAudioProcessingModule(
|
||||||
AudioProcessing* audioProcessingModule);
|
AudioProcessing* audioProcessingModule);
|
||||||
|
|
||||||
// VoEExternalMedia
|
// VoEExternalMedia
|
||||||
@@ -53,32 +52,29 @@ public:
|
|||||||
int DeRegisterExternalMediaProcessing();
|
int DeRegisterExternalMediaProcessing();
|
||||||
|
|
||||||
// VoEDtmf
|
// VoEDtmf
|
||||||
int PlayDtmfTone(WebRtc_UWord8 eventCode,
|
int PlayDtmfTone(uint8_t eventCode, int lengthMs, int attenuationDb);
|
||||||
int lengthMs,
|
|
||||||
int attenuationDb);
|
|
||||||
|
|
||||||
int StartPlayingDtmfTone(WebRtc_UWord8 eventCode,
|
int StartPlayingDtmfTone(uint8_t eventCode, int attenuationDb);
|
||||||
int attenuationDb);
|
|
||||||
|
|
||||||
int StopPlayingDtmfTone();
|
int StopPlayingDtmfTone();
|
||||||
|
|
||||||
WebRtc_Word32 MixActiveChannels();
|
int32_t MixActiveChannels();
|
||||||
|
|
||||||
WebRtc_Word32 DoOperationsOnCombinedSignal();
|
int32_t DoOperationsOnCombinedSignal();
|
||||||
|
|
||||||
WebRtc_Word32 SetMixabilityStatus(MixerParticipant& participant,
|
int32_t SetMixabilityStatus(MixerParticipant& participant,
|
||||||
const bool mixable);
|
const bool mixable);
|
||||||
|
|
||||||
WebRtc_Word32 SetAnonymousMixabilityStatus(MixerParticipant& participant,
|
int32_t SetAnonymousMixabilityStatus(MixerParticipant& participant,
|
||||||
const bool mixable);
|
const bool mixable);
|
||||||
|
|
||||||
int GetMixedAudio(int sample_rate_hz, int num_channels,
|
int GetMixedAudio(int sample_rate_hz, int num_channels,
|
||||||
AudioFrame* audioFrame);
|
AudioFrame* audioFrame);
|
||||||
|
|
||||||
// VoEVolumeControl
|
// VoEVolumeControl
|
||||||
int GetSpeechOutputLevel(WebRtc_UWord32& level);
|
int GetSpeechOutputLevel(uint32_t& level);
|
||||||
|
|
||||||
int GetSpeechOutputLevelFullRange(WebRtc_UWord32& level);
|
int GetSpeechOutputLevelFullRange(uint32_t& level);
|
||||||
|
|
||||||
int SetOutputVolumePan(float left, float right);
|
int SetOutputVolumePan(float left, float right);
|
||||||
|
|
||||||
@@ -96,37 +92,34 @@ public:
|
|||||||
|
|
||||||
// from AudioMixerOutputReceiver
|
// from AudioMixerOutputReceiver
|
||||||
virtual void NewMixedAudio(
|
virtual void NewMixedAudio(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const AudioFrame& generalAudioFrame,
|
const AudioFrame& generalAudioFrame,
|
||||||
const AudioFrame** uniqueAudioFrames,
|
const AudioFrame** uniqueAudioFrames,
|
||||||
const WebRtc_UWord32 size);
|
const uint32_t size);
|
||||||
|
|
||||||
// from AudioMixerStatusReceiver
|
// from AudioMixerStatusReceiver
|
||||||
virtual void MixedParticipants(
|
virtual void MixedParticipants(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const ParticipantStatistics* participantStatistics,
|
const ParticipantStatistics* participantStatistics,
|
||||||
const WebRtc_UWord32 size);
|
const uint32_t size);
|
||||||
|
|
||||||
virtual void VADPositiveParticipants(
|
virtual void VADPositiveParticipants(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const ParticipantStatistics* participantStatistics,
|
const ParticipantStatistics* participantStatistics,
|
||||||
const WebRtc_UWord32 size);
|
const uint32_t size);
|
||||||
|
|
||||||
virtual void MixedAudioLevel(const WebRtc_Word32 id,
|
virtual void MixedAudioLevel(const int32_t id, const uint32_t level);
|
||||||
const WebRtc_UWord32 level);
|
|
||||||
|
|
||||||
// For file recording
|
// For file recording
|
||||||
void PlayNotification(const WebRtc_Word32 id,
|
void PlayNotification(const int32_t id, const uint32_t durationMs);
|
||||||
const WebRtc_UWord32 durationMs);
|
|
||||||
|
|
||||||
void RecordNotification(const WebRtc_Word32 id,
|
void RecordNotification(const int32_t id, const uint32_t durationMs);
|
||||||
const WebRtc_UWord32 durationMs);
|
|
||||||
|
|
||||||
void PlayFileEnded(const WebRtc_Word32 id);
|
void PlayFileEnded(const int32_t id);
|
||||||
void RecordFileEnded(const WebRtc_Word32 id);
|
void RecordFileEnded(const int32_t id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OutputMixer(const WebRtc_UWord32 instanceId);
|
OutputMixer(const uint32_t instanceId);
|
||||||
void APMAnalyzeReverseStream();
|
void APMAnalyzeReverseStream();
|
||||||
int InsertInbandDtmfTone();
|
int InsertInbandDtmfTone();
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace voe {
|
namespace voe {
|
||||||
|
|
||||||
static WebRtc_Word32 _gInstanceCounter = 0;
|
static int32_t _gInstanceCounter = 0;
|
||||||
|
|
||||||
SharedData::SharedData() :
|
SharedData::SharedData() :
|
||||||
_instanceId(++_gInstanceCounter),
|
_instanceId(++_gInstanceCounter),
|
||||||
@@ -76,16 +76,16 @@ void SharedData::set_audio_processing(AudioProcessing* audioproc) {
|
|||||||
_outputMixerPtr->SetAudioProcessingModule(audioproc);
|
_outputMixerPtr->SetAudioProcessingModule(audioproc);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord16 SharedData::NumOfSendingChannels()
|
uint16_t SharedData::NumOfSendingChannels()
|
||||||
{
|
{
|
||||||
WebRtc_Word32 numOfChannels = _channelManager.NumOfChannels();
|
int32_t numOfChannels = _channelManager.NumOfChannels();
|
||||||
if (numOfChannels <= 0)
|
if (numOfChannels <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord16 nChannelsSending(0);
|
uint16_t nChannelsSending(0);
|
||||||
WebRtc_Word32* channelsArray = new WebRtc_Word32[numOfChannels];
|
int32_t* channelsArray = new int32_t[numOfChannels];
|
||||||
|
|
||||||
_channelManager.GetChannelIds(channelsArray, numOfChannels);
|
_channelManager.GetChannelIds(channelsArray, numOfChannels);
|
||||||
for (int i = 0; i < numOfChannels; i++)
|
for (int i = 0; i < numOfChannels; i++)
|
||||||
@@ -104,16 +104,16 @@ WebRtc_UWord16 SharedData::NumOfSendingChannels()
|
|||||||
return nChannelsSending;
|
return nChannelsSending;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedData::SetLastError(const WebRtc_Word32 error) const {
|
void SharedData::SetLastError(const int32_t error) const {
|
||||||
_engineStatistics.SetLastError(error);
|
_engineStatistics.SetLastError(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedData::SetLastError(const WebRtc_Word32 error,
|
void SharedData::SetLastError(const int32_t error,
|
||||||
const TraceLevel level) const {
|
const TraceLevel level) const {
|
||||||
_engineStatistics.SetLastError(error, level);
|
_engineStatistics.SetLastError(error, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedData::SetLastError(const WebRtc_Word32 error, const TraceLevel level,
|
void SharedData::SetLastError(const int32_t error, const TraceLevel level,
|
||||||
const char* msg) const {
|
const char* msg) const {
|
||||||
_engineStatistics.SetLastError(error, level, msg);
|
_engineStatistics.SetLastError(error, level, msg);
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ class SharedData
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Public accessors.
|
// Public accessors.
|
||||||
WebRtc_UWord32 instance_id() const { return _instanceId; }
|
uint32_t instance_id() const { return _instanceId; }
|
||||||
Statistics& statistics() { return _engineStatistics; }
|
Statistics& statistics() { return _engineStatistics; }
|
||||||
ChannelManager& channel_manager() { return _channelManager; }
|
ChannelManager& channel_manager() { return _channelManager; }
|
||||||
AudioDeviceModule* audio_device() { return _audioDevicePtr; }
|
AudioDeviceModule* audio_device() { return _audioDevicePtr; }
|
||||||
@@ -55,16 +55,16 @@ public:
|
|||||||
_audioDeviceLayer = layer;
|
_audioDeviceLayer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord16 NumOfSendingChannels();
|
uint16_t NumOfSendingChannels();
|
||||||
|
|
||||||
// Convenience methods for calling statistics().SetLastError().
|
// Convenience methods for calling statistics().SetLastError().
|
||||||
void SetLastError(const WebRtc_Word32 error) const;
|
void SetLastError(const int32_t error) const;
|
||||||
void SetLastError(const WebRtc_Word32 error, const TraceLevel level) const;
|
void SetLastError(const int32_t error, const TraceLevel level) const;
|
||||||
void SetLastError(const WebRtc_Word32 error, const TraceLevel level,
|
void SetLastError(const int32_t error, const TraceLevel level,
|
||||||
const char* msg) const;
|
const char* msg) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const WebRtc_UWord32 _instanceId;
|
const uint32_t _instanceId;
|
||||||
CriticalSectionWrapper* _apiCritPtr;
|
CriticalSectionWrapper* _apiCritPtr;
|
||||||
ChannelManager _channelManager;
|
ChannelManager _channelManager;
|
||||||
Statistics _engineStatistics;
|
Statistics _engineStatistics;
|
||||||
|
@@ -20,7 +20,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace voe {
|
namespace voe {
|
||||||
|
|
||||||
Statistics::Statistics(const WebRtc_UWord32 instanceId) :
|
Statistics::Statistics(const uint32_t instanceId) :
|
||||||
_critPtr(CriticalSectionWrapper::CreateCriticalSection()),
|
_critPtr(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_instanceId(instanceId),
|
_instanceId(instanceId),
|
||||||
_lastError(0),
|
_lastError(0),
|
||||||
@@ -37,13 +37,13 @@ Statistics::~Statistics()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::SetInitialized()
|
int32_t Statistics::SetInitialized()
|
||||||
{
|
{
|
||||||
_isInitialized = true;
|
_isInitialized = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::SetUnInitialized()
|
int32_t Statistics::SetUnInitialized()
|
||||||
{
|
{
|
||||||
_isInitialized = false;
|
_isInitialized = false;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -54,14 +54,14 @@ bool Statistics::Initialized() const
|
|||||||
return _isInitialized;
|
return _isInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error) const
|
int32_t Statistics::SetLastError(const int32_t error) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_critPtr);
|
CriticalSectionScoped cs(_critPtr);
|
||||||
_lastError = error;
|
_lastError = error;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error,
|
int32_t Statistics::SetLastError(const int32_t error,
|
||||||
const TraceLevel level) const
|
const TraceLevel level) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_critPtr);
|
CriticalSectionScoped cs(_critPtr);
|
||||||
@@ -72,8 +72,8 @@ WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::SetLastError(
|
int32_t Statistics::SetLastError(
|
||||||
const WebRtc_Word32 error,
|
const int32_t error,
|
||||||
const TraceLevel level, const char* msg) const
|
const TraceLevel level, const char* msg) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_critPtr);
|
CriticalSectionScoped cs(_critPtr);
|
||||||
@@ -86,7 +86,7 @@ WebRtc_Word32 Statistics::SetLastError(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 Statistics::LastError() const
|
int32_t Statistics::LastError() const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_critPtr);
|
CriticalSectionScoped cs(_critPtr);
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
|
@@ -26,24 +26,23 @@ class Statistics
|
|||||||
public:
|
public:
|
||||||
enum {KTraceMaxMessageSize = 256};
|
enum {KTraceMaxMessageSize = 256};
|
||||||
public:
|
public:
|
||||||
Statistics(const WebRtc_UWord32 instanceId);
|
Statistics(const uint32_t instanceId);
|
||||||
~Statistics();
|
~Statistics();
|
||||||
|
|
||||||
WebRtc_Word32 SetInitialized();
|
int32_t SetInitialized();
|
||||||
WebRtc_Word32 SetUnInitialized();
|
int32_t SetUnInitialized();
|
||||||
bool Initialized() const;
|
bool Initialized() const;
|
||||||
WebRtc_Word32 SetLastError(const WebRtc_Word32 error) const;
|
int32_t SetLastError(const int32_t error) const;
|
||||||
WebRtc_Word32 SetLastError(const WebRtc_Word32 error,
|
int32_t SetLastError(const int32_t error, const TraceLevel level) const;
|
||||||
const TraceLevel level) const;
|
int32_t SetLastError(const int32_t error,
|
||||||
WebRtc_Word32 SetLastError(const WebRtc_Word32 error,
|
|
||||||
const TraceLevel level,
|
const TraceLevel level,
|
||||||
const char* msg) const;
|
const char* msg) const;
|
||||||
WebRtc_Word32 LastError() const;
|
int32_t LastError() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CriticalSectionWrapper* _critPtr;
|
CriticalSectionWrapper* _critPtr;
|
||||||
const WebRtc_UWord32 _instanceId;
|
const uint32_t _instanceId;
|
||||||
mutable WebRtc_Word32 _lastError;
|
mutable int32_t _lastError;
|
||||||
bool _isInitialized;
|
bool _isInitialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -16,20 +16,20 @@ class FakeMediaProcess : public webrtc::VoEMediaProcess {
|
|||||||
public:
|
public:
|
||||||
virtual void Process(const int channel,
|
virtual void Process(const int channel,
|
||||||
const webrtc::ProcessingTypes type,
|
const webrtc::ProcessingTypes type,
|
||||||
WebRtc_Word16 audio_10ms[],
|
int16_t audio_10ms[],
|
||||||
const int length,
|
const int length,
|
||||||
const int sampling_freq_hz,
|
const int sampling_freq_hz,
|
||||||
const bool stereo) {
|
const bool stereo) {
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
if (!stereo) {
|
if (!stereo) {
|
||||||
audio_10ms[i] = static_cast<WebRtc_Word16>(audio_10ms[i] *
|
audio_10ms[i] = static_cast<int16_t>(audio_10ms[i] *
|
||||||
sin(2.0 * 3.14 * frequency * 400.0 / sampling_freq_hz));
|
sin(2.0 * 3.14 * frequency * 400.0 / sampling_freq_hz));
|
||||||
} else {
|
} else {
|
||||||
// Interleaved stereo.
|
// Interleaved stereo.
|
||||||
audio_10ms[2 * i] = static_cast<WebRtc_Word16> (
|
audio_10ms[2 * i] = static_cast<int16_t> (
|
||||||
audio_10ms[2 * i] * sin(2.0 * 3.14 *
|
audio_10ms[2 * i] * sin(2.0 * 3.14 *
|
||||||
frequency * 400.0 / sampling_freq_hz));
|
frequency * 400.0 / sampling_freq_hz));
|
||||||
audio_10ms[2 * i + 1] = static_cast<WebRtc_Word16> (
|
audio_10ms[2 * i + 1] = static_cast<int16_t> (
|
||||||
audio_10ms[2 * i + 1] * sin(2.0 * 3.14 *
|
audio_10ms[2 * i + 1] * sin(2.0 * 3.14 *
|
||||||
frequency * 400.0 / sampling_freq_hz));
|
frequency * 400.0 / sampling_freq_hz));
|
||||||
}
|
}
|
||||||
|
@@ -2986,7 +2986,7 @@ int VoEExtendedTest::TestExternalMedia() {
|
|||||||
TEST_MUSTPASS(voe_base_->StartSend(0));
|
TEST_MUSTPASS(voe_base_->StartSend(0));
|
||||||
|
|
||||||
int getLen = 0;
|
int getLen = 0;
|
||||||
WebRtc_Word16 vector[32000];
|
int16_t vector[32000];
|
||||||
memset(vector, 0, 32000 * sizeof(short));
|
memset(vector, 0, 32000 * sizeof(short));
|
||||||
|
|
||||||
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
||||||
|
@@ -186,7 +186,7 @@ public:
|
|||||||
MediaProcessImpl();
|
MediaProcessImpl();
|
||||||
virtual void Process(const int channel,
|
virtual void Process(const int channel,
|
||||||
const ProcessingTypes type,
|
const ProcessingTypes type,
|
||||||
WebRtc_Word16 audio_10ms[],
|
int16_t audio_10ms[],
|
||||||
const int length,
|
const int length,
|
||||||
const int samplingFreqHz,
|
const int samplingFreqHz,
|
||||||
const bool stereo);
|
const bool stereo);
|
||||||
@@ -198,7 +198,7 @@ MediaProcessImpl::MediaProcessImpl()
|
|||||||
|
|
||||||
void MediaProcessImpl::Process(const int channel,
|
void MediaProcessImpl::Process(const int channel,
|
||||||
const ProcessingTypes type,
|
const ProcessingTypes type,
|
||||||
WebRtc_Word16 audio_10ms[],
|
int16_t audio_10ms[],
|
||||||
const int length,
|
const int length,
|
||||||
const int samplingFreqHz,
|
const int samplingFreqHz,
|
||||||
const bool stereo)
|
const bool stereo)
|
||||||
|
@@ -81,8 +81,8 @@ TransmitMixer::OnPeriodicProcess()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TransmitMixer::PlayNotification(const WebRtc_Word32 id,
|
void TransmitMixer::PlayNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs)
|
const uint32_t durationMs)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
"TransmitMixer::PlayNotification(id=%d, durationMs=%d)",
|
"TransmitMixer::PlayNotification(id=%d, durationMs=%d)",
|
||||||
@@ -91,8 +91,8 @@ void TransmitMixer::PlayNotification(const WebRtc_Word32 id,
|
|||||||
// Not implement yet
|
// Not implement yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransmitMixer::RecordNotification(const WebRtc_Word32 id,
|
void TransmitMixer::RecordNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs)
|
const uint32_t durationMs)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
"TransmitMixer::RecordNotification(id=%d, durationMs=%d)",
|
"TransmitMixer::RecordNotification(id=%d, durationMs=%d)",
|
||||||
@@ -101,7 +101,7 @@ void TransmitMixer::RecordNotification(const WebRtc_Word32 id,
|
|||||||
// Not implement yet
|
// Not implement yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransmitMixer::PlayFileEnded(const WebRtc_Word32 id)
|
void TransmitMixer::PlayFileEnded(const int32_t id)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
"TransmitMixer::PlayFileEnded(id=%d)", id);
|
"TransmitMixer::PlayFileEnded(id=%d)", id);
|
||||||
@@ -117,7 +117,7 @@ void TransmitMixer::PlayFileEnded(const WebRtc_Word32 id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TransmitMixer::RecordFileEnded(const WebRtc_Word32 id)
|
TransmitMixer::RecordFileEnded(const int32_t id)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
"TransmitMixer::RecordFileEnded(id=%d)", id);
|
"TransmitMixer::RecordFileEnded(id=%d)", id);
|
||||||
@@ -139,8 +139,8 @@ TransmitMixer::RecordFileEnded(const WebRtc_Word32 id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::Create(TransmitMixer*& mixer, const WebRtc_UWord32 instanceId)
|
TransmitMixer::Create(TransmitMixer*& mixer, const uint32_t instanceId)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, -1),
|
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, -1),
|
||||||
"TransmitMixer::Create(instanceId=%d)", instanceId);
|
"TransmitMixer::Create(instanceId=%d)", instanceId);
|
||||||
@@ -165,7 +165,7 @@ TransmitMixer::Destroy(TransmitMixer*& mixer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TransmitMixer::TransmitMixer(const WebRtc_UWord32 instanceId) :
|
TransmitMixer::TransmitMixer(const uint32_t instanceId) :
|
||||||
_engineStatisticsPtr(NULL),
|
_engineStatisticsPtr(NULL),
|
||||||
_channelManagerPtr(NULL),
|
_channelManagerPtr(NULL),
|
||||||
audioproc_(NULL),
|
audioproc_(NULL),
|
||||||
@@ -250,7 +250,7 @@ TransmitMixer::~TransmitMixer()
|
|||||||
delete &_callbackCritSect;
|
delete &_callbackCritSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::SetEngineInformation(ProcessThread& processThread,
|
TransmitMixer::SetEngineInformation(ProcessThread& processThread,
|
||||||
Statistics& engineStatistics,
|
Statistics& engineStatistics,
|
||||||
ChannelManager& channelManager)
|
ChannelManager& channelManager)
|
||||||
@@ -275,7 +275,7 @@ TransmitMixer::SetEngineInformation(ProcessThread& processThread,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
|
TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -293,7 +293,7 @@ TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::SetAudioProcessingModule(AudioProcessing* audioProcessingModule)
|
TransmitMixer::SetAudioProcessingModule(AudioProcessing* audioProcessingModule)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -325,14 +325,14 @@ void TransmitMixer::GetSendCodecInfo(int* max_sample_rate, int* max_channels) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::PrepareDemux(const void* audioSamples,
|
TransmitMixer::PrepareDemux(const void* audioSamples,
|
||||||
const WebRtc_UWord32 nSamples,
|
const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
const WebRtc_UWord16 totalDelayMS,
|
const uint16_t totalDelayMS,
|
||||||
const WebRtc_Word32 clockDrift,
|
const int32_t clockDrift,
|
||||||
const WebRtc_UWord16 currentMicLevel)
|
const uint16_t currentMicLevel)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
"TransmitMixer::PrepareDemux(nSamples=%u, nChannels=%u,"
|
"TransmitMixer::PrepareDemux(nSamples=%u, nChannels=%u,"
|
||||||
@@ -341,7 +341,7 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
totalDelayMS, clockDrift, currentMicLevel);
|
totalDelayMS, clockDrift, currentMicLevel);
|
||||||
|
|
||||||
// --- Resample input audio and create/store the initial audio frame
|
// --- Resample input audio and create/store the initial audio frame
|
||||||
if (GenerateAudioFrame(static_cast<const WebRtc_Word16*>(audioSamples),
|
if (GenerateAudioFrame(static_cast<const int16_t*>(audioSamples),
|
||||||
nSamples,
|
nSamples,
|
||||||
nChannels,
|
nChannels,
|
||||||
samplesPerSec) == -1)
|
samplesPerSec) == -1)
|
||||||
@@ -417,7 +417,7 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::DemuxAndMix()
|
TransmitMixer::DemuxAndMix()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -442,7 +442,7 @@ TransmitMixer::DemuxAndMix()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::EncodeAndSend()
|
TransmitMixer::EncodeAndSend()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -462,14 +462,14 @@ TransmitMixer::EncodeAndSend()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 TransmitMixer::CaptureLevel() const
|
uint32_t TransmitMixer::CaptureLevel() const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return _captureLevel;
|
return _captureLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TransmitMixer::UpdateMuteMicrophoneTime(const WebRtc_UWord32 lengthMs)
|
TransmitMixer::UpdateMuteMicrophoneTime(const uint32_t lengthMs)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
"TransmitMixer::UpdateMuteMicrophoneTime(lengthMs=%d)",
|
"TransmitMixer::UpdateMuteMicrophoneTime(lengthMs=%d)",
|
||||||
@@ -477,7 +477,7 @@ TransmitMixer::UpdateMuteMicrophoneTime(const WebRtc_UWord32 lengthMs)
|
|||||||
_remainingMuteMicTimeMs = lengthMs;
|
_remainingMuteMicTimeMs = lengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
TransmitMixer::StopSend()
|
TransmitMixer::StopSend()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
|
||||||
@@ -531,7 +531,7 @@ int TransmitMixer::StartPlayingFileAsMicrophone(const char* fileName,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_UWord32 notificationTime(0);
|
const uint32_t notificationTime(0);
|
||||||
|
|
||||||
if (_filePlayerPtr->StartPlayingFile(
|
if (_filePlayerPtr->StartPlayingFile(
|
||||||
fileName,
|
fileName,
|
||||||
@@ -608,7 +608,7 @@ int TransmitMixer::StartPlayingFileAsMicrophone(InStream* stream,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_UWord32 notificationTime(0);
|
const uint32_t notificationTime(0);
|
||||||
|
|
||||||
if (_filePlayerPtr->StartPlayingFile(
|
if (_filePlayerPtr->StartPlayingFile(
|
||||||
(InStream&) *stream,
|
(InStream&) *stream,
|
||||||
@@ -713,7 +713,7 @@ int TransmitMixer::StartRecordingMicrophone(const char* fileName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0); // Not supported in VoE
|
const uint32_t notificationTime(0); // Not supported in VoE
|
||||||
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
||||||
|
|
||||||
if (codecInst != NULL &&
|
if (codecInst != NULL &&
|
||||||
@@ -792,7 +792,7 @@ int TransmitMixer::StartRecordingMicrophone(OutStream* stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0); // Not supported in VoE
|
const uint32_t notificationTime(0); // Not supported in VoE
|
||||||
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
||||||
|
|
||||||
if (codecInst != NULL && codecInst->channels != 1)
|
if (codecInst != NULL && codecInst->channels != 1)
|
||||||
@@ -899,7 +899,7 @@ int TransmitMixer::StartRecordingCall(const char* fileName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0); // Not supported in VoE
|
const uint32_t notificationTime(0); // Not supported in VoE
|
||||||
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
||||||
|
|
||||||
if (codecInst != NULL && codecInst->channels != 1)
|
if (codecInst != NULL && codecInst->channels != 1)
|
||||||
@@ -977,7 +977,7 @@ int TransmitMixer::StartRecordingCall(OutStream* stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileFormats format;
|
FileFormats format;
|
||||||
const WebRtc_UWord32 notificationTime(0); // Not supported in VoE
|
const uint32_t notificationTime(0); // Not supported in VoE
|
||||||
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
CodecInst dummyCodec = { 100, "L16", 16000, 320, 1, 320000 };
|
||||||
|
|
||||||
if (codecInst != NULL && codecInst->channels != 1)
|
if (codecInst != NULL && codecInst->channels != 1)
|
||||||
@@ -1128,13 +1128,13 @@ TransmitMixer::Mute() const
|
|||||||
return _mute;
|
return _mute;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word8 TransmitMixer::AudioLevel() const
|
int8_t TransmitMixer::AudioLevel() const
|
||||||
{
|
{
|
||||||
// Speech + file level [0,9]
|
// Speech + file level [0,9]
|
||||||
return _audioLevel.Level();
|
return _audioLevel.Level();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word16 TransmitMixer::AudioLevelFullRange() const
|
int16_t TransmitMixer::AudioLevelFullRange() const
|
||||||
{
|
{
|
||||||
// Speech + file level [0,32767]
|
// Speech + file level [0,32767]
|
||||||
return _audioLevel.LevelFullRange();
|
return _audioLevel.LevelFullRange();
|
||||||
@@ -1211,8 +1211,8 @@ int TransmitMixer::GenerateAudioFrame(const int16_t audio[],
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 TransmitMixer::RecordAudioToFile(
|
int32_t TransmitMixer::RecordAudioToFile(
|
||||||
const WebRtc_UWord32 mixingFrequency)
|
const uint32_t mixingFrequency)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
if (_fileRecorderPtr == NULL)
|
if (_fileRecorderPtr == NULL)
|
||||||
@@ -1234,10 +1234,10 @@ WebRtc_Word32 TransmitMixer::RecordAudioToFile(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 TransmitMixer::MixOrReplaceAudioWithFile(
|
int32_t TransmitMixer::MixOrReplaceAudioWithFile(
|
||||||
const int mixingFrequency)
|
const int mixingFrequency)
|
||||||
{
|
{
|
||||||
scoped_array<WebRtc_Word16> fileBuffer(new WebRtc_Word16[640]);
|
scoped_array<int16_t> fileBuffer(new int16_t[640]);
|
||||||
|
|
||||||
int fileSamples(0);
|
int fileSamples(0);
|
||||||
{
|
{
|
||||||
|
@@ -40,37 +40,36 @@ class TransmitMixer : public MonitorObserver,
|
|||||||
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static WebRtc_Word32 Create(TransmitMixer*& mixer,
|
static int32_t Create(TransmitMixer*& mixer, const uint32_t instanceId);
|
||||||
const WebRtc_UWord32 instanceId);
|
|
||||||
|
|
||||||
static void Destroy(TransmitMixer*& mixer);
|
static void Destroy(TransmitMixer*& mixer);
|
||||||
|
|
||||||
WebRtc_Word32 SetEngineInformation(ProcessThread& processThread,
|
int32_t SetEngineInformation(ProcessThread& processThread,
|
||||||
Statistics& engineStatistics,
|
Statistics& engineStatistics,
|
||||||
ChannelManager& channelManager);
|
ChannelManager& channelManager);
|
||||||
|
|
||||||
WebRtc_Word32 SetAudioProcessingModule(
|
int32_t SetAudioProcessingModule(
|
||||||
AudioProcessing* audioProcessingModule);
|
AudioProcessing* audioProcessingModule);
|
||||||
|
|
||||||
WebRtc_Word32 PrepareDemux(const void* audioSamples,
|
int32_t PrepareDemux(const void* audioSamples,
|
||||||
const WebRtc_UWord32 nSamples,
|
const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
const WebRtc_UWord16 totalDelayMS,
|
const uint16_t totalDelayMS,
|
||||||
const WebRtc_Word32 clockDrift,
|
const int32_t clockDrift,
|
||||||
const WebRtc_UWord16 currentMicLevel);
|
const uint16_t currentMicLevel);
|
||||||
|
|
||||||
|
|
||||||
WebRtc_Word32 DemuxAndMix();
|
int32_t DemuxAndMix();
|
||||||
|
|
||||||
WebRtc_Word32 EncodeAndSend();
|
int32_t EncodeAndSend();
|
||||||
|
|
||||||
WebRtc_UWord32 CaptureLevel() const;
|
uint32_t CaptureLevel() const;
|
||||||
|
|
||||||
WebRtc_Word32 StopSend();
|
int32_t StopSend();
|
||||||
|
|
||||||
// VoEDtmf
|
// VoEDtmf
|
||||||
void UpdateMuteMicrophoneTime(const WebRtc_UWord32 lengthMs);
|
void UpdateMuteMicrophoneTime(const uint32_t lengthMs);
|
||||||
|
|
||||||
// VoEExternalMedia
|
// VoEExternalMedia
|
||||||
int RegisterExternalMediaProcessing(VoEMediaProcess* object,
|
int RegisterExternalMediaProcessing(VoEMediaProcess* object,
|
||||||
@@ -84,9 +83,9 @@ public:
|
|||||||
|
|
||||||
bool Mute() const;
|
bool Mute() const;
|
||||||
|
|
||||||
WebRtc_Word8 AudioLevel() const;
|
int8_t AudioLevel() const;
|
||||||
|
|
||||||
WebRtc_Word16 AudioLevelFullRange() const;
|
int16_t AudioLevelFullRange() const;
|
||||||
|
|
||||||
bool IsRecordingCall();
|
bool IsRecordingCall();
|
||||||
|
|
||||||
@@ -129,7 +128,7 @@ public:
|
|||||||
|
|
||||||
void SetMixWithMicStatus(bool mix);
|
void SetMixWithMicStatus(bool mix);
|
||||||
|
|
||||||
WebRtc_Word32 RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
|
int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
|
||||||
|
|
||||||
virtual ~TransmitMixer();
|
virtual ~TransmitMixer();
|
||||||
|
|
||||||
@@ -138,15 +137,15 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// FileCallback
|
// FileCallback
|
||||||
void PlayNotification(const WebRtc_Word32 id,
|
void PlayNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs);
|
const uint32_t durationMs);
|
||||||
|
|
||||||
void RecordNotification(const WebRtc_Word32 id,
|
void RecordNotification(const int32_t id,
|
||||||
const WebRtc_UWord32 durationMs);
|
const uint32_t durationMs);
|
||||||
|
|
||||||
void PlayFileEnded(const WebRtc_Word32 id);
|
void PlayFileEnded(const int32_t id);
|
||||||
|
|
||||||
void RecordFileEnded(const WebRtc_Word32 id);
|
void RecordFileEnded(const int32_t id);
|
||||||
|
|
||||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||||
// Typing detection
|
// Typing detection
|
||||||
@@ -162,7 +161,7 @@ public:
|
|||||||
bool IsStereoChannelSwappingEnabled();
|
bool IsStereoChannelSwappingEnabled();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TransmitMixer(const WebRtc_UWord32 instanceId);
|
TransmitMixer(const uint32_t instanceId);
|
||||||
|
|
||||||
// Gets the maximum sample rate and number of channels over all currently
|
// Gets the maximum sample rate and number of channels over all currently
|
||||||
// sending codecs.
|
// sending codecs.
|
||||||
@@ -172,9 +171,9 @@ private:
|
|||||||
int nSamples,
|
int nSamples,
|
||||||
int nChannels,
|
int nChannels,
|
||||||
int samplesPerSec);
|
int samplesPerSec);
|
||||||
WebRtc_Word32 RecordAudioToFile(const WebRtc_UWord32 mixingFrequency);
|
int32_t RecordAudioToFile(const uint32_t mixingFrequency);
|
||||||
|
|
||||||
WebRtc_Word32 MixOrReplaceAudioWithFile(
|
int32_t MixOrReplaceAudioWithFile(
|
||||||
const int mixingFrequency);
|
const 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);
|
||||||
@@ -209,9 +208,9 @@ private:
|
|||||||
CriticalSectionWrapper& _callbackCritSect;
|
CriticalSectionWrapper& _callbackCritSect;
|
||||||
|
|
||||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||||
WebRtc_Word32 _timeActive;
|
int32_t _timeActive;
|
||||||
WebRtc_Word32 _timeSinceLastTyping;
|
int32_t _timeSinceLastTyping;
|
||||||
WebRtc_Word32 _penaltyCounter;
|
int32_t _penaltyCounter;
|
||||||
bool _typingNoiseWarning;
|
bool _typingNoiseWarning;
|
||||||
|
|
||||||
// Tunable treshold values
|
// Tunable treshold values
|
||||||
@@ -226,11 +225,11 @@ private:
|
|||||||
|
|
||||||
int _instanceId;
|
int _instanceId;
|
||||||
bool _mixFileWithMicrophone;
|
bool _mixFileWithMicrophone;
|
||||||
WebRtc_UWord32 _captureLevel;
|
uint32_t _captureLevel;
|
||||||
VoEMediaProcess* external_postproc_ptr_;
|
VoEMediaProcess* external_postproc_ptr_;
|
||||||
VoEMediaProcess* external_preproc_ptr_;
|
VoEMediaProcess* external_preproc_ptr_;
|
||||||
bool _mute;
|
bool _mute;
|
||||||
WebRtc_Word32 _remainingMuteMicTimeMs;
|
int32_t _remainingMuteMicTimeMs;
|
||||||
bool stereo_codec_;
|
bool stereo_codec_;
|
||||||
bool swap_stereo_channels_;
|
bool swap_stereo_channels_;
|
||||||
};
|
};
|
||||||
|
@@ -21,9 +21,9 @@ namespace voe
|
|||||||
{
|
{
|
||||||
enum{kMaxTargetLen = 2*32*10}; // stereo 32KHz 10ms
|
enum{kMaxTargetLen = 2*32*10}; // stereo 32KHz 10ms
|
||||||
|
|
||||||
void Utility::MixWithSat(WebRtc_Word16 target[],
|
void Utility::MixWithSat(int16_t target[],
|
||||||
int target_channel,
|
int target_channel,
|
||||||
const WebRtc_Word16 source[],
|
const int16_t source[],
|
||||||
int source_channel,
|
int source_channel,
|
||||||
int source_len)
|
int source_len)
|
||||||
{
|
{
|
||||||
@@ -34,8 +34,8 @@ void Utility::MixWithSat(WebRtc_Word16 target[],
|
|||||||
if ((target_channel == 2) && (source_channel == 1))
|
if ((target_channel == 2) && (source_channel == 1))
|
||||||
{
|
{
|
||||||
// Convert source from mono to stereo.
|
// Convert source from mono to stereo.
|
||||||
WebRtc_Word32 left = 0;
|
int32_t left = 0;
|
||||||
WebRtc_Word32 right = 0;
|
int32_t right = 0;
|
||||||
for (int i = 0; i < source_len; ++i) {
|
for (int i = 0; i < source_len; ++i) {
|
||||||
left = source[i] + target[i*2];
|
left = source[i] + target[i*2];
|
||||||
right = source[i] + target[i*2 + 1];
|
right = source[i] + target[i*2 + 1];
|
||||||
@@ -46,7 +46,7 @@ void Utility::MixWithSat(WebRtc_Word16 target[],
|
|||||||
else if ((target_channel == 1) && (source_channel == 2))
|
else if ((target_channel == 1) && (source_channel == 2))
|
||||||
{
|
{
|
||||||
// Convert source from stereo to mono.
|
// Convert source from stereo to mono.
|
||||||
WebRtc_Word32 temp = 0;
|
int32_t temp = 0;
|
||||||
for (int i = 0; i < source_len/2; ++i) {
|
for (int i = 0; i < source_len/2; ++i) {
|
||||||
temp = ((source[i*2] + source[i*2 + 1])>>1) + target[i];
|
temp = ((source[i*2] + source[i*2 + 1])>>1) + target[i];
|
||||||
target[i] = WebRtcSpl_SatW32ToW16(temp);
|
target[i] = WebRtcSpl_SatW32ToW16(temp);
|
||||||
@@ -54,7 +54,7 @@ void Utility::MixWithSat(WebRtc_Word16 target[],
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WebRtc_Word32 temp = 0;
|
int32_t temp = 0;
|
||||||
for (int i = 0; i < source_len; ++i) {
|
for (int i = 0; i < source_len; ++i) {
|
||||||
temp = source[i] + target[i];
|
temp = source[i] + target[i];
|
||||||
target[i] = WebRtcSpl_SatW32ToW16(temp);
|
target[i] = WebRtcSpl_SatW32ToW16(temp);
|
||||||
@@ -62,11 +62,11 @@ void Utility::MixWithSat(WebRtc_Word16 target[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utility::MixSubtractWithSat(WebRtc_Word16 target[],
|
void Utility::MixSubtractWithSat(int16_t target[],
|
||||||
const WebRtc_Word16 source[],
|
const int16_t source[],
|
||||||
WebRtc_UWord16 len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 temp(0);
|
int32_t temp(0);
|
||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
temp = target[i] - source[i];
|
temp = target[i] - source[i];
|
||||||
@@ -75,48 +75,48 @@ void Utility::MixSubtractWithSat(WebRtc_Word16 target[],
|
|||||||
else if (temp < -32768)
|
else if (temp < -32768)
|
||||||
target[i] = -32768;
|
target[i] = -32768;
|
||||||
else
|
else
|
||||||
target[i] = (WebRtc_Word16) temp;
|
target[i] = (int16_t) temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utility::MixAndScaleWithSat(WebRtc_Word16 target[],
|
void Utility::MixAndScaleWithSat(int16_t target[],
|
||||||
const WebRtc_Word16 source[], float scale,
|
const int16_t source[], float scale,
|
||||||
WebRtc_UWord16 len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 temp(0);
|
int32_t temp(0);
|
||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
temp = (WebRtc_Word32) (target[i] + scale * source[i]);
|
temp = (int32_t) (target[i] + scale * source[i]);
|
||||||
if (temp > 32767)
|
if (temp > 32767)
|
||||||
target[i] = 32767;
|
target[i] = 32767;
|
||||||
else if (temp < -32768)
|
else if (temp < -32768)
|
||||||
target[i] = -32768;
|
target[i] = -32768;
|
||||||
else
|
else
|
||||||
target[i] = (WebRtc_Word16) temp;
|
target[i] = (int16_t) temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utility::Scale(WebRtc_Word16 vector[], float scale, WebRtc_UWord16 len)
|
void Utility::Scale(int16_t vector[], float scale, uint16_t len)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
vector[i] = (WebRtc_Word16) (scale * vector[i]);
|
vector[i] = (int16_t) (scale * vector[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utility::ScaleWithSat(WebRtc_Word16 vector[], float scale,
|
void Utility::ScaleWithSat(int16_t vector[], float scale,
|
||||||
WebRtc_UWord16 len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 temp(0);
|
int32_t temp(0);
|
||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
temp = (WebRtc_Word32) (scale * vector[i]);
|
temp = (int32_t) (scale * vector[i]);
|
||||||
if (temp > 32767)
|
if (temp > 32767)
|
||||||
vector[i] = 32767;
|
vector[i] = 32767;
|
||||||
else if (temp < -32768)
|
else if (temp < -32768)
|
||||||
vector[i] = -32768;
|
vector[i] = -32768;
|
||||||
else
|
else
|
||||||
vector[i] = (WebRtc_Word16) temp;
|
vector[i] = (int16_t) temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,26 +29,26 @@ namespace voe
|
|||||||
class Utility
|
class Utility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void MixWithSat(WebRtc_Word16 target[],
|
static void MixWithSat(int16_t target[],
|
||||||
int target_channel,
|
int target_channel,
|
||||||
const WebRtc_Word16 source[],
|
const int16_t source[],
|
||||||
int source_channel,
|
int source_channel,
|
||||||
int source_len);
|
int source_len);
|
||||||
|
|
||||||
static void MixSubtractWithSat(WebRtc_Word16 target[],
|
static void MixSubtractWithSat(int16_t target[],
|
||||||
const WebRtc_Word16 source[],
|
const int16_t source[],
|
||||||
WebRtc_UWord16 len);
|
uint16_t len);
|
||||||
|
|
||||||
static void MixAndScaleWithSat(WebRtc_Word16 target[],
|
static void MixAndScaleWithSat(int16_t target[],
|
||||||
const WebRtc_Word16 source[],
|
const int16_t source[],
|
||||||
float scale,
|
float scale,
|
||||||
WebRtc_UWord16 len);
|
uint16_t len);
|
||||||
|
|
||||||
static void Scale(WebRtc_Word16 vector[], float scale, WebRtc_UWord16 len);
|
static void Scale(int16_t vector[], float scale, uint16_t len);
|
||||||
|
|
||||||
static void ScaleWithSat(WebRtc_Word16 vector[],
|
static void ScaleWithSat(int16_t vector[],
|
||||||
float scale,
|
float scale,
|
||||||
WebRtc_UWord16 len);
|
uint16_t len);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace voe
|
} // namespace voe
|
||||||
|
@@ -124,16 +124,16 @@ void VoEBaseImpl::OnWarningIsReported(const WarningCode warning)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
int32_t VoEBaseImpl::RecordedDataIsAvailable(
|
||||||
const void* audioSamples,
|
const void* audioSamples,
|
||||||
const WebRtc_UWord32 nSamples,
|
const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nBytesPerSample,
|
const uint8_t nBytesPerSample,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
const WebRtc_UWord32 totalDelayMS,
|
const uint32_t totalDelayMS,
|
||||||
const WebRtc_Word32 clockDrift,
|
const int32_t clockDrift,
|
||||||
const WebRtc_UWord32 currentMicLevel,
|
const uint32_t currentMicLevel,
|
||||||
WebRtc_UWord32& newMicLevel)
|
uint32_t& newMicLevel)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::RecordedDataIsAvailable(nSamples=%u, "
|
"VoEBaseImpl::RecordedDataIsAvailable(nSamples=%u, "
|
||||||
@@ -146,9 +146,9 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
|||||||
assert(_shared->audio_device() != NULL);
|
assert(_shared->audio_device() != NULL);
|
||||||
|
|
||||||
bool isAnalogAGC(false);
|
bool isAnalogAGC(false);
|
||||||
WebRtc_UWord32 maxVolume(0);
|
uint32_t maxVolume(0);
|
||||||
WebRtc_UWord16 currentVoEMicLevel(0);
|
uint16_t currentVoEMicLevel(0);
|
||||||
WebRtc_UWord32 newVoEMicLevel(0);
|
uint32_t newVoEMicLevel(0);
|
||||||
|
|
||||||
if (_shared->audio_processing() &&
|
if (_shared->audio_processing() &&
|
||||||
(_shared->audio_processing()->gain_control()->mode()
|
(_shared->audio_processing()->gain_control()->mode()
|
||||||
@@ -165,7 +165,7 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
|||||||
{
|
{
|
||||||
if (0 != maxVolume)
|
if (0 != maxVolume)
|
||||||
{
|
{
|
||||||
currentVoEMicLevel = (WebRtc_UWord16) ((currentMicLevel
|
currentVoEMicLevel = (uint16_t) ((currentMicLevel
|
||||||
* kMaxVolumeLevel + (int) (maxVolume / 2))
|
* kMaxVolumeLevel + (int) (maxVolume / 2))
|
||||||
/ (maxVolume));
|
/ (maxVolume));
|
||||||
}
|
}
|
||||||
@@ -188,13 +188,13 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
|||||||
// issues with truncation introduced by the scaling.
|
// issues with truncation introduced by the scaling.
|
||||||
if (_oldMicLevel == currentMicLevel)
|
if (_oldMicLevel == currentMicLevel)
|
||||||
{
|
{
|
||||||
currentVoEMicLevel = (WebRtc_UWord16) _oldVoEMicLevel;
|
currentVoEMicLevel = (uint16_t) _oldVoEMicLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform channel-independent operations
|
// Perform channel-independent operations
|
||||||
// (APM, mix with file, record to file, mute, etc.)
|
// (APM, mix with file, record to file, mute, etc.)
|
||||||
_shared->transmit_mixer()->PrepareDemux(audioSamples, nSamples, nChannels,
|
_shared->transmit_mixer()->PrepareDemux(audioSamples, nSamples, nChannels,
|
||||||
samplesPerSec, static_cast<WebRtc_UWord16>(totalDelayMS), clockDrift,
|
samplesPerSec, static_cast<uint16_t>(totalDelayMS), clockDrift,
|
||||||
currentVoEMicLevel);
|
currentVoEMicLevel);
|
||||||
|
|
||||||
// Copy the audio frame to each sending channel and perform
|
// Copy the audio frame to each sending channel and perform
|
||||||
@@ -213,7 +213,7 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
|||||||
if (newVoEMicLevel != currentVoEMicLevel)
|
if (newVoEMicLevel != currentVoEMicLevel)
|
||||||
{
|
{
|
||||||
// Add (kMaxVolumeLevel/2) to round the value
|
// Add (kMaxVolumeLevel/2) to round the value
|
||||||
newMicLevel = (WebRtc_UWord32) ((newVoEMicLevel * maxVolume
|
newMicLevel = (uint32_t) ((newVoEMicLevel * maxVolume
|
||||||
+ (int) (kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
+ (int) (kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -230,13 +230,13 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::NeedMorePlayData(
|
int32_t VoEBaseImpl::NeedMorePlayData(
|
||||||
const WebRtc_UWord32 nSamples,
|
const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nBytesPerSample,
|
const uint8_t nBytesPerSample,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
void* audioSamples,
|
void* audioSamples,
|
||||||
WebRtc_UWord32& nSamplesOut)
|
uint32_t& nSamplesOut)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::NeedMorePlayData(nSamples=%u, "
|
"VoEBaseImpl::NeedMorePlayData(nSamples=%u, "
|
||||||
@@ -259,13 +259,13 @@ WebRtc_Word32 VoEBaseImpl::NeedMorePlayData(
|
|||||||
|
|
||||||
assert(static_cast<int>(nSamples) == _audioFrame.samples_per_channel_);
|
assert(static_cast<int>(nSamples) == _audioFrame.samples_per_channel_);
|
||||||
assert(samplesPerSec ==
|
assert(samplesPerSec ==
|
||||||
static_cast<WebRtc_UWord32>(_audioFrame.sample_rate_hz_));
|
static_cast<uint32_t>(_audioFrame.sample_rate_hz_));
|
||||||
|
|
||||||
// Deliver audio (PCM) samples to the ADM
|
// Deliver audio (PCM) samples to the ADM
|
||||||
memcpy(
|
memcpy(
|
||||||
(WebRtc_Word16*) audioSamples,
|
(int16_t*) audioSamples,
|
||||||
(const WebRtc_Word16*) _audioFrame.data_,
|
(const int16_t*) _audioFrame.data_,
|
||||||
sizeof(WebRtc_Word16) * (_audioFrame.samples_per_channel_
|
sizeof(int16_t) * (_audioFrame.samples_per_channel_
|
||||||
* _audioFrame.num_channels_));
|
* _audioFrame.num_channels_));
|
||||||
|
|
||||||
nSamplesOut = _audioFrame.samples_per_channel_;
|
nSamplesOut = _audioFrame.samples_per_channel_;
|
||||||
@@ -573,7 +573,7 @@ int VoEBaseImpl::MaxNumOfChannels()
|
|||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"MaxNumOfChannels()");
|
"MaxNumOfChannels()");
|
||||||
WebRtc_Word32 maxNumOfChannels =
|
int32_t maxNumOfChannels =
|
||||||
_shared->channel_manager().MaxNumOfChannels();
|
_shared->channel_manager().MaxNumOfChannels();
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||||
VoEId(_shared->instance_id(), -1),
|
VoEId(_shared->instance_id(), -1),
|
||||||
@@ -593,7 +593,7 @@ int VoEBaseImpl::CreateChannel()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 channelId = -1;
|
int32_t channelId = -1;
|
||||||
|
|
||||||
if (!_shared->channel_manager().CreateChannel(channelId))
|
if (!_shared->channel_manager().CreateChannel(channelId))
|
||||||
{
|
{
|
||||||
@@ -860,8 +860,8 @@ int VoEBaseImpl::GetVersion(char version[1024])
|
|||||||
char versionBuf[kVoiceEngineVersionMaxMessageSize];
|
char versionBuf[kVoiceEngineVersionMaxMessageSize];
|
||||||
char* versionPtr = versionBuf;
|
char* versionPtr = versionBuf;
|
||||||
|
|
||||||
WebRtc_Word32 len = 0;
|
int32_t len = 0;
|
||||||
WebRtc_Word32 accLen = 0;
|
int32_t accLen = 0;
|
||||||
|
|
||||||
len = AddVoEVersion(versionPtr);
|
len = AddVoEVersion(versionPtr);
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
@@ -933,25 +933,25 @@ int VoEBaseImpl::GetVersion(char version[1024])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::AddBuildInfo(char* str) const
|
int32_t VoEBaseImpl::AddBuildInfo(char* str) const
|
||||||
{
|
{
|
||||||
return sprintf(str, "Build: svn:%s %s\n", WEBRTC_SVNREVISION, BUILDINFO);
|
return sprintf(str, "Build: svn:%s %s\n", WEBRTC_SVNREVISION, BUILDINFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::AddVoEVersion(char* str) const
|
int32_t VoEBaseImpl::AddVoEVersion(char* str) const
|
||||||
{
|
{
|
||||||
return sprintf(str, "VoiceEngine 4.1.0\n");
|
return sprintf(str, "VoiceEngine 4.1.0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_EXTERNAL_TRANSPORT
|
#ifdef WEBRTC_EXTERNAL_TRANSPORT
|
||||||
WebRtc_Word32 VoEBaseImpl::AddExternalTransportBuild(char* str) const
|
int32_t VoEBaseImpl::AddExternalTransportBuild(char* str) const
|
||||||
{
|
{
|
||||||
return sprintf(str, "External transport build\n");
|
return sprintf(str, "External transport build\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
||||||
WebRtc_Word32 VoEBaseImpl::AddExternalRecAndPlayoutBuild(char* str) const
|
int32_t VoEBaseImpl::AddExternalRecAndPlayoutBuild(char* str) const
|
||||||
{
|
{
|
||||||
return sprintf(str, "External recording and playout build\n");
|
return sprintf(str, "External recording and playout build\n");
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1046,7 @@ int VoEBaseImpl::GetOnHoldStatus(int channel, bool& enabled, OnHoldModes& mode)
|
|||||||
return channelPtr->GetOnHoldStatus(enabled, mode);
|
return channelPtr->GetOnHoldStatus(enabled, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::StartPlayout()
|
int32_t VoEBaseImpl::StartPlayout()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::StartPlayout()");
|
"VoEBaseImpl::StartPlayout()");
|
||||||
@@ -1074,19 +1074,19 @@ WebRtc_Word32 VoEBaseImpl::StartPlayout()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::StopPlayout()
|
int32_t VoEBaseImpl::StopPlayout()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::StopPlayout()");
|
"VoEBaseImpl::StopPlayout()");
|
||||||
|
|
||||||
WebRtc_Word32 numOfChannels = _shared->channel_manager().NumOfChannels();
|
int32_t numOfChannels = _shared->channel_manager().NumOfChannels();
|
||||||
if (numOfChannels <= 0)
|
if (numOfChannels <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord16 nChannelsPlaying(0);
|
uint16_t nChannelsPlaying(0);
|
||||||
WebRtc_Word32* channelsArray = new WebRtc_Word32[numOfChannels];
|
int32_t* channelsArray = new int32_t[numOfChannels];
|
||||||
|
|
||||||
// Get number of playing channels
|
// Get number of playing channels
|
||||||
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
||||||
@@ -1117,7 +1117,7 @@ WebRtc_Word32 VoEBaseImpl::StopPlayout()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::StartSend()
|
int32_t VoEBaseImpl::StartSend()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::StartSend()");
|
"VoEBaseImpl::StartSend()");
|
||||||
@@ -1146,7 +1146,7 @@ WebRtc_Word32 VoEBaseImpl::StartSend()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::StopSend()
|
int32_t VoEBaseImpl::StopSend()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::StopSend()");
|
"VoEBaseImpl::StopSend()");
|
||||||
@@ -1167,16 +1167,16 @@ WebRtc_Word32 VoEBaseImpl::StopSend()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VoEBaseImpl::TerminateInternal()
|
int32_t VoEBaseImpl::TerminateInternal()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::TerminateInternal()");
|
"VoEBaseImpl::TerminateInternal()");
|
||||||
|
|
||||||
// Delete any remaining channel objects
|
// Delete any remaining channel objects
|
||||||
WebRtc_Word32 numOfChannels = _shared->channel_manager().NumOfChannels();
|
int32_t numOfChannels = _shared->channel_manager().NumOfChannels();
|
||||||
if (numOfChannels > 0)
|
if (numOfChannels > 0)
|
||||||
{
|
{
|
||||||
WebRtc_Word32* channelsArray = new WebRtc_Word32[numOfChannels];
|
int32_t* channelsArray = new int32_t[numOfChannels];
|
||||||
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
||||||
for (int i = 0; i < numOfChannels; i++)
|
for (int i = 0; i < numOfChannels; i++)
|
||||||
{
|
{
|
||||||
|
@@ -71,23 +71,23 @@ public:
|
|||||||
virtual int LastError();
|
virtual int LastError();
|
||||||
|
|
||||||
// AudioTransport
|
// AudioTransport
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
RecordedDataIsAvailable(const void* audioSamples,
|
RecordedDataIsAvailable(const void* audioSamples,
|
||||||
const WebRtc_UWord32 nSamples,
|
const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nBytesPerSample,
|
const uint8_t nBytesPerSample,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
const WebRtc_UWord32 totalDelayMS,
|
const uint32_t totalDelayMS,
|
||||||
const WebRtc_Word32 clockDrift,
|
const int32_t clockDrift,
|
||||||
const WebRtc_UWord32 currentMicLevel,
|
const uint32_t currentMicLevel,
|
||||||
WebRtc_UWord32& newMicLevel);
|
uint32_t& newMicLevel);
|
||||||
|
|
||||||
virtual WebRtc_Word32 NeedMorePlayData(const WebRtc_UWord32 nSamples,
|
virtual int32_t NeedMorePlayData(const uint32_t nSamples,
|
||||||
const WebRtc_UWord8 nBytesPerSample,
|
const uint8_t nBytesPerSample,
|
||||||
const WebRtc_UWord8 nChannels,
|
const uint8_t nChannels,
|
||||||
const WebRtc_UWord32 samplesPerSec,
|
const uint32_t samplesPerSec,
|
||||||
void* audioSamples,
|
void* audioSamples,
|
||||||
WebRtc_UWord32& nSamplesOut);
|
uint32_t& nSamplesOut);
|
||||||
|
|
||||||
// AudioDeviceObserver
|
// AudioDeviceObserver
|
||||||
virtual void OnErrorIsReported(const ErrorCode error);
|
virtual void OnErrorIsReported(const ErrorCode error);
|
||||||
@@ -98,26 +98,26 @@ protected:
|
|||||||
virtual ~VoEBaseImpl();
|
virtual ~VoEBaseImpl();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 StartPlayout();
|
int32_t StartPlayout();
|
||||||
WebRtc_Word32 StopPlayout();
|
int32_t StopPlayout();
|
||||||
WebRtc_Word32 StartSend();
|
int32_t StartSend();
|
||||||
WebRtc_Word32 StopSend();
|
int32_t StopSend();
|
||||||
WebRtc_Word32 TerminateInternal();
|
int32_t TerminateInternal();
|
||||||
|
|
||||||
WebRtc_Word32 AddBuildInfo(char* str) const;
|
int32_t AddBuildInfo(char* str) const;
|
||||||
WebRtc_Word32 AddVoEVersion(char* str) const;
|
int32_t AddVoEVersion(char* str) const;
|
||||||
#ifdef WEBRTC_EXTERNAL_TRANSPORT
|
#ifdef WEBRTC_EXTERNAL_TRANSPORT
|
||||||
WebRtc_Word32 AddExternalTransportBuild(char* str) const;
|
int32_t AddExternalTransportBuild(char* str) const;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
#ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
|
||||||
WebRtc_Word32 AddExternalRecAndPlayoutBuild(char* str) const;
|
int32_t AddExternalRecAndPlayoutBuild(char* str) const;
|
||||||
#endif
|
#endif
|
||||||
VoiceEngineObserver* _voiceEngineObserverPtr;
|
VoiceEngineObserver* _voiceEngineObserverPtr;
|
||||||
CriticalSectionWrapper& _callbackCritSect;
|
CriticalSectionWrapper& _callbackCritSect;
|
||||||
|
|
||||||
bool _voiceEngineObserver;
|
bool _voiceEngineObserver;
|
||||||
WebRtc_UWord32 _oldVoEMicLevel;
|
uint32_t _oldVoEMicLevel;
|
||||||
WebRtc_UWord32 _oldMicLevel;
|
uint32_t _oldMicLevel;
|
||||||
AudioFrame _audioFrame;
|
AudioFrame _audioFrame;
|
||||||
voe::SharedData* _shared;
|
voe::SharedData* _shared;
|
||||||
|
|
||||||
|
@@ -100,13 +100,13 @@ int VoECallReportImpl::ResetCallReportStatistics(int channel)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WebRtc_Word32 numOfChannels =
|
int32_t numOfChannels =
|
||||||
_shared->channel_manager().NumOfChannels();
|
_shared->channel_manager().NumOfChannels();
|
||||||
if (numOfChannels <= 0)
|
if (numOfChannels <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32* channelsArray = new WebRtc_Word32[numOfChannels];
|
int32_t* channelsArray = new int32_t[numOfChannels];
|
||||||
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
||||||
for (int i = 0; i < numOfChannels; i++)
|
for (int i = 0; i < numOfChannels; i++)
|
||||||
{
|
{
|
||||||
@@ -333,12 +333,12 @@ int VoECallReportImpl::WriteReportToFile(const char* fileNameUTF8)
|
|||||||
_file.WriteText("\nNetwork Packet Round Trip Time (RTT)\n");
|
_file.WriteText("\nNetwork Packet Round Trip Time (RTT)\n");
|
||||||
_file.WriteText("------------------------------------\n\n");
|
_file.WriteText("------------------------------------\n\n");
|
||||||
|
|
||||||
WebRtc_Word32 numOfChannels = _shared->channel_manager().NumOfChannels();
|
int32_t numOfChannels = _shared->channel_manager().NumOfChannels();
|
||||||
if (numOfChannels <= 0)
|
if (numOfChannels <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32* channelsArray = new WebRtc_Word32[numOfChannels];
|
int32_t* channelsArray = new int32_t[numOfChannels];
|
||||||
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
_shared->channel_manager().GetChannelIds(channelsArray, numOfChannels);
|
||||||
for (int ch = 0; ch < numOfChannels; ch++)
|
for (int ch = 0; ch < numOfChannels; ch++)
|
||||||
{
|
{
|
||||||
|
@@ -55,7 +55,7 @@ int VoECodecImpl::NumOfCodecs()
|
|||||||
"NumOfCodecs()");
|
"NumOfCodecs()");
|
||||||
|
|
||||||
// Number of supported codecs in the ACM
|
// Number of supported codecs in the ACM
|
||||||
WebRtc_UWord8 nSupportedCodecs = AudioCodingModule::NumberOfCodecs();
|
uint8_t nSupportedCodecs = AudioCodingModule::NumberOfCodecs();
|
||||||
|
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||||
VoEId(_shared->instance_id(), -1),
|
VoEId(_shared->instance_id(), -1),
|
||||||
|
@@ -162,7 +162,7 @@ int VoEExternalMediaImpl::SetExternalRecordingStatus(bool enable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int VoEExternalMediaImpl::ExternalRecordingInsertData(
|
int VoEExternalMediaImpl::ExternalRecordingInsertData(
|
||||||
const WebRtc_Word16 speechData10ms[],
|
const int16_t speechData10ms[],
|
||||||
int lengthSamples,
|
int lengthSamples,
|
||||||
int samplingFreqHz,
|
int samplingFreqHz,
|
||||||
int current_delay_ms)
|
int current_delay_ms)
|
||||||
@@ -211,12 +211,12 @@ int VoEExternalMediaImpl::ExternalRecordingInsertData(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord16 blockSize = samplingFreqHz / 100;
|
uint16_t blockSize = samplingFreqHz / 100;
|
||||||
WebRtc_UWord32 nBlocks = lengthSamples / blockSize;
|
uint32_t nBlocks = lengthSamples / blockSize;
|
||||||
WebRtc_Word16 totalDelayMS = 0;
|
int16_t totalDelayMS = 0;
|
||||||
WebRtc_UWord16 playoutDelayMS = 0;
|
uint16_t playoutDelayMS = 0;
|
||||||
|
|
||||||
for (WebRtc_UWord32 i = 0; i < nBlocks; i++)
|
for (uint32_t i = 0; i < nBlocks; i++)
|
||||||
{
|
{
|
||||||
if (!shared_->ext_playout())
|
if (!shared_->ext_playout())
|
||||||
{
|
{
|
||||||
@@ -233,12 +233,12 @@ int VoEExternalMediaImpl::ExternalRecordingInsertData(
|
|||||||
// to ExternalPlayoutGetData.
|
// to ExternalPlayoutGetData.
|
||||||
totalDelayMS = current_delay_ms + playout_delay_ms_;
|
totalDelayMS = current_delay_ms + playout_delay_ms_;
|
||||||
// Compensate for block sizes larger than 10ms
|
// Compensate for block sizes larger than 10ms
|
||||||
totalDelayMS -= (WebRtc_Word16)(i*10);
|
totalDelayMS -= (int16_t)(i*10);
|
||||||
if (totalDelayMS < 0)
|
if (totalDelayMS < 0)
|
||||||
totalDelayMS = 0;
|
totalDelayMS = 0;
|
||||||
}
|
}
|
||||||
shared_->transmit_mixer()->PrepareDemux(
|
shared_->transmit_mixer()->PrepareDemux(
|
||||||
(const WebRtc_Word8*)(&speechData10ms[i*blockSize]),
|
(const int8_t*)(&speechData10ms[i*blockSize]),
|
||||||
blockSize,
|
blockSize,
|
||||||
1,
|
1,
|
||||||
samplingFreqHz,
|
samplingFreqHz,
|
||||||
@@ -278,7 +278,7 @@ int VoEExternalMediaImpl::SetExternalPlayoutStatus(bool enable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int VoEExternalMediaImpl::ExternalPlayoutGetData(
|
int VoEExternalMediaImpl::ExternalPlayoutGetData(
|
||||||
WebRtc_Word16 speechData10ms[],
|
int16_t speechData10ms[],
|
||||||
int samplingFreqHz,
|
int samplingFreqHz,
|
||||||
int current_delay_ms,
|
int current_delay_ms,
|
||||||
int& lengthSamples)
|
int& lengthSamples)
|
||||||
@@ -323,7 +323,7 @@ int VoEExternalMediaImpl::ExternalPlayoutGetData(
|
|||||||
// Deliver audio (PCM) samples to the external sink
|
// Deliver audio (PCM) samples to the external sink
|
||||||
memcpy(speechData10ms,
|
memcpy(speechData10ms,
|
||||||
audioFrame.data_,
|
audioFrame.data_,
|
||||||
sizeof(WebRtc_Word16)*(audioFrame.samples_per_channel_));
|
sizeof(int16_t)*(audioFrame.samples_per_channel_));
|
||||||
lengthSamples = audioFrame.samples_per_channel_;
|
lengthSamples = audioFrame.samples_per_channel_;
|
||||||
|
|
||||||
// Store current playout delay (to be used by ExternalRecordingInsertData).
|
// Store current playout delay (to be used by ExternalRecordingInsertData).
|
||||||
|
@@ -34,12 +34,12 @@ public:
|
|||||||
virtual int SetExternalPlayoutStatus(bool enable);
|
virtual int SetExternalPlayoutStatus(bool enable);
|
||||||
|
|
||||||
virtual int ExternalRecordingInsertData(
|
virtual int ExternalRecordingInsertData(
|
||||||
const WebRtc_Word16 speechData10ms[],
|
const int16_t speechData10ms[],
|
||||||
int lengthSamples,
|
int lengthSamples,
|
||||||
int samplingFreqHz,
|
int samplingFreqHz,
|
||||||
int current_delay_ms);
|
int current_delay_ms);
|
||||||
|
|
||||||
virtual int ExternalPlayoutGetData(WebRtc_Word16 speechData10ms[],
|
virtual int ExternalPlayoutGetData(int16_t speechData10ms[],
|
||||||
int samplingFreqHz,
|
int samplingFreqHz,
|
||||||
int current_delay_ms,
|
int current_delay_ms,
|
||||||
int& lengthSamples);
|
int& lengthSamples);
|
||||||
|
@@ -205,8 +205,8 @@ int VoEFileImpl::StartPlayingFileAsMicrophone(int channel,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_UWord32 startPointMs(0);
|
const uint32_t startPointMs(0);
|
||||||
const WebRtc_UWord32 stopPointMs(0);
|
const uint32_t stopPointMs(0);
|
||||||
|
|
||||||
if (channel == -1)
|
if (channel == -1)
|
||||||
{
|
{
|
||||||
@@ -282,8 +282,8 @@ int VoEFileImpl::StartPlayingFileAsMicrophone(int channel,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_UWord32 startPointMs(0);
|
const uint32_t startPointMs(0);
|
||||||
const WebRtc_UWord32 stopPointMs(0);
|
const uint32_t stopPointMs(0);
|
||||||
|
|
||||||
if (channel == -1)
|
if (channel == -1)
|
||||||
{
|
{
|
||||||
@@ -692,9 +692,9 @@ int VoEFileImpl::ConvertPCMToWAV(const char* fileNameInUTF8,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -705,7 +705,7 @@ int VoEFileImpl::ConvertPCMToWAV(const char* fileNameInUTF8,
|
|||||||
}
|
}
|
||||||
|
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency, AudioFrame::kNormalSpeech,
|
frequency, AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -775,9 +775,9 @@ int VoEFileImpl::ConvertPCMToWAV(InStream* streamIn, OutStream* streamOut)
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -788,7 +788,7 @@ int VoEFileImpl::ConvertPCMToWAV(InStream* streamIn, OutStream* streamOut)
|
|||||||
}
|
}
|
||||||
|
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength, frequency,
|
(uint16_t)decLength, frequency,
|
||||||
AudioFrame::kNormalSpeech,
|
AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -855,9 +855,9 @@ int VoEFileImpl::ConvertWAVToPCM(const char* fileNameInUTF8,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -868,7 +868,7 @@ int VoEFileImpl::ConvertWAVToPCM(const char* fileNameInUTF8,
|
|||||||
}
|
}
|
||||||
|
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency, AudioFrame::kNormalSpeech,
|
frequency, AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -940,9 +940,9 @@ int VoEFileImpl::ConvertWAVToPCM(InStream* streamIn, OutStream* streamOut)
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -953,7 +953,7 @@ int VoEFileImpl::ConvertWAVToPCM(InStream* streamIn, OutStream* streamOut)
|
|||||||
}
|
}
|
||||||
|
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength, frequency,
|
(uint16_t)decLength, frequency,
|
||||||
AudioFrame::kNormalSpeech,
|
AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -1019,9 +1019,9 @@ int VoEFileImpl::ConvertPCMToCompressed(const char* fileNameInUTF8,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -1031,7 +1031,7 @@ int VoEFileImpl::ConvertPCMToCompressed(const char* fileNameInUTF8,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency, AudioFrame::kNormalSpeech,
|
frequency, AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -1103,9 +1103,9 @@ int VoEFileImpl::ConvertPCMToCompressed(InStream* streamIn,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -1115,7 +1115,7 @@ int VoEFileImpl::ConvertPCMToCompressed(InStream* streamIn,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency, AudioFrame::kNormalSpeech,
|
frequency, AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
|
|
||||||
@@ -1185,9 +1185,9 @@ int VoEFileImpl::ConvertCompressedToPCM(const char* fileNameInUTF8,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -1197,7 +1197,7 @@ int VoEFileImpl::ConvertCompressedToPCM(const char* fileNameInUTF8,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency,
|
frequency,
|
||||||
AudioFrame::kNormalSpeech,
|
AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
@@ -1274,9 +1274,9 @@ int VoEFileImpl::ConvertCompressedToPCM(InStream* streamIn,
|
|||||||
|
|
||||||
// Run throught the file
|
// Run throught the file
|
||||||
AudioFrame audioFrame;
|
AudioFrame audioFrame;
|
||||||
WebRtc_Word16 decodedData[160];
|
int16_t decodedData[160];
|
||||||
int decLength=0;
|
int decLength=0;
|
||||||
const WebRtc_UWord32 frequency = 16000;
|
const uint32_t frequency = 16000;
|
||||||
|
|
||||||
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
while(!playerObj.Get10msAudioFromFile(decodedData,decLength,frequency))
|
||||||
{
|
{
|
||||||
@@ -1286,7 +1286,7 @@ int VoEFileImpl::ConvertCompressedToPCM(InStream* streamIn,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
audioFrame.UpdateFrame(-1, 0, decodedData,
|
audioFrame.UpdateFrame(-1, 0, decodedData,
|
||||||
(WebRtc_UWord16)decLength,
|
(uint16_t)decLength,
|
||||||
frequency,
|
frequency,
|
||||||
AudioFrame::kNormalSpeech,
|
AudioFrame::kNormalSpeech,
|
||||||
AudioFrame::kVadActive);
|
AudioFrame::kVadActive);
|
||||||
@@ -1322,7 +1322,7 @@ int VoEFileImpl::GetFileDuration(const char* fileNameUTF8,
|
|||||||
MediaFile * fileModule=MediaFile::CreateMediaFile(-1);
|
MediaFile * fileModule=MediaFile::CreateMediaFile(-1);
|
||||||
|
|
||||||
// Temp container of the right format
|
// Temp container of the right format
|
||||||
WebRtc_UWord32 duration;
|
uint32_t duration;
|
||||||
int res=fileModule->FileDurationMs(fileNameUTF8,duration,format);
|
int res=fileModule->FileDurationMs(fileNameUTF8,duration,format);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
|
@@ -211,7 +211,7 @@ int VoEHardwareImpl::GetRecordingDeviceName(int index,
|
|||||||
// Note that strGuidUTF8 is allowed to be NULL
|
// Note that strGuidUTF8 is allowed to be NULL
|
||||||
|
|
||||||
// Init len variable to length of supplied vectors
|
// Init len variable to length of supplied vectors
|
||||||
const WebRtc_UWord16 strLen = 128;
|
const uint16_t strLen = 128;
|
||||||
|
|
||||||
// Check if length has been changed in module
|
// Check if length has been changed in module
|
||||||
assert(strLen == kAdmMaxDeviceNameSize);
|
assert(strLen == kAdmMaxDeviceNameSize);
|
||||||
@@ -269,7 +269,7 @@ int VoEHardwareImpl::GetPlayoutDeviceName(int index,
|
|||||||
// Note that strGuidUTF8 is allowed to be NULL
|
// Note that strGuidUTF8 is allowed to be NULL
|
||||||
|
|
||||||
// Init len variable to length of supplied vectors
|
// Init len variable to length of supplied vectors
|
||||||
const WebRtc_UWord16 strLen = 128;
|
const uint16_t strLen = 128;
|
||||||
|
|
||||||
// Check if length has been changed in module
|
// Check if length has been changed in module
|
||||||
assert(strLen == kAdmMaxDeviceNameSize);
|
assert(strLen == kAdmMaxDeviceNameSize);
|
||||||
@@ -361,9 +361,9 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Map indices to unsigned since underlying functions need that
|
// Map indices to unsigned since underlying functions need that
|
||||||
WebRtc_UWord16 indexU = static_cast<WebRtc_UWord16> (index);
|
uint16_t indexU = static_cast<uint16_t> (index);
|
||||||
|
|
||||||
WebRtc_Word32 res(0);
|
int32_t res(0);
|
||||||
|
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
{
|
{
|
||||||
@@ -470,9 +470,9 @@ int VoEHardwareImpl::SetPlayoutDevice(int index)
|
|||||||
// We let the module do the index sanity
|
// We let the module do the index sanity
|
||||||
|
|
||||||
// Map indices to unsigned since underlying functions need that
|
// Map indices to unsigned since underlying functions need that
|
||||||
WebRtc_UWord16 indexU = static_cast<WebRtc_UWord16> (index);
|
uint16_t indexU = static_cast<uint16_t> (index);
|
||||||
|
|
||||||
WebRtc_Word32 res(0);
|
int32_t res(0);
|
||||||
|
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
{
|
{
|
||||||
@@ -722,7 +722,7 @@ int VoEHardwareImpl::GetCPULoad(int& loadPercent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get CPU load from ADM
|
// Get CPU load from ADM
|
||||||
WebRtc_UWord16 load(0);
|
uint16_t load(0);
|
||||||
if (_shared->audio_device()->CPULoad(&load) != 0)
|
if (_shared->audio_device()->CPULoad(&load) != 0)
|
||||||
{
|
{
|
||||||
_shared->SetLastError(VE_CPU_INFO_ERROR, kTraceError,
|
_shared->SetLastError(VE_CPU_INFO_ERROR, kTraceError,
|
||||||
|
@@ -122,7 +122,7 @@ int VoENetworkImpl::ReceivedRTPPacket(int channel,
|
|||||||
"ReceivedRTPPacket() external transport is not enabled");
|
"ReceivedRTPPacket() external transport is not enabled");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return channelPtr->ReceivedRTPPacket((const WebRtc_Word8*) data, length);
|
return channelPtr->ReceivedRTPPacket((const int8_t*) data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VoENetworkImpl::ReceivedRTCPPacket(int channel, const void* data,
|
int VoENetworkImpl::ReceivedRTCPPacket(int channel, const void* data,
|
||||||
@@ -161,7 +161,7 @@ int VoENetworkImpl::ReceivedRTCPPacket(int channel, const void* data,
|
|||||||
"ReceivedRTCPPacket() external transport is not enabled");
|
"ReceivedRTCPPacket() external transport is not enabled");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return channelPtr->ReceivedRTCPPacket((const WebRtc_Word8*) data, length);
|
return channelPtr->ReceivedRTCPPacket((const int8_t*) data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VoENetworkImpl::SetPacketTimeoutNotification(int channel,
|
int VoENetworkImpl::SetPacketTimeoutNotification(int channel,
|
||||||
|
@@ -199,7 +199,7 @@ int VoEVideoSyncImpl::GetPlayoutBufferSize(int& bufferMs)
|
|||||||
}
|
}
|
||||||
AudioDeviceModule::BufferType type
|
AudioDeviceModule::BufferType type
|
||||||
(AudioDeviceModule::kFixedBufferSize);
|
(AudioDeviceModule::kFixedBufferSize);
|
||||||
WebRtc_UWord16 sizeMS(0);
|
uint16_t sizeMS(0);
|
||||||
if (_shared->audio_device()->PlayoutBuffer(&type, &sizeMS) != 0)
|
if (_shared->audio_device()->PlayoutBuffer(&type, &sizeMS) != 0)
|
||||||
{
|
{
|
||||||
_shared->SetLastError(VE_AUDIO_DEVICE_MODULE_ERROR, kTraceError,
|
_shared->SetLastError(VE_AUDIO_DEVICE_MODULE_ERROR, kTraceError,
|
||||||
|
@@ -68,8 +68,8 @@ int VoEVolumeControlImpl::SetSpeakerVolume(unsigned int volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 maxVol(0);
|
uint32_t maxVol(0);
|
||||||
WebRtc_UWord32 spkrVol(0);
|
uint32_t spkrVol(0);
|
||||||
|
|
||||||
// scale: [0,kMaxVolumeLevel] -> [0,MaxSpeakerVolume]
|
// scale: [0,kMaxVolumeLevel] -> [0,MaxSpeakerVolume]
|
||||||
if (_shared->audio_device()->MaxSpeakerVolume(&maxVol) != 0)
|
if (_shared->audio_device()->MaxSpeakerVolume(&maxVol) != 0)
|
||||||
@@ -79,7 +79,7 @@ int VoEVolumeControlImpl::SetSpeakerVolume(unsigned int volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Round the value and avoid floating computation.
|
// Round the value and avoid floating computation.
|
||||||
spkrVol = (WebRtc_UWord32)((volume * maxVol +
|
spkrVol = (uint32_t)((volume * maxVol +
|
||||||
(int)(kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
(int)(kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
||||||
|
|
||||||
// set the actual volume using the audio mixer
|
// set the actual volume using the audio mixer
|
||||||
@@ -104,8 +104,8 @@ int VoEVolumeControlImpl::GetSpeakerVolume(unsigned int& volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 spkrVol(0);
|
uint32_t spkrVol(0);
|
||||||
WebRtc_UWord32 maxVol(0);
|
uint32_t maxVol(0);
|
||||||
|
|
||||||
if (_shared->audio_device()->SpeakerVolume(&spkrVol) != 0)
|
if (_shared->audio_device()->SpeakerVolume(&spkrVol) != 0)
|
||||||
{
|
{
|
||||||
@@ -122,7 +122,7 @@ int VoEVolumeControlImpl::GetSpeakerVolume(unsigned int& volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Round the value and avoid floating computation.
|
// Round the value and avoid floating computation.
|
||||||
volume = (WebRtc_UWord32) ((spkrVol * kMaxVolumeLevel +
|
volume = (uint32_t) ((spkrVol * kMaxVolumeLevel +
|
||||||
(int)(maxVol / 2)) / (maxVol));
|
(int)(maxVol / 2)) / (maxVol));
|
||||||
|
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||||
@@ -194,8 +194,8 @@ int VoEVolumeControlImpl::SetMicVolume(unsigned int volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 maxVol(0);
|
uint32_t maxVol(0);
|
||||||
WebRtc_UWord32 micVol(0);
|
uint32_t micVol(0);
|
||||||
|
|
||||||
// scale: [0, kMaxVolumeLevel] -> [0,MaxMicrophoneVolume]
|
// scale: [0, kMaxVolumeLevel] -> [0,MaxMicrophoneVolume]
|
||||||
if (_shared->audio_device()->MaxMicrophoneVolume(&maxVol) != 0)
|
if (_shared->audio_device()->MaxMicrophoneVolume(&maxVol) != 0)
|
||||||
@@ -221,7 +221,7 @@ int VoEVolumeControlImpl::SetMicVolume(unsigned int volume)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Round the value and avoid floating point computation.
|
// Round the value and avoid floating point computation.
|
||||||
micVol = (WebRtc_UWord32) ((volume * maxVol +
|
micVol = (uint32_t) ((volume * maxVol +
|
||||||
(int)(kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
(int)(kMaxVolumeLevel / 2)) / (kMaxVolumeLevel));
|
||||||
|
|
||||||
// set the actual volume using the audio mixer
|
// set the actual volume using the audio mixer
|
||||||
@@ -247,8 +247,8 @@ int VoEVolumeControlImpl::GetMicVolume(unsigned int& volume)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 micVol(0);
|
uint32_t micVol(0);
|
||||||
WebRtc_UWord32 maxVol(0);
|
uint32_t maxVol(0);
|
||||||
|
|
||||||
if (_shared->audio_device()->MicrophoneVolume(&micVol) != 0)
|
if (_shared->audio_device()->MicrophoneVolume(&micVol) != 0)
|
||||||
{
|
{
|
||||||
@@ -266,7 +266,7 @@ int VoEVolumeControlImpl::GetMicVolume(unsigned int& volume)
|
|||||||
}
|
}
|
||||||
if (micVol < maxVol) {
|
if (micVol < maxVol) {
|
||||||
// Round the value and avoid floating point calculation.
|
// Round the value and avoid floating point calculation.
|
||||||
volume = (WebRtc_UWord32) ((micVol * kMaxVolumeLevel +
|
volume = (uint32_t) ((micVol * kMaxVolumeLevel +
|
||||||
(int)(maxVol / 2)) / (maxVol));
|
(int)(maxVol / 2)) / (maxVol));
|
||||||
} else {
|
} else {
|
||||||
// Truncate the value to the kMaxVolumeLevel.
|
// Truncate the value to the kMaxVolumeLevel.
|
||||||
@@ -396,7 +396,7 @@ int VoEVolumeControlImpl::GetSpeechInputLevel(unsigned int& level)
|
|||||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word8 currentLevel = _shared->transmit_mixer()->AudioLevel();
|
int8_t currentLevel = _shared->transmit_mixer()->AudioLevel();
|
||||||
level = static_cast<unsigned int> (currentLevel);
|
level = static_cast<unsigned int> (currentLevel);
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||||
VoEId(_shared->instance_id(), -1),
|
VoEId(_shared->instance_id(), -1),
|
||||||
@@ -418,7 +418,7 @@ int VoEVolumeControlImpl::GetSpeechOutputLevel(int channel,
|
|||||||
if (channel == -1)
|
if (channel == -1)
|
||||||
{
|
{
|
||||||
return _shared->output_mixer()->GetSpeechOutputLevel(
|
return _shared->output_mixer()->GetSpeechOutputLevel(
|
||||||
(WebRtc_UWord32&)level);
|
(uint32_t&)level);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -430,7 +430,7 @@ int VoEVolumeControlImpl::GetSpeechOutputLevel(int channel,
|
|||||||
"GetSpeechOutputLevel() failed to locate channel");
|
"GetSpeechOutputLevel() failed to locate channel");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
channelPtr->GetSpeechOutputLevel((WebRtc_UWord32&)level);
|
channelPtr->GetSpeechOutputLevel((uint32_t&)level);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -445,7 +445,7 @@ int VoEVolumeControlImpl::GetSpeechInputLevelFullRange(unsigned int& level)
|
|||||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word16 currentLevel = _shared->transmit_mixer()->
|
int16_t currentLevel = _shared->transmit_mixer()->
|
||||||
AudioLevelFullRange();
|
AudioLevelFullRange();
|
||||||
level = static_cast<unsigned int> (currentLevel);
|
level = static_cast<unsigned int> (currentLevel);
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||||
@@ -468,7 +468,7 @@ int VoEVolumeControlImpl::GetSpeechOutputLevelFullRange(int channel,
|
|||||||
if (channel == -1)
|
if (channel == -1)
|
||||||
{
|
{
|
||||||
return _shared->output_mixer()->GetSpeechOutputLevelFullRange(
|
return _shared->output_mixer()->GetSpeechOutputLevelFullRange(
|
||||||
(WebRtc_UWord32&)level);
|
(uint32_t&)level);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -480,7 +480,7 @@ int VoEVolumeControlImpl::GetSpeechOutputLevelFullRange(int channel,
|
|||||||
"GetSpeechOutputLevelFullRange() failed to locate channel");
|
"GetSpeechOutputLevelFullRange() failed to locate channel");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
channelPtr->GetSpeechOutputLevelFullRange((WebRtc_UWord32&)level);
|
channelPtr->GetSpeechOutputLevelFullRange((uint32_t&)level);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ namespace webrtc
|
|||||||
// methods. It is not the nicest solution, especially not since we already
|
// methods. It is not the nicest solution, especially not since we already
|
||||||
// have a counter in VoEBaseImpl. In other words, there is room for
|
// have a counter in VoEBaseImpl. In other words, there is room for
|
||||||
// improvement here.
|
// improvement here.
|
||||||
static WebRtc_Word32 gVoiceEngineInstanceCounter = 0;
|
static int32_t gVoiceEngineInstanceCounter = 0;
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@@ -87,11 +87,11 @@ int VoiceEngine::SetTraceFilter(const unsigned int filter)
|
|||||||
"SetTraceFilter(filter=0x%x)", filter);
|
"SetTraceFilter(filter=0x%x)", filter);
|
||||||
|
|
||||||
// Remember old filter
|
// Remember old filter
|
||||||
WebRtc_UWord32 oldFilter = 0;
|
uint32_t oldFilter = 0;
|
||||||
Trace::LevelFilter(oldFilter);
|
Trace::LevelFilter(oldFilter);
|
||||||
|
|
||||||
// Set new filter
|
// Set new filter
|
||||||
WebRtc_Word32 ret = Trace::SetLevelFilter(filter);
|
int32_t ret = Trace::SetLevelFilter(filter);
|
||||||
|
|
||||||
// If previous log was ignored, log again after changing filter
|
// If previous log was ignored, log again after changing filter
|
||||||
if (kTraceNone == oldFilter)
|
if (kTraceNone == oldFilter)
|
||||||
|
Reference in New Issue
Block a user