option for zero playout-delay

This commit is contained in:
Maxim Devaev
2022-07-16 12:15:51 +03:00
parent 13f522e81d
commit 9d1a42631e
9 changed files with 32 additions and 15 deletions

View File

@@ -24,6 +24,7 @@
static char *_get_value(janus_config *jcfg, const char *section, const char *option);
static bool _get_bool(janus_config *jcfg, const char *section, const char *option, bool def);
plugin_config_s *plugin_config_init(const char *config_dir_path) {
@@ -50,6 +51,9 @@ plugin_config_s *plugin_config_init(const char *config_dir_path) {
JLOG_ERROR("config", "Missing config value: video.sink (ex. memsink.object)");
goto error;
}
if ((config->video_zero_playout_delay = _get_bool(jcfg, "video", "zero_playout_delay", false)) == true) {
JLOG_INFO("config", "Enabled the experimental Playout-Delay=0 RTP extension for VIDEO");
}
if ((config->audio_dev_name = _get_value(jcfg, "audio", "device")) != NULL) {
JLOG_INFO("config", "Enabled the experimental AUDIO feature");
if ((config->tc358743_dev_path = _get_value(jcfg, "audio", "tc358743")) == NULL) {
@@ -85,3 +89,13 @@ static char *_get_value(janus_config *jcfg, const char *section, const char *opt
}
return strdup(option_obj->value);
}
static bool _get_bool(janus_config *jcfg, const char *section, const char *option, bool def) {
char *tmp = _get_value(jcfg, section, option);
bool value = def;
if (tmp != NULL) {
value = (!strcasecmp(tmp, "1") || !strcasecmp(tmp, "true") || !strcasecmp(tmp, "yes"));
free(tmp);
}
return value;
}