Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions indra/llwebrtc/llwebrtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,10 @@ void freePeerConnection(LLWebRTCPeerConnectionInterface* peer_connection)

void init(LLWebRTCLogCallback* logCallback)
{
if (gWebRTCImpl)
{
return;
}
gWebRTCImpl = new LLWebRTCImpl(logCallback);
gWebRTCImpl->init();
}
Expand Down
15 changes: 15 additions & 0 deletions indra/newview/llvoicewebrtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ void LLWebRTCVoiceClient::cleanupSingleton()
void LLWebRTCVoiceClient::init(LLPumpIO* pump)
{
// constructor will set up LLVoiceClient::getInstance()
initWebRTC();
}

void LLWebRTCVoiceClient::initWebRTC()
{
llwebrtc::init(this);

mWebRTCDeviceInterface = llwebrtc::getDeviceInterface();
Expand All @@ -292,6 +297,7 @@ void LLWebRTCVoiceClient::terminate()

mVoiceEnabled = false;
llwebrtc::terminate();
mWebRTCDeviceInterface = nullptr;

sShuttingDown = true;
}
Expand Down Expand Up @@ -1805,6 +1811,15 @@ void LLWebRTCVoiceClient::onChangeDetailed(const LLMute& mute)
}
}

void LLWebRTCVoiceClient::userAuthorized(const std::string& user_id, const LLUUID& agentID)
{
if (sShuttingDown)
{
sShuttingDown = false; // was terminated, restart
initWebRTC();
}
}

void LLWebRTCVoiceClient::predSetUserMute(const LLWebRTCVoiceClient::sessionStatePtr_t &session, const LLUUID &id, bool mute)
{
session->setUserMute(id, mute);
Expand Down
4 changes: 3 additions & 1 deletion indra/newview/llvoicewebrtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
//@}

// authorize the user
void userAuthorized(const std::string &user_id, const LLUUID &agentID) override {};
void userAuthorized(const std::string &user_id, const LLUUID &agentID) override;


void OnConnectionEstablished(const std::string& channelID, const LLUUID& regionID);
Expand Down Expand Up @@ -443,6 +443,8 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
boost::signals2::connection mAvatarNameCacheConnection;

private:
// init or restart the WebRTC device interface.
void initWebRTC();

// Coroutine support methods
//---
Expand Down