diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-09-22 23:16:23 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-06-15 21:38:12 +0200 |
commit | e19b3701260d4a855736c623b8c8a270413f041e (patch) | |
tree | 905bce590cbc44c4077defa52276bac245c22a2a /src/net/WebRTCDataChannelNative.hpp | |
parent | 8c18112f5dcf96bf24fab14ab4470c00ab7f7f70 (diff) | |
download | fork-godot-webrtc-native-e19b3701260d4a855736c623b8c8a270413f041e.tar.gz fork-godot-webrtc-native-e19b3701260d4a855736c623b8c8a270413f041e.tar.bz2 fork-godot-webrtc-native-e19b3701260d4a855736c623b8c8a270413f041e.zip |
Use libdatachannel library, add Godot 4 support.
Diffstat (limited to 'src/net/WebRTCDataChannelNative.hpp')
-rw-r--r-- | src/net/WebRTCDataChannelNative.hpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/net/WebRTCDataChannelNative.hpp b/src/net/WebRTCDataChannelNative.hpp index 20ef38e..a8ab697 100644 --- a/src/net/WebRTCDataChannelNative.hpp +++ b/src/net/WebRTCDataChannelNative.hpp @@ -69,6 +69,8 @@ typedef struct { } #endif +namespace godot { + class WebRTCDataChannelNative : public godot::WebRTCDataChannelGDNative { GODOT_CLASS(WebRTCDataChannelNative, godot::WebRTCDataChannelGDNative); @@ -110,30 +112,32 @@ public: void _init(); void register_interface(const godot_net_webrtc_data_channel *interface); - virtual void set_write_mode(godot_int mode) = 0; - virtual godot_int get_write_mode() const = 0; - virtual bool was_string_packet() const = 0; + virtual void _set_write_mode(int64_t mode) = 0; + virtual int64_t _get_write_mode() const = 0; + virtual bool _was_string_packet() const = 0; - virtual ChannelState get_ready_state() const = 0; - virtual const char *get_label() const = 0; - virtual bool is_ordered() const = 0; - virtual int get_id() const = 0; - virtual int get_max_packet_life_time() const = 0; - virtual int get_max_retransmits() const = 0; - virtual const char *get_protocol() const = 0; - virtual bool is_negotiated() const = 0; - virtual int get_buffered_amount() const = 0; + virtual int64_t _get_ready_state() const = 0; + virtual godot::String _get_label() const = 0; + virtual bool _is_ordered() const = 0; + virtual int64_t _get_id() const = 0; + virtual int64_t _get_max_packet_life_time() const = 0; + virtual int64_t _get_max_retransmits() const = 0; + virtual godot::String _get_protocol() const = 0; + virtual bool _is_negotiated() const = 0; + virtual int64_t _get_buffered_amount() const = 0; - virtual godot_error poll() = 0; - virtual void close() = 0; + virtual int64_t _poll() = 0; + virtual void _close() = 0; /* PacketPeer */ - virtual godot_error get_packet(const uint8_t **r_buffer, int *r_len) = 0; - virtual godot_error put_packet(const uint8_t *p_buffer, int p_len) = 0; - virtual godot_int get_available_packet_count() const = 0; - virtual godot_int get_max_packet_size() const = 0; + virtual int64_t _get_packet(const uint8_t **r_buffer, int32_t *r_len) = 0; + virtual int64_t _put_packet(const uint8_t *p_buffer, int64_t p_len) = 0; + virtual int64_t _get_available_packet_count() const = 0; + virtual int64_t _get_max_packet_size() const = 0; ~WebRTCDataChannelNative(); }; +}; // namespace godot + #endif // WEBRTC_DATA_CHANNEL_NATIVE |