| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 /* | 11 /* |
| 12 * This file contains common constants for VoiceEngine, as well as | 12 * This file contains common constants for VoiceEngine, as well as |
| 13 * platform specific settings. | 13 * platform specific settings. |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 #ifndef VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ | 16 #ifndef VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ |
| 17 #define VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ | 17 #define VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ |
| 18 | 18 |
| 19 #include "common_types.h" // NOLINT(build/include) |
| 19 #include "modules/audio_processing/include/audio_processing.h" | 20 #include "modules/audio_processing/include/audio_processing.h" |
| 21 #include "typedefs.h" // NOLINT(build/include) |
| 20 | 22 |
| 21 namespace webrtc { | 23 namespace webrtc { |
| 22 | 24 |
| 23 // VolumeControl | 25 // VolumeControl |
| 24 enum { kMinVolumeLevel = 0 }; | 26 enum { kMinVolumeLevel = 0 }; |
| 25 enum { kMaxVolumeLevel = 255 }; | 27 enum { kMaxVolumeLevel = 255 }; |
| 28 // Min scale factor for per-channel volume scaling |
| 29 const float kMinOutputVolumeScaling = 0.0f; |
| 30 // Max scale factor for per-channel volume scaling |
| 31 const float kMaxOutputVolumeScaling = 10.0f; |
| 32 // Min scale factor for output volume panning |
| 33 const float kMinOutputVolumePanning = 0.0f; |
| 34 // Max scale factor for output volume panning |
| 35 const float kMaxOutputVolumePanning = 1.0f; |
| 26 | 36 |
| 27 // Audio processing | 37 // Audio processing |
| 28 const NoiseSuppression::Level kDefaultNsMode = NoiseSuppression::kModerate; | 38 const NoiseSuppression::Level kDefaultNsMode = NoiseSuppression::kModerate; |
| 29 const GainControl::Mode kDefaultAgcMode = | 39 const GainControl::Mode kDefaultAgcMode = |
| 30 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 40 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 31 GainControl::kAdaptiveDigital; | 41 GainControl::kAdaptiveDigital; |
| 32 #else | 42 #else |
| 33 GainControl::kAdaptiveAnalog; | 43 GainControl::kAdaptiveAnalog; |
| 34 #endif | 44 #endif |
| 35 const bool kDefaultAgcState = | 45 const bool kDefaultAgcState = |
| 36 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 46 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 37 false; | 47 false; |
| 38 #else | 48 #else |
| 39 true; | 49 true; |
| 40 #endif | 50 #endif |
| 51 const GainControl::Mode kDefaultRxAgcMode = GainControl::kAdaptiveDigital; |
| 41 | 52 |
| 42 // VideoSync | 53 // VideoSync |
| 43 // Lowest minimum playout delay | 54 // Lowest minimum playout delay |
| 44 enum { kVoiceEngineMinMinPlayoutDelayMs = 0 }; | 55 enum { kVoiceEngineMinMinPlayoutDelayMs = 0 }; |
| 45 // Highest minimum playout delay | 56 // Highest minimum playout delay |
| 46 enum { kVoiceEngineMaxMinPlayoutDelayMs = 10000 }; | 57 enum { kVoiceEngineMaxMinPlayoutDelayMs = 10000 }; |
| 47 | 58 |
| 48 } // namespace webrtc | 59 } // namespace webrtc |
| 49 | 60 |
| 50 namespace webrtc { | 61 namespace webrtc { |
| 51 | 62 |
| 52 inline int VoEId(int veId, int chId) { | 63 inline int VoEId(int veId, int chId) { |
| 53 if (chId == -1) { | 64 if (chId == -1) { |
| 54 const int dummyChannel(99); | 65 const int dummyChannel(99); |
| 55 return (int)((veId << 16) + dummyChannel); | 66 return (int)((veId << 16) + dummyChannel); |
| 56 } | 67 } |
| 57 return (int)((veId << 16) + chId); | 68 return (int)((veId << 16) + chId); |
| 58 } | 69 } |
| 59 | 70 |
| 71 inline int VoEModuleId(int veId, int chId) { |
| 72 return (int)((veId << 16) + chId); |
| 73 } |
| 74 |
| 75 // Convert module ID to internal VoE channel ID |
| 76 inline int VoEChannelId(int moduleId) { |
| 77 return (int)(moduleId & 0xffff); |
| 78 } |
| 79 |
| 60 } // namespace webrtc | 80 } // namespace webrtc |
| 61 | 81 |
| 62 #if defined(_WIN32) | 82 #if defined(_WIN32) |
| 63 #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE \ | 83 #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE \ |
| 64 AudioDeviceModule::kDefaultCommunicationDevice | 84 AudioDeviceModule::kDefaultCommunicationDevice |
| 65 #else | 85 #else |
| 66 #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE 0 | 86 #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE 0 |
| 67 #endif // #if (defined(_WIN32) | 87 #endif // #if (defined(_WIN32) |
| 68 | 88 |
| 69 #endif // VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ | 89 #endif // VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_ |
| OLD | NEW |