summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp118
1 files changed, 118 insertions, 0 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 623d8deac9..3d8ffc35e7 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -26,7 +26,9 @@
#include "llvoiceclient.h"
#include "llvoicevivox.h"
+#if !__FreeBSD__
#include "llvoicewebrtc.h"
+#endif
#include "llviewernetwork.h"
#include "llviewercontrol.h"
#include "llcommandhandler.h"
@@ -120,10 +122,12 @@ LLVoiceModuleInterface *getVoiceModule(const std::string &voice_server_type)
{
return (LLVoiceModuleInterface *) LLVivoxVoiceClient::getInstance();
}
+#if !__FreeBSD__
else if (voice_server_type == WEBRTC_VOICE_SERVER_TYPE)
{
return (LLVoiceModuleInterface *) LLWebRTCVoiceClient::getInstance();
}
+#endif
else
{
LLNotificationsUtil::add("VoiceVersionMismatch");
@@ -165,7 +169,9 @@ void LLVoiceClient::init(LLPumpIO *pump)
{
// Initialize all of the voice modules
m_servicePump = pump;
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->init(pump);
+#endif
LLVivoxVoiceClient::getInstance()->init(pump);
}
@@ -176,7 +182,9 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age
mRegionChangedCallbackSlot.disconnect();
}
mRegionChangedCallbackSlot = gAgent.addRegionChangedCallback(boost::bind(&LLVoiceClient::onRegionChanged, this));
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->userAuthorized(user_id, agentID);
+#endif
LLVivoxVoiceClient::getInstance()->userAuthorized(user_id, agentID);
}
@@ -285,7 +293,9 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ
void LLVoiceClient::setHidden(bool hidden)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setHidden(hidden);
+#endif
LLVivoxVoiceClient::getInstance()->setHidden(hidden);
}
@@ -326,7 +336,9 @@ void LLVoiceClient::updateSettings()
updateMicMuteLogic();
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->updateSettings();
+#endif
LLVivoxVoiceClient::getInstance()->updateSettings();
}
@@ -335,34 +347,54 @@ void LLVoiceClient::updateSettings()
void LLVoiceClient::tuningStart()
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->tuningStart();
+#endif
LLVivoxVoiceClient::getInstance()->tuningStart();
}
void LLVoiceClient::tuningStop()
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->tuningStop();
+#endif
LLVivoxVoiceClient::getInstance()->tuningStop();
}
bool LLVoiceClient::inTuningMode()
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->inTuningMode();
+#else
+ return LLVivoxVoiceClient::getInstance()->inTuningMode();
+#endif
}
void LLVoiceClient::tuningSetMicVolume(float volume)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->tuningSetMicVolume(volume);
+#else
+ LLVivoxVoiceClient::getInstance()->tuningSetMicVolume(volume);
+#endif
}
void LLVoiceClient::tuningSetSpeakerVolume(float volume)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->tuningSetSpeakerVolume(volume);
+#else
+ LLVivoxVoiceClient::getInstance()->tuningSetSpeakerVolume(volume);
+#endif
}
float LLVoiceClient::tuningGetEnergy(void)
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->tuningGetEnergy();
+#else
+ return LLVivoxVoiceClient::getInstance()->tuningGetEnergy();
+#endif
}
//------------------------------------------------
@@ -370,40 +402,64 @@ float LLVoiceClient::tuningGetEnergy(void)
bool LLVoiceClient::deviceSettingsAvailable()
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->deviceSettingsAvailable();
+#else
+ return LLVivoxVoiceClient::getInstance()->deviceSettingsAvailable();
+#endif
}
bool LLVoiceClient::deviceSettingsUpdated()
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->deviceSettingsUpdated();
+#else
+ return LLVivoxVoiceClient::getInstance()->deviceSettingsUpdated();
+#endif
}
void LLVoiceClient::refreshDeviceLists(bool clearCurrentList)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->refreshDeviceLists(clearCurrentList);
+#else
+ LLVivoxVoiceClient::getInstance()->refreshDeviceLists(clearCurrentList);
+#endif
}
void LLVoiceClient::setCaptureDevice(const std::string& name)
{
LLVivoxVoiceClient::getInstance()->setCaptureDevice(name);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setCaptureDevice(name);
+#endif
}
void LLVoiceClient::setRenderDevice(const std::string& name)
{
LLVivoxVoiceClient::getInstance()->setRenderDevice(name);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setRenderDevice(name);
+#endif
}
const LLVoiceDeviceList& LLVoiceClient::getCaptureDevices()
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->getCaptureDevices();
+#else
+ return LLVivoxVoiceClient::getInstance()->getCaptureDevices();
+#endif
}
const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->getRenderDevices();
+#else
+ return LLVivoxVoiceClient::getInstance()->getRenderDevices();
+#endif
}
@@ -412,13 +468,19 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants) const
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->getParticipantList(participants);
+#endif
LLVivoxVoiceClient::getInstance()->getParticipantList(participants);
}
bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) const
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) ||
+#else
+ return
+#endif
LLVivoxVoiceClient::getInstance()->isParticipant(speaker_id);
}
@@ -511,13 +573,21 @@ void LLVoiceClient::activateSpatialChannel(bool activate)
bool LLVoiceClient::isCurrentChannel(const LLSD& channelInfo)
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->isCurrentChannel(channelInfo) ||
+#else
+ return
+#endif
LLVivoxVoiceClient::getInstance()->isCurrentChannel(channelInfo);
}
bool LLVoiceClient::compareChannels(const LLSD &channelInfo1, const LLSD &channelInfo2)
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2) ||
+#else
+ return
+#endif
LLVivoxVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2);
}
@@ -559,13 +629,17 @@ LLVoiceP2POutgoingCallInterface *LLVoiceClient::getOutgoingCallInterface(const L
void LLVoiceClient::setVoiceVolume(F32 volume)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setVoiceVolume(volume);
+#endif
LLVivoxVoiceClient::getInstance()->setVoiceVolume(volume);
}
void LLVoiceClient::setMicGain(F32 gain)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setMicGain(gain);
+#endif
LLVivoxVoiceClient::getInstance()->setMicGain(gain);
}
@@ -612,10 +686,12 @@ bool LLVoiceClient::voiceEnabled()
void LLVoiceClient::setVoiceEnabled(bool enabled)
{
+#if !__FreeBSD__
if (LLWebRTCVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled);
}
+#endif
if (LLVivoxVoiceClient::instanceExists())
{
LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled);
@@ -638,7 +714,9 @@ void LLVoiceClient::updateMicMuteLogic()
// Either of these always overrides any other PTT setting.
new_mic_mute = true;
}
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setMuteMic(new_mic_mute);
+#endif
LLVivoxVoiceClient::getInstance()->setMuteMic(new_mic_mute);
}
@@ -733,18 +811,26 @@ bool LLVoiceClient::getVoiceEnabled(const LLUUID& id) const
std::string LLVoiceClient::getDisplayName(const LLUUID& id) const
{
+#if !__FreeBSD__
std::string result = LLWebRTCVoiceClient::getInstance()->getDisplayName(id);
if (result.empty())
{
result = LLVivoxVoiceClient::getInstance()->getDisplayName(id);
}
return result;
+#else
+ return LLVivoxVoiceClient::getInstance()->getDisplayName(id);
+#endif
}
bool LLVoiceClient::isVoiceWorking() const
{
+#if !__FreeBSD__
return LLVivoxVoiceClient::getInstance()->isVoiceWorking() ||
LLWebRTCVoiceClient::getInstance()->isVoiceWorking();
+#else
+ return LLVivoxVoiceClient::getInstance()->isVoiceWorking();
+#endif
}
bool LLVoiceClient::isParticipantAvatar(const LLUUID& id)
@@ -759,7 +845,11 @@ bool LLVoiceClient::isOnlineSIP(const LLUUID& id)
bool LLVoiceClient::getIsSpeaking(const LLUUID& id)
{
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->getIsSpeaking(id) ||
+#else
+ return
+#endif
LLVivoxVoiceClient::getInstance()->getIsSpeaking(id);
}
@@ -767,14 +857,22 @@ bool LLVoiceClient::getIsModeratorMuted(const LLUUID& id)
{
// don't bother worrying about p2p calls, as
// p2p calls don't have mute.
+#if !__FreeBSD__
return LLWebRTCVoiceClient::getInstance()->getIsModeratorMuted(id) ||
+#else
+ return
+#endif
LLVivoxVoiceClient::getInstance()->getIsModeratorMuted(id);
}
F32 LLVoiceClient::getCurrentPower(const LLUUID& id)
{
+#if !__FreeBSD__
return std::fmax(LLVivoxVoiceClient::getInstance()->getCurrentPower(id),
LLWebRTCVoiceClient::getInstance()->getCurrentPower(id));
+#else
+ return LLVivoxVoiceClient::getInstance()->getCurrentPower(id);
+#endif
}
bool LLVoiceClient::getOnMuteList(const LLUUID& id)
@@ -786,12 +884,18 @@ bool LLVoiceClient::getOnMuteList(const LLUUID& id)
F32 LLVoiceClient::getUserVolume(const LLUUID& id)
{
+#if !__FreeBSD__
return std::fmax(LLVivoxVoiceClient::getInstance()->getUserVolume(id), LLWebRTCVoiceClient::getInstance()->getUserVolume(id));
+#else
+ return LLVivoxVoiceClient::getInstance()->getUserVolume(id);
+#endif
}
void LLVoiceClient::setUserVolume(const LLUUID& id, F32 volume)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setUserVolume(id, volume);
+#endif
LLVivoxVoiceClient::getInstance()->setUserVolume(id, volume);
}
@@ -801,7 +905,9 @@ void LLVoiceClient::setUserVolume(const LLUUID& id, F32 volume)
void LLVoiceClient::addObserver(LLVoiceClientStatusObserver* observer)
{
LLVivoxVoiceClient::getInstance()->addObserver(observer);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->addObserver(observer);
+#endif
}
void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer)
@@ -810,16 +916,20 @@ void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
}
+#if !__FreeBSD__
if (LLWebRTCVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
}
+#endif
}
void LLVoiceClient::addObserver(LLFriendObserver* observer)
{
LLVivoxVoiceClient::getInstance()->addObserver(observer);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->addObserver(observer);
+#endif
}
void LLVoiceClient::removeObserver(LLFriendObserver* observer)
@@ -828,16 +938,20 @@ void LLVoiceClient::removeObserver(LLFriendObserver* observer)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
}
+#if !__FreeBSD__
if (LLWebRTCVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
}
+#endif
}
void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer)
{
LLVivoxVoiceClient::getInstance()->addObserver(observer);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->addObserver(observer);
+#endif
}
void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)
@@ -846,10 +960,12 @@ void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
}
+#if !__FreeBSD__
if (LLWebRTCVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
}
+#endif
}
std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const
@@ -912,10 +1028,12 @@ class LLViewerRequiredVoiceVersion : public LLHTTPNode
{
voiceModule = (LLVoiceModuleInterface *) LLVivoxVoiceClient::getInstance();
}
+#if !__FreeBSD__
else if (voice_server_type == "webrtc")
{
voiceModule = (LLVoiceModuleInterface *) LLWebRTCVoiceClient::getInstance();
}
+#endif
else
{
LL_WARNS("Voice") << "Unknown voice server type " << voice_server_type << LL_ENDL;