diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-04-21 04:57:53 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-16 10:32:51 +0200 |
commit | 3e64a42b1492e38bf033041c0eb1212542728cbd (patch) | |
tree | d187f873ecfdace0d127c6bc340ed295edcaa2f1 /src/GodotDataChannelObserver.cpp | |
parent | f2cf2e5340c1aa20516aea4863b8f7a46f317bb6 (diff) | |
download | fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.tar.gz fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.tar.bz2 fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.zip |
Update to new DataChannel API.
New WebRTCLibDataChannel class act as PacketPeer.
Old WebRTCPeer (now WebRTCPeerConnection) now allows you to set
configuration (STUN/TURN) and creating multiple data channels.
Fixed many bugs and implemented most of the missing API.
Diffstat (limited to 'src/GodotDataChannelObserver.cpp')
-rw-r--r-- | src/GodotDataChannelObserver.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/GodotDataChannelObserver.cpp b/src/GodotDataChannelObserver.cpp deleted file mode 100644 index 7a6cf96..0000000 --- a/src/GodotDataChannelObserver.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "WebRTCLibPeer.hpp" - -using namespace godot_webrtc; - -WebRTCLibPeer::GodotDCO::GodotDCO(WebRTCLibPeer *parent) { - this->parent = parent; -} - -void WebRTCLibPeer::GodotDCO::OnMessage(const webrtc::DataBuffer &buffer) { - const uint8_t *data = buffer.data.data<uint8_t>(); - uint8_t *memory_controlled_buffer = new uint8_t[buffer.data.size()]; - - std::copy(data, data + buffer.data.size(), memory_controlled_buffer); - parent->queue_packet(memory_controlled_buffer, buffer.data.size()); -}; - -void WebRTCLibPeer::GodotDCO::OnStateChange(){}; - -void WebRTCLibPeer::GodotDCO::OnBufferedAmountChange(uint64_t previous_amount){}; |