From 34fd1f8caa847d75ff7d5c6e3b8619b494608629 Mon Sep 17 00:00:00 2001 From: Brandon Makin Date: Sun, 12 Aug 2018 22:47:37 -0700 Subject: Import GSoC work to WebRTC GDNative implementation --- src/GodotCreateSessionDescriptionObserver.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/GodotCreateSessionDescriptionObserver.cpp (limited to 'src/GodotCreateSessionDescriptionObserver.cpp') diff --git a/src/GodotCreateSessionDescriptionObserver.cpp b/src/GodotCreateSessionDescriptionObserver.cpp new file mode 100644 index 0000000..1f4b661 --- /dev/null +++ b/src/GodotCreateSessionDescriptionObserver.cpp @@ -0,0 +1,16 @@ +#include "WebRTCPeer.hpp" + +using namespace godot_webrtc; + +WebRTCPeer::GodotCSDO::GodotCSDO(WebRTCPeer *parent) { + this->parent = parent; +} + +void WebRTCPeer::GodotCSDO::OnSuccess(webrtc::SessionDescriptionInterface *desc) { + // serialize this offer and send it to the remote peer: + std::string sdp; // sdp = session description protocol + desc->ToString(&sdp); + parent->queue_signal("offer_created", 2, desc->type().c_str(), sdp.c_str()); +}; + +void WebRTCPeer::GodotCSDO::OnFailure(const std::string &error){}; -- cgit v1.2.3