From 35c6c20e12bb52000fabd6867fab48d58529f7fc Mon Sep 17 00:00:00 2001 From: Marc-Antoine Maheux Date: Mon, 20 Nov 2023 18:07:55 -0500 Subject: [PATCH 1/4] Add missing failure callbacks --- .../src/Handlers/PeerConnectionHandler.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp index dac82b6d..7d1ab4b0 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp @@ -3,18 +3,6 @@ using namespace opentera; using namespace std; -class DummySetSessionDescriptionObserver : public webrtc::SetSessionDescriptionObserver -{ -public: - static DummySetSessionDescriptionObserver* Create() - { - return new rtc::RefCountedObject(); - } - - void OnSuccess() override {} - void OnFailure(webrtc::RTCError error) override {} -}; - void CreateSessionDescriptionObserverHelper::OnSuccess(webrtc::SessionDescriptionInterface* desc) { OnCreateSessionDescriptionObserverSuccess(desc); @@ -102,7 +90,7 @@ void PeerConnectionHandler::receivePeerCallAnswer(const string& sdp) auto desc = webrtc::CreateSessionDescription("answer", sdp, &error); if (desc) { - m_peerConnection->SetRemoteDescription(DummySetSessionDescriptionObserver::Create(), desc); + m_peerConnection->SetRemoteDescription(this, desc); } else { @@ -175,7 +163,7 @@ void PeerConnectionHandler::OnIceGatheringChange(webrtc::PeerConnectionInterface void PeerConnectionHandler::OnCreateSessionDescriptionObserverSuccess(webrtc::SessionDescriptionInterface* desc) { - m_peerConnection->SetLocalDescription(DummySetSessionDescriptionObserver::Create(), desc); + m_peerConnection->SetLocalDescription(this, desc); string sdp; desc->ToString(&sdp); From d76aae29be5658b6143607b9a193b02cd2f04cce Mon Sep 17 00:00:00 2001 From: Marc-Antoine Maheux Date: Mon, 20 Nov 2023 18:08:22 -0500 Subject: [PATCH 2/4] Bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ef5e4454..05e8a459 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.5 +0.6.6 From e3b3bfe3061639dc05158346349d448a74835674 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Maheux Date: Mon, 20 Nov 2023 18:58:58 -0500 Subject: [PATCH 3/4] Convert the dummy observer to log errors instead of removing it. --- .../src/Handlers/PeerConnectionHandler.cpp | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp index 7d1ab4b0..c4743612 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp @@ -3,6 +3,27 @@ using namespace opentera; using namespace std; +class OnlyFailureSetSessionDescriptionObserver : public webrtc::SetSessionDescriptionObserver +{ + function m_onError; + +public: + explicit OnlyFailureSetSessionDescriptionObserver(function onError) : m_onError(move(onError)) + { + } + + static OnlyFailureSetSessionDescriptionObserver* Create(function onError) + { + return new rtc::RefCountedObject(move(onError)); + } + + void OnSuccess() override {} + void OnFailure(webrtc::RTCError error) override + { + m_onError(error.message()); + } +}; + void CreateSessionDescriptionObserverHelper::OnSuccess(webrtc::SessionDescriptionInterface* desc) { OnCreateSessionDescriptionObserverSuccess(desc); @@ -90,7 +111,7 @@ void PeerConnectionHandler::receivePeerCallAnswer(const string& sdp) auto desc = webrtc::CreateSessionDescription("answer", sdp, &error); if (desc) { - m_peerConnection->SetRemoteDescription(this, desc); + m_peerConnection->SetRemoteDescription(OnlyFailureSetSessionDescriptionObserver::Create(m_onError), desc); } else { @@ -163,7 +184,7 @@ void PeerConnectionHandler::OnIceGatheringChange(webrtc::PeerConnectionInterface void PeerConnectionHandler::OnCreateSessionDescriptionObserverSuccess(webrtc::SessionDescriptionInterface* desc) { - m_peerConnection->SetLocalDescription(this, desc); + m_peerConnection->SetLocalDescription(OnlyFailureSetSessionDescriptionObserver::Create(m_onError), desc); string sdp; desc->ToString(&sdp); From 16a8106b946259b4bb492e683d7f2a4dcad41fed Mon Sep 17 00:00:00 2001 From: Marc-Antoine Maheux Date: Thu, 23 Nov 2023 22:13:19 -0500 Subject: [PATCH 4/4] Add missing enter. --- .../src/Handlers/PeerConnectionHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp index c4743612..be2b6f87 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp @@ -18,6 +18,7 @@ class OnlyFailureSetSessionDescriptionObserver : public webrtc::SetSessionDescri } void OnSuccess() override {} + void OnFailure(webrtc::RTCError error) override { m_onError(error.message());