summaryrefslogtreecommitdiff
path: root/modules/webrtc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/webrtc')
-rw-r--r--modules/webrtc/doc_classes/WebRTCPeerConnection.xml4
-rw-r--r--modules/webrtc/webrtc_data_channel.h7
-rw-r--r--modules/webrtc/webrtc_data_channel_gdnative.h42
-rw-r--r--modules/webrtc/webrtc_data_channel_js.h42
-rw-r--r--modules/webrtc/webrtc_multiplayer.h30
-rw-r--r--modules/webrtc/webrtc_peer_connection_gdnative.h26
6 files changed, 72 insertions, 79 deletions
diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
index 504b4705d8..c80b903e39 100644
--- a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
+++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
@@ -97,7 +97,7 @@
{
"urls": [ "turn:turn.example.com:3478" ], # One or more TURN servers.
"username": "a_username", # Optional username for the TURN server.
- "credentials": "a_password", # Optional password for the TURN server.
+ "credential": "a_password", # Optional password for the TURN server.
}
]
}
@@ -120,7 +120,7 @@
</argument>
<description>
Sets the SDP description of the local peer. This should be called in response to [signal session_description_created].
- If [code]type[/code] is [code]answer[/code] the peer will start emitting [signal ice_candidate_created].
+ After calling this function the peer will start emitting [signal ice_candidate_created] (unless an [enum Error] different from [constant OK] is returned).
</description>
</method>
<method name="set_remote_description">
diff --git a/modules/webrtc/webrtc_data_channel.h b/modules/webrtc/webrtc_data_channel.h
index e61f786ca1..1407f1e3bd 100644
--- a/modules/webrtc/webrtc_data_channel.h
+++ b/modules/webrtc/webrtc_data_channel.h
@@ -73,13 +73,6 @@ public:
virtual Error poll() = 0;
virtual void close() = 0;
- /** Inherited from PacketPeer: **/
- virtual int get_available_packet_count() const = 0;
- virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) = 0; ///< buffer is GONE after next get_packet
- virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) = 0;
-
- virtual int get_max_packet_size() const = 0;
-
WebRTCDataChannel();
~WebRTCDataChannel();
};
diff --git a/modules/webrtc/webrtc_data_channel_gdnative.h b/modules/webrtc/webrtc_data_channel_gdnative.h
index be3ea13028..03396d207d 100644
--- a/modules/webrtc/webrtc_data_channel_gdnative.h
+++ b/modules/webrtc/webrtc_data_channel_gdnative.h
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifdef WEBRTC_GDNATIVE_ENABLED
-
#ifndef WEBRTC_DATA_CHANNEL_GDNATIVE_H
#define WEBRTC_DATA_CHANNEL_GDNATIVE_H
+#ifdef WEBRTC_GDNATIVE_ENABLED
+
#include "modules/gdnative/include/net/godot_net.h"
#include "webrtc_data_channel.h"
@@ -48,33 +48,33 @@ private:
public:
void set_native_webrtc_data_channel(const godot_net_webrtc_data_channel *p_impl);
- virtual void set_write_mode(WriteMode mode);
- virtual WriteMode get_write_mode() const;
- virtual bool was_string_packet() const;
+ virtual void set_write_mode(WriteMode mode) override;
+ virtual WriteMode get_write_mode() const override;
+ virtual bool was_string_packet() const override;
- virtual ChannelState get_ready_state() const;
- virtual String get_label() const;
- virtual bool is_ordered() const;
- virtual int get_id() const;
- virtual int get_max_packet_life_time() const;
- virtual int get_max_retransmits() const;
- virtual String get_protocol() const;
- virtual bool is_negotiated() const;
+ virtual ChannelState get_ready_state() const override;
+ virtual String get_label() const override;
+ virtual bool is_ordered() const override;
+ virtual int get_id() const override;
+ virtual int get_max_packet_life_time() const override;
+ virtual int get_max_retransmits() const override;
+ virtual String get_protocol() const override;
+ virtual bool is_negotiated() const override;
- virtual Error poll();
- virtual void close();
+ virtual Error poll() override;
+ virtual void close() override;
/** Inherited from PacketPeer: **/
- virtual int get_available_packet_count() const;
- virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); ///< buffer is GONE after next get_packet
- virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size);
+ virtual int get_available_packet_count() const override;
+ virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; ///< buffer is GONE after next get_packet
+ virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override;
- virtual int get_max_packet_size() const;
+ virtual int get_max_packet_size() const override;
WebRTCDataChannelGDNative();
~WebRTCDataChannelGDNative();
};
-#endif // WEBRTC_DATA_CHANNEL_GDNATIVE_H
-
#endif // WEBRTC_GDNATIVE_ENABLED
+
+#endif // WEBRTC_DATA_CHANNEL_GDNATIVE_H
diff --git a/modules/webrtc/webrtc_data_channel_js.h b/modules/webrtc/webrtc_data_channel_js.h
index 00b5963ea1..7545910e66 100644
--- a/modules/webrtc/webrtc_data_channel_js.h
+++ b/modules/webrtc/webrtc_data_channel_js.h
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifdef JAVASCRIPT_ENABLED
-
#ifndef WEBRTC_DATA_CHANNEL_JS_H
#define WEBRTC_DATA_CHANNEL_JS_H
+#ifdef JAVASCRIPT_ENABLED
+
#include "webrtc_data_channel.h"
class WebRTCDataChannelJS : public WebRTCDataChannel {
@@ -60,34 +60,34 @@ public:
void _on_error();
void _on_message(uint8_t *p_data, uint32_t p_size, bool p_is_string);
- virtual void set_write_mode(WriteMode mode);
- virtual WriteMode get_write_mode() const;
- virtual bool was_string_packet() const;
+ virtual void set_write_mode(WriteMode mode) override;
+ virtual WriteMode get_write_mode() const override;
+ virtual bool was_string_packet() const override;
- virtual ChannelState get_ready_state() const;
- virtual String get_label() const;
- virtual bool is_ordered() const;
- virtual int get_id() const;
- virtual int get_max_packet_life_time() const;
- virtual int get_max_retransmits() const;
- virtual String get_protocol() const;
- virtual bool is_negotiated() const;
+ virtual ChannelState get_ready_state() const override;
+ virtual String get_label() const override;
+ virtual bool is_ordered() const override;
+ virtual int get_id() const override;
+ virtual int get_max_packet_life_time() const override;
+ virtual int get_max_retransmits() const override;
+ virtual String get_protocol() const override;
+ virtual bool is_negotiated() const override;
- virtual Error poll();
- virtual void close();
+ virtual Error poll() override;
+ virtual void close() override;
/** Inherited from PacketPeer: **/
- virtual int get_available_packet_count() const;
- virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); ///< buffer is GONE after next get_packet
- virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size);
+ virtual int get_available_packet_count() const override;
+ virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; ///< buffer is GONE after next get_packet
+ virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override;
- virtual int get_max_packet_size() const;
+ virtual int get_max_packet_size() const override;
WebRTCDataChannelJS();
WebRTCDataChannelJS(int js_id);
~WebRTCDataChannelJS();
};
-#endif // WEBRTC_DATA_CHANNEL_JS_H
-
#endif // JAVASCRIPT_ENABLED
+
+#endif // WEBRTC_DATA_CHANNEL_JS_H
diff --git a/modules/webrtc/webrtc_multiplayer.h b/modules/webrtc/webrtc_multiplayer.h
index 906b90a1b6..fb37bd7722 100644
--- a/modules/webrtc/webrtc_multiplayer.h
+++ b/modules/webrtc/webrtc_multiplayer.h
@@ -89,27 +89,27 @@ public:
void close();
// PacketPeer
- Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); ///< buffer is GONE after next get_packet
- Error put_packet(const uint8_t *p_buffer, int p_buffer_size);
- int get_available_packet_count() const;
- int get_max_packet_size() const;
+ Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; ///< buffer is GONE after next get_packet
+ Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override;
+ int get_available_packet_count() const override;
+ int get_max_packet_size() const override;
// NetworkedMultiplayerPeer
- void set_transfer_mode(TransferMode p_mode);
- TransferMode get_transfer_mode() const;
- void set_target_peer(int p_peer_id);
+ void set_transfer_mode(TransferMode p_mode) override;
+ TransferMode get_transfer_mode() const override;
+ void set_target_peer(int p_peer_id) override;
- int get_unique_id() const;
- int get_packet_peer() const;
+ int get_unique_id() const override;
+ int get_packet_peer() const override;
- bool is_server() const;
+ bool is_server() const override;
- void poll();
+ void poll() override;
- void set_refuse_new_connections(bool p_enable);
- bool is_refusing_new_connections() const;
+ void set_refuse_new_connections(bool p_enable) override;
+ bool is_refusing_new_connections() const override;
- ConnectionStatus get_connection_status() const;
+ ConnectionStatus get_connection_status() const override;
};
-#endif
+#endif // WEBRTC_MULTIPLAYER_H
diff --git a/modules/webrtc/webrtc_peer_connection_gdnative.h b/modules/webrtc/webrtc_peer_connection_gdnative.h
index 8e59ad62ba..846b65c466 100644
--- a/modules/webrtc/webrtc_peer_connection_gdnative.h
+++ b/modules/webrtc/webrtc_peer_connection_gdnative.h
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifdef WEBRTC_GDNATIVE_ENABLED
-
#ifndef WEBRTC_PEER_CONNECTION_GDNATIVE_H
#define WEBRTC_PEER_CONNECTION_GDNATIVE_H
+#ifdef WEBRTC_GDNATIVE_ENABLED
+
#include "modules/gdnative/include/net/godot_net.h"
#include "webrtc_peer_connection.h"
@@ -53,21 +53,21 @@ public:
void set_native_webrtc_peer_connection(const godot_net_webrtc_peer_connection *p_impl);
- virtual ConnectionState get_connection_state() const;
+ virtual ConnectionState get_connection_state() const override;
- virtual Error initialize(Dictionary p_config = Dictionary());
- virtual Ref<WebRTCDataChannel> create_data_channel(String p_label, Dictionary p_options = Dictionary());
- virtual Error create_offer();
- virtual Error set_remote_description(String type, String sdp);
- virtual Error set_local_description(String type, String sdp);
- virtual Error add_ice_candidate(String sdpMidName, int sdpMlineIndexName, String sdpName);
- virtual Error poll();
- virtual void close();
+ virtual Error initialize(Dictionary p_config = Dictionary()) override;
+ virtual Ref<WebRTCDataChannel> create_data_channel(String p_label, Dictionary p_options = Dictionary()) override;
+ virtual Error create_offer() override;
+ virtual Error set_remote_description(String type, String sdp) override;
+ virtual Error set_local_description(String type, String sdp) override;
+ virtual Error add_ice_candidate(String sdpMidName, int sdpMlineIndexName, String sdpName) override;
+ virtual Error poll() override;
+ virtual void close() override;
WebRTCPeerConnectionGDNative();
~WebRTCPeerConnectionGDNative();
};
-#endif // WEBRTC_PEER_CONNECTION_GDNATIVE_H
-
#endif // WEBRTC_GDNATIVE_ENABLED
+
+#endif // WEBRTC_PEER_CONNECTION_GDNATIVE_H