From 98322d5f070b260f1e46eb5d9fcd54fa43151329 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 21 Apr 2024 21:12:06 -0700 Subject: Reconnect when parcel voice params change. When parcel voice permissions and region/parcel-only voice settings change, a callback will be made to the viewer with new voice credential information. For webrtc, this means either just the uuid of the voice channel, or nothing if voice is disabled. This change looks at that callback and the channel id, and sets the appropriate flags on the parcel/region as needed which will cause voice to be renegotiated. Also, there was a race condition if the voice connect attempt was made before caps were retrieved, which would have resulted in full renegotiate attempts. Now, just wait until the cap comes in and continue. --- indra/llwebrtc/llwebrtc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llwebrtc/llwebrtc.cpp') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index eb9bb65e67..e08ace12c5 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -735,6 +735,10 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti else { RTC_LOG(LS_ERROR) << __FUNCTION__ << "Error creating peer connection: " << error_or_peer_connection.error().message(); + for (auto &observer : mSignalingObserverList) + { + observer->OnRenegotiationNeeded(); + } return; } -- cgit v1.2.3 From d4fce4990ad0527430d2b3e70be360c26d6cb46b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 28 Apr 2024 17:43:15 -0700 Subject: Reconnects to the voice server weren't happening. --- indra/llwebrtc/llwebrtc.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llwebrtc/llwebrtc.cpp') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index e08ace12c5..b20d3cd4e0 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -652,6 +652,13 @@ LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() : { } +LLWebRTCPeerConnectionImpl::~LLWebRTCPeerConnectionImpl() +{ + terminate(); + mSignalingObserverList.clear(); + mDataObserverList.clear(); +} + // // LLWebRTCPeerConnection interface // @@ -670,9 +677,6 @@ void LLWebRTCPeerConnectionImpl::terminate() rtc::scoped_refptr localStream; mLocalStream.swap(localStream); - mSignalingObserverList.clear(); - mDataObserverList.clear(); - mWebRTCImpl->PostSignalingTask( [=]() { -- cgit v1.2.3 From cf13866da951f8c7c7eedfd0ff0571c6951f42a4 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 28 Apr 2024 18:43:48 -0700 Subject: Don't default the tracks to unmuted --- indra/llwebrtc/llwebrtc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/llwebrtc/llwebrtc.cpp') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index b20d3cd4e0..d07e6deea4 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -766,7 +766,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti rtc::scoped_refptr audio_track( mPeerConnectionFactory->CreateAudioTrack("SLAudio", mPeerConnectionFactory->CreateAudioSource(audioOptions).get())); - audio_track->set_enabled(true); + audio_track->set_enabled(false); mLocalStream->AddTrack(audio_track); mPeerConnection->AddTrack(audio_track, {"SLStream"}); @@ -999,8 +999,6 @@ void LLWebRTCPeerConnectionImpl::OnConnectionChange(webrtc::PeerConnectionInterf { case webrtc::PeerConnectionInterface::PeerConnectionState::kConnected: { - mWebRTCImpl->setRecording(true); - mWebRTCImpl->PostWorkerTask([this]() { for (auto &observer : mSignalingObserverList) { -- cgit v1.2.3 From 07c3095a785864b39b03d979d43b7d0d7a932a81 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 2 May 2024 11:07:36 -0700 Subject: Unregister requested data channel when using the negotiated one. When creating a new connection, the viewer builds a data channel interface. It then gets a new one, which is a proxy. The viewer uses the new one, and therefore must unregister the callbacks from the old one. Also, update the position data before sending it after the join is sent. --- indra/llwebrtc/llwebrtc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llwebrtc/llwebrtc.cpp') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index d07e6deea4..97c04ae446 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -957,6 +957,10 @@ void LLWebRTCPeerConnectionImpl::OnRemoveTrack(rtc::scoped_refptr channel) { + if (mDataChannel) + { + mDataChannel->UnregisterObserver(); + } mDataChannel = channel; channel->RegisterObserver(this); } -- cgit v1.2.3