diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-02 15:50:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-02 15:50:08 +0200 |
commit | e120cc7ed6fb2413743d1ade59c50a55c3c9511b (patch) | |
tree | 4264358c3618a6db142d4cef4c0452decc3188d0 /src/WebRTCLibPeerConnection.hpp | |
parent | 001be7850090f88e0ff760eddadbe1c03004fd0f (diff) | |
parent | da20ebf3970e311af4fa7a0e0b52a58041ceac3e (diff) | |
download | fork-godot-webrtc-native-e120cc7ed6fb2413743d1ade59c50a55c3c9511b.tar.gz fork-godot-webrtc-native-e120cc7ed6fb2413743d1ade59c50a55c3c9511b.tar.bz2 fork-godot-webrtc-native-e120cc7ed6fb2413743d1ade59c50a55c3c9511b.zip |
Merge pull request #33 from Faless/bump/webrtc_4472
Bump webrtc to branch-heads/4472. Fixes signalling.
Diffstat (limited to 'src/WebRTCLibPeerConnection.hpp')
-rw-r--r-- | src/WebRTCLibPeerConnection.hpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/WebRTCLibPeerConnection.hpp b/src/WebRTCLibPeerConnection.hpp index b46d606..8c5d9b8 100644 --- a/src/WebRTCLibPeerConnection.hpp +++ b/src/WebRTCLibPeerConnection.hpp @@ -3,8 +3,8 @@ #include <Godot.hpp> // Godot.hpp must go first, or windows builds breaks -#include "api/peerconnectioninterface.h" // interface for all things needed from WebRTC -#include "media/base/mediaengine.h" // needed for CreateModularPeerConnectionFactory +#include "api/peer_connection_interface.h" // interface for all things needed from WebRTC +#include "media/base/media_engine.h" // needed for CreateModularPeerConnectionFactory #include <functional> // std::function #include <mutex> // mutex @TODO replace std::mutex with Godot mutex @@ -18,8 +18,11 @@ class WebRTCLibPeerConnection : public WebRTCPeerConnectionNative { private: godot_error _create_pc(webrtc::PeerConnectionInterface::RTCConfiguration &config); + static std::unique_ptr<rtc::Thread> signaling_thread; public: static void _register_methods(); + static void initialize_signaling(); + static void deinitialize_signaling(); void _init(); @@ -66,7 +69,7 @@ public: GodotCSDO(WebRTCLibPeerConnection *parent); void OnSuccess(webrtc::SessionDescriptionInterface *desc) override; - void OnFailure(const std::string &error) override; + void OnFailure(webrtc::RTCError error) override; }; /** SetSessionDescriptionObserver callback functions **/ @@ -76,17 +79,16 @@ public: GodotSSDO(WebRTCLibPeerConnection *parent); void OnSuccess() override; - void OnFailure(const std::string &error) override; + void OnFailure(webrtc::RTCError error) override; }; GodotPCO pco; rtc::scoped_refptr<GodotSSDO> ptr_ssdo; rtc::scoped_refptr<GodotCSDO> ptr_csdo; - std::mutex *mutex_signal_queue; + std::mutex *mutex_signal_queue = nullptr; std::queue<std::function<void()> > signal_queue; - rtc::Thread *signaling_thread; rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory; rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection; }; |