Skip to content

Commit

Permalink
Merge pull request #748 from paullouisageneau/capi-forcemediatransport
Browse files Browse the repository at this point in the history
Add configuration option to force media transport in C API
  • Loading branch information
paullouisageneau authored Nov 22, 2022
2 parents ca9db92 + 7c75864 commit 47a3a86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ typedef struct {
bool enableIceTcp;
bool enableIceUdpMux;
bool disableAutoNegotiation;
bool forceMediaTransport;
uint16_t portRangeBegin;
uint16_t portRangeEnd;
int mtu;
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions include/rtc/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pages/content/pages/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ typedef struct {
bool enableIceTcp;
bool enableIceUdpMux;
bool disableAutoNegotiation;
bool forceMediaTransport;
uint16_t portRangeBegin;
uint16_t portRangeEnd;
int mtu;
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 47a3a86

Please sign in to comment.