diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-21 14:08:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 14:08:30 +0200 |
commit | 423454086e21d40a545f9e46d6e35c1b3c557d77 (patch) | |
tree | 34c78fa5e627d35b9302618724dfbb7ff0e5e77c /src/GodotPeerConnectionObserver.cpp | |
parent | f2cf2e5340c1aa20516aea4863b8f7a46f317bb6 (diff) | |
parent | 599ed98f6cb956d5189ec4b4905dbc2a8a1b5d9a (diff) | |
download | fork-godot-webrtc-native-423454086e21d40a545f9e46d6e35c1b3c557d77.tar.gz fork-godot-webrtc-native-423454086e21d40a545f9e46d6e35c1b3c557d77.tar.bz2 fork-godot-webrtc-native-423454086e21d40a545f9e46d6e35c1b3c557d77.zip |
Merge pull request #3 from Faless/channels_pr
Update to new DataChannel API, singleton load.
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, |