diff options
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
| -rw-r--r-- | indra/newview/llvoiceclient.cpp | 120 | 
1 files changed, 120 insertions, 0 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 71a9e71a9f..59e8db7752 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -26,7 +26,9 @@  #include "llvoiceclient.h"  #include "llvoicevivox.h" +#if !__FreeBSD__ && !_M_ARM64  #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__ && !_M_ARM64      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__ && !_M_ARM64      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__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->userAuthorized(user_id, agentID); +#endif      LLVivoxVoiceClient::getInstance()->userAuthorized(user_id, agentID);  } @@ -286,16 +294,20 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ  void LLVoiceClient::setHidden(bool hidden)  {      LL_INFOS("Voice") << "( " << (hidden ? "true" : "false") << " )" << LL_ENDL; +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setHidden(hidden); +#endif      LLVivoxVoiceClient::getInstance()->setHidden(hidden);  }  void LLVoiceClient::terminate()  { +#if !__FreeBSD__ && !_M_ARM64      if (LLVivoxVoiceClient::instanceExists())      {          LLWebRTCVoiceClient::getInstance()->terminate();      } +#endif      if (LLVivoxVoiceClient::instanceExists())      {          LLVivoxVoiceClient::getInstance()->terminate(); @@ -334,7 +346,9 @@ void LLVoiceClient::updateSettings()      updateMicMuteLogic(); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->updateSettings(); +#endif      LLVivoxVoiceClient::getInstance()->updateSettings();  } @@ -343,34 +357,54 @@ void LLVoiceClient::updateSettings()  void LLVoiceClient::tuningStart()  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->tuningStart(); +#endif      LLVivoxVoiceClient::getInstance()->tuningStart();  }  void LLVoiceClient::tuningStop()  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->tuningStop(); +#endif      LLVivoxVoiceClient::getInstance()->tuningStop();  }  bool LLVoiceClient::inTuningMode()  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->inTuningMode(); +#else +    return LLVivoxVoiceClient::getInstance()->inTuningMode(); +#endif  }  void LLVoiceClient::tuningSetMicVolume(float volume)  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->tuningSetMicVolume(volume); +#else +    LLVivoxVoiceClient::getInstance()->tuningSetMicVolume(volume); +#endif  }  void LLVoiceClient::tuningSetSpeakerVolume(float volume)  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->tuningSetSpeakerVolume(volume); +#else +    LLVivoxVoiceClient::getInstance()->tuningSetSpeakerVolume(volume); +#endif  }  float LLVoiceClient::tuningGetEnergy(void)  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->tuningGetEnergy(); +#else +    return LLVivoxVoiceClient::getInstance()->tuningGetEnergy(); +#endif  }  //------------------------------------------------ @@ -378,40 +412,64 @@ float LLVoiceClient::tuningGetEnergy(void)  bool LLVoiceClient::deviceSettingsAvailable()  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->deviceSettingsAvailable(); +#else +    return LLVivoxVoiceClient::getInstance()->deviceSettingsAvailable(); +#endif  }  bool LLVoiceClient::deviceSettingsUpdated()  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->deviceSettingsUpdated(); +#else +    return LLVivoxVoiceClient::getInstance()->deviceSettingsUpdated(); +#endif  }  void LLVoiceClient::refreshDeviceLists(bool clearCurrentList)  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->refreshDeviceLists(clearCurrentList); +#else +    LLVivoxVoiceClient::getInstance()->refreshDeviceLists(clearCurrentList); +#endif  }  void LLVoiceClient::setCaptureDevice(const std::string& name)  {      LLVivoxVoiceClient::getInstance()->setCaptureDevice(name); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setCaptureDevice(name); +#endif  }  void LLVoiceClient::setRenderDevice(const std::string& name)  {      LLVivoxVoiceClient::getInstance()->setRenderDevice(name); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setRenderDevice(name); +#endif  }  const LLVoiceDeviceList& LLVoiceClient::getCaptureDevices()  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->getCaptureDevices(); +#else +    return LLVivoxVoiceClient::getInstance()->getCaptureDevices(); +#endif  }  const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->getRenderDevices(); +#else +    return LLVivoxVoiceClient::getInstance()->getRenderDevices(); +#endif  } @@ -420,13 +478,19 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()  void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants) const  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->getParticipantList(participants); +#endif      LLVivoxVoiceClient::getInstance()->getParticipantList(participants);  }  bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) const  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) || +#else +    return +#endif             LLVivoxVoiceClient::getInstance()->isParticipant(speaker_id);  } @@ -519,13 +583,21 @@ void LLVoiceClient::activateSpatialChannel(bool activate)  bool LLVoiceClient::isCurrentChannel(const LLSD& channelInfo)  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->isCurrentChannel(channelInfo) || +#else +    return +#endif             LLVivoxVoiceClient::getInstance()->isCurrentChannel(channelInfo);  }  bool LLVoiceClient::compareChannels(const LLSD &channelInfo1, const LLSD &channelInfo2)  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2) || +#else +    return +#endif             LLVivoxVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2);  } @@ -567,13 +639,17 @@ LLVoiceP2POutgoingCallInterface *LLVoiceClient::getOutgoingCallInterface(const L  void LLVoiceClient::setVoiceVolume(F32 volume)  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setVoiceVolume(volume); +#endif      LLVivoxVoiceClient::getInstance()->setVoiceVolume(volume);  }  void LLVoiceClient::setMicGain(F32 gain)  { +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setMicGain(gain); +#endif      LLVivoxVoiceClient::getInstance()->setMicGain(gain);  } @@ -620,10 +696,12 @@ bool LLVoiceClient::voiceEnabled()  void LLVoiceClient::setVoiceEnabled(bool enabled)  { +#if !__FreeBSD__ && !_M_ARM64      if (LLWebRTCVoiceClient::instanceExists())      {          LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled);      } +#endif      if (LLVivoxVoiceClient::instanceExists())      {          LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled); @@ -646,7 +724,9 @@ void LLVoiceClient::updateMicMuteLogic()          // Either of these always overrides any other PTT setting.          new_mic_mute = true;      } +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setMuteMic(new_mic_mute); +#endif      LLVivoxVoiceClient::getInstance()->setMuteMic(new_mic_mute);  } @@ -741,18 +821,26 @@ bool LLVoiceClient::getVoiceEnabled(const LLUUID& id) const  std::string LLVoiceClient::getDisplayName(const LLUUID& id) const  { +#if !__FreeBSD__ && !_M_ARM64      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__ && !_M_ARM64      return LLVivoxVoiceClient::getInstance()->isVoiceWorking() ||             LLWebRTCVoiceClient::getInstance()->isVoiceWorking(); +#else +    return LLVivoxVoiceClient::getInstance()->isVoiceWorking(); +#endif  }  bool LLVoiceClient::isParticipantAvatar(const LLUUID& id) @@ -767,7 +855,11 @@ bool LLVoiceClient::isOnlineSIP(const LLUUID& id)  bool LLVoiceClient::getIsSpeaking(const LLUUID& id)  { +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->getIsSpeaking(id) || +#else +    return +#endif             LLVivoxVoiceClient::getInstance()->getIsSpeaking(id);  } @@ -775,14 +867,22 @@ bool LLVoiceClient::getIsModeratorMuted(const LLUUID& id)  {      // don't bother worrying about p2p calls, as      // p2p calls don't have mute. +#if !__FreeBSD__ && !_M_ARM64      return LLWebRTCVoiceClient::getInstance()->getIsModeratorMuted(id) || +#else +    return +#endif             LLVivoxVoiceClient::getInstance()->getIsModeratorMuted(id);  }  F32 LLVoiceClient::getCurrentPower(const LLUUID& id)  { +#if !__FreeBSD__ && !_M_ARM64      return std::fmax(LLVivoxVoiceClient::getInstance()->getCurrentPower(id),                       LLWebRTCVoiceClient::getInstance()->getCurrentPower(id)); +#else +    return LLVivoxVoiceClient::getInstance()->getCurrentPower(id); +#endif  }  bool LLVoiceClient::getOnMuteList(const LLUUID& id) @@ -794,12 +894,18 @@ bool LLVoiceClient::getOnMuteList(const LLUUID& id)  F32 LLVoiceClient::getUserVolume(const LLUUID& id)  { +#if !__FreeBSD__ && !_M_ARM64      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__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->setUserVolume(id, volume); +#endif      LLVivoxVoiceClient::getInstance()->setUserVolume(id, volume);  } @@ -809,7 +915,9 @@ void LLVoiceClient::setUserVolume(const LLUUID& id, F32 volume)  void LLVoiceClient::addObserver(LLVoiceClientStatusObserver* observer)  {      LLVivoxVoiceClient::getInstance()->addObserver(observer); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->addObserver(observer); +#endif  }  void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer) @@ -818,16 +926,20 @@ void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer)      {          LLVivoxVoiceClient::getInstance()->removeObserver(observer);      } +#if !__FreeBSD__ && !_M_ARM64      if (LLWebRTCVoiceClient::instanceExists())      {          LLWebRTCVoiceClient::getInstance()->removeObserver(observer);      } +#endif  }  void LLVoiceClient::addObserver(LLFriendObserver* observer)  {      LLVivoxVoiceClient::getInstance()->addObserver(observer); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->addObserver(observer); +#endif  }  void LLVoiceClient::removeObserver(LLFriendObserver* observer) @@ -836,16 +948,20 @@ void LLVoiceClient::removeObserver(LLFriendObserver* observer)      {          LLVivoxVoiceClient::getInstance()->removeObserver(observer);      } +#if !__FreeBSD__ && !_M_ARM64      if (LLWebRTCVoiceClient::instanceExists())      {          LLWebRTCVoiceClient::getInstance()->removeObserver(observer);      } +#endif  }  void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer)  {      LLVivoxVoiceClient::getInstance()->addObserver(observer); +#if !__FreeBSD__ && !_M_ARM64      LLWebRTCVoiceClient::getInstance()->addObserver(observer); +#endif  }  void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer) @@ -854,10 +970,12 @@ void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)      {          LLVivoxVoiceClient::getInstance()->removeObserver(observer);      } +#if !__FreeBSD__ && !_M_ARM64      if (LLWebRTCVoiceClient::instanceExists())      {          LLWebRTCVoiceClient::getInstance()->removeObserver(observer);      } +#endif  }  std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const @@ -920,10 +1038,12 @@ class LLViewerRequiredVoiceVersion : public LLHTTPNode          {              voiceModule = (LLVoiceModuleInterface *) LLVivoxVoiceClient::getInstance();          } +#if !__FreeBSD__ && !_M_ARM64          else if (voice_server_type == "webrtc")          {              voiceModule = (LLVoiceModuleInterface *) LLWebRTCVoiceClient::getInstance();          } +#endif          else          {              LL_WARNS("Voice") << "Unknown voice server type " << voice_server_type << LL_ENDL;  | 
