Browse Source

MT#55283 distinguish transcoding PTs

PTs that were remembered from a previous handshake to save codec options
must be flagged as such so that they're not considered as having been
present in the current offer, so that they can be flagged as transcoding
PTs.

closes #1989

Change-Id: I19c2aff7e83ed338a81be99544645821165304cd
rfuchs/1989
Richard Fuchs 4 months ago
parent
commit
f2a9111fb6
2 changed files with 21 additions and 8 deletions
  1. +20
    -8
      daemon/codec.c
  2. +1
    -0
      lib/rtplib.h

+ 20
- 8
daemon/codec.c View File

@ -5669,14 +5669,16 @@ void __codec_store_populate_reuse(struct codec_store *dst, struct codec_store *s
rtp_payload_type *pt = l->data;
rtp_payload_type *orig_pt = t_hash_table_lookup(src->codecs,
GINT_TO_POINTER(pt->payload_type));
if(!orig_pt){
if (a.merge_cs)
if (!orig_pt){
if (a.merge_cs) {
pt->removed = 1;
codec_store_add_raw_link(src, rtp_payload_type_dup(pt),
src->codec_prefs.head);
}
l = __codec_store_delete_link(l, dst);
}else{
l = l->next;
}
else
l = l->next;
}
}
@ -5705,6 +5707,7 @@ static void codec_store_merge(struct codec_store *dst, struct codec_store *src)
if (old_pt)
__codec_store_delete_link(old_pt->prefs_link, dst);
pt->removed = 1;
codec_store_add_raw_link(dst, pt, dst->codec_prefs.head);
}
@ -6116,10 +6119,19 @@ void codec_store_transcode(struct codec_store *cs, str_q *offer, struct codec_st
STR_FMT(codec));
continue;
}
ilogs(codec, LOG_DEBUG, "Re-adding stripped codec " STR_FORMAT "/" STR_FORMAT " (%i)",
STR_FMT(&orig_pt->encoding_with_params),
STR_FMT0(&orig_pt->format_parameters),
orig_pt->payload_type);
if (orig_pt->removed) {
ilogs(codec, LOG_DEBUG, "Adding previously present codec "
STR_FORMAT "/" STR_FORMAT " (%i) for transcoding",
STR_FMT(&orig_pt->encoding_with_params),
STR_FMT0(&orig_pt->format_parameters),
orig_pt->payload_type);
orig_pt->for_transcoding = 1;
}
else
ilogs(codec, LOG_DEBUG, "Re-adding stripped codec " STR_FORMAT "/" STR_FORMAT " (%i)",
STR_FMT(&orig_pt->encoding_with_params),
STR_FMT0(&orig_pt->format_parameters),
orig_pt->payload_type);
codec_touched(cs, orig_pt);
codec_store_add_order(cs, orig_pt);
}


+ 1
- 0
lib/rtplib.h View File

@ -118,6 +118,7 @@ struct rtp_payload_type {
unsigned int for_transcoding:1;
unsigned int accepted:1;
unsigned int removed:1;
};


Loading…
Cancel
Save