summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-03 19:50:19 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-03 19:50:19 +0800
commitb7a79709003b1f7f0451ba577576040fc03e50f9 (patch)
treeb698a84bf52c40a2907ac3eaab7b0de2ba6a1055 /indra/newview
parent96d322edfcb97096f701ef11d5fdd1f1c97255ac (diff)
parentb89076f0567547b9c2749595af5ae9d5f9de9f3a (diff)
Merge branch 'webrtc-voice' into tmp
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt9
-rw-r--r--indra/newview/FixBundle.cmake.in35
-rw-r--r--indra/newview/llvoavatar.cpp2
-rw-r--r--indra/newview/llvoicechannel.cpp1
-rw-r--r--indra/newview/llvoiceclient.cpp139
-rw-r--r--indra/newview/llvoiceclient.h6
-rw-r--r--indra/newview/llvoicevivox.cpp26
-rw-r--r--indra/newview/llvoicevivox.h8
-rw-r--r--indra/newview/llvoicewebrtc.cpp32
-rw-r--r--indra/newview/llvoicewebrtc.h13
10 files changed, 243 insertions, 28 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d639840f70..97d501ca2e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -743,6 +743,10 @@ set(viewer_SOURCE_FILES
pipeline.cpp
)
+if (CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ list(REMOVE_ITEM viewer_SOURCE_FILES llvoicewebrtc.cpp)
+endif ()
+
set(VIEWER_BINARY_NAME "secondlife-bin" CACHE STRING
"The name of the viewer executable to create.")
@@ -1943,7 +1947,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
llcorehttp
llcommon
llmeshoptimizer
- llwebrtc
ll::ndof
lllogin
llprimitive
@@ -1953,6 +1956,10 @@ target_link_libraries(${VIEWER_BINARY_NAME}
ll::tracy
)
+if (NOT CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ target_link_libraries(${VIEWER_BINARY_NAME} llwebrtc )
+endif ()
+
if (ENABLE_MEDIA_PLUGINS)
target_link_libraries(${VIEWER_BINARY_NAME} ll::libvlc )
if (DARWIN OR LINUX)
diff --git a/indra/newview/FixBundle.cmake.in b/indra/newview/FixBundle.cmake.in
index 6841b2ede2..6d343680d9 100644
--- a/indra/newview/FixBundle.cmake.in
+++ b/indra/newview/FixBundle.cmake.in
@@ -62,6 +62,41 @@ file(CREATE_LINK
SYMBOLIC
)
file(CREATE_LINK
+ "../../../../Frameworks/libboost_context-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_context-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_fiber-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_fiber-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_filesystem-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_filesystem-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_program_options-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_program_options-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_regex-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_regex-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_system-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_system-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
+ "../../../../Frameworks/libboost_thread-mt.dylib"
+ "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libboost_thread-mt.dylib"
+ SYMBOLIC
+ )
+file(CREATE_LINK
"../../../../Frameworks/liburiparser.1.dylib"
"${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/liburiparser.1.dylib"
SYMBOLIC
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 65fcded257..ae322910ea 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2817,7 +2817,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled, const LLVector3 &
// Notice the calls to "gAwayTimer.reset()". This resets the timer that determines how long the avatar has been
// "away", so that the avatar doesn't lapse into away-mode (and slump over) while the user is still talking.
//-----------------------------------------------------------------------------------------------------------------
- if (LLVoiceClient::getInstance()->getIsSpeaking( mID ))
+ if (LLVoiceClient::getInstance()->getIsSpeaking( mID ) && (!isInMuteList() || isSelf()))
{
if (!mVoiceVisualizer->getCurrentlySpeaking())
{
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index b95e43da8d..912b5a330e 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -768,6 +768,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID &session_id,
mReceivedCall(false),
mOutgoingCallInterface(outgoing_call_interface)
{
+ mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(other_user_id);
}
void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 4b299a51f5..3a07e4bb90 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,14 +169,18 @@ 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);
}
void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &agentID)
{
gAgent.addRegionChangedCallback(boost::bind(&LLVoiceClient::onRegionChanged, this));
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->userAuthorized(user_id, agentID);
+#endif
LLVivoxVoiceClient::getInstance()->userAuthorized(user_id, agentID);
}
@@ -324,7 +332,9 @@ void LLVoiceClient::updateSettings()
updateMicMuteLogic();
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->updateSettings();
+#endif
LLVivoxVoiceClient::getInstance()->updateSettings();
}
@@ -333,34 +343,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 LLVivoxVoiceClient::getInstance()->inTuningMode();
+#else
return LLWebRTCVoiceClient::getInstance()->inTuningMode();
+#endif
}
void LLVoiceClient::tuningSetMicVolume(float volume)
{
+#if __FreeBSD__
+ LLVivoxVoiceClient::getInstance()->tuningSetMicVolume(volume);
+#else
LLWebRTCVoiceClient::getInstance()->tuningSetMicVolume(volume);
+#endif
}
void LLVoiceClient::tuningSetSpeakerVolume(float volume)
{
+#if __FreeBSD__
+ LLVivoxVoiceClient::getInstance()->tuningSetSpeakerVolume(volume);
+#else
LLWebRTCVoiceClient::getInstance()->tuningSetSpeakerVolume(volume);
+#endif
}
float LLVoiceClient::tuningGetEnergy(void)
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->tuningGetEnergy();
+#else
return LLWebRTCVoiceClient::getInstance()->tuningGetEnergy();
+#endif
}
//------------------------------------------------
@@ -368,40 +398,64 @@ float LLVoiceClient::tuningGetEnergy(void)
bool LLVoiceClient::deviceSettingsAvailable()
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->deviceSettingsAvailable();
+#else
return LLWebRTCVoiceClient::getInstance()->deviceSettingsAvailable();
+#endif
}
bool LLVoiceClient::deviceSettingsUpdated()
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->deviceSettingsUpdated();
+#else
return LLWebRTCVoiceClient::getInstance()->deviceSettingsUpdated();
+#endif
}
void LLVoiceClient::refreshDeviceLists(bool clearCurrentList)
{
+#if __FreeBSD__
+ LLVivoxVoiceClient::getInstance()->refreshDeviceLists(clearCurrentList);
+#else
LLWebRTCVoiceClient::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 LLVivoxVoiceClient::getInstance()->getCaptureDevices();
+#else
return LLWebRTCVoiceClient::getInstance()->getCaptureDevices();
+#endif
}
const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->getRenderDevices();
+#else
return LLWebRTCVoiceClient::getInstance()->getRenderDevices();
+#endif
}
@@ -410,13 +464,18 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->getParticipantList(participants);
+#endif
LLVivoxVoiceClient::getInstance()->getParticipantList(participants);
}
bool LLVoiceClient::isParticipant(const LLUUID &speaker_id)
{
- return LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) ||
+ return
+#if !__FreeBSD__
+ LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) ||
+#endif
LLVivoxVoiceClient::getInstance()->isParticipant(speaker_id);
}
@@ -509,13 +568,19 @@ void LLVoiceClient::activateSpatialChannel(bool activate)
bool LLVoiceClient::isCurrentChannel(const LLSD& channelInfo)
{
- return LLWebRTCVoiceClient::getInstance()->isCurrentChannel(channelInfo) ||
+ return
+#if !__FreeBSD__
+ LLWebRTCVoiceClient::getInstance()->isCurrentChannel(channelInfo) ||
+#endif
LLVivoxVoiceClient::getInstance()->isCurrentChannel(channelInfo);
}
bool LLVoiceClient::compareChannels(const LLSD &channelInfo1, const LLSD &channelInfo2)
{
- return LLWebRTCVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2) ||
+ return
+#if !__FreeBSD__
+ LLWebRTCVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2) ||
+#endif
LLVivoxVoiceClient::getInstance()->compareChannels(channelInfo1, channelInfo2);
}
@@ -557,13 +622,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);
}
@@ -610,7 +679,9 @@ bool LLVoiceClient::voiceEnabled()
void LLVoiceClient::setVoiceEnabled(bool enabled)
{
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled);
+#endif
LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled);
}
@@ -630,7 +701,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);
}
@@ -725,18 +798,26 @@ bool LLVoiceClient::getVoiceEnabled(const LLUUID& id)
std::string LLVoiceClient::getDisplayName(const LLUUID& id)
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->getDisplayName(id);
+#else
std::string result = LLWebRTCVoiceClient::getInstance()->getDisplayName(id);
if (result.empty())
{
result = LLVivoxVoiceClient::getInstance()->getDisplayName(id);
}
return result;
+#endif
}
bool LLVoiceClient::isVoiceWorking() const
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->isVoiceWorking();
+#else
return LLVivoxVoiceClient::getInstance()->isVoiceWorking() ||
LLWebRTCVoiceClient::getInstance()->isVoiceWorking();
+#endif
}
bool LLVoiceClient::isParticipantAvatar(const LLUUID& id)
@@ -751,7 +832,10 @@ bool LLVoiceClient::isOnlineSIP(const LLUUID& id)
bool LLVoiceClient::getIsSpeaking(const LLUUID& id)
{
- return LLWebRTCVoiceClient::getInstance()->getIsSpeaking(id) ||
+ return
+#if !__FreeBSD__
+ LLWebRTCVoiceClient::getInstance()->getIsSpeaking(id) ||
+#endif
LLVivoxVoiceClient::getInstance()->getIsSpeaking(id);
}
@@ -759,14 +843,21 @@ bool LLVoiceClient::getIsModeratorMuted(const LLUUID& id)
{
// don't bother worrying about p2p calls, as
// p2p calls don't have mute.
- return LLWebRTCVoiceClient::getInstance()->getIsModeratorMuted(id) ||
+ return
+#if !__FreeBSD__
+ LLWebRTCVoiceClient::getInstance()->getIsModeratorMuted(id) ||
+#endif
LLVivoxVoiceClient::getInstance()->getIsModeratorMuted(id);
}
F32 LLVoiceClient::getCurrentPower(const LLUUID& id)
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->getCurrentPower(id);
+#else
return std::fmax(LLVivoxVoiceClient::getInstance()->getCurrentPower(id),
LLWebRTCVoiceClient::getInstance()->getCurrentPower(id));
+#endif
}
bool LLVoiceClient::getOnMuteList(const LLUUID& id)
@@ -778,12 +869,18 @@ bool LLVoiceClient::getOnMuteList(const LLUUID& id)
F32 LLVoiceClient::getUserVolume(const LLUUID& id)
{
+#if __FreeBSD__
+ return LLVivoxVoiceClient::getInstance()->getUserVolume(id);
+#else
return std::fmax(LLVivoxVoiceClient::getInstance()->getUserVolume(id), LLWebRTCVoiceClient::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);
}
@@ -793,40 +890,52 @@ 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)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+#if !__FreeBSD__
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)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+#if !__FreeBSD__
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)
{
LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+#endif
}
-std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const
{
if (mNonSpatialVoiceModule)
{
@@ -842,6 +951,22 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
}
}
+LLSD LLVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ if (mNonSpatialVoiceModule)
+ {
+ return mNonSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else if (mSpatialVoiceModule)
+ {
+ return mSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else
+ {
+ return LLSD();
+ }
+}
+
LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const
{
return NULL;
@@ -870,10 +995,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;
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index 9ae18b315c..ea67500109 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -281,7 +281,8 @@ public:
virtual void removeObserver(LLVoiceClientParticipantObserver* observer)=0;
//@}
- virtual std::string sipURIFromID(const LLUUID &id)=0;
+ virtual std::string sipURIFromID(const LLUUID &id) const=0;
+ virtual LLSD getP2PChannelInfoTemplate(const LLUUID& id) const=0;
//@}
};
@@ -488,7 +489,8 @@ public:
void addObserver(LLVoiceClientParticipantObserver* observer);
void removeObserver(LLVoiceClientParticipantObserver* observer);
- std::string sipURIFromID(const LLUUID &id);
+ std::string sipURIFromID(const LLUUID &id) const;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const;
//////////////////////////
/// @name Voice effects
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index ab1a3056fa..532633754f 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -298,7 +298,6 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mDevicesListUpdated(false),
mAudioSession(), // TBD - should be NULL
- mAudioSessionChanged(false),
mNextAudioSession(),
mCurrentParcelLocalID(0),
@@ -1653,7 +1652,6 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LL_INFOS("Voice") << "Adding or joining voice session " << nextSession->mHandle << LL_ENDL;
mAudioSession = nextSession;
- mAudioSessionChanged = true;
if (!mAudioSession || !mAudioSession->mReconnect)
{
mNextAudioSession.reset();
@@ -1910,9 +1908,8 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
sessionStatePtr_t oldSession = mAudioSession;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); // needs mAudioSession for uri
mAudioSession.reset();
- // We just notified status observers about this change. Don't do it again.
- mAudioSessionChanged = false;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -1920,9 +1917,9 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
else
{
LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
}
- notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
// Always reset the terminate request flag when we get here.
// Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves
@@ -3844,7 +3841,6 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
sessionStatePtr_t oldSession = mAudioSession;
mAudioSession = session;
- mAudioSessionChanged = true;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -5154,7 +5150,7 @@ bool LLVivoxVoiceClient::inProximalChannel()
return result;
}
-std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) const
{
std::string result;
result = "sip:";
@@ -5165,6 +5161,14 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
return result;
}
+LLSD LLVivoxVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ LLSD result;
+ result["channel_uri"] = sipURIFromID(id);
+ result["voice_server_type"] = VIVOX_VOICE_SERVER_TYPE;
+ return result;
+}
+
std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
{
std::string result;
@@ -5179,7 +5183,7 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
return result;
}
-std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
+std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) const
{
std::string result;
@@ -6159,7 +6163,6 @@ void LLVivoxVoiceClient::deleteSession(const sessionStatePtr_t &session)
if(mAudioSession == session)
{
mAudioSession.reset();
- mAudioSessionChanged = true;
}
// ditto for the next audio session
@@ -6268,9 +6271,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
}
}
+ LLSD channel_info = getAudioSessionChannelInfo();
LL_DEBUGS("Voice")
<< " " << LLVoiceClientStatusObserver::status2string(status)
- << ", session channelInfo " << getAudioSessionChannelInfo()
+ << ", session channelInfo " << channel_info
<< ", proximal is " << inSpatialChannel()
<< LL_ENDL;
@@ -6285,7 +6289,7 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
)
{
LLVoiceClientStatusObserver* observer = *it;
- observer->onChange(status, getAudioSessionChannelInfo(), inSpatialChannel());
+ observer->onChange(status, channel_info, inSpatialChannel());
// In case onError() deleted an entry.
it = mStatusObservers.upper_bound(observer);
}
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 420e0aa869..c40c84cef3 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -39,6 +39,8 @@ class LLVivoxProtocolParser;
#include "llcallingcard.h" // for LLFriendObserver
#include "lleventcoro.h"
#include "llcoros.h"
+#include "llparcel.h"
+#include "llmutelist.h"
#include <queue>
#ifdef LL_USESYSTEMLIBS
@@ -221,7 +223,8 @@ public:
void removeObserver(LLVoiceClientParticipantObserver* observer) override;
//@}
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
//@}
/// @name LLVoiceEffectInterface virtual implementations
@@ -706,7 +709,6 @@ private:
std::string mChannelName; // Name of the channel to be looked up
sessionStatePtr_t mAudioSession; // Session state for the current audio session
- bool mAudioSessionChanged; // set to true when the above pointer gets changed, so observers can be notified.
sessionStatePtr_t mNextAudioSession; // Session state for the audio session we're trying to join
@@ -748,7 +750,7 @@ private:
bool switchChannel(std::string uri = std::string(), bool spatial = true, bool no_reconnect = false, bool is_p2p = false, std::string hash = "");
void joinSession(const sessionStatePtr_t &session);
- std::string nameFromID(const LLUUID &id);
+ std::string nameFromID(const LLUUID &id) const;
bool IDFromName(const std::string name, LLUUID &uuid);
std::string sipURIFromAvatar(LLVOAvatar *avatar);
std::string sipURIFromName(std::string &name);
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 1d729dcd35..617981c3aa 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -251,7 +251,7 @@ LLWebRTCVoiceClient::~LLWebRTCVoiceClient()
void LLWebRTCVoiceClient::init(LLPumpIO* pump)
{
// constructor will set up LLVoiceClient::getInstance()
- llwebrtc::init();
+ llwebrtc::init(this);
mWebRTCDeviceInterface = llwebrtc::getDeviceInterface();
mWebRTCDeviceInterface->setDevicesObserver(this);
@@ -282,6 +282,29 @@ void LLWebRTCVoiceClient::cleanUp()
LL_DEBUGS("Voice") << "Exiting" << LL_ENDL;
}
+void LLWebRTCVoiceClient::LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message)
+{
+ switch (level)
+ {
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_VERBOSE:
+ LL_DEBUGS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_INFO:
+ LL_INFOS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_WARNING:
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_ERROR:
+ // use WARN so that we don't crash on a webrtc error.
+ // webrtc will force a crash on a fatal error.
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ default:
+ break;
+ }
+}
+
// --------------------------------------------------
const LLVoiceVersionInfo& LLWebRTCVoiceClient::getVersion()
@@ -2070,11 +2093,16 @@ void LLWebRTCVoiceClient::avatarNameResolved(const LLUUID &id, const std::string
}
// Leftover from vivox PTSN
-std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id)
+std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id) const
{
return id.asString();
}
+LLSD LLWebRTCVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ return LLSD();
+}
+
/////////////////////////////
// LLVoiceWebRTCConnection
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 480a7897cd..2b9a113fcc 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -62,7 +62,8 @@ extern const std::string WEBRTC_VOICE_SERVER_TYPE;
class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
virtual public LLVoiceModuleInterface,
public llwebrtc::LLWebRTCDevicesObserver,
- public LLMuteListObserver
+ public LLMuteListObserver,
+ public llwebrtc::LLWebRTCLogCallback
{
LLSINGLETON(LLWebRTCVoiceClient);
LOG_CLASS(LLWebRTCVoiceClient);
@@ -84,7 +85,15 @@ public:
// Returns true if WebRTC has successfully logged in and is not in error state
bool isVoiceWorking() const override;
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
+
+
+ ///////////////////
+ /// @name Logging
+ /// @{
+ void LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message) override;
+ //@}
/////////////////////
/// @name Tuning