summaryrefslogtreecommitdiff
path: root/src/WebRTCPeer.cpp
blob: 5eada1f22da37187164994b33c1d2ea78950ad23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "WebRTCPeer.hpp"

void WebRTCPeer::set_write_mode(godot_int mode) {

}

godot_int WebRTCPeer::get_write_mode() const {
	return 0;
}

bool WebRTCPeer::was_string_packet() const {
	return false;
}

godot_int WebRTCPeer::get_connection_state() const {
	return 0;
}

godot_error WebRTCPeer::create_offer() {
	return GODOT_FAILED;
}

godot_error WebRTCPeer::set_remote_description(const char *type, const char *sdp) {
	return GODOT_FAILED;
}

godot_error WebRTCPeer::set_local_description(const char *type, const char *sdp) {
	return GODOT_FAILED;
}

godot_error WebRTCPeer::add_ice_candidate(const char *sdpMidName, int sdpMlineIndexName, const char *sdpName) {
	return GODOT_FAILED;
}

godot_error WebRTCPeer::poll() {
	return GODOT_FAILED;
}

godot_error WebRTCPeer::get_packet(const uint8_t **r_buffer, int &r_len) {
	printf("Get packet");
	r_len = 0;
	return GODOT_OK;
}

godot_error WebRTCPeer::put_packet(const uint8_t *p_buffer, int p_len) {
	printf("Put packet");
	return GODOT_OK;
}

godot_int WebRTCPeer::get_available_packet_count() const {
	printf("Get packet count");
	return 2;
}

godot_int WebRTCPeer::get_max_packet_size() const {
	printf("Get max packet size");
	return 1024;
}

void WebRTCPeer::_register_methods() { }

void WebRTCPeer::_init() {
	printf("Binding PacketPeer interface");
	godot_net_bind_webrtc_peer(_owner, &interface);
}

WebRTCPeer::~WebRTCPeer() {
	if (_owner) {
		printf("Unbinding PacketPeer interface");
		godot_net_bind_webrtc_peer(_owner, NULL);
	}
}