2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-03-08 17:54:24 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This file contains common constants for VoiceEngine, as well as
|
2017-02-13 04:42:52 -08:00
|
|
|
* platform specific settings.
|
2011-07-07 08:21:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_VOICE_ENGINE_VOICE_ENGINE_DEFINES_H
|
|
|
|
|
#define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_DEFINES_H
|
|
|
|
|
|
2013-02-05 21:23:39 +00:00
|
|
|
#include "webrtc/common_types.h"
|
2013-03-05 01:12:49 +00:00
|
|
|
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
2016-12-12 05:03:02 -08:00
|
|
|
#include "webrtc/typedefs.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-02-01 23:42:44 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
// VolumeControl
|
|
|
|
|
enum { kMinVolumeLevel = 0 };
|
|
|
|
|
enum { kMaxVolumeLevel = 255 };
|
|
|
|
|
// Min scale factor for per-channel volume scaling
|
|
|
|
|
const float kMinOutputVolumeScaling = 0.0f;
|
|
|
|
|
// Max scale factor for per-channel volume scaling
|
|
|
|
|
const float kMaxOutputVolumeScaling = 10.0f;
|
|
|
|
|
// Min scale factor for output volume panning
|
|
|
|
|
const float kMinOutputVolumePanning = 0.0f;
|
|
|
|
|
// Max scale factor for output volume panning
|
|
|
|
|
const float kMaxOutputVolumePanning = 1.0f;
|
|
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
enum { kVoiceEngineMaxIpPacketSizeBytes = 1500 }; // assumes Ethernet
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// Audio processing
|
2013-03-05 01:12:49 +00:00
|
|
|
const NoiseSuppression::Level kDefaultNsMode = NoiseSuppression::kModerate;
|
|
|
|
|
const GainControl::Mode kDefaultAgcMode =
|
|
|
|
|
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
|
2015-05-04 14:15:32 +02:00
|
|
|
GainControl::kAdaptiveDigital;
|
2013-03-05 01:12:49 +00:00
|
|
|
#else
|
2015-05-04 14:15:32 +02:00
|
|
|
GainControl::kAdaptiveAnalog;
|
2013-03-05 01:12:49 +00:00
|
|
|
#endif
|
|
|
|
|
const bool kDefaultAgcState =
|
|
|
|
|
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
|
2015-05-04 14:15:32 +02:00
|
|
|
false;
|
2013-03-05 01:12:49 +00:00
|
|
|
#else
|
2015-05-04 14:15:32 +02:00
|
|
|
true;
|
2013-03-05 01:12:49 +00:00
|
|
|
#endif
|
2013-10-04 17:54:09 +00:00
|
|
|
const GainControl::Mode kDefaultRxAgcMode = GainControl::kAdaptiveDigital;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// VideoSync
|
|
|
|
|
// Lowest minimum playout delay
|
|
|
|
|
enum { kVoiceEngineMinMinPlayoutDelayMs = 0 };
|
|
|
|
|
// Highest minimum playout delay
|
2013-01-17 22:25:49 +00:00
|
|
|
enum { kVoiceEngineMaxMinPlayoutDelayMs = 10000 };
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// RTP/RTCP
|
|
|
|
|
// Min 4-bit ID for RTP extension (see section 4.2 in RFC 5285)
|
|
|
|
|
enum { kVoiceEngineMinRtpExtensionId = 1 };
|
|
|
|
|
// Max 4-bit ID for RTP extension
|
|
|
|
|
enum { kVoiceEngineMaxRtpExtensionId = 14 };
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
#define NOT_SUPPORTED(stat) \
|
|
|
|
|
LOG_F(LS_ERROR) << "not supported"; \
|
|
|
|
|
stat.SetLastError(VE_FUNC_NOT_SUPPORTED); \
|
2013-02-05 21:23:39 +00:00
|
|
|
return -1;
|
|
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
inline int VoEId(int veId, int chId) {
|
|
|
|
|
if (chId == -1) {
|
|
|
|
|
const int dummyChannel(99);
|
|
|
|
|
return (int)((veId << 16) + dummyChannel);
|
|
|
|
|
}
|
|
|
|
|
return (int)((veId << 16) + chId);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
inline int VoEModuleId(int veId, int chId) {
|
|
|
|
|
return (int)((veId << 16) + chId);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Convert module ID to internal VoE channel ID
|
2015-05-04 14:15:32 +02:00
|
|
|
inline int VoEChannelId(int moduleId) {
|
|
|
|
|
return (int)(moduleId & 0xffff);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
2015-05-04 14:15:32 +02:00
|
|
|
#define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE \
|
|
|
|
|
AudioDeviceModule::kDefaultCommunicationDevice
|
2011-07-07 08:21:25 +00:00
|
|
|
#else
|
|
|
|
|
#define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE 0
|
2017-02-13 04:42:52 -08:00
|
|
|
#endif // #if (defined(_WIN32)
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_DEFINES_H
|