From df7958487aefb2425c5b1e7a3e8d366017d2c200 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 29 Jun 2021 14:02:31 +0200 Subject: [PATCH] Server mode: support audio --- src/audio/audio.cpp | 4 ++++ src/main.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index cbb12e614..2b2f08561 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -84,6 +84,7 @@ #include "tv.h" #include "transmit.h" #include "pdb.h" +#include "utils/net.h" #include "utils/thread.h" #include "utils/worker.h" @@ -519,6 +520,9 @@ static struct rtp *initialize_audio_network(struct audio_network_parameters *par rtp_set_option(r, RTP_OPT_RECORD_SOURCE, TRUE); rtp_set_sdes(r, rtp_my_ssrc(r), RTCP_SDES_TOOL, PACKAGE_STRING, strlen(PACKAGE_VERSION)); + if (strcmp(params->addr, IN6_BLACKHOLE_STR) == 0) { + rtp_set_option(r, RTP_OPT_SEND_BACK, TRUE); + } rtp_set_recv_buf(r, DEFAULT_AUDIO_RECV_BUF_SIZE); } diff --git a/src/main.cpp b/src/main.cpp index 3c6bb5324..45bcebf11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1121,6 +1121,9 @@ int main(int argc, char *argv[]) if (strcmp(requested_display, "none") == 0) { requested_display = "dummy"; } + if (strcmp(audio_recv, "none") == 0) { + audio_recv = "dummy"; + } } if (is_client) { commandline_params["udp-disable-multi-socket"] = string(); @@ -1131,6 +1134,10 @@ int main(int argc, char *argv[]) if (strcmp("none", vidcap_params_get_driver(vidcap_params_head)) == 0) { vidcap_params_set_device(vidcap_params_tail, "testcard:2:1:5:UYVY"); } + if (strcmp("none", audio_send) == 0) { + parse_audio_capture_format("sample_rate=5"); + audio_send = "testcard:frames=1"; + } } if (!audio_host) {