Browse Source

MT#55283 annotate codec_store functions

Change-Id: If0690f5ddba23c6e1c4e7a2dd72bd25d8557e114
pull/1759/head
Richard Fuchs 2 years ago
parent
commit
61ce4ca5db
2 changed files with 21 additions and 2 deletions
  1. +6
    -2
      daemon/codec.c
  2. +15
    -0
      include/codec.h

+ 6
- 2
daemon/codec.c View File

@ -4746,6 +4746,7 @@ static void codec_store_find_matching_codecs(GQueue *out_compat, struct rtp_payl
} }
} }
__attribute__((nonnull(1, 2)))
static void codec_store_add_raw_link(struct codec_store *cs, struct rtp_payload_type *pt, GList *link) { static void codec_store_add_raw_link(struct codec_store *cs, struct rtp_payload_type *pt, GList *link) {
// cs->media may be NULL // cs->media may be NULL
ensure_codec_def(pt, cs->media); ensure_codec_def(pt, cs->media);
@ -4768,14 +4769,17 @@ static void codec_store_add_raw_link(struct codec_store *cs, struct rtp_payload_
} }
// appends to the end, but before supplemental codecs // appends to the end, but before supplemental codecs
__attribute__((nonnull(1, 2)))
static void codec_store_add_raw_order(struct codec_store *cs, struct rtp_payload_type *pt) { static void codec_store_add_raw_order(struct codec_store *cs, struct rtp_payload_type *pt) {
codec_store_add_raw_link(cs, pt, cs->supp_link); codec_store_add_raw_link(cs, pt, cs->supp_link);
} }
// appends to the end // appends to the end
__attribute__((nonnull(1, 2)))
void codec_store_add_raw(struct codec_store *cs, struct rtp_payload_type *pt) { void codec_store_add_raw(struct codec_store *cs, struct rtp_payload_type *pt) {
codec_store_add_raw_link(cs, pt, NULL); codec_store_add_raw_link(cs, pt, NULL);
} }
__attribute__((nonnull(1, 2)))
static struct rtp_payload_type *codec_store_add_link(struct codec_store *cs, static struct rtp_payload_type *codec_store_add_link(struct codec_store *cs,
struct rtp_payload_type *pt, GList *link) struct rtp_payload_type *pt, GList *link)
{ {
@ -5065,7 +5069,7 @@ int codec_store_accept_one(struct codec_store *cs, GQueue *accept, bool accept_a
struct rtp_payload_type *accept_pt = NULL; struct rtp_payload_type *accept_pt = NULL;
for (GList *l = accept ? accept->head : NULL; l; l = l->next) {
for (GList *l = accept->head; l; l = l->next) {
// iterate through list and look for the first supported codec // iterate through list and look for the first supported codec
str *codec = l->data; str *codec = l->data;
if (!str_cmp(codec, "any")) { if (!str_cmp(codec, "any")) {
@ -5234,7 +5238,7 @@ void codec_store_answer(struct codec_store *dst, struct codec_store *src, struct
// populate dst via output PTs from src's codec handlers // populate dst via output PTs from src's codec handlers
for (GList *l = src->codec_prefs.head; l; l = l->next) { for (GList *l = src->codec_prefs.head; l; l = l->next) {
bool add_codec = true; bool add_codec = true;
if (flags && flags->single_codec && num_codecs >= 1)
if (flags->single_codec && num_codecs >= 1)
add_codec = false; add_codec = false;
struct rtp_payload_type *pt = l->data; struct rtp_payload_type *pt = l->data;


+ 15
- 0
include/codec.h View File

@ -116,24 +116,39 @@ struct codec_store_args {
bool answer_only; bool answer_only;
}; };
__attribute__((nonnull(1)))
void codec_store_cleanup(struct codec_store *cs); void codec_store_cleanup(struct codec_store *cs);
__attribute__((nonnull(1)))
void codec_store_init(struct codec_store *cs, struct call_media *); void codec_store_init(struct codec_store *cs, struct call_media *);
__attribute__((nonnull(1, 2)))
void __codec_store_populate(struct codec_store *dst, struct codec_store *src, struct codec_store_args); void __codec_store_populate(struct codec_store *dst, struct codec_store *src, struct codec_store_args);
#define codec_store_populate(dst, src, ...) \ #define codec_store_populate(dst, src, ...) \
__codec_store_populate(dst, src, (struct codec_store_args) {__VA_ARGS__}) __codec_store_populate(dst, src, (struct codec_store_args) {__VA_ARGS__})
__attribute__((nonnull(1, 2)))
void __codec_store_populate_reuse(struct codec_store *, struct codec_store *, struct codec_store_args); void __codec_store_populate_reuse(struct codec_store *, struct codec_store *, struct codec_store_args);
#define codec_store_populate_reuse(dst, src, ...) \ #define codec_store_populate_reuse(dst, src, ...) \
__codec_store_populate_reuse(dst, src, (struct codec_store_args) {__VA_ARGS__}) __codec_store_populate_reuse(dst, src, (struct codec_store_args) {__VA_ARGS__})
__attribute__((nonnull(1, 2)))
void codec_store_add_raw(struct codec_store *cs, struct rtp_payload_type *pt); void codec_store_add_raw(struct codec_store *cs, struct rtp_payload_type *pt);
__attribute__((nonnull(1, 2)))
void codec_store_strip(struct codec_store *, GQueue *strip, GHashTable *except); void codec_store_strip(struct codec_store *, GQueue *strip, GHashTable *except);
__attribute__((nonnull(1, 2, 3)))
void codec_store_offer(struct codec_store *, GQueue *, struct codec_store *); void codec_store_offer(struct codec_store *, GQueue *, struct codec_store *);
__attribute__((nonnull(1, 2)))
void codec_store_check_empty(struct codec_store *, struct codec_store *); void codec_store_check_empty(struct codec_store *, struct codec_store *);
__attribute__((nonnull(1, 2)))
void codec_store_accept(struct codec_store *, GQueue *, struct codec_store *); void codec_store_accept(struct codec_store *, GQueue *, struct codec_store *);
__attribute__((nonnull(1, 2)))
int codec_store_accept_one(struct codec_store *, GQueue *, bool accept_any); int codec_store_accept_one(struct codec_store *, GQueue *, bool accept_any);
__attribute__((nonnull(1, 2)))
void codec_store_track(struct codec_store *, GQueue *); void codec_store_track(struct codec_store *, GQueue *);
__attribute__((nonnull(1, 2, 3)))
void codec_store_transcode(struct codec_store *, GQueue *, struct codec_store *); 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, struct sdp_ng_flags *flags);
__attribute__((nonnull(1, 2)))
void codec_store_synthesise(struct codec_store *dst, struct codec_store *opposite); void codec_store_synthesise(struct codec_store *dst, struct codec_store *opposite);
__attribute__((nonnull(1, 2)))
bool codec_store_is_full_answer(const struct codec_store *src, const struct codec_store *dst); bool codec_store_is_full_answer(const struct codec_store *src, const struct codec_store *dst);
void codec_add_raw_packet(struct media_packet *mp, unsigned int clockrate); void codec_add_raw_packet(struct media_packet *mp, unsigned int clockrate);


Loading…
Cancel
Save