Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove native libdatachannel #7

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
fail-fast: false
matrix:
precision: [double]
platform: [linuxbsd, windows, android, web]
platform: [linuxbsd, windows, web]
target: [editor, template_release, template_debug]

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-4.4
commit = 44d2bc3ab61be9576a941f9c5931db4426215af4
parent = 671983d2cb7b4c5ad5e3c70fc81624058be03227
commit = 92581f6ca41a0f1dcfe2b170a6591fa2663b29ca
parent = bc628496b76c86c0f9c904e862fc3b34790a174e
method = merge
cmdver = 0.4.9
2 changes: 0 additions & 2 deletions godot/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ opts.Add(BoolVariable("threads", "Enable threading support", True))
# Components
opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True))
opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double")))
opts.Add(BoolVariable("libdatachannel", "Enable the built-in libdatachannel webrtc implementation", True))
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable("brotli", "Enable Brotli for decompresson and WOFF2 fonts support", True))
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver on supported platforms", False))
Expand Down Expand Up @@ -286,7 +285,6 @@ opts.Add(BoolVariable("builtin_glslang", "Use the built-in glslang library", Tru
opts.Add(BoolVariable("builtin_graphite", "Use the built-in Graphite library", True))
opts.Add(BoolVariable("builtin_harfbuzz", "Use the built-in HarfBuzz library", True))
opts.Add(BoolVariable("builtin_icu4c", "Use the built-in ICU library", True))
opts.Add(BoolVariable("builtin_libdatachannel", "Use the built-in libdatachannel library", True))
opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True))
opts.Add(BoolVariable("builtin_libpng", "Use the built-in libpng library", True))
opts.Add(BoolVariable("builtin_libtheora", "Use the built-in libtheora library", True))
Expand Down
7 changes: 7 additions & 0 deletions godot/modules/mbedtls/crypto_mbedtls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@ Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoK
uint8_t rand_serial[20];
mbedtls_ctr_drbg_random(&ctr_drbg, rand_serial, sizeof(rand_serial));

#if MBEDTLS_VERSION_MAJOR >= 3
mbedtls_x509write_crt_set_serial_raw(&crt, rand_serial, sizeof(rand_serial));
#else
mbedtls_mpi serial;
mbedtls_mpi_init(&serial);
ERR_FAIL_COND_V(mbedtls_mpi_read_binary(&serial, rand_serial, sizeof(rand_serial)), nullptr);
mbedtls_x509write_crt_set_serial(&crt, &serial);
#endif

mbedtls_x509write_crt_set_validity(&crt, p_not_before.utf8().get_data(), p_not_after.utf8().get_data());
mbedtls_x509write_crt_set_basic_constraints(&crt, 1, -1);
Expand Down
144 changes: 1 addition & 143 deletions godot/modules/webrtc/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -6,150 +6,8 @@ Import("env_modules")

env_webrtc = env_modules.Clone()

thirdparty_obj = []

if env["platform"] == "web":
# Our JavaScript/C++ interface.
env.AddJSLibraries(["library_godot_webrtc.js"])

elif env["builtin_libdatachannel"] and env["libdatachannel"]:
# Thirdparty source files
thirdparty_dir = "#thirdparty/libdatachannel/"
thirdparty_sources = [
"deps/libjuice/src/addr.c",
"deps/libjuice/src/agent.c",
"deps/libjuice/src/base64.c",
"deps/libjuice/src/conn.c",
"deps/libjuice/src/conn_mux.c",
"deps/libjuice/src/conn_poll.c",
"deps/libjuice/src/conn_thread.c",
"deps/libjuice/src/const_time.c",
"deps/libjuice/src/crc32.c",
"deps/libjuice/src/hash.c",
"deps/libjuice/src/hmac.c",
"deps/libjuice/src/ice.c",
"deps/libjuice/src/juice.c",
"deps/libjuice/src/log.c",
"deps/libjuice/src/random.c",
"deps/libjuice/src/server.c",
"deps/libjuice/src/stun.c",
"deps/libjuice/src/timestamp.c",
"deps/libjuice/src/turn.c",
"deps/libjuice/src/udp.c",
"deps/usrsctp/usrsctplib/netinet/sctputil.c",
"deps/usrsctp/usrsctplib/netinet/sctp_asconf.c",
"deps/usrsctp/usrsctplib/netinet/sctp_auth.c",
"deps/usrsctp/usrsctplib/netinet/sctp_bsd_addr.c",
"deps/usrsctp/usrsctplib/netinet/sctp_callout.c",
"deps/usrsctp/usrsctplib/netinet/sctp_cc_functions.c",
"deps/usrsctp/usrsctplib/netinet/sctp_crc32.c",
"deps/usrsctp/usrsctplib/netinet/sctp_indata.c",
"deps/usrsctp/usrsctplib/netinet/sctp_input.c",
"deps/usrsctp/usrsctplib/netinet/sctp_output.c",
"deps/usrsctp/usrsctplib/netinet/sctp_pcb.c",
"deps/usrsctp/usrsctplib/netinet/sctp_peeloff.c",
"deps/usrsctp/usrsctplib/netinet/sctp_sha1.c",
"deps/usrsctp/usrsctplib/netinet/sctp_ss_functions.c",
"deps/usrsctp/usrsctplib/netinet/sctp_sysctl.c",
"deps/usrsctp/usrsctplib/netinet/sctp_timer.c",
"deps/usrsctp/usrsctplib/netinet/sctp_userspace.c",
"deps/usrsctp/usrsctplib/netinet/sctp_usrreq.c",
"deps/usrsctp/usrsctplib/netinet6/sctp6_usrreq.c",
"deps/usrsctp/usrsctplib/user_environment.c",
"deps/usrsctp/usrsctplib/user_mbuf.c",
"deps/usrsctp/usrsctplib/user_recv_thread.c",
"deps/usrsctp/usrsctplib/user_socket.c",
"src/candidate.cpp",
"src/channel.cpp",
"src/configuration.cpp",
"src/datachannel.cpp",
"src/description.cpp",
"src/global.cpp",
"src/exception_wrapper_godot.cpp",
"src/impl/certificate.cpp",
"src/impl/channel.cpp",
"src/impl/datachannel.cpp",
"src/impl/dtlstransport.cpp",
"src/impl/icetransport.cpp",
"src/impl/init.cpp",
"src/impl/logcounter.cpp",
"src/impl/peerconnection.cpp",
"src/impl/processor.cpp",
"src/impl/sctptransport.cpp",
"src/impl/threadpool.cpp",
"src/impl/tls.cpp",
"src/impl/transport.cpp",
"src/impl/utils.cpp",
"src/message.cpp",
"src/peerconnection.cpp",
]
thirdparty_sources = [thirdparty_dir + s for s in thirdparty_sources]

thirdparty_includes = [
"include",
"include/rtc",
"src",
"deps/usrsctp/usrsctplib",
"deps/plog/include",
"deps/libjuice/include",
"deps/libjuice/include/juice",
]
thirdparty_includes = [thirdparty_dir + s for s in thirdparty_includes]

env_webrtc.Prepend(CPPPATH=thirdparty_includes)
if env["builtin_mbedtls"]:
env_webrtc.Prepend(CPPPATH=["#thirdparty/mbedtls/include"])
env_webrtc.Append(
CPPDEFINES=[("MBEDTLS_CONFIG_FILE", '\\"thirdparty/mbedtls/include/godot_module_mbedtls_config.h\\"')]
)
env_webrtc.Depends(thirdparty_obj, "#thirdparty/mbedtls/include/godot_module_mbedtls_config.h")

env_webrtc.Append(CPPDEFINES=["HAVE_CONFIG_H"])
if env["arch"] in ["x86_64", "x86_32"]:
env_webrtc.Append(CPPDEFINES=["HAVE_X86", "HAVE_CISC"])
else:
env_webrtc.Append(CPPDEFINES=["HAVE_RISC"])

if env["platform"] == "windows":
env_webrtc.Append(CPPDEFINES=["HAVE_WINSOCK2_H", "HAVE_WINDOWS_H", "WIN32_LEAN_AND_MEAN", "NOMINMAX"])
else:
env_webrtc.Append(CPPDEFINES=["HAVE_NETINET_IN_H", "HAVE_ARPA_INET_H", "HAVE_SYS_SOCKET_H", "HAVE_UNISTD_H"])

env_webrtc.Append(
CPPDEFINES=[
"RTC_STATIC",
"RTC_ENABLE_WEBSOCKET=0",
"RTC_ENABLE_MEDIA=0",
"USE_GNUTLS=0",
"USE_NICE=0",
"RTC_SYSTEM_SRTP=0",
"MBEDTLS",
"GCM",
"USE_MBEDTLS",
"USE_NICE=0",
"RTC_SYSTEM_JUICE=0" "USE_NETTLE=0",
"JUICE_STATIC",
"SCTP_PROCESS_LEVEL_LOCKS",
"SCTP_SIMPLE_ALLOCATOR",
"__Userspace__",
]
)
if env["target"] == "template_release":
# Debug logging takes 100KB. May be better to check for env.debug_features
env_webrtc.Append(CPPDEFINES=["GODOT_JUICE_DISABLE_LOG", "GODOT_PLOG_DISABLE_LOG"])

env_thirdparty = env_webrtc.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj

if env["platform"] != "web" and env["libdatachannel"]:
env_webrtc.Append(CPPDEFINES=["ENABLE_LIBDATACHANNEL"])

module_obj = []

env_webrtc.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj

# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)
env_webrtc.add_source_files(env.modules_sources, "*.cpp")
Loading
Loading