summaryrefslogtreecommitdiff
path: root/src/GodotCreateSessionDescriptionObserver.cpp
diff options
context:
space:
mode:
authorBrandon Makin <bmicmak@gmail.com>2018-08-12 22:47:37 -0700
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-03-08 15:10:08 +0100
commit34fd1f8caa847d75ff7d5c6e3b8619b494608629 (patch)
treed91f06930c66014b19bea7fd4526736b69a676f5 /src/GodotCreateSessionDescriptionObserver.cpp
parenta44a5af115871b5be4dcfb05a421046a25ba5d73 (diff)
downloadfork-godot-webrtc-native-34fd1f8caa847d75ff7d5c6e3b8619b494608629.tar.gz
fork-godot-webrtc-native-34fd1f8caa847d75ff7d5c6e3b8619b494608629.tar.bz2
fork-godot-webrtc-native-34fd1f8caa847d75ff7d5c6e3b8619b494608629.zip
Import GSoC work to WebRTC GDNative implementation
Diffstat (limited to 'src/GodotCreateSessionDescriptionObserver.cpp')
-rw-r--r--src/GodotCreateSessionDescriptionObserver.cpp16
1 files changed, 16 insertions, 0 deletions
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){};