1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Directly expose WebRTCPeerConnection::create_data_channel() to GDExtension

This commit is contained in:
David Snopek
2023-06-14 13:26:00 -05:00
parent 33957aee69
commit 1b9364ba96
4 changed files with 6 additions and 18 deletions

View File

@@ -43,14 +43,3 @@ void WebRTCPeerConnectionExtension::_bind_methods() {
GDVIRTUAL_BIND(_poll);
GDVIRTUAL_BIND(_close);
}
Ref<WebRTCDataChannel> WebRTCPeerConnectionExtension::create_data_channel(String p_label, Dictionary p_options) {
Object *ret = nullptr;
if (GDVIRTUAL_CALL(_create_data_channel, p_label, p_options, ret)) {
WebRTCDataChannel *ch = Object::cast_to<WebRTCDataChannel>(ret);
ERR_FAIL_COND_V_MSG(ret && !ch, nullptr, "Returned object must be an instance of WebRTCDataChannel.");
return ch;
}
WARN_PRINT_ONCE("WebRTCPeerConnectionExtension::_create_data_channel is unimplemented!");
return nullptr;
}