MT#55283 add evs-dtx= option

Change-Id: I6489895e31e1fcf1c72c9767b122189f22f58792
pull/1912/head
Richard Fuchs 4 months ago
parent 7e30f816e4
commit ccccded287

@ -3838,6 +3838,10 @@ static bool __ssrc_handler_decode_common(struct codec_ssrc_handler *ch, struct c
if (rtpe_config.amr_cn_dtx)
decoder_set_cn_dtx(ch->decoder, &rtpe_config.dtx_cn_params);
}
else if (ch->decoder->def->evs) {
if (rtpe_config.evs_cn_dtx)
decoder_set_cn_dtx(ch->decoder, &rtpe_config.dtx_cn_params);
}
else
decoder_set_cn_dtx(ch->decoder, &rtpe_config.dtx_cn_params);
}

@ -600,6 +600,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
g_autoptr(char_p) dtx_cn_params = NULL;
bool debug_srtp = false;
g_autoptr(char) amr_dtx = NULL;
g_autoptr(char) evs_dtx = NULL;
#ifdef HAVE_MQTT
g_autoptr(char) mqtt_publish_scope = NULL;
#endif
@ -745,6 +746,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
{ "dtx-shift", 0,0, G_OPTION_ARG_INT, &rtpe_config.dtx_shift, "Length of time (in ms) to shift DTX buffer after over/underflow", "INT"},
{ "dtx-cn-params",0,0, G_OPTION_ARG_STRING_ARRAY,&dtx_cn_params, "Parameters for CN generated from DTX","INT INT INT ..."},
{ "amr-dtx", 0,0, G_OPTION_ARG_STRING, &amr_dtx, "DTX mechanism to use for AMR and AMR-WB","native|CN"},
{ "evs-dtx", 0,0, G_OPTION_ARG_STRING, &evs_dtx, "DTX mechanism to use for EVS","native|CN"},
{ "silence-detect",0,0, G_OPTION_ARG_DOUBLE, &silence_detect, "Audio level threshold in percent for silence detection","FLOAT"},
{ "cn-payload",0,0, G_OPTION_ARG_STRING_ARRAY,&cn_payload, "Comfort noise parameters to replace silence with","INT INT INT ..."},
{ "player-cache",0,0, G_OPTION_ARG_NONE, &rtpe_config.player_cache,"Cache media files for playback in memory",NULL},
@ -1161,6 +1163,14 @@ static void options(int *argc, char ***argv, charp_ht templates) {
die("Invalid --amr-dtx ('%s')", amr_dtx);
}
if (evs_dtx) {
if (!strcasecmp(evs_dtx, "native")) {}
else if (!strcasecmp(evs_dtx, "CN"))
rtpe_config.evs_cn_dtx = true;
else
die("Invalid --evs-dtx ('%s')", evs_dtx);
}
if (use_audio_player) {
if (!strcasecmp(use_audio_player, "on-demand")
|| !strcasecmp(use_audio_player, "on demand")

@ -1051,16 +1051,17 @@ call to inject-DTMF won't be sent to __\-\-dtmf-log-dest=__ or __\-\-listen-tcp-
gaps.
- __\-\-amr-dtx=native__\|__CN__
- __\-\-evs-dtx=native__\|__CN__
Select the DTX behaviour for AMR codecs. The default is use the codec's
internal processing: during a DTX event, a "no data" frame is passed to the
decoder and the output is used as audio data.
Select the DTX behaviour for AMR and EVS codecs, respectively. The default
is use the codec's internal processing: during a DTX event, a "no data"
frame is passed to the decoder and the output is used as audio data.
If __CN__ is selected here, the same DTX mechanism as other codecs use is used
for AMR, which is to fill in DTX gaps with either silence or RFC 3389 comfort
noise (see __dtx-cn-params__). This also affects processing of received SID
frames: SID frames would not be passed to the codec but instead be replaced by
generated silence or comfort noise.
If __CN__ is selected here, the same DTX mechanism as other codecs use is
used for AMR/EVS, which is to fill in DTX gaps with either silence or RFC
3389 comfort noise (see __dtx-cn-params__). This also affects processing of
received SID frames: SID frames would not be passed to the codec but
instead be replaced by generated silence or comfort noise.
- __\-\-silence-detect=__*FLOAT*

@ -123,6 +123,7 @@ enum endpoint_learning {
X(redis_resolve_on_reconnect) \
X(measure_rtp) \
X(amr_cn_dtx) \
X(evs_cn_dtx) \
#define RTPE_CONFIG_CHARP_PARAMS \
X(b2b_url) \

@ -725,6 +725,7 @@ static struct codec_def_s __codec_defs[] = {
.select_encoder_format = evs_select_encoder_format,
.packetizer = packetizer_passthrough,
.bits_per_sample = 1,
.evs = 1,
.media_type = MT_AUDIO,
.codec_type = &codec_type_evs,
.dtx_methods = {

@ -228,6 +228,7 @@ struct codec_def_s {
unsigned int supplemental:1,
dtmf:1, // special case
fixed_sizes:1, // hint for `block-short` feature
evs:1,
amr:1;
const codec_type_t *codec_type;

Loading…
Cancel
Save