diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/WebRTCPeerNative.cpp | 30 | ||||
-rw-r--r-- | src/net/WebRTCPeerNative.hpp | 6 |
2 files changed, 17 insertions, 19 deletions
diff --git a/src/net/WebRTCPeerNative.cpp b/src/net/WebRTCPeerNative.cpp index be9040c..d2abcaa 100644 --- a/src/net/WebRTCPeerNative.cpp +++ b/src/net/WebRTCPeerNative.cpp @@ -7,16 +7,14 @@ void WebRTCPeerNative::register_interface(const godot_net_webrtc_peer *p_interfa _net_api->godot_net_bind_webrtc_peer(_owner, p_interface); } -void WebRTCPeerNative::_register_methods() { } +void WebRTCPeerNative::_register_methods() {} void WebRTCPeerNative::_init() { - printf("Binding PacketPeer interface"); register_interface(&interface); } WebRTCPeerNative::~WebRTCPeerNative() { if (_owner) { - printf("Unbinding PacketPeer interface"); register_interface(NULL); } } @@ -27,53 +25,53 @@ WebRTCPeerNative::~WebRTCPeerNative() { * and you could use void *user for any kind of state struct pointer you have. */ godot_error get_packet_wp(void *user, const uint8_t **r_buffer, int &r_len) { - return ((WebRTCPeerNative *) user)->get_packet(r_buffer, r_len); + return ((WebRTCPeerNative *)user)->get_packet(r_buffer, r_len); } godot_error put_packet_wp(void *user, const uint8_t *p_buffer, int p_len) { - return ((WebRTCPeerNative *) user)->put_packet(p_buffer, p_len); + return ((WebRTCPeerNative *)user)->put_packet(p_buffer, p_len); } godot_int get_available_packet_count_wp(const void *user) { - return ((WebRTCPeerNative *) user)->get_available_packet_count(); + return ((WebRTCPeerNative *)user)->get_available_packet_count(); } godot_int get_max_packet_size_wp(const void *user) { - return ((WebRTCPeerNative *) user)->get_max_packet_size(); + return ((WebRTCPeerNative *)user)->get_max_packet_size(); } void set_write_mode_wp(void *user, godot_int write_mode) { - ((WebRTCPeerNative *) user)->set_write_mode(write_mode); + ((WebRTCPeerNative *)user)->set_write_mode(write_mode); } godot_int get_write_mode_wp(const void *user) { - return ((WebRTCPeerNative *) user)->get_write_mode(); + return ((WebRTCPeerNative *)user)->get_write_mode(); } bool was_string_packet_wp(const void *user) { - return ((WebRTCPeerNative *) user)->was_string_packet(); + return ((WebRTCPeerNative *)user)->was_string_packet(); } godot_int get_connection_state_wp(const void *user) { - return ((WebRTCPeerNative *) user)->get_connection_state(); + return ((WebRTCPeerNative *)user)->get_connection_state(); } godot_error create_offer_wp(void *user) { - return ((WebRTCPeerNative *) user)->create_offer(); + return ((WebRTCPeerNative *)user)->create_offer(); } godot_error set_remote_description_wp(void *user, const char *type, const char *sdp) { - return ((WebRTCPeerNative *) user)->set_remote_description(type, sdp); + return ((WebRTCPeerNative *)user)->set_remote_description(type, sdp); } godot_error set_local_description_wp(void *user, const char *type, const char *sdp) { - return ((WebRTCPeerNative *) user)->set_local_description(type, sdp); + return ((WebRTCPeerNative *)user)->set_local_description(type, sdp); } godot_error add_ice_candidate_wp(void *user, const char *sdpMidName, int sdpMlineIndexName, const char *sdpName) { - return ((WebRTCPeerNative *) user)->add_ice_candidate(sdpMidName, sdpMlineIndexName, sdpName); + return ((WebRTCPeerNative *)user)->add_ice_candidate(sdpMidName, sdpMlineIndexName, sdpName); } godot_error poll_wp(void *user) { - return ((WebRTCPeerNative *) user)->poll(); + return ((WebRTCPeerNative *)user)->poll(); } diff --git a/src/net/WebRTCPeerNative.hpp b/src/net/WebRTCPeerNative.hpp index fe2a8a7..e82f295 100644 --- a/src/net/WebRTCPeerNative.hpp +++ b/src/net/WebRTCPeerNative.hpp @@ -29,7 +29,7 @@ class WebRTCPeerNative : public godot::WebRTCPeerGDNative { protected: godot_net_webrtc_peer interface = { - {3, 1}, + { 3, 1 }, this, &get_packet_wp, @@ -63,8 +63,8 @@ public: virtual godot_int get_connection_state() const = 0; virtual godot_error create_offer() = 0; - virtual godot_error set_remote_description(const char * type, const char * sdp) = 0; - virtual godot_error set_local_description(const char * type, const char * sdp) = 0; + virtual godot_error set_remote_description(const char *type, const char *sdp) = 0; + virtual godot_error set_local_description(const char *type, const char *sdp) = 0; virtual godot_error add_ice_candidate(const char *sdpMidName, int sdpMlineIndexName, const char *sdpName) = 0; virtual godot_error poll() = 0; |