diff options
Diffstat (limited to 'src/GodotPeerConnectionObserver.cpp')
-rw-r--r-- | src/GodotPeerConnectionObserver.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/GodotPeerConnectionObserver.cpp b/src/GodotPeerConnectionObserver.cpp index 298cfcf..c3f8f39 100644 --- a/src/GodotPeerConnectionObserver.cpp +++ b/src/GodotPeerConnectionObserver.cpp @@ -1,33 +1,35 @@ -#include "WebRTCLibPeer.hpp" +#include "WebRTCLibPeerConnection.hpp" +#include "WebRTCLibDataChannel.hpp" using namespace godot_webrtc; -WebRTCLibPeer::GodotPCO::GodotPCO(WebRTCLibPeer *parent) { +WebRTCLibPeerConnection::GodotPCO::GodotPCO(WebRTCLibPeerConnection *parent) { this->parent = parent; } -void WebRTCLibPeer::GodotPCO::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) { +void WebRTCLibPeerConnection::GodotPCO::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) { } -void WebRTCLibPeer::GodotPCO::OnAddStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) { +void WebRTCLibPeerConnection::GodotPCO::OnAddStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) { } -void WebRTCLibPeer::GodotPCO::OnRemoveStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) { +void WebRTCLibPeerConnection::GodotPCO::OnRemoveStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) { } -void WebRTCLibPeer::GodotPCO::OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) { +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 WebRTCLibPeer::GodotPCO::OnRenegotiationNeeded() { +void WebRTCLibPeerConnection::GodotPCO::OnRenegotiationNeeded() { } -void WebRTCLibPeer::GodotPCO::OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) { +void WebRTCLibPeerConnection::GodotPCO::OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) { } -void WebRTCLibPeer::GodotPCO::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) { +void WebRTCLibPeerConnection::GodotPCO::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) { } -void WebRTCLibPeer::GodotPCO::OnIceCandidate(const webrtc::IceCandidateInterface *candidate) { +void WebRTCLibPeerConnection::GodotPCO::OnIceCandidate(const webrtc::IceCandidateInterface *candidate) { // Serialize the candidate and send it to the remote peer: godot::Dictionary candidateSDP; @@ -38,7 +40,7 @@ void WebRTCLibPeer::GodotPCO::OnIceCandidate(const webrtc::IceCandidateInterface candidate->ToString(&sdp); godot::String candidateSdpName = sdp.c_str(); - parent->queue_signal("new_ice_candidate", + parent->queue_signal("ice_candidate_created", 3, candidateSdpMidName, candidateSdpMlineIndexName, |