Skip to content

Commit

Permalink
MT#58535 rtpp_flags: refactor default case of flags-flags parsing
Browse files Browse the repository at this point in the history
Keep the default case for the `call_ng_flags_flags()` more
accurate, which makes it easier for reading.

Change-Id: I317656ab964503389f2c84e835dd9db69cc70c3e
  • Loading branch information
zenichev committed Apr 4, 2024
1 parent 41a4321 commit 09f129f
Showing 1 changed file with 61 additions and 45 deletions.
106 changes: 61 additions & 45 deletions daemon/call_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,66 +1184,82 @@ void call_ng_flags_flags(sdp_ng_flags *out, str *s, helper_arg dummy) {
default:
/* handle values aliases from other dictionaries */

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-offer-", call_ng_flags_esc_str_list,
&out->codec_offer))
return;
if (call_ng_flags_prefix(out, s, "codec-strip-", call_ng_flags_esc_str_list,
&out->codec_strip))
return;
if (call_ng_flags_prefix(out, s, "endpoint-learning-", ng_el_option, NULL))
return;
if (call_ng_flags_prefix(out, s, "from-tags-", call_ng_flags_esc_str_list,
&out->from_tags))
return;

/* OSRTP */
if (call_ng_flags_prefix(out, s, "OSRTP-", ng_osrtp_option, NULL))
return;
/* replacing SDP body parts */
if (call_ng_flags_prefix(out, s, "replace-", call_ng_flags_replace, NULL))
return;
if (call_ng_flags_prefix(out, s, "SDES-", ng_sdes_option, NULL))
return;
if (call_ng_flags_prefix(out, s, "SDES-offerer_pref:", call_ng_flags_str_q_multi,
&out->sdes_offerer_pref))
return;
if (call_ng_flags_prefix(out, s, "SDES-no-", call_ng_flags_str_ht, &out->sdes_no))
return;
if (call_ng_flags_prefix(out, s, "SDES-only-", call_ng_flags_str_ht, &out->sdes_only))
return;
if (call_ng_flags_prefix(out, s, "SDES-order:", call_ng_flags_str_q_multi, &out->sdes_order))
return;
if (call_ng_flags_prefix(out, s, "sdp-attr-add-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_add))
return;
if (call_ng_flags_prefix(out, s, "sdp-attr-remove-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_remove))
return;
if (call_ng_flags_prefix(out, s, "sdp-attr-substitute-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_substitute))
return;
#ifdef WITH_TRANSCODING
if (out->opmode == OP_OFFER || out->opmode == OP_REQUEST || out->opmode == OP_PUBLISH) {
if (call_ng_flags_prefix(out, s, "transcode-", call_ng_flags_esc_str_list,
&out->codec_transcode))

/* codec manipulations */
{
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-offer-", call_ng_flags_esc_str_list,
&out->codec_offer))
return;
if (call_ng_flags_prefix(out, s, "codec-transcode-", call_ng_flags_esc_str_list,
&out->codec_transcode))
if (call_ng_flags_prefix(out, s, "codec-strip-", call_ng_flags_esc_str_list,
&out->codec_strip))
return;
if (call_ng_flags_prefix(out, s, "codec-mask-", call_ng_flags_esc_str_list,
&out->codec_mask))
}
/* SDES */
{
if (call_ng_flags_prefix(out, s, "SDES-", ng_sdes_option, NULL))
return;
if (call_ng_flags_prefix(out, s, "T38-", ng_t38_option, NULL))
if (call_ng_flags_prefix(out, s, "SDES-offerer_pref:", call_ng_flags_str_q_multi,
&out->sdes_offerer_pref))
return;
if (call_ng_flags_prefix(out, s, "T.38-", ng_t38_option, NULL))
if (call_ng_flags_prefix(out, s, "SDES-no-", call_ng_flags_str_ht, &out->sdes_no))
return;
if (call_ng_flags_prefix(out, s, "SDES-only-", call_ng_flags_str_ht, &out->sdes_only))
return;
if (call_ng_flags_prefix(out, s, "SDES-order:", call_ng_flags_str_q_multi, &out->sdes_order))
return;
}
/* SDP attributes manipulations */
{
if (call_ng_flags_prefix(out, s, "sdp-attr-add-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_add))
return;
if (call_ng_flags_prefix(out, s, "sdp-attr-remove-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_remove))
return;
if (call_ng_flags_prefix(out, s, "sdp-attr-substitute-", call_ng_flags_sdp_attr_helper, &sdp_attr_helper_substitute))
return;
}
#ifdef WITH_TRANSCODING
/* transcoding */
{
if (out->opmode == OP_OFFER || out->opmode == OP_REQUEST || out->opmode == OP_PUBLISH) {
if (call_ng_flags_prefix(out, s, "transcode-", call_ng_flags_esc_str_list,
&out->codec_transcode))
return;
if (call_ng_flags_prefix(out, s, "codec-transcode-", call_ng_flags_esc_str_list,
&out->codec_transcode))
return;
if (call_ng_flags_prefix(out, s, "codec-mask-", call_ng_flags_esc_str_list,
&out->codec_mask))
return;
if (call_ng_flags_prefix(out, s, "T38-", ng_t38_option, NULL))
return;
if (call_ng_flags_prefix(out, s, "T.38-", ng_t38_option, NULL))
return;
}
if (call_ng_flags_prefix(out, s, "codec-accept-", call_ng_flags_esc_str_list,
&out->codec_accept))
return;
if (call_ng_flags_prefix(out, s, "codec-consume-", call_ng_flags_esc_str_list,
&out->codec_consume))
return;
if (call_ng_flags_prefix(out, s, "codec-set-", call_ng_flags_str_ht_split,
&out->codec_set))
return;
}
if (call_ng_flags_prefix(out, s, "codec-accept-", call_ng_flags_esc_str_list,
&out->codec_accept))
return;
if (call_ng_flags_prefix(out, s, "codec-consume-", call_ng_flags_esc_str_list,
&out->codec_consume))
return;
if (call_ng_flags_prefix(out, s, "codec-set-", call_ng_flags_str_ht_split,
&out->codec_set))
return;
#endif

ilog(LOG_WARN, "Unknown flag encountered: '" STR_FORMAT "'",
Expand Down

0 comments on commit 09f129f

Please sign in to comment.