Reenable loopback connections for VRG

This commit is contained in:
Martin Pulec
2021-06-09 13:17:08 +02:00
parent 3ff957fce5
commit aa660ffaff
2 changed files with 4 additions and 6 deletions

View File

@@ -1154,11 +1154,6 @@ int main(int argc, char *argv[])
video_rxtx_mode |= MODE_SENDER;
}
if (video_rxtx_mode & MODE_RECEIVER && video_rxtx_mode & MODE_SENDER) {
LOG(LOG_LEVEL_ERROR) << "Combined sender and receiver not supported in VRG mode!\n";
EXIT(EXIT_FAILURE);
}
if (video_rx_port == -1) {
if ((video_rxtx_mode & MODE_RECEIVER) == 0) {
// do not occupy recv port if we are not receiving (note that this disables communication with

View File

@@ -1111,10 +1111,13 @@ struct rtp *rtp_init_if(const char *addr, const char *iface,
session->send_rtcp_to_origin = false; // VRG
// VRG specific changes
assert((rx_port == 0 || tx_port == 0));
session->rtp_socket = udp_init_if(addr, iface, rx_port, tx_port, ttl, force_ip_version, multithreaded);
uint16_t rtcp_rx_port = rx_port != 0 ? 0 : tx_port != 0 ? tx_port + 1 : 0;
uint16_t rtcp_tx_port = (rx_port == 0 ? tx_port : rx_port) + 1;
if (rx_port != 0 && tx_port != 0) {
assert (rx_port == tx_port);
rtcp_rx_port = rtcp_tx_port = rx_port + 1;
}
session->rtcp_socket =
udp_init_if(addr, iface, rtcp_rx_port, rtcp_tx_port, ttl, force_ip_version, false);