[Asterisk-code-review] Binaural synthesis (confbridge): On/off setting for binaural... (asterisk[master])
Frank Haase
asteriskteam at digium.com
Fri Aug 12 11:33:27 CDT 2016
Frank Haase has uploaded a new change for review.
https://gerrit.asterisk.org/3523
Change subject: Binaural synthesis (confbridge): On/off setting for binaural synthesis.
......................................................................
Binaural synthesis (confbridge): On/off setting for binaural synthesis.
Adds setting to confbridge.conf (binaural_active) that determines if binaural
synthesis can be available in bridge_softmix.
ASTERISK-26292
Change-Id: I59dfcb8e55fe1df4ef32045882fea5bb58fc71db
---
M apps/confbridge/conf_config_parser.c
M apps/confbridge/include/confbridge.h
2 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/23/3523/1
diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
index 69d6f69..489deb0 100644
--- a/apps/confbridge/conf_config_parser.c
+++ b/apps/confbridge/conf_config_parser.c
@@ -284,6 +284,13 @@
or 80.
</para></description>
</configOption>
+ <configOption name="binaural_active">
+ <synopsis>If true binaural conferencing with stereo opus is active</synopsis>
+ <description><para>
+ Activates binaural mixing for a conference bridge.
+ Binaural features are disabled by default.
+ </para></description>
+ </configOption>
<configOption name="record_conference">
<synopsis>Record the conference starting with the first active user's entrance and ending with the last active user's exit</synopsis>
<description><para>
@@ -1918,6 +1925,22 @@
}
}
+static int binaural_active_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
+{
+ struct bridge_profile *b_profile = obj;
+
+ if (strcasecmp(var->name, "binaural_active")) {
+ return -1;
+ }
+ if (sscanf(var->value, "%30u", &b_profile->binaural_active) != 1) {
+ return -1;
+ }
+ if (b_profile->binaural_active == 0 || b_profile->binaural_active == 1) {
+ return 0;
+ }
+ return -1;
+}
+
static int video_mode_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
{
struct bridge_profile *b_profile = obj;
@@ -2172,6 +2195,7 @@
aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
/* "auto" will fail to parse as a uint, but we use PARSE_DEFAULT to set the value to 0 in that case, which is the value that auto resolves to */
aco_option_register(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, PARSE_DEFAULT, FLDSET(struct bridge_profile, internal_sample_rate), 0);
+ aco_option_register_custom(&cfg_info, "binaural_active", ACO_EXACT, bridge_types, "0", binaural_active_handler, 0);
aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
aco_option_register(&cfg_info, "record_conference", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_CONFERENCE);
aco_option_register_custom(&cfg_info, "video_mode", ACO_EXACT, bridge_types, NULL, video_mode_handler, 0);
diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h
index 5ae0421..735bc50 100644
--- a/apps/confbridge/include/confbridge.h
+++ b/apps/confbridge/include/confbridge.h
@@ -209,6 +209,7 @@
unsigned int max_members; /*!< The maximum number of participants allowed in the conference */
unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */
+ unsigned int binaural_active; /*!< TRUE if binaural is activated. */
struct bridge_profile_sounds *sounds;
char regcontext[AST_MAX_CONTEXT];
};
--
To view, visit https://gerrit.asterisk.org/3523
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59dfcb8e55fe1df4ef32045882fea5bb58fc71db
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Frank Haase <fra.haase at googlemail.com>
More information about the asterisk-code-review
mailing list