Browse Source

TT#92250 allow codec-strip/offer/except also in answer messages

Change-Id: I9a8dcb3ec83b7037ffa0017a810de506bfa5a356
pull/1093/head
Richard Fuchs 5 years ago
parent
commit
1bc43aa506
2 changed files with 22 additions and 15 deletions
  1. +6
    -1
      README.md
  2. +16
    -14
      daemon/call_interfaces.c

+ 6
- 1
README.md View File

@ -1076,7 +1076,6 @@ Optionally included keys are:
* `codec`
Contains a dictionary controlling various aspects of codecs (or RTP payload types).
These options are only processed in `offer` messages and ignored otherwise.
These options can also be put into the `flags` list using a prefix of `codec-`. For example,
to set the codec options for two variants of Opus when they're implicitly accepted, (see
@ -1170,6 +1169,8 @@ Optionally included keys are:
be inserted into the offer. (This special exception does not apply to `mask=full`
or `strip=full`.)
This option is only processed in `offer` messages and ignored otherwise.
* `mask`
Similar to `strip` except that codecs listed here will still be accepted and
@ -1185,6 +1186,8 @@ Optionally included keys are:
As with the `strip` option, the special keywords `all` and `full` can be used
to mask all codecs that have been offered.
This option is only processed in `offer` messages and ignored otherwise.
* `set`
Contains a list of strings. This list makes it possible to set codec options
@ -1202,6 +1205,8 @@ Optionally included keys are:
different parameters. For example, to specify different bitrates for Opus for both
mono and stereo output, one could use `set=[opus/48000/1/16000,opus/48000/2/32000]`.
This option is only processed in `offer` messages and ignored otherwise.
* `ptime`
Contains an integer. If set, changes the `a=ptime` attribute's value in the outgoing


+ 16
- 14
daemon/call_interfaces.c View File

@ -830,17 +830,17 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, void *dummy) {
return;
if (call_ng_flags_prefix(out, s, "OSRTP-", ng_osrtp_option, NULL))
return;
if (out->opmode == OP_OFFER) {
if (call_ng_flags_prefix(out, s, "codec-strip-", call_ng_flags_str_ht,
&out->codec_strip))
return;
if (call_ng_flags_prefix(out, s, "codec-offer-", call_ng_flags_codec_list,
&out->codec_offer))
return;
if (call_ng_flags_prefix(out, s, "codec-except-", call_ng_flags_str_ht,
&out->codec_except))
return;
if (call_ng_flags_prefix(out, s, "codec-strip-", call_ng_flags_str_ht,
&out->codec_strip))
return;
if (call_ng_flags_prefix(out, s, "codec-offer-", call_ng_flags_codec_list,
&out->codec_offer))
return;
if (call_ng_flags_prefix(out, s, "codec-except-", call_ng_flags_str_ht,
&out->codec_except))
return;
#ifdef WITH_TRANSCODING
if (out->opmode == OP_OFFER) {
if (call_ng_flags_prefix(out, s, "transcode-", call_ng_flags_codec_list,
&out->codec_transcode))
return;
@ -1003,14 +1003,16 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
STR_FMT(&s));
}
if (opmode == OP_OFFER && (dict = bencode_dictionary_get_expect(input, "codec", BENCODE_DICTIONARY))) {
if ((dict = bencode_dictionary_get_expect(input, "codec", BENCODE_DICTIONARY))) {
call_ng_flags_list(out, dict, "strip", call_ng_flags_str_ht, &out->codec_strip);
call_ng_flags_list(out, dict, "offer", call_ng_flags_codec_list, &out->codec_offer);
call_ng_flags_list(out, dict, "except", call_ng_flags_str_ht, &out->codec_except);
#ifdef WITH_TRANSCODING
call_ng_flags_list(out, dict, "transcode", call_ng_flags_codec_list, &out->codec_transcode);
call_ng_flags_list(out, dict, "mask", call_ng_flags_str_ht, &out->codec_mask);
call_ng_flags_list(out, dict, "set", call_ng_flags_str_ht_split, &out->codec_set);
if (opmode == OP_OFFER) {
call_ng_flags_list(out, dict, "transcode", call_ng_flags_codec_list, &out->codec_transcode);
call_ng_flags_list(out, dict, "mask", call_ng_flags_str_ht, &out->codec_mask);
call_ng_flags_list(out, dict, "set", call_ng_flags_str_ht_split, &out->codec_set);
}
#endif
}
}


Loading…
Cancel
Save