From a3f235da5ca88c8001ae2abfa92fc7a474cf36e2 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Tue, 22 Nov 2022 10:27:35 +0100 Subject: [PATCH 1/2] Added forceMediaTransport to configuration in C API --- include/rtc/rtc.h | 1 + src/capi.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/rtc/rtc.h b/include/rtc/rtc.h index fa1357d08..ed9e0bf22 100644 --- a/include/rtc/rtc.h +++ b/include/rtc/rtc.h @@ -159,6 +159,7 @@ typedef struct { bool enableIceTcp; // libnice only bool enableIceUdpMux; // libjuice only bool disableAutoNegotiation; + bool forceMediaTransport; uint16_t portRangeBegin; // 0 means automatic uint16_t portRangeEnd; // 0 means automatic int mtu; // <= 0 means automatic diff --git a/src/capi.cpp b/src/capi.cpp index a833ad239..dba9c27c8 100644 --- a/src/capi.cpp +++ b/src/capi.cpp @@ -395,6 +395,7 @@ int rtcCreatePeerConnection(const rtcConfiguration *config) { c.enableIceTcp = config->enableIceTcp; c.enableIceUdpMux = config->enableIceUdpMux; c.disableAutoNegotiation = config->disableAutoNegotiation; + c.forceMediaTransport = config->forceMediaTransport; if (config->mtu > 0) c.mtu = size_t(config->mtu); From 7c75864ea78a64b7ed9c25fda274e4827cfc4788 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Tue, 22 Nov 2022 10:34:59 +0100 Subject: [PATCH 2/2] Updated doc --- DOC.md | 2 ++ pages/content/pages/reference.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/DOC.md b/DOC.md index f1bd486d7..d27464f77 100644 --- a/DOC.md +++ b/DOC.md @@ -84,6 +84,7 @@ typedef struct { bool enableIceTcp; bool enableIceUdpMux; bool disableAutoNegotiation; + bool forceMediaTransport; uint16_t portRangeBegin; uint16_t portRangeEnd; int mtu; @@ -105,6 +106,7 @@ Arguments: - `enableIceTcp`: if true, generate TCP candidates for ICE (ignored with libjuice as ICE backend) - `enableIceUdpMux`: if true, connections are multiplexed on the same UDP port (should be combined with `portRangeBegin` and `portRangeEnd`, ignored with libnice as ICE backend) - `disableAutoNegotiation`: if true, the user is responsible for calling `rtcSetLocalDescription` after creating a Data Channel and after setting the remote description + - `forceMediaTransport`: if true, the connection allocates the SRTP media transport even if no tracks are present (necessary to add tracks during later renegotiation) - `portRangeBegin` (optional): first port (included) of the allowed local port range (0 if unused) - `portRangeEnd` (optional): last port (included) of the allowed local port (0 if unused) - `mtu` (optional): manually set the Maximum Transfer Unit (MTU) for the connection (0 if automatic) diff --git a/pages/content/pages/reference.md b/pages/content/pages/reference.md index 566cd5a3f..ab338ec2a 100644 --- a/pages/content/pages/reference.md +++ b/pages/content/pages/reference.md @@ -87,6 +87,7 @@ typedef struct { bool enableIceTcp; bool enableIceUdpMux; bool disableAutoNegotiation; + bool forceMediaTransport; uint16_t portRangeBegin; uint16_t portRangeEnd; int mtu; @@ -108,6 +109,7 @@ Arguments: - `enableIceTcp`: if true, generate TCP candidates for ICE (ignored with libjuice as ICE backend) - `enableIceUdpMux`: if true, connections are multiplexed on the same UDP port (should be combined with `portRangeBegin` and `portRangeEnd`, ignored with libnice as ICE backend) - `disableAutoNegotiation`: if true, the user is responsible for calling `rtcSetLocalDescription` after creating a Data Channel and after setting the remote description + - `forceMediaTransport`: if true, the connection allocates the SRTP media transport even if no tracks are present (necessary to add tracks during later renegotiation) - `portRangeBegin` (optional): first port (included) of the allowed local port range (0 if unused) - `portRangeEnd` (optional): last port (included) of the allowed local port (0 if unused) - `mtu` (optional): manually set the Maximum Transfer Unit (MTU) for the connection (0 if automatic)