summaryrefslogtreecommitdiff
path: root/src/WebRTCLibObservers.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-09 16:24:35 +0200
committerGitHub <noreply@github.com>2021-07-09 16:24:35 +0200
commiteeabf0a8446c41ce8b11c063ede07337ba7eabbb (patch)
tree46051009da46064afab43fb816dc47db5c032a98 /src/WebRTCLibObservers.cpp
parentfa5296a4e428d625351082d13248f7f7c20f0598 (diff)
parent04fbae6ce38550fac2a8be3786405949563304d5 (diff)
downloadfork-godot-webrtc-native-eeabf0a8446c41ce8b11c063ede07337ba7eabbb.tar.gz
fork-godot-webrtc-native-eeabf0a8446c41ce8b11c063ede07337ba7eabbb.tar.bz2
fork-godot-webrtc-native-eeabf0a8446c41ce8b11c063ede07337ba7eabbb.zip
Merge pull request #38 from Faless/refactor/signals
Refactor signals and obeserver, fixes answer creation.
Diffstat (limited to 'src/WebRTCLibObservers.cpp')
-rw-r--r--src/WebRTCLibObservers.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/WebRTCLibObservers.cpp b/src/WebRTCLibObservers.cpp
deleted file mode 100644
index 6d8f15f..0000000
--- a/src/WebRTCLibObservers.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "WebRTCLibDataChannel.hpp"
-#include "WebRTCLibPeerConnection.hpp"
-
-using namespace godot_webrtc;
-
-// CreateSessionObseerver
-WebRTCLibPeerConnection::GodotCSDO::GodotCSDO(WebRTCLibPeerConnection *parent) {
- this->parent = parent;
-}
-
-void WebRTCLibPeerConnection::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("session_description_created", 2, desc->type().c_str(), sdp.c_str());
-};
-
-void WebRTCLibPeerConnection::GodotCSDO::OnFailure(webrtc::RTCError error){};
-
-// SetSessionObseerver
-WebRTCLibPeerConnection::GodotSSDO::GodotSSDO(WebRTCLibPeerConnection *parent) {
- this->parent = parent;
-}
-
-void WebRTCLibPeerConnection::GodotSSDO::OnSuccess(){};
-void WebRTCLibPeerConnection::GodotSSDO::OnFailure(webrtc::RTCError error){};
-
-// PeerConnectionObserver
-WebRTCLibPeerConnection::GodotPCO::GodotPCO(WebRTCLibPeerConnection *parent) {
- this->parent = parent;
-}
-
-void WebRTCLibPeerConnection::GodotPCO::OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) {
- parent->queue_signal("data_channel_received", 1, WebRTCLibDataChannel::new_data_channel(data_channel));
-}
-
-void WebRTCLibPeerConnection::GodotPCO::OnIceCandidate(const webrtc::IceCandidateInterface *candidate) {
- godot::Dictionary candidateSDP;
- godot::String candidateSdpMidName = candidate->sdp_mid().c_str();
- int candidateSdpMlineIndexName = candidate->sdp_mline_index();
- std::string sdp;
- candidate->ToString(&sdp);
- godot::String candidateSdpName = sdp.c_str();
-
- parent->queue_signal("ice_candidate_created", 3, candidateSdpMidName, candidateSdpMlineIndexName, candidateSdpName);
-}
-
-void WebRTCLibPeerConnection::GodotPCO::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) {}
-void WebRTCLibPeerConnection::GodotPCO::OnAddStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {}
-void WebRTCLibPeerConnection::GodotPCO::OnRemoveStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {}
-void WebRTCLibPeerConnection::GodotPCO::OnRenegotiationNeeded() {}
-void WebRTCLibPeerConnection::GodotPCO::OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) {}
-void WebRTCLibPeerConnection::GodotPCO::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) {}