diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-08-12 04:18:44 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-08-12 04:50:28 +0200 |
commit | b238ad6dad6942fc6a53dfee5d22e12ad8b13df5 (patch) | |
tree | 4f7aa168855296b5d6c98c7b273987759d805247 /src/WebRTCPeer.hpp | |
parent | 46f45cc37388b442aa83fab76d26b81cc13bb9ca (diff) | |
download | fork-godot-webrtc-native-b238ad6dad6942fc6a53dfee5d22e12ad8b13df5.tar.gz fork-godot-webrtc-native-b238ad6dad6942fc6a53dfee5d22e12ad8b13df5.tar.bz2 fork-godot-webrtc-native-b238ad6dad6942fc6a53dfee5d22e12ad8b13df5.zip |
Add initial interface
Diffstat (limited to 'src/WebRTCPeer.hpp')
-rw-r--r-- | src/WebRTCPeer.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/WebRTCPeer.hpp b/src/WebRTCPeer.hpp new file mode 100644 index 0000000..1f4550a --- /dev/null +++ b/src/WebRTCPeer.hpp @@ -0,0 +1,36 @@ +#ifndef MY_PACKET_PEER +#define MY_PACKET_PEER + +#include <Godot.hpp> + +#include "net/WebRTCPeerNative.hpp" + +class WebRTCPeer : public WebRTCPeerNative { + GODOT_CLASS(WebRTCPeer, WebRTCPeerNative); + +public: + static void _register_methods(); + + void _init(); + + void set_write_mode(godot_int mode); + godot_int get_write_mode() const; + bool was_string_packet() const; + godot_int get_connection_state() const; + + godot_error create_offer(); + godot_error set_remote_description(godot_string type, godot_string sdp); + godot_error set_local_description(godot_string type, godot_string sdp); + godot_error add_ice_candidate(godot_string sdpMidName, int sdpMlineIndexName, godot_string sdpName); + godot_error poll(); + + /* WebRTCPeer */ + virtual godot_error get_packet(const uint8_t **r_buffer, int &r_len); + virtual godot_error put_packet(const uint8_t *p_buffer, int p_len); + virtual godot_int get_available_packet_count() const; + virtual godot_int get_max_packet_size() const; + + ~WebRTCPeer(); +}; + +#endif // MY_PACKET_PEER |