summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WebRTCLibPeerConnection.cpp4
-rw-r--r--src/WebRTCLibPeerConnection.hpp4
-rw-r--r--src/init_gdextension.cpp4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/WebRTCLibPeerConnection.cpp b/src/WebRTCLibPeerConnection.cpp
index a372644..effc1d7 100644
--- a/src/WebRTCLibPeerConnection.cpp
+++ b/src/WebRTCLibPeerConnection.cpp
@@ -180,7 +180,11 @@ Error WebRTCLibPeerConnection::_initialize(const Dictionary &p_config) {
return _create_pc(config);
}
+#if defined(GDNATIVE_WEBRTC) || defined(GDEXTENSION_WEBRTC_40)
Object *WebRTCLibPeerConnection::_create_data_channel(const String &p_channel, const Dictionary &p_channel_config) try {
+#else
+Ref<WebRTCDataChannel> WebRTCLibPeerConnection::_create_data_channel(const String &p_channel, const Dictionary &p_channel_config) try {
+#endif
ERR_FAIL_COND_V(!peer_connection, nullptr);
// Read config from dictionary
diff --git a/src/WebRTCLibPeerConnection.hpp b/src/WebRTCLibPeerConnection.hpp
index c4f8111..6608735 100644
--- a/src/WebRTCLibPeerConnection.hpp
+++ b/src/WebRTCLibPeerConnection.hpp
@@ -79,7 +79,11 @@ public:
SignalingState _get_signaling_state() const override;
godot::Error _initialize(const godot::Dictionary &p_config) override;
+#if defined(GDNATIVE_WEBRTC) || defined(GDEXTENSION_WEBRTC_40)
godot::Object *_create_data_channel(const godot::String &p_channel, const godot::Dictionary &p_channel_config) override;
+#else
+ godot::Ref<godot::WebRTCDataChannel> _create_data_channel(const godot::String &p_channel, const godot::Dictionary &p_channel_config) override;
+#endif
godot::Error _create_offer() override;
godot::Error _set_remote_description(const godot::String &type, const godot::String &sdp) override;
godot::Error _set_local_description(const godot::String &type, const godot::String &sdp) override;
diff --git a/src/init_gdextension.cpp b/src/init_gdextension.cpp
index 85aed1d..47f8177 100644
--- a/src/init_gdextension.cpp
+++ b/src/init_gdextension.cpp
@@ -66,7 +66,11 @@ void unregister_webrtc_extension_types(ModuleInitializationLevel p_level) {
}
extern "C" {
+#ifdef GDEXTENSION_WEBRTC_40
GDExtensionBool GDE_EXPORT webrtc_extension_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
+#else
+GDExtensionBool GDE_EXPORT webrtc_extension_init(const GDExtensionInterfaceGetProcAddress p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
+#endif
GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
init_obj.register_initializer(register_webrtc_extension_types);