diff --git a/webrtc/voice_engine/channel_manager_base.cc b/webrtc/voice_engine/channel_manager_base.cc index 572720c9c..268766bf9 100644 --- a/webrtc/voice_engine/channel_manager_base.cc +++ b/webrtc/voice_engine/channel_manager_base.cc @@ -24,7 +24,7 @@ ChannelManagerBase::ChannelManagerBase() : _itemsCritSectPtr(CriticalSectionWrapper::CreateCriticalSection()), _itemsRWLockPtr(RWLockWrapper::CreateRWLock()) { - for (int i = 0; i < KMaxNumberOfItems; i++) + for (int i = 0; i < kVoiceEngineMaxNumChannels; i++) { _freeItemIds[i] = true; } @@ -48,7 +48,7 @@ bool ChannelManagerBase::GetFreeItemId(WebRtc_Word32& itemId) { CriticalSectionScoped cs(_itemsCritSectPtr); WebRtc_Word32 i(0); - while (i < KMaxNumberOfItems) + while (i < kVoiceEngineMaxNumChannels) { if (_freeItemIds[i]) { @@ -63,13 +63,13 @@ bool ChannelManagerBase::GetFreeItemId(WebRtc_Word32& itemId) void ChannelManagerBase::AddFreeItemId(WebRtc_Word32 itemId) { - assert(itemId < KMaxNumberOfItems); + assert(itemId < kVoiceEngineMaxNumChannels); _freeItemIds[itemId] = true; } void ChannelManagerBase::RemoveFreeItemIds() { - for (int i = 0; i < KMaxNumberOfItems; i++) + for (int i = 0; i < kVoiceEngineMaxNumChannels; i++) { _freeItemIds[i] = false; } @@ -142,7 +142,7 @@ WebRtc_Word32 ChannelManagerBase::NumOfItems() const WebRtc_Word32 ChannelManagerBase::MaxNumOfItems() const { - return static_cast (KMaxNumberOfItems); + return static_cast (kVoiceEngineMaxNumChannels); } void* diff --git a/webrtc/voice_engine/channel_manager_base.h b/webrtc/voice_engine/channel_manager_base.h index 0831e434e..b74934d51 100644 --- a/webrtc/voice_engine/channel_manager_base.h +++ b/webrtc/voice_engine/channel_manager_base.h @@ -28,9 +28,6 @@ class Channel; class ChannelManagerBase { -public: - enum {KMaxNumberOfItems = kVoiceEngineMaxNumOfChannels}; - protected: bool CreateItem(WebRtc_Word32& itemId); @@ -77,7 +74,7 @@ private: MapWrapper _items; - bool _freeItemIds[KMaxNumberOfItems]; + bool _freeItemIds[kVoiceEngineMaxNumChannels]; // Protects channels from being destroyed while being used RWLockWrapper* _itemsRWLockPtr; diff --git a/webrtc/voice_engine/test/auto_test/voe_extended_test.cc b/webrtc/voice_engine/test/auto_test/voe_extended_test.cc index 8af0cb980..93eda2a8c 100644 --- a/webrtc/voice_engine/test/auto_test/voe_extended_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_extended_test.cc @@ -981,19 +981,17 @@ int VoEExtendedTest::TestBase() { voe_base_->DeleteChannel(ch); // Multi-channel tests - const int MaxNumberOfPlayingChannels(kVoiceEngineMaxNumOfActiveChannels); - - for (i = 0; i < MaxNumberOfPlayingChannels; i++) { + for (i = 0; i < kVoiceEngineMaxNumChannels; i++) { ch = voe_base_->CreateChannel(); TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); } - for (i = 0; i < MaxNumberOfPlayingChannels; i++) { + for (i = 0; i < kVoiceEngineMaxNumChannels; i++) { TEST_MUSTPASS(voe_base_->StopPlayout(i)); MARK(); voe_base_->DeleteChannel(i); } - for (i = 0; i < MaxNumberOfPlayingChannels; i++) { + for (i = 0; i < kVoiceEngineMaxNumChannels; i++) { ch = voe_base_->CreateChannel(); TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); diff --git a/webrtc/voice_engine/voice_engine_defines.h b/webrtc/voice_engine/voice_engine_defines.h index a5f96a2e8..c2d9a4280 100644 --- a/webrtc/voice_engine/voice_engine_defines.h +++ b/webrtc/voice_engine/voice_engine_defines.h @@ -23,8 +23,10 @@ // Enumerators // ---------------------------------------------------------------------------- -namespace webrtc -{ +namespace webrtc { + +// TODO(ajm): There's not really a reason for this limitation. Remove it. +enum { kVoiceEngineMaxNumChannels = 100 }; // VolumeControl enum { kMinVolumeLevel = 0 }; @@ -254,18 +256,6 @@ inline int VoEChannelId(const int moduleId) #pragma comment( lib, "ws2_32.lib" ) #endif -// ---------------------------------------------------------------------------- -// Enumerators -// ---------------------------------------------------------------------------- - -namespace webrtc -{ -// Max number of supported channels -enum { kVoiceEngineMaxNumOfChannels = 32 }; -// Max number of channels which can be played out simultaneously -enum { kVoiceEngineMaxNumOfActiveChannels = 16 }; -} // namespace webrtc - // ---------------------------------------------------------------------------- // Defines // ---------------------------------------------------------------------------- @@ -340,18 +330,6 @@ enum { kVoiceEngineMaxNumOfActiveChannels = 16 }; #ifdef ANDROID -// ---------------------------------------------------------------------------- -// Enumerators -// ---------------------------------------------------------------------------- - -namespace webrtc -{ - // Max number of supported channels - enum { kVoiceEngineMaxNumOfChannels = 32 }; - // Max number of channels which can be played out simultaneously - enum { kVoiceEngineMaxNumOfActiveChannels = 16 }; -} // namespace webrtc - // ---------------------------------------------------------------------------- // Defines // ---------------------------------------------------------------------------- @@ -384,17 +362,6 @@ namespace webrtc return -1; #else // LINUX PC -// ---------------------------------------------------------------------------- -// Enumerators -// ---------------------------------------------------------------------------- - -namespace webrtc -{ - // Max number of supported channels - enum { kVoiceEngineMaxNumOfChannels = 32 }; - // Max number of channels which can be played out simultaneously - enum { kVoiceEngineMaxNumOfActiveChannels = 16 }; -} // namespace webrtc // ---------------------------------------------------------------------------- // Defines @@ -466,18 +433,6 @@ namespace webrtc // iPhone specific #if defined(WEBRTC_IOS) -// ---------------------------------------------------------------------------- -// Enumerators -// ---------------------------------------------------------------------------- - -namespace webrtc -{ - // Max number of supported channels - enum { kVoiceEngineMaxNumOfChannels = 2 }; - // Max number of channels which can be played out simultaneously - enum { kVoiceEngineMaxNumOfActiveChannels = 2 }; -} // namespace webrtc - // ---------------------------------------------------------------------------- // Defines // ---------------------------------------------------------------------------- @@ -511,14 +466,6 @@ namespace webrtc // Enumerators // ---------------------------------------------------------------------------- -namespace webrtc -{ - // Max number of supported channels - enum { kVoiceEngineMaxNumOfChannels = 32 }; - // Max number of channels which can be played out simultaneously - enum { kVoiceEngineMaxNumOfActiveChannels = 16 }; -} // namespace webrtc - // ---------------------------------------------------------------------------- // Defines // ---------------------------------------------------------------------------- @@ -530,6 +477,4 @@ namespace webrtc #define IPHONE_NOT_SUPPORTED(stat) #endif // #ifdef WEBRTC_MAC - - #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_DEFINES_H