MT#55283 add codec-ignore option

Change-Id: Ie14a97896e2bb8a82ccfce0ee9d07a38adb275c9
pull/1910/head
Richard Fuchs 3 months ago
parent c12da568ad
commit daf39269c5

@ -2452,6 +2452,8 @@ static void codecs_offer(struct call_media *media, struct call_media *other_medi
codec_store_populate(&other_media->codecs, &sp->codecs,
.codec_set = flags->codec_set,
.allow_asymmetric = !!flags->allow_asymmetric_codecs);
codec_store_strip(&other_media->codecs, &flags->codec_ignore, flags->codec_except);
codec_store_check_empty(&other_media->codecs, &sp->codecs, flags);
codec_store_accept(&other_media->codecs, &flags->codec_accept, NULL);
codec_store_accept(&other_media->codecs, &flags->codec_consume, &sp->codecs);
codec_store_track(&other_media->codecs, &flags->codec_mask);

@ -1366,6 +1366,9 @@ void call_ng_flags_flags(str *s, unsigned int idx, helper_arg arg) {
if (call_ng_flags_prefix(s, "codec-strip-", call_ng_flags_esc_str_list,
&out->codec_strip))
return;
if (call_ng_flags_prefix(s, "codec-ignore-", call_ng_flags_esc_str_list,
&out->codec_ignore))
return;
}
/* SDES */
{
@ -1467,6 +1470,9 @@ void call_ng_codec_flags(const ng_parser_t *parser, str *key, parser_arg value,
case CSH_LOOKUP("strip"):
call_ng_flags_str_list(parser, value, call_ng_flags_esc_str_list, &out->codec_strip);
return;
case CSH_LOOKUP("ignore"):
call_ng_flags_str_list(parser, value, call_ng_flags_esc_str_list, &out->codec_ignore);
return;
}
#ifdef WITH_TRANSCODING
if (out->opmode == OP_OFFER || out->opmode == OP_SUBSCRIBE_REQ || out->opmode == OP_PUBLISH

@ -1289,6 +1289,16 @@ The following keys are understood:
This list also supports codec format parameters as per above.
* `ignore`
Similar to the `strip` option below, but affects only codecs listed in the
incoming received SDP. Codecs listed here are treated as if they were never
offered, and so will not be used for media towards the offerer. Note that
codecs listed here would still be used in the outgoing rewritten offer SDP,
unless the same codecs are also listed under `strip`. This means that if a
codec is only ignored but not stripped, and if that codec is then accepted
by the answerer, transcoding will necessarily be enabled.
* `mask`
Similar to `strip` except that codecs listed here will still be accepted and
@ -1339,7 +1349,8 @@ The following keys are understood:
an `a=rtpmap` attribute, or can be from the list of RFC-defined codecs. Examples
are `PCMU`, `opus`, or `telephone-event`. Codecs stripped using this option
are only removed from the outgoing rewritten SDP and don't affect the list
of codecs that was offered by the source SDP.
of codecs that was offered by the source SDP. See the `ignore` option above
for a similar mechanism that affects the offer codecs.
It is possible to specify codec format parameters alongside with the codec name
in the same format as they're written in SDP for codecs that support them,

@ -16,6 +16,7 @@ struct sockaddr_in6;
#define RTPE_NG_FLAGS_STR_Q_PARAMS \
X(from_tags) \
X(codec_strip) \
X(codec_ignore) \
X(codec_offer) \
X(codec_transcode) \
X(codec_mask) \

Loading…
Cancel
Save