summaryrefslogtreecommitdiff
path: root/indra/llwebrtc
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp35
-rw-r--r--indra/llwebrtc/llwebrtc.h1
2 files changed, 32 insertions, 4 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index e7a9072b2e..c2631b2ea3 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -389,6 +389,36 @@ void LLWebRTCImpl::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGath
void LLWebRTCImpl::OnConnectionChange(webrtc::PeerConnectionInterface::PeerConnectionState new_state)
{
RTC_LOG(LS_ERROR) << __FUNCTION__ << " Peer Connection State Change " << new_state;
+
+ switch (new_state)
+ {
+ case webrtc::PeerConnectionInterface::PeerConnectionState::kConnected:
+ {
+ if (new_state == webrtc::PeerConnectionInterface::PeerConnectionState::kConnected)
+ {
+ for (auto &observer : mSignalingObserverList)
+ {
+ observer->OnAudioEstablished(this);
+ }
+ }
+ break;
+ }
+ case webrtc::PeerConnectionInterface::PeerConnectionState::kDisconnected:
+ {
+ if (new_state == webrtc::PeerConnectionInterface::PeerConnectionState::kConnected)
+ {
+ for (auto &observer : mSignalingObserverList)
+ {
+ observer->OnRenegotiationNeeded();
+ }
+ }
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
}
void LLWebRTCImpl::OnIceCandidate(const webrtc::IceCandidateInterface *candidate)
@@ -447,10 +477,6 @@ void LLWebRTCImpl::OnSetRemoteDescriptionComplete(webrtc::RTCError error)
RTC_LOG(LS_ERROR) << ToString(error.type()) << ": " << error.message();
return;
}
- for (auto &observer : mSignalingObserverList)
- {
- observer->OnAudioEstablished(this);
- }
}
//
@@ -467,6 +493,7 @@ void LLWebRTCImpl::OnSetLocalDescriptionComplete(webrtc::RTCError error)
auto desc = mPeerConnection->pending_local_description();
std::string sdp;
desc->ToString(&sdp);
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " Local SDP: " << sdp;
for (auto &observer : mSignalingObserverList)
{
observer->OnOfferAvailable(sdp);
diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h
index cb639ee116..acc3665e95 100644
--- a/indra/llwebrtc/llwebrtc.h
+++ b/indra/llwebrtc/llwebrtc.h
@@ -106,6 +106,7 @@ class LLWebRTCSignalingObserver
virtual void OnIceGatheringState(IceGatheringState state) = 0;
virtual void OnIceCandidate(const LLWebRTCIceCandidate& candidate) = 0;
virtual void OnOfferAvailable(const std::string& sdp) = 0;
+ virtual void OnRenegotiationNeeded() = 0;
virtual void OnAudioEstablished(LLWebRTCAudioInterface *audio_interface) = 0;
};