MT#55283 annotate functions & const qualify

Change-Id: I7b6a47c01765a8021bd811e311c9901f075d67c6
pull/2090/head
Richard Fuchs 4 weeks ago
parent e59ee48a06
commit c17a48d5e8

@ -5835,8 +5835,8 @@ void codec_store_copy(struct codec_store *dst, struct codec_store *src) {
#endif
}
void codec_store_strip(struct codec_store *cs, str_q *strip, str_case_ht except) {
for (__auto_type l = strip->head; l; l = l->next) {
void codec_store_strip(struct codec_store *cs, const str_q *strip, str_case_ht except) {
for (auto_iter(l, strip->head); l; l = l->next) {
str *codec = l->data;
if (!str_cmp(codec, "all") || !str_cmp(codec, "full")) {
if (!str_cmp(codec, "all"))
@ -5897,10 +5897,10 @@ void codec_store_strip(struct codec_store *cs, str_q *strip, str_case_ht except)
}
}
void codec_store_offer(struct codec_store *cs, str_q *offer, struct codec_store *orig) {
void codec_store_offer(struct codec_store *cs, const str_q *offer, struct codec_store *orig) {
// restore stripped codecs in order: codecs must be present in `orig` but not present
// in `cs`
for (__auto_type l = offer->head; l; l = l->next) {
for (auto_iter(l, offer->head); l; l = l->next) {
str *codec = l->data;
GQueue *pts = t_hash_table_lookup(cs->codec_names, codec);
if (pts && pts->length) {
@ -5940,9 +5940,9 @@ void codec_store_offer(struct codec_store *cs, str_q *offer, struct codec_store
}
}
void codec_store_accept(struct codec_store *cs, str_q *accept, struct codec_store *orig) {
void codec_store_accept(struct codec_store *cs, const str_q *accept, struct codec_store *orig) {
// mark codecs as `for transcoding`
for (__auto_type l = accept->head; l; l = l->next) {
for (auto_iter(l, accept->head); l; l = l->next) {
str *codec = l->data;
g_auto(rtp_pt_q) pts_matched = TYPED_GQUEUE_INIT;
@ -6010,13 +6010,13 @@ void codec_store_accept(struct codec_store *cs, str_q *accept, struct codec_stor
}
}
int codec_store_accept_one(struct codec_store *cs, str_q *accept, bool accept_any) {
int codec_store_accept_one(struct codec_store *cs, const str_q *accept, bool accept_any) {
// local codec-accept routine: accept first supported codec, or first from "accept" list
// if given
rtp_payload_type *accept_pt = NULL;
for (__auto_type l = accept->head; l; l = l->next) {
for (auto_iter(l, accept->head); l; l = l->next) {
// iterate through list and look for the first supported codec
str *codec = l->data;
if (!str_cmp(codec, "any")) {
@ -6074,10 +6074,10 @@ int codec_store_accept_one(struct codec_store *cs, str_q *accept, bool accept_an
return 0;
}
void codec_store_track(struct codec_store *cs, str_q *q) {
void codec_store_track(struct codec_store *cs, const str_q *q) {
#ifdef WITH_TRANSCODING
// just track all codecs from the list as "touched"
for (__auto_type l = q->head; l; l = l->next) {
for (auto_iter(l, q->head); l; l = l->next) {
str *codec = l->data;
if (!str_cmp(codec, "all") || !str_cmp(codec, "full")) {
cs->tracker->all_touched = 1;
@ -6096,7 +6096,7 @@ void codec_store_track(struct codec_store *cs, str_q *q) {
#endif
}
void codec_store_transcode(struct codec_store *cs, str_q *offer, struct codec_store *orig) {
void codec_store_transcode(struct codec_store *cs, const str_q *offer, struct codec_store *orig) {
#ifdef WITH_TRANSCODING
// special case of codec_store_offer(): synthesise codecs that were not already present
for (__auto_type l = offer->head; l; l = l->next) {

@ -891,16 +891,21 @@ int monologue_offer_answer(struct call_monologue *monologues[2], sdp_streams_q *
__attribute__((nonnull(1, 2, 3, 4)))
void codecs_offer_answer(struct call_media *media, struct call_media *other_media,
struct stream_params *sp, sdp_ng_flags *flags);
__attribute__((nonnull(1, 2, 3)))
int monologue_publish(struct call_monologue *ml, sdp_streams_q *streams, sdp_ng_flags *flags);
__attribute__((nonnull(1, 2, 3)))
int monologue_subscribe_request(const subscription_q *srms, struct call_monologue *dst, sdp_ng_flags *flags);
__attribute__((nonnull(1, 2, 3)))
int monologue_subscribe_answer(struct call_monologue *dst, sdp_ng_flags *flags,
sdp_streams_q *streams);
__attribute__((nonnull(1, 2)))
int monologue_unsubscribe(struct call_monologue *dst, sdp_ng_flags *);
int monologue_inject_start(struct call_monologue *src, struct call_monologue *dst,
sdp_ng_flags *flags);
int monologue_inject_stop(struct call_monologue *src, struct call_monologue *dst,
sdp_ng_flags *flags);
void dialogue_connect(struct call_monologue *, struct call_monologue *, sdp_ng_flags *);
__attribute__((nonnull(1, 2, 3)))
bool monologue_transform(struct call_monologue *, sdp_ng_flags *, medias_q *);
void monologue_destroy(struct call_monologue *ml);
int call_delete_branch_by_id(const str *callid, const str *branch,

@ -183,19 +183,19 @@ __attribute__((nonnull(1, 2)))
void codec_store_copy(struct codec_store *, struct codec_store *);
void codec_store_add_raw(struct codec_store *cs, rtp_payload_type *pt);
__attribute__((nonnull(1, 2)))
void codec_store_strip(struct codec_store *, str_q *strip, str_case_ht except);
void codec_store_strip(struct codec_store *, const str_q *strip, str_case_ht except);
__attribute__((nonnull(1, 2, 3)))
void codec_store_offer(struct codec_store *, str_q *, struct codec_store *);
void codec_store_offer(struct codec_store *, const str_q *, struct codec_store *);
__attribute__((nonnull(1, 2, 3)))
void codec_store_check_empty(struct codec_store *, struct codec_store *, sdp_ng_flags *);
__attribute__((nonnull(1, 2)))
void codec_store_accept(struct codec_store *, str_q *, struct codec_store *);
void codec_store_accept(struct codec_store *, const str_q *, struct codec_store *);
__attribute__((nonnull(1, 2)))
int codec_store_accept_one(struct codec_store *, str_q *, bool accept_any);
int codec_store_accept_one(struct codec_store *, const str_q *, bool accept_any);
__attribute__((nonnull(1, 2)))
void codec_store_track(struct codec_store *, str_q *);
void codec_store_track(struct codec_store *, const str_q *);
__attribute__((nonnull(1, 2, 3)))
void codec_store_transcode(struct codec_store *, str_q *, struct codec_store *);
void codec_store_transcode(struct codec_store *, const str_q *, struct codec_store *);
__attribute__((nonnull(1, 2, 3)))
void __codec_store_answer(struct codec_store *dst, struct codec_store *src, sdp_ng_flags *flags,
struct codec_store_args);

Loading…
Cancel
Save