diff --git a/daemon/call.c b/daemon/call.c index 59c3fc9cb..1a6768ff9 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -612,7 +612,7 @@ struct call_media *call_media_new(struct call *call) { } static struct call_media *__get_media(struct call_monologue *ml, const struct stream_params *sp, - const struct sdp_ng_flags *flags, unsigned int index) + const sdp_ng_flags *flags, unsigned int index) { struct call_media *med; struct call *call; @@ -673,7 +673,7 @@ static void __endpoint_map_truncate(struct endpoint_map *em, unsigned int num_in } } static struct endpoint_map *__hunt_endpoint_map(struct call_media *media, unsigned int num_ports, - const struct endpoint *ep, const struct sdp_ng_flags *flags, bool always_reuse, + const struct endpoint *ep, const sdp_ng_flags *flags, bool always_reuse, unsigned int want_interfaces) { for (GList *l = media->endpoint_maps.tail; l; l = l->prev) { @@ -752,7 +752,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media) return NULL; } static struct endpoint_map *__get_endpoint_map(struct call_media *media, unsigned int num_ports, - const struct endpoint *ep, const struct sdp_ng_flags *flags, bool always_reuse) + const struct endpoint *ep, const sdp_ng_flags *flags, bool always_reuse) { struct stream_fd *sfd; GQueue intf_sockets = G_QUEUE_INIT; @@ -934,7 +934,7 @@ static int __num_media_streams(struct call_media *media, unsigned int num_ports) } static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp, unsigned int port_off, - const struct stream_params *sp, const struct sdp_ng_flags *flags) + const struct stream_params *sp, const sdp_ng_flags *flags) { struct endpoint ep; struct call_media *media = ps->media; @@ -1200,7 +1200,7 @@ static void __reset_streams(struct call_media *media) { * TODO: this function seems to do two things - stream init (with B NULL) and sink init - split up? */ static int __init_streams(struct call_media *A, struct call_media *B, const struct stream_params *sp, - const struct sdp_ng_flags *flags, const struct sink_attrs *attrs) { + const sdp_ng_flags *flags, const struct sink_attrs *attrs) { GList *la, *lb; struct packet_stream *a, *ax, *b; unsigned int port_off = 0; @@ -1332,7 +1332,7 @@ no_rtcp: return 0; } -static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *this, +static void __ice_offer(const sdp_ng_flags *flags, struct call_media *this, struct call_media *other, bool ice_restart) { if (!flags) @@ -1456,7 +1456,7 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi } -static void __sdes_flags(struct crypto_params_sdes *cps, const struct sdp_ng_flags *flags) { +static void __sdes_flags(struct crypto_params_sdes *cps, const sdp_ng_flags *flags) { if (!cps) return; @@ -1478,7 +1478,7 @@ static void __sdes_flags(struct crypto_params_sdes *cps, const struct sdp_ng_fla * Only generates SDES parameters for outgoing SDP, which is our media "out" direction. * `other` can be NULL. */ -static void __generate_crypto(const struct sdp_ng_flags *flags, struct call_media *this, +static void __generate_crypto(const sdp_ng_flags *flags, struct call_media *this, struct call_media *other) { /* SDES options, which will be present in the outgoing offer */ @@ -1853,7 +1853,7 @@ skip_sdes: * the list of (generated) outgoing crypto suites to contain only the one that was * accepted. */ -static void __sdes_accept(struct call_media *media, const struct sdp_ng_flags *flags) { +static void __sdes_accept(struct call_media *media, const sdp_ng_flags *flags) { if (!media->sdes_in.length) return; @@ -1933,14 +1933,14 @@ static void __disable_streams(struct call_media *media, unsigned int num_ports) } } -static void __rtcp_mux_set(const struct sdp_ng_flags *flags, struct call_media *media) { +static void __rtcp_mux_set(const sdp_ng_flags *flags, struct call_media *media) { if (flags->rtcp_mux_offer || flags->rtcp_mux_require) MEDIA_SET(media, RTCP_MUX); else if (flags->rtcp_mux_demux) MEDIA_CLEAR(media, RTCP_MUX); } -static void __rtcp_mux_logic(struct sdp_ng_flags *flags, struct call_media *media, +static void __rtcp_mux_logic(sdp_ng_flags *flags, struct call_media *media, struct call_media *other_media) { if (!flags) @@ -2037,7 +2037,7 @@ static void __set_all_tos(struct call *c) { } } -static void __tos_change(struct call *call, const struct sdp_ng_flags *flags) { +static void __tos_change(struct call *call, const sdp_ng_flags *flags) { unsigned char new_tos; /* Handle TOS= parameter. Negative value = no change, not present or too large = @@ -2096,7 +2096,7 @@ get: // process received a=setup and related attributes -static void __dtls_logic(const struct sdp_ng_flags *flags, +static void __dtls_logic(const sdp_ng_flags *flags, struct call_media *other_media, struct stream_params *sp) { unsigned int tmp; @@ -2194,7 +2194,7 @@ static void __endpoint_loop_protect(struct stream_params *sp, struct call_media } static void __update_media_id(struct call_media *media, struct call_media *other_media, - struct stream_params *sp, const struct sdp_ng_flags *flags) + struct stream_params *sp, const sdp_ng_flags *flags) { if (!flags) return; @@ -2283,7 +2283,7 @@ static void __t38_reset(struct call_media *media, struct call_media *other_media } static void __update_media_protocol(struct call_media *media, struct call_media *other_media, - struct stream_params *sp, struct sdp_ng_flags *flags) + struct stream_params *sp, sdp_ng_flags *flags) { // is the media type still the same? if (str_cmp_str(&other_media->type, &sp->type)) { @@ -2391,7 +2391,7 @@ static void __update_media_protocol(struct call_media *media, struct call_media __attribute__((nonnull(1, 2, 3))) static void codecs_offer(struct call_media *media, struct call_media *other_media, - struct stream_params *sp, struct sdp_ng_flags *flags) + struct stream_params *sp, sdp_ng_flags *flags) { ilogs(codec, LOG_DEBUG, "Updating codecs for offerer " STR_FORMAT " #%u", STR_FMT(&other_media->monologue->tag), @@ -2462,7 +2462,7 @@ static void codecs_offer(struct call_media *media, struct call_media *other_medi __attribute__((nonnull(1, 2, 3, 4))) static void codecs_answer(struct call_media *media, struct call_media *other_media, - struct stream_params *sp, struct sdp_ng_flags *flags) + struct stream_params *sp, sdp_ng_flags *flags) { ilogs(codec, LOG_DEBUG, "Updating codecs for answerer " STR_FORMAT " #%u", STR_FMT(&other_media->monologue->tag), @@ -2522,7 +2522,7 @@ static void codecs_answer(struct call_media *media, struct call_media *other_med void codecs_offer_answer(struct call_media *media, struct call_media *other_media, struct stream_params *sp, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { if (!flags || flags->opmode != OP_ANSWER) codecs_offer(media, other_media, sp, flags); @@ -2533,7 +2533,7 @@ void codecs_offer_answer(struct call_media *media, struct call_media *other_medi /* called with call->master_lock held in W */ static void __update_init_subscribers(struct call_media *media, struct stream_params *sp, - struct sdp_ng_flags *flags, enum call_opmode opmode) + sdp_ng_flags *flags, enum call_opmode opmode) { if (!media) return; @@ -2581,7 +2581,7 @@ void update_init_subscribers(struct call_monologue *ml, enum call_opmode opmode) } } -static void __call_monologue_init_from_flags(struct call_monologue *ml, struct sdp_ng_flags *flags) { +static void __call_monologue_init_from_flags(struct call_monologue *ml, sdp_ng_flags *flags) { struct call *call = ml->call; call->last_signal = rtpe_now.tv_sec; @@ -2610,7 +2610,7 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct s } static void __update_media_label(struct call_media *media, struct call_media *other_media, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { if (!media) return; @@ -2633,7 +2633,7 @@ static void __update_media_label(struct call_media *media, struct call_media *ot // `media` can be NULL static void __media_init_from_flags(struct call_media *other_media, struct call_media *media, - struct stream_params *sp, struct sdp_ng_flags *flags) + struct stream_params *sp, sdp_ng_flags *flags) { struct call *call = other_media->call; GQueue *additional_attributes = &sp->attributes; /* attributes in str format */ @@ -2773,7 +2773,7 @@ static void __media_init_from_flags(struct call_media *other_media, struct call_ } } -unsigned int proto_num_ports(unsigned int sp_ports, struct call_media *media, struct sdp_ng_flags *flags, +unsigned int proto_num_ports(unsigned int sp_ports, struct call_media *media, sdp_ng_flags *flags, bool allow_offer_split) { if (sp_ports == 0) @@ -2816,7 +2816,7 @@ static void media_update_transcoding_flag(struct call_media *media) { /* called with call->master_lock held in W */ int monologue_offer_answer(struct call_monologue *monologues[2], GQueue *streams, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { struct call_media *media, *other_media; struct endpoint_map *em; @@ -3232,7 +3232,7 @@ struct media_subscription *call_get_media_subscription(GHashTable *ht, struct ca /* called with call->master_lock held in W */ __attribute__((nonnull(1, 2, 3))) -int monologue_publish(struct call_monologue *ml, GQueue *streams, struct sdp_ng_flags *flags) { +int monologue_publish(struct call_monologue *ml, GQueue *streams, sdp_ng_flags *flags) { __call_monologue_init_from_flags(ml, flags); if (flags->exclude_recording) @@ -3299,7 +3299,7 @@ int monologue_publish(struct call_monologue *ml, GQueue *streams, struct sdp_ng_ /* called with call->master_lock held in W */ __attribute__((nonnull(1, 2, 3, 4))) static int monologue_subscribe_request1(struct call_monologue *src_ml, struct call_monologue *dst_ml, - struct sdp_ng_flags *flags, unsigned int *index, bool print_extra_sess_attrs) + sdp_ng_flags *flags, unsigned int *index, bool print_extra_sess_attrs) { unsigned int idx_diff = 0, rev_idx_diff = 0; @@ -3377,7 +3377,7 @@ static int monologue_subscribe_request1(struct call_monologue *src_ml, struct ca /* called with call->master_lock held in W */ __attribute__((nonnull(1, 2, 3))) int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst_ml, - struct sdp_ng_flags *flags, bool print_extra_sess_attrs) + sdp_ng_flags *flags, bool print_extra_sess_attrs) { unsigned int index = 1; /* running counter for output/dst medias */ @@ -3404,7 +3404,7 @@ int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst_m /* called with call->master_lock held in W */ __attribute__((nonnull(1, 2, 3))) -int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flags *flags, GQueue *streams, +int monologue_subscribe_answer(struct call_monologue *dst_ml, sdp_ng_flags *flags, GQueue *streams, bool print_extra_sess_attrs) { struct media_subscription *rev_ms = NULL; @@ -3501,7 +3501,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag /* called with call->master_lock held in W */ __attribute__((nonnull(1, 2))) -int monologue_unsubscribe(struct call_monologue *dst_ml, struct sdp_ng_flags *flags) { +int monologue_unsubscribe(struct call_monologue *dst_ml, sdp_ng_flags *flags) { for (unsigned int i = 0; i < dst_ml->medias->len; i++) { struct call_media *media = dst_ml->medias->pdata[i]; diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index c552b2f97..d590f64e8 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -47,17 +47,17 @@ bool trust_address_def; bool dtls_passive_def; -INLINE int call_ng_flags_prefix(struct sdp_ng_flags *out, str *s_ori, const char *prefix, - void (*cb)(struct sdp_ng_flags *, str *, helper_arg), helper_arg); -static void call_ng_flags_str_ht(struct sdp_ng_flags *out, str *s, helper_arg); -static void call_ng_flags_str_q_multi(struct sdp_ng_flags *out, str *s, helper_arg); -static void call_ng_flags_str_list(struct sdp_ng_flags *out, bencode_item_t *list, - void (*callback)(struct sdp_ng_flags *, str *, helper_arg), helper_arg); -static void call_ng_flags_list(struct sdp_ng_flags *out, bencode_item_t *list, - void (*str_callback)(struct sdp_ng_flags *, str *, helper_arg), - void (*item_callback)(struct sdp_ng_flags *, bencode_item_t *, helper_arg), +INLINE int call_ng_flags_prefix(sdp_ng_flags *out, str *s_ori, const char *prefix, + void (*cb)(sdp_ng_flags *, str *, helper_arg), helper_arg); +static void call_ng_flags_str_ht(sdp_ng_flags *out, str *s, helper_arg); +static void call_ng_flags_str_q_multi(sdp_ng_flags *out, str *s, helper_arg); +static void call_ng_flags_str_list(sdp_ng_flags *out, bencode_item_t *list, + void (*callback)(sdp_ng_flags *, str *, helper_arg), helper_arg); +static void call_ng_flags_list(sdp_ng_flags *out, bencode_item_t *list, + void (*str_callback)(sdp_ng_flags *, str *, helper_arg), + void (*item_callback)(sdp_ng_flags *, bencode_item_t *, helper_arg), helper_arg); -static void call_ng_flags_esc_str_list(struct sdp_ng_flags *out, str *s, helper_arg); +static void call_ng_flags_esc_str_list(sdp_ng_flags *out, str *s, helper_arg); static void ng_stats_ssrc(bencode_item_t *dict, struct ssrc_hash *ht); static str *str_dup_escape(const str *s); @@ -505,7 +505,7 @@ INLINE char *bencode_get_alt(bencode_item_t *i, const char *one, const char *two return bencode_dictionary_get_str(i, two, out); } -INLINE void ng_sdes_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +INLINE void ng_sdes_option(sdp_ng_flags *out, str *s, helper_arg dummy) { str_hyphenate(s); /* Accept only certain individual crypto suites */ @@ -578,7 +578,7 @@ INLINE void ng_sdes_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { } } -INLINE void ng_osrtp_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +INLINE void ng_osrtp_option(sdp_ng_flags *out, str *s, helper_arg dummy) { switch (__csh_lookup(s)) { case CSH_LOOKUP("accept-rfc"): case CSH_LOOKUP("accept-RFC"): @@ -605,7 +605,7 @@ INLINE void ng_osrtp_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) } } -static void call_ng_flags_str_pair_ht(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_str_pair_ht(sdp_ng_flags *out, str *s, helper_arg arg) { str *s_copy = str_dup_escape(s); str token; if (str_token(&token, s_copy, '>')) { @@ -619,7 +619,7 @@ static void call_ng_flags_str_pair_ht(struct sdp_ng_flags *out, str *s, helper_a g_hash_table_replace(*ht, str_dup(&token), s_copy); } -static void call_ng_flags_item_pair_ht(struct sdp_ng_flags *out, bencode_item_t *it, helper_arg arg) { +static void call_ng_flags_item_pair_ht(sdp_ng_flags *out, bencode_item_t *it, helper_arg arg) { str from; str to; @@ -644,7 +644,7 @@ static void call_ng_flags_item_pair_ht(struct sdp_ng_flags *out, bencode_item_t g_hash_table_replace(*ht, s_copy_from, s_copy_to); } -INLINE void ng_sdp_attr_manipulations(struct sdp_ng_flags *flags, bencode_item_t *value) { +INLINE void ng_sdp_attr_manipulations(sdp_ng_flags *flags, bencode_item_t *value) { if (!value || value->type != BENCODE_DICTIONARY) { ilog(LOG_WARN, "SDP manipulations: Wrong type for this type of command."); @@ -713,7 +713,7 @@ INLINE void ng_sdp_attr_manipulations(struct sdp_ng_flags *flags, bencode_item_t } } -INLINE void ng_el_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +INLINE void ng_el_option(sdp_ng_flags *out, str *s, helper_arg dummy) { switch (__csh_lookup(s)) { case CSH_LOOKUP("off"): out->el_option = EL_OFF; @@ -734,7 +734,7 @@ INLINE void ng_el_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { } #ifdef WITH_TRANSCODING -INLINE void ng_t38_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +INLINE void ng_t38_option(sdp_ng_flags *out, str *s, helper_arg dummy) { str_hyphenate(s); switch (__csh_lookup(s)) { case CSH_LOOKUP("decode"): @@ -790,9 +790,9 @@ INLINE void ng_t38_option(struct sdp_ng_flags *out, str *s, helper_arg dummy) { #endif -static void call_ng_flags_list(struct sdp_ng_flags *out, bencode_item_t *list, - void (*str_callback)(struct sdp_ng_flags *, str *, helper_arg), - void (*item_callback)(struct sdp_ng_flags *, bencode_item_t *, helper_arg), +static void call_ng_flags_list(sdp_ng_flags *out, bencode_item_t *list, + void (*str_callback)(sdp_ng_flags *, str *, helper_arg), + void (*item_callback)(sdp_ng_flags *, bencode_item_t *, helper_arg), helper_arg arg) { str s; @@ -815,13 +815,13 @@ static void call_ng_flags_list(struct sdp_ng_flags *out, bencode_item_t *list, ilog(LOG_DEBUG, "Ignoring non-string value in list"); } } -static void call_ng_flags_str_list(struct sdp_ng_flags *out, bencode_item_t *list, - void (*callback)(struct sdp_ng_flags *, str *, helper_arg), helper_arg arg) +static void call_ng_flags_str_list(sdp_ng_flags *out, bencode_item_t *list, + void (*callback)(sdp_ng_flags *, str *, helper_arg), helper_arg arg) { call_ng_flags_list(out, list, callback, NULL, arg); } -static void call_ng_flags_rtcp_mux(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +static void call_ng_flags_rtcp_mux(sdp_ng_flags *out, str *s, helper_arg dummy) { switch (__csh_lookup(s)) { case CSH_LOOKUP("offer"): out->rtcp_mux_offer = 1; @@ -843,7 +843,7 @@ static void call_ng_flags_rtcp_mux(struct sdp_ng_flags *out, str *s, helper_arg STR_FMT(s)); } } -static void call_ng_flags_replace(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_replace(sdp_ng_flags *out, str *s, helper_arg arg) { str_hyphenate(s); switch (__csh_lookup(s)) { case CSH_LOOKUP("origin"): @@ -874,7 +874,7 @@ static void call_ng_flags_replace(struct sdp_ng_flags *out, str *s, helper_arg a STR_FMT(s)); } } -static void call_ng_flags_supports(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +static void call_ng_flags_supports(sdp_ng_flags *out, str *s, helper_arg dummy) { if (!str_cmp(s, "load limit")) out->supports_load_limit = 1; else @@ -896,14 +896,14 @@ static str *str_dup_escape(const str *s) { } return ret; } -static void call_ng_flags_esc_str_list(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_esc_str_list(sdp_ng_flags *out, str *s, helper_arg arg) { str *s_copy = str_dup_escape(s); g_queue_push_tail(arg.q, s_copy); } /** * Stores flag's value in the given GhashTable. */ -static void call_ng_flags_str_ht(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_str_ht(sdp_ng_flags *out, str *s, helper_arg arg) { str *s_copy = str_dup_escape(s); GHashTable **ht = arg.htp; if (!*ht) @@ -914,7 +914,7 @@ static void call_ng_flags_str_ht(struct sdp_ng_flags *out, str *s, helper_arg ar * Parses one-row flags separated by 'delimiter'. * Stores parsed flag's values then in the given GQueue. */ -static void call_ng_flags_str_q_multi(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_str_q_multi(sdp_ng_flags *out, str *s, helper_arg arg) { str *s_copy = str_dup_escape(s); str token; GQueue *q = arg.q; @@ -931,7 +931,7 @@ static void call_ng_flags_str_q_multi(struct sdp_ng_flags *out, str *s, helper_a free(s_copy); } #ifdef WITH_TRANSCODING -static void call_ng_flags_str_ht_split(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_str_ht_split(sdp_ng_flags *out, str *s, helper_arg arg) { GHashTable **ht = arg.htp; if (!*ht) *ht = g_hash_table_new_full(str_case_hash, str_case_equal, free, free); @@ -947,7 +947,7 @@ static void call_ng_flags_str_ht_split(struct sdp_ng_flags *out, str *s, helper_ #endif struct sdp_attr_helper { - void (*fn)(struct sdp_ng_flags *out, str *s, helper_arg); + void (*fn)(sdp_ng_flags *out, str *s, helper_arg); size_t offset; }; @@ -964,7 +964,7 @@ static const struct sdp_attr_helper sdp_attr_helper_substitute = { .offset = G_STRUCT_OFFSET(struct sdp_manipulations, subst_commands), }; -static void call_ng_flags_sdp_attr_helper(struct sdp_ng_flags *out, str *s, helper_arg arg) { +static void call_ng_flags_sdp_attr_helper(sdp_ng_flags *out, str *s, helper_arg arg) { // get media type str token; if (str_token(&token, s, '-')) @@ -979,8 +979,8 @@ static void call_ng_flags_sdp_attr_helper(struct sdp_ng_flags *out, str *s, help } // helper to alias values from other dictionaries into the "flags" dictionary -INLINE int call_ng_flags_prefix(struct sdp_ng_flags *out, str *s_ori, const char *prefix, - void (*cb)(struct sdp_ng_flags *, str *, helper_arg), helper_arg arg) +INLINE int call_ng_flags_prefix(sdp_ng_flags *out, str *s_ori, const char *prefix, + void (*cb)(sdp_ng_flags *, str *, helper_arg), helper_arg arg) { size_t len = strlen(prefix); str s = *s_ori; @@ -990,7 +990,7 @@ INLINE int call_ng_flags_prefix(struct sdp_ng_flags *out, str *s_ori, const char cb(out, &s, arg); return 1; } -static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, helper_arg dummy) { +static void call_ng_flags_flags(sdp_ng_flags *out, str *s, helper_arg dummy) { str_hyphenate(s); switch (__csh_lookup(s)) { @@ -1234,7 +1234,7 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, helper_arg dum } } -void call_ng_flags_init(struct sdp_ng_flags *out, enum call_opmode opmode) { +void call_ng_flags_init(sdp_ng_flags *out, enum call_opmode opmode) { ZERO(*out); out->opmode = opmode; @@ -1249,8 +1249,8 @@ void call_ng_flags_init(struct sdp_ng_flags *out, enum call_opmode opmode) { out->frequencies = g_array_new(false, false, sizeof(int)); } -static void call_ng_dict_iter(struct sdp_ng_flags *out, bencode_item_t *input, - void (*callback)(struct sdp_ng_flags *, str *key, bencode_item_t *value)) +static void call_ng_dict_iter(sdp_ng_flags *out, bencode_item_t *input, + void (*callback)(sdp_ng_flags *, str *key, bencode_item_t *value)) { if (input->type != BENCODE_DICTIONARY) return; @@ -1269,7 +1269,7 @@ static void call_ng_dict_iter(struct sdp_ng_flags *out, bencode_item_t *input, } } -static void call_ng_codec_flags(struct sdp_ng_flags *out, str *key, bencode_item_t *value) { +static void call_ng_codec_flags(sdp_ng_flags *out, str *key, bencode_item_t *value) { switch (__csh_lookup(key)) { case CSH_LOOKUP("strip"): call_ng_flags_str_list(out, value, call_ng_flags_esc_str_list, &out->codec_strip); @@ -1348,7 +1348,7 @@ static void call_ng_parse_block_mode(str *s, enum block_dtmf_mode *output) { } #endif -static void call_ng_flags_freqs(struct sdp_ng_flags *out, bencode_item_t *value) { +static void call_ng_flags_freqs(sdp_ng_flags *out, bencode_item_t *value) { unsigned int val; switch (value->type) { @@ -1373,7 +1373,7 @@ static void call_ng_flags_freqs(struct sdp_ng_flags *out, bencode_item_t *value) } } -static void call_ng_main_flags(struct sdp_ng_flags *out, str *key, bencode_item_t *value) { +static void call_ng_main_flags(sdp_ng_flags *out, str *key, bencode_item_t *value) { str s = STR_NULL; bencode_item_t *it; @@ -1847,7 +1847,7 @@ static void call_ng_main_flags(struct sdp_ng_flags *out, str *key, bencode_item_ } } -static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *input, enum call_opmode opmode) { +static void call_ng_process_flags(sdp_ng_flags *out, bencode_item_t *input, enum call_opmode opmode) { call_ng_flags_init(out, opmode); call_ng_dict_iter(out, input, call_ng_main_flags); } @@ -1870,7 +1870,7 @@ static void ng_sdp_attr_manipulations_free(struct sdp_manipulations * array[__MT } } -void call_ng_free_flags(struct sdp_ng_flags *flags) { +void call_ng_free_flags(sdp_ng_flags *flags) { if (flags->codec_except) g_hash_table_destroy(flags->codec_except); if (flags->codec_set) @@ -1974,7 +1974,7 @@ static const char *call_offer_answer_ng(struct ng_buffer *ngbuf, bencode_item_t struct call *call; struct call_monologue * monologues[2]; int ret; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); struct sdp_chopper *chopper; call_ng_process_flags(&flags, input, opmode); @@ -2684,7 +2684,7 @@ const char *call_stop_recording_ng(bencode_item_t *input, bencode_item_t *output static const char *media_block_match1(struct call *call, struct call_monologue **monologue, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { if (flags->label.s) { *monologue = g_hash_table_lookup(call->labels, &flags->label); @@ -2726,7 +2726,7 @@ found: return NULL; } static const char *media_block_match(struct call **call, struct call_monologue **monologue, - struct sdp_ng_flags *flags, bencode_item_t *input, enum call_opmode opmode) + sdp_ng_flags *flags, bencode_item_t *input, enum call_opmode opmode) { *call = NULL; *monologue = NULL; @@ -2762,7 +2762,7 @@ void add_media_to_sub_list(GQueue *q, struct call_media *media, struct call_mono g_queue_push_tail(q, ms); } static const char *media_block_match_mult(struct call **call, GQueue *medias, - struct sdp_ng_flags *flags, bencode_item_t *input, enum call_opmode opmode) + sdp_ng_flags *flags, bencode_item_t *input, enum call_opmode opmode) { call_ng_process_flags(flags, input, opmode); @@ -2830,7 +2830,7 @@ const char *call_start_forwarding_ng(bencode_item_t *input, bencode_item_t *outp AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); struct call_monologue *monologue; const char *errstr = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); errstr = media_block_match(&call, &monologue, &flags, input, OP_OTHER); if (errstr) @@ -2859,7 +2859,7 @@ const char *call_stop_forwarding_ng(bencode_item_t *input, bencode_item_t *outpu AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); struct call_monologue *monologue; const char *errstr = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); errstr = media_block_match(&call, &monologue, &flags, input, OP_OTHER); if (errstr) @@ -2891,7 +2891,7 @@ const char *call_stop_forwarding_ng(bencode_item_t *input, bencode_item_t *outpu return NULL; } -static void call_monologue_set_block_mode(struct call_monologue *ml, struct sdp_ng_flags *flags) { +static void call_monologue_set_block_mode(struct call_monologue *ml, sdp_ng_flags *flags) { if (flags->delay_buffer >= 0) { for (unsigned int i = 0; i < ml->medias->len; i++) { struct call_media *media = ml->medias->pdata[i]; @@ -2938,7 +2938,7 @@ const char *call_block_dtmf_ng(bencode_item_t *input, bencode_item_t *output) { AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); struct call_monologue *monologue; const char *errstr = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); errstr = media_block_match(&call, &monologue, &flags, input, OP_OTHER); if (errstr) @@ -2979,7 +2979,7 @@ const char *call_unblock_dtmf_ng(bencode_item_t *input, bencode_item_t *output) AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); struct call_monologue *monologue; const char *errstr = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); errstr = media_block_match(&call, &monologue, &flags, input, OP_OTHER); if (errstr) @@ -3041,7 +3041,7 @@ static const char *call_block_silence_media(bencode_item_t *input, bool on_off, AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); struct call_monologue *monologue; const char *errstr = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); errstr = media_block_match(&call, &monologue, &flags, input, OP_OTHER); if (errstr) @@ -3191,7 +3191,7 @@ const char *call_unsilence_media_ng(bencode_item_t *input, bencode_item_t *outpu #ifdef WITH_TRANSCODING static const char *play_media_select_party(struct call **call, GQueue *monologues, - bencode_item_t *input, struct sdp_ng_flags *flags) + bencode_item_t *input, sdp_ng_flags *flags) { struct call_monologue *monologue; @@ -3216,7 +3216,7 @@ const char *call_play_media_ng(bencode_item_t *input, bencode_item_t *output) { AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); g_auto(GQueue) monologues; const char *err = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); err = play_media_select_party(&call, &monologues, input, &flags); if (err) @@ -3272,7 +3272,7 @@ const char *call_stop_media_ng(bencode_item_t *input, bencode_item_t *output) { g_auto(GQueue) monologues; const char *err = NULL; long long last_frame_pos = 0; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); err = play_media_select_party(&call, &monologues, input, &flags); if (err) @@ -3304,7 +3304,7 @@ const char *call_play_dtmf_ng(bencode_item_t *input, bencode_item_t *output) { AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); g_auto(GQueue) monologues; const char *err = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); err = play_media_select_party(&call, &monologues, input, &flags); if (err) @@ -3405,7 +3405,7 @@ const char *call_publish_ng(struct ng_buffer *ngbuf, bencode_item_t *input, benc const char *addr, const endpoint_t *sin) { - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); AUTO_CLEANUP(GQueue parsed, sdp_free) = G_QUEUE_INIT; AUTO_CLEANUP(GQueue streams, sdp_streams_free) = G_QUEUE_INIT; AUTO_CLEANUP(str sdp_in, str_free_dup) = STR_NULL; @@ -3461,7 +3461,7 @@ const char *call_publish_ng(struct ng_buffer *ngbuf, bencode_item_t *input, benc const char *call_subscribe_request_ng(bencode_item_t *input, bencode_item_t *output) { const char *err = NULL; - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); char rand_buf[65]; AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); AUTO_CLEANUP(GQueue srms, media_subscriptions_clear) = G_QUEUE_INIT; @@ -3594,7 +3594,7 @@ const char *call_subscribe_request_ng(bencode_item_t *input, bencode_item_t *out const char *call_subscribe_answer_ng(struct ng_buffer *ngbuf, bencode_item_t *input, bencode_item_t *output) { - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); AUTO_CLEANUP(GQueue parsed, sdp_free) = G_QUEUE_INIT; AUTO_CLEANUP(GQueue streams, sdp_streams_free) = G_QUEUE_INIT; AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); @@ -3636,7 +3636,7 @@ const char *call_subscribe_answer_ng(struct ng_buffer *ngbuf, bencode_item_t *in const char *call_unsubscribe_ng(bencode_item_t *input, bencode_item_t *output) { - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); call_ng_process_flags(&flags, input, OP_REQ_ANSWER); diff --git a/daemon/codec.c b/daemon/codec.c index 15b2430b9..2c5c0e8d3 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -808,7 +808,7 @@ static void __generator_stop_all(struct call_media *media) { audio_player_stop(media); } -static void __t38_options_from_flags(struct t38_options *t_opts, const struct sdp_ng_flags *flags) { +static void __t38_options_from_flags(struct t38_options *t_opts, const sdp_ng_flags *flags) { #define t38_opt(name) t_opts->name = flags ? flags->t38_ ## name : 0 t38_opt(no_ecm); t38_opt(no_v17); @@ -819,7 +819,7 @@ static void __t38_options_from_flags(struct t38_options *t_opts, const struct sd } static void __check_t38_gateway(struct call_media *pcm_media, struct call_media *t38_media, - const struct stream_params *sp, const struct sdp_ng_flags *flags) + const struct stream_params *sp, const sdp_ng_flags *flags) { struct t38_options t_opts = {0,}; @@ -866,7 +866,7 @@ static void __check_t38_gateway(struct call_media *pcm_media, struct call_media // call must be locked in W static int codec_handler_udptl_update(struct call_media *receiver, struct call_media *sink, - const struct sdp_ng_flags *flags) + const sdp_ng_flags *flags) { // anything to do? if (proto_is(sink->protocol, PROTO_UDPTL)) @@ -888,7 +888,7 @@ static int codec_handler_udptl_update(struct call_media *receiver, struct call_m // call must be locked in W // for transcoding RTP types to non-RTP static int codec_handler_non_rtp_update(struct call_media *receiver, struct call_media *sink, - const struct sdp_ng_flags *flags, const struct stream_params *sp) + const sdp_ng_flags *flags, const struct stream_params *sp) { if (proto_is(sink->protocol, PROTO_UDPTL) && !str_cmp(&sink->format_str, "t38")) { __check_t38_gateway(receiver, sink, sp, flags); @@ -4203,7 +4203,7 @@ void codec_update_all_handlers(struct call_monologue *ml) { dialogue_unconfirm(ml, "updating codec handlers"); } -void codec_update_all_source_handlers(struct call_monologue *ml, const struct sdp_ng_flags *flags) { +void codec_update_all_source_handlers(struct call_monologue *ml, const sdp_ng_flags *flags) { for (int i = 0; i < ml->medias->len; i++) { @@ -5310,7 +5310,7 @@ void codec_store_transcode(struct codec_store *cs, GQueue *offer, struct codec_s #endif } -void codec_store_answer(struct codec_store *dst, struct codec_store *src, struct sdp_ng_flags *flags) { +void codec_store_answer(struct codec_store *dst, struct codec_store *src, sdp_ng_flags *flags) { // retain existing setup for supplemental codecs, but start fresh otherwise struct codec_store orig_dst; codec_store_move(&orig_dst, dst); diff --git a/daemon/ice.c b/daemon/ice.c index bdde63425..a91e74a1b 100644 --- a/daemon/ice.c +++ b/daemon/ice.c @@ -47,7 +47,7 @@ struct sdp_fragment { struct ng_buffer *ngbuf; struct timeval received; GQueue streams; - struct sdp_ng_flags flags; + sdp_ng_flags flags; }; @@ -153,7 +153,7 @@ static void fragment_key_free(void *p) { g_free(k->from_tag.s); g_slice_free1(sizeof(*k), k); } -static void queue_sdp_fragment(struct ng_buffer *ngbuf, GQueue *streams, struct sdp_ng_flags *flags) { +static void queue_sdp_fragment(struct ng_buffer *ngbuf, GQueue *streams, sdp_ng_flags *flags) { ilog(LOG_DEBUG, "Queuing up SDP fragment for " STR_FORMAT_M "/" STR_FORMAT_M, STR_FMT_M(&flags->call_id), STR_FMT_M(&flags->from_tag)); @@ -174,7 +174,7 @@ static void queue_sdp_fragment(struct ng_buffer *ngbuf, GQueue *streams, struct g_queue_push_tail(frags, frag); mutex_unlock(&sdp_fragments_lock); } -bool trickle_ice_update(struct ng_buffer *ngbuf, struct call *call, struct sdp_ng_flags *flags, +bool trickle_ice_update(struct ng_buffer *ngbuf, struct call *call, sdp_ng_flags *flags, GQueue *streams) { if (!flags->fragment) diff --git a/daemon/janus.c b/daemon/janus.c index 0986a6707..71cc46e67 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -603,7 +603,7 @@ static const char *janus_videoroom_join(struct websocket_message *wm, struct jan struct call_monologue *dest_ml = janus_get_monologue(handle->id, call, call_get_or_create_monologue); - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); call_ng_flags_init(&flags, OP_REQUEST); flags.generate_mid = 1; @@ -843,7 +843,7 @@ static const char *janus_videoroom_configure(struct websocket_message *wm, struc AUTO_CLEANUP(str sdp_in, str_free_dup) = STR_INIT_DUP(jsep_sdp); - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); AUTO_CLEANUP(GQueue parsed, sdp_free) = G_QUEUE_INIT; AUTO_CLEANUP(GQueue streams, sdp_streams_free) = G_QUEUE_INIT; call_ng_flags_init(&flags, OP_PUBLISH); @@ -947,7 +947,7 @@ static const char *janus_videoroom_start(struct websocket_message *wm, struct ja AUTO_CLEANUP(str sdp_in, str_free_dup) = STR_INIT_DUP(jsep_sdp); - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); AUTO_CLEANUP(GQueue parsed, sdp_free) = G_QUEUE_INIT; AUTO_CLEANUP(GQueue streams, sdp_streams_free) = G_QUEUE_INIT; call_ng_flags_init(&flags, OP_PUBLISH); @@ -1619,7 +1619,7 @@ static const char *janus_trickle(JsonReader *reader, struct janus_session *sessi // top-level structures first, with auto cleanup AUTO_CLEANUP(GQueue streams, sdp_streams_free) = G_QUEUE_INIT; AUTO_CLEANUP(struct ng_buffer *ngbuf, ng_buffer_auto_release) = ng_buffer_new(NULL); - AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); + AUTO_CLEANUP(sdp_ng_flags flags, call_ng_free_flags); call_ng_flags_init(&flags, OP_OTHER); // then the contained structures, and add them in diff --git a/daemon/recording.c b/daemon/recording.c index d8f254381..54199543f 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -418,7 +418,7 @@ void recording_discard(struct call *call) { * * Returns a boolean for whether or not the call is being recorded. */ -void detect_setup_recording(struct call *call, const struct sdp_ng_flags *flags) { +void detect_setup_recording(struct call *call, const sdp_ng_flags *flags) { if (!flags) return; diff --git a/daemon/sdp.c b/daemon/sdp.c index 5b743256a..50992f0cf 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -361,9 +361,9 @@ static str *sdp_manipulations_subst(struct sdp_manipulations * sdp_manipulations } static void append_attr_to_gstring(GString *s, char * name, const str * value, - struct sdp_ng_flags *flags, enum media_type media_type); + sdp_ng_flags *flags, enum media_type media_type); static void append_attr_int_to_gstring(GString *s, char * value, const int * additional, - struct sdp_ng_flags *flags, enum media_type media_type); + sdp_ng_flags *flags, enum media_type media_type); INLINE struct sdp_attribute *attr_get_by_id(struct sdp_attributes *a, int id) { return g_hash_table_lookup(a->id_hash, &id); @@ -1211,7 +1211,7 @@ static int parse_attribute(struct sdp_attribute *a) { return ret; } -int sdp_parse(str *body, GQueue *sessions, const struct sdp_ng_flags *flags) { +int sdp_parse(str *body, GQueue *sessions, const sdp_ng_flags *flags) { char *b, *end, *value, *line_end, *next_line; struct sdp_session *session = NULL; struct sdp_media *media = NULL; @@ -1417,7 +1417,7 @@ void sdp_free(GQueue *sessions) { g_queue_clear_full(sessions, session_free); } -static int fill_endpoint(struct endpoint *ep, const struct sdp_media *media, struct sdp_ng_flags *flags, +static int fill_endpoint(struct endpoint *ep, const struct sdp_media *media, sdp_ng_flags *flags, struct network_address *address, long int port) { struct sdp_session *session = media->session; @@ -1670,7 +1670,7 @@ static void sp_free(void *p) { // lists to be matching. // returns: discard this `sp` yes/no static bool legacy_osrtp_accept(struct stream_params *sp, GQueue *streams, GList *media_link, - struct sdp_ng_flags *flags, unsigned int *num) + sdp_ng_flags *flags, unsigned int *num) { if (!streams->tail) return false; @@ -1739,7 +1739,7 @@ static bool legacy_osrtp_accept(struct stream_params *sp, GQueue *streams, GList } /* XXX split this function up */ -int sdp_streams(const GQueue *sessions, GQueue *streams, struct sdp_ng_flags *flags) { +int sdp_streams(const GQueue *sessions, GQueue *streams, sdp_ng_flags *flags) { struct sdp_session *session; struct sdp_media *media; struct stream_params *sp; @@ -2112,7 +2112,7 @@ static int replace_codec_list(struct sdp_chopper *chop, } static void insert_codec_parameters(GString *s, struct call_media *cm, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { for (GList *l = cm->codecs.codec_prefs.head; l; l = l->next) { @@ -2173,7 +2173,7 @@ static void insert_codec_parameters(GString *s, struct call_media *cm, } } -static void insert_sdp_attributes(GString *gs, struct call_media *cm, struct sdp_ng_flags *flags) { +static void insert_sdp_attributes(GString *gs, struct call_media *cm, sdp_ng_flags *flags) { for (GList *l = cm->sdp_attributes.head; l; l = l->next) { str *s = l->data; append_attr_to_gstring(gs, s->s, NULL, flags, cm->type_id); @@ -2242,7 +2242,7 @@ warn: return 0; } -static int insert_ice_address(GString *s, struct stream_fd *sfd, struct sdp_ng_flags *flags) { +static int insert_ice_address(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) { char buf[64]; int len; @@ -2257,7 +2257,7 @@ static int insert_ice_address(GString *s, struct stream_fd *sfd, struct sdp_ng_f return 0; } -static int insert_raddr_rport(GString *s, struct stream_fd *sfd, struct sdp_ng_flags *flags) { +static int insert_raddr_rport(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) { char buf[64]; int len; @@ -2276,7 +2276,7 @@ static int insert_raddr_rport(GString *s, struct stream_fd *sfd, struct sdp_ng_f static int replace_network_address(struct sdp_chopper *chop, struct network_address *address, - struct packet_stream *ps, struct sdp_ng_flags *flags, bool keep_unspec) + struct packet_stream *ps, sdp_ng_flags *flags, bool keep_unspec) { char buf[64]; int len; @@ -2335,7 +2335,7 @@ void sdp_chopper_destroy_ret(struct sdp_chopper *chop, str *ret) { /* processing existing session attributes (those present in offer/answer) */ static int process_session_attributes(struct sdp_chopper *chop, struct sdp_attributes *attrs, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { GList *l; struct sdp_attribute *attr; @@ -2428,7 +2428,7 @@ strip_with_subst: /* processing existing media attributes (those present in offer/answer) */ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media *sdp, - struct sdp_ng_flags *flags, struct call_media *media, bool strip_attr_other) + sdp_ng_flags *flags, struct call_media *media, bool strip_attr_other) { GList *l; struct sdp_attributes *attrs = &sdp->attributes; @@ -2625,7 +2625,7 @@ out: static void insert_candidate(GString *s, struct stream_fd *sfd, unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type, - struct sdp_ng_flags *flags, struct sdp_media *sdp_media) + sdp_ng_flags *flags, struct sdp_media *sdp_media) { unsigned long priority; struct packet_stream *ps = sfd->stream; @@ -2654,7 +2654,7 @@ static void insert_candidate(GString *s, struct stream_fd *sfd, static void insert_sfd_candidates(GString *s, struct packet_stream *ps, unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type, - struct sdp_ng_flags *flags, struct sdp_media *sdp_media) + sdp_ng_flags *flags, struct sdp_media *sdp_media) { GList *l; struct stream_fd *sfd; @@ -2669,7 +2669,7 @@ static void insert_sfd_candidates(GString *s, struct packet_stream *ps, } static void insert_candidates(GString *s, struct packet_stream *rtp, struct packet_stream *rtcp, - struct sdp_ng_flags *flags, struct sdp_media *sdp_media) + sdp_ng_flags *flags, struct sdp_media *sdp_media) { const struct local_intf *ifa; struct call_media *media; @@ -2730,7 +2730,7 @@ static void insert_candidates(GString *s, struct packet_stream *rtp, struct pack } static void insert_dtls(GString *s, struct call_media *media, struct dtls_connection *dtls, - struct sdp_ng_flags *flags) { + sdp_ng_flags *flags) { unsigned char *p; int i; const struct dtls_hash_func *hf; @@ -2807,7 +2807,7 @@ static void insert_dtls(GString *s, struct call_media *media, struct dtls_connec } static void insert_crypto1(GString *s, struct call_media *media, struct crypto_params_sdes *cps, - struct sdp_ng_flags *flags) + sdp_ng_flags *flags) { char b64_buf[((SRTP_MAX_MASTER_KEY_LEN + SRTP_MAX_MASTER_SALT_LEN) / 3 + 1) * 4 + 4]; char *p; @@ -2861,13 +2861,13 @@ static void insert_crypto1(GString *s, struct call_media *media, struct crypto_p g_string_free(s_dst, TRUE); } -static void insert_crypto(GString *s, struct call_media *media, struct sdp_ng_flags *flags) { +static void insert_crypto(GString *s, struct call_media *media, sdp_ng_flags *flags) { if (!media->protocol || !media->protocol->srtp) return; for (GList *l = media->sdes_out.head; l; l = l->next) insert_crypto1(s, media, l->data, flags); } -static void insert_rtcp_attr(GString *s, struct packet_stream *ps, struct sdp_ng_flags *flags, +static void insert_rtcp_attr(GString *s, struct packet_stream *ps, sdp_ng_flags *flags, struct sdp_media *sdp_media) { if (flags->no_rtcp_attr) return; @@ -2947,7 +2947,7 @@ const char *sdp_get_sendrecv(struct call_media *media) { /* A function used to append attributes to the output chop */ static void append_attr_to_gstring(GString *s, char * name, const str * value, - struct sdp_ng_flags *flags, enum media_type media_type) + sdp_ng_flags *flags, enum media_type media_type) { /* ignore `a=` if given in the name (required for a proper lookup) */ if (name[0] == 'a' && name[1] == '=') @@ -2982,7 +2982,7 @@ static void append_attr_to_gstring(GString *s, char * name, const str * value, /* A function used to append attributes to the output chop */ static void append_attr_int_to_gstring(GString *s, char * name, const int * value, - struct sdp_ng_flags *flags, enum media_type media_type) + sdp_ng_flags *flags, enum media_type media_type) { /* ignore `a=` if given in the name (required for a proper lookup) */ if (name[0] == 'a' && name[1] == '=') @@ -3016,7 +3016,7 @@ static void append_attr_int_to_gstring(GString *s, char * name, const int * valu } struct packet_stream *print_rtcp(GString *s, struct call_media *media, GList *rtp_ps_link, - struct sdp_ng_flags *flags, struct sdp_media *sdp_media) + sdp_ng_flags *flags, struct sdp_media *sdp_media) { struct packet_stream *ps = rtp_ps_link->data; struct packet_stream *ps_rtcp = NULL; @@ -3064,7 +3064,7 @@ void sdp_copy_session_attributes(struct call_monologue * src, struct call_monolo g_queue_push_tail(&dst->sdp_attributes, ret); } } -static void print_sdp_session_section(GString *s, struct sdp_ng_flags *flags, +static void print_sdp_session_section(GString *s, sdp_ng_flags *flags, struct call_media *call_media) { bool media_has_ice = MEDIA_ISSET(call_media, ICE); @@ -3079,7 +3079,7 @@ static void print_sdp_session_section(GString *s, struct sdp_ng_flags *flags, /* TODO: rework an appending of parameters in terms of sdp attribute manipulations */ static struct packet_stream *print_sdp_media_section(GString *s, struct call_media *media, struct sdp_media *sdp_media, - struct sdp_ng_flags *flags, + sdp_ng_flags *flags, GList *rtp_ps_link, bool is_active, bool force_end_of_ice, @@ -3142,7 +3142,7 @@ static struct packet_stream *print_sdp_media_section(GString *s, struct call_med static const char *replace_sdp_media_section(struct sdp_chopper *chop, struct call_media *call_media, - struct sdp_media *sdp_media, GList *rtp_ps_link, struct sdp_ng_flags *flags, + struct sdp_media *sdp_media, GList *rtp_ps_link, sdp_ng_flags *flags, const bool keep_zero_address, bool print_other_attrs) { const char *err = NULL; @@ -3206,7 +3206,7 @@ error: /* called with call->master_lock held in W */ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologue *monologue, - struct sdp_ng_flags *flags, bool print_other_attrs) + sdp_ng_flags *flags, bool print_other_attrs) { struct sdp_session *session; struct sdp_media *sdp_media; @@ -3418,7 +3418,7 @@ error: return -1; } -int sdp_create(str *out, struct call_monologue *monologue, struct sdp_ng_flags *flags, +int sdp_create(str *out, struct call_monologue *monologue, sdp_ng_flags *flags, bool print_other_sess_attrs, bool print_other_media_attrs) { const char *err = NULL; diff --git a/include/call.h b/include/call.h index 66e451e2e..173dffc7e 100644 --- a/include/call.h +++ b/include/call.h @@ -28,6 +28,7 @@ #include "codeclib.h" #include "t38.h" #include "xt_RTPENGINE.h" +#include "types.h" #define UNDEFINED ((unsigned int) -1) @@ -273,7 +274,6 @@ struct call; struct redis; struct crypto_suite; struct rtpengine_srtp; -struct sdp_ng_flags; struct local_interface; struct call_monologue; struct ice_agent; @@ -737,17 +737,17 @@ int call_get_mono_dialogue(struct call_monologue *monologues[2], struct call *ca struct call_monologue *call_get_monologue(struct call *call, const str *fromtag); struct call_monologue *call_get_or_create_monologue(struct call *call, const str *fromtag); struct call *call_get(const str *callid); -int monologue_offer_answer(struct call_monologue *monologues[2], GQueue *streams, struct sdp_ng_flags *flags); +int monologue_offer_answer(struct call_monologue *monologues[2], GQueue *streams, sdp_ng_flags *flags); __attribute__((nonnull(1, 2, 3))) void codecs_offer_answer(struct call_media *media, struct call_media *other_media, struct stream_params *sp, - struct sdp_ng_flags *flags); -int monologue_publish(struct call_monologue *ml, GQueue *streams, struct sdp_ng_flags *flags); -int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst, struct sdp_ng_flags *flags, + sdp_ng_flags *flags); +int monologue_publish(struct call_monologue *ml, GQueue *streams, sdp_ng_flags *flags); +int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst, sdp_ng_flags *flags, bool print_extra_sess_attrs); -int monologue_subscribe_answer(struct call_monologue *dst, struct sdp_ng_flags *flags, +int monologue_subscribe_answer(struct call_monologue *dst, sdp_ng_flags *flags, GQueue *streams, bool print_extra_sess_attrs); -int monologue_unsubscribe(struct call_monologue *dst, struct sdp_ng_flags *); +int monologue_unsubscribe(struct call_monologue *dst, sdp_ng_flags *); void monologue_destroy(struct call_monologue *ml); int call_delete_branch_by_id(const str *callid, const str *branch, const str *fromtag, const str *totag, bencode_item_t *output, int delete_delay); diff --git a/include/call_interfaces.h b/include/call_interfaces.h index ec62185b0..969d5d81c 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -9,6 +9,7 @@ #include "socket.h" #include "call.h" #include "sdp.h" +#include "types.h" struct call; struct call_stats; @@ -251,15 +252,15 @@ const char *call_unsubscribe_ng(bencode_item_t *, bencode_item_t *); void add_media_to_sub_list(GQueue *q, struct call_media *media, struct call_monologue *ml); void save_last_sdp(struct call_monologue *ml, str *sdp, GQueue *parsed, GQueue *streams); -void call_ng_flags_init(struct sdp_ng_flags *out, enum call_opmode opmode); -void call_ng_free_flags(struct sdp_ng_flags *flags); +void call_ng_flags_init(sdp_ng_flags *out, enum call_opmode opmode); +void call_ng_free_flags(sdp_ng_flags *flags); void call_unlock_release(struct call **c); int call_interfaces_init(void); void call_interfaces_free(void); void call_interfaces_timer(void); -INLINE struct sdp_manipulations *sdp_manipulations_get_by_id(struct sdp_ng_flags *f, enum media_type id) { +INLINE struct sdp_manipulations *sdp_manipulations_get_by_id(sdp_ng_flags *f, enum media_type id) { if (id < 0 || id >= G_N_ELEMENTS(f->sdp_manipulations)) return NULL; if (!f->sdp_manipulations[id]) @@ -267,7 +268,7 @@ INLINE struct sdp_manipulations *sdp_manipulations_get_by_id(struct sdp_ng_flags return f->sdp_manipulations[id]; } -INLINE struct sdp_manipulations *sdp_manipulations_get_by_name(struct sdp_ng_flags *f, const str *s) { +INLINE struct sdp_manipulations *sdp_manipulations_get_by_name(sdp_ng_flags *f, const str *s) { if (!str_cmp(s, "none") || !str_cmp(s, "global")) return sdp_manipulations_get_by_id(f, MT_UNKNOWN); enum media_type id = codec_get_type(s); diff --git a/include/codec.h b/include/codec.h index 996a745cf..bf214f681 100644 --- a/include/codec.h +++ b/include/codec.h @@ -10,13 +10,13 @@ #include "rtplib.h" #include "timerthread.h" #include "xt_RTPENGINE.h" +#include "types.h" struct call_media; struct codec_handler; struct media_packet; struct ssrc_hash; -struct sdp_ng_flags; struct codec_ssrc_handler; struct rtp_header; struct stream_params; @@ -109,7 +109,7 @@ struct codec_handler *codec_handler_make_media_player(const struct rtp_payload_t struct codec_handler *codec_handler_make_dummy(const struct rtp_payload_type *dst_pt, struct call_media *media); void codec_calc_jitter(struct ssrc_ctx *, unsigned long ts, unsigned int clockrate, const struct timeval *); void codec_update_all_handlers(struct call_monologue *ml); -void codec_update_all_source_handlers(struct call_monologue *ml, const struct sdp_ng_flags *flags); +void codec_update_all_source_handlers(struct call_monologue *ml, const sdp_ng_flags *flags); struct codec_store_args { GHashTable *codec_set; @@ -146,7 +146,7 @@ void codec_store_track(struct codec_store *, GQueue *); __attribute__((nonnull(1, 2, 3))) void codec_store_transcode(struct codec_store *, GQueue *, struct codec_store *); __attribute__((nonnull(1, 2, 3))) -void codec_store_answer(struct codec_store *dst, struct codec_store *src, struct sdp_ng_flags *flags); +void codec_store_answer(struct codec_store *dst, struct codec_store *src, sdp_ng_flags *flags); __attribute__((nonnull(1, 2))) void codec_store_synthesise(struct codec_store *dst, struct codec_store *opposite); __attribute__((nonnull(1, 2))) @@ -170,7 +170,7 @@ void payload_type_clear(struct rtp_payload_type *p); struct chu_args { - const struct sdp_ng_flags *flags; + const sdp_ng_flags *flags; const struct stream_params *sp; bool allow_asymmetric; bool reset_transcoding; diff --git a/include/ice.h b/include/ice.h index d73f7ad32..ec55d8866 100644 --- a/include/ice.h +++ b/include/ice.h @@ -14,6 +14,7 @@ #include "media_socket.h" #include "socket.h" #include "timerthread.h" +#include "types.h" @@ -68,7 +69,6 @@ struct stream_params; struct stun_attrs; struct ng_buffer; struct call_monologue; -struct sdp_ng_flags; @@ -171,7 +171,7 @@ int ice_response(struct stream_fd *, const endpoint_t *src, struct stun_attrs *attrs, void *transaction); void dequeue_sdp_fragments(struct call_monologue *); -bool trickle_ice_update(struct ng_buffer *ngbuf, struct call *call, struct sdp_ng_flags *flags, +bool trickle_ice_update(struct ng_buffer *ngbuf, struct call *call, sdp_ng_flags *flags, GQueue *streams); enum thread_looper_action ice_slow_timer(void); diff --git a/include/recording.h b/include/recording.h index ba16eee1c..5015797e0 100644 --- a/include/recording.h +++ b/include/recording.h @@ -15,6 +15,7 @@ #include "str.h" #include "helpers.h" #include "bencode.h" +#include "types.h" struct packet_stream; @@ -24,7 +25,6 @@ enum call_opmode; struct rtpengine_target_info; struct call_monologue; struct call_media; -struct sdp_ng_flags; struct recording_pcap { @@ -114,7 +114,7 @@ void recording_fs_free(void); * * Returns a boolean for whether or not the call is being recorded. */ -void detect_setup_recording(struct call *call, const struct sdp_ng_flags *flags); +void detect_setup_recording(struct call *call, const sdp_ng_flags *flags); void update_metadata_call(struct call *call, str *metadata); void update_metadata_monologue(struct call_monologue *ml, str *metadata); diff --git a/include/sdp.h b/include/sdp.h index 700c94bc1..6fd661d9a 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -29,14 +29,14 @@ extern const str rtpe_instance_id; void sdp_init(void); -int sdp_parse(str *body, GQueue *sessions, const struct sdp_ng_flags *); -int sdp_streams(const GQueue *sessions, GQueue *streams, struct sdp_ng_flags *); +int sdp_parse(str *body, GQueue *sessions, const sdp_ng_flags *); +int sdp_streams(const GQueue *sessions, GQueue *streams, sdp_ng_flags *); void sdp_streams_free(GQueue *); void sdp_free(GQueue *sessions); -int sdp_replace(struct sdp_chopper *, GQueue *, struct call_monologue *, struct sdp_ng_flags *, +int sdp_replace(struct sdp_chopper *, GQueue *, struct call_monologue *, sdp_ng_flags *, bool print_other_attrs); int sdp_is_duplicate(GQueue *sessions); -int sdp_create(str *out, struct call_monologue *, struct sdp_ng_flags *flags, +int sdp_create(str *out, struct call_monologue *, sdp_ng_flags *flags, bool print_other_sess_attrs, bool print_other_media_attrs); const char *sdp_get_sendrecv(struct call_media *media); diff --git a/include/types.h b/include/types.h new file mode 100644 index 000000000..b5fcc49c2 --- /dev/null +++ b/include/types.h @@ -0,0 +1,6 @@ +#ifndef __TYPES__H__ +#define __TYPES__H__ + +typedef struct sdp_ng_flags sdp_ng_flags; + +#endif diff --git a/t/test-transcode.c b/t/test-transcode.c index c041ba574..290ad84be 100644 --- a/t/test-transcode.c +++ b/t/test-transcode.c @@ -37,7 +37,7 @@ static GHashTable *rtp_seq_ht; static uint32_t ssrc_A; static uint32_t ssrc_B; static struct call call; -static struct sdp_ng_flags flags; +static sdp_ng_flags flags; static struct call_media *media_A; static struct call_media *media_B; struct call_monologue *ml_A;