summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-11-26 11:41:16 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-11-26 11:41:16 +0100
commite63ff17999e7a74106e36fff9ddd4fd4af485572 (patch)
treec741a2c9970d50ad0e3949deebcdbdd666c6f0b1 /src/config.c
parent0262f1aa1e73ff6fd4aa4aca4ad0f14d5ed8fe3e (diff)
config: add support for setting audio transmit mode
audio_txmode poll|thread 1. "poll" -- uses the audio driver thread to encode and send RTP packets (default) 2. "thread" -- uses a dedicated thread to encode and send RTP packets
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index d3f64eb..f94310c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -159,7 +159,7 @@ int config_parse_conf(struct config *cfg, const struct conf *conf)
struct pl pollm, as, ap;
enum poll_method method;
struct vidsz size = {0, 0};
- struct pl fmt;
+ struct pl fmt, txmode;
uint32_t v;
int err = 0;
@@ -223,6 +223,17 @@ int config_parse_conf(struct config *cfg, const struct conf *conf)
0 == conf_get(conf, "audio_player", &ap))
cfg->audio.src_first = as.p < ap.p;
+ if (0 == conf_get(conf, "audio_txmode", &txmode)) {
+
+ if (0 == pl_strcasecmp(&txmode, "poll"))
+ cfg->audio.txmode = AUDIO_MODE_POLL;
+ else if (0 == pl_strcasecmp(&txmode, "thread"))
+ cfg->audio.txmode = AUDIO_MODE_THREAD;
+ else {
+ warning("unsupported audio txmode (%r)\n", &txmode);
+ }
+ }
+
(void)conf_get_bool(conf, "audio_level", &cfg->audio.level);
if (0 == conf_get(conf, "ausrc_format", &fmt)) {
@@ -509,6 +520,7 @@ static int core_config_template(struct re_printf *pf, const struct config *cfg)
"#auplay_srate\t\t48000\n"
"#ausrc_channels\t\t0\n"
"#auplay_channels\t\t0\n"
+ "#audio_txmode\t\tpoll\t\t# poll, thread\n"
"audio_level\t\tno\n"
"ausrc_format\t\ts16\t\t# s16, float, ..\n"
"auplay_format\t\ts16\t\t# s16, float, ..\n"