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
(cherry picked from commit f2a9111fb6)
(cherry picked from commit 1926a0c398)
mr13.4.1
Richard Fuchs 5 months ago
parent bfff7bc7c4
commit 45111b7fa3

@ -5656,14 +5656,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;
}
}
@ -5692,6 +5694,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);
}
@ -6095,10 +6098,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);
}

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

Loading…
Cancel
Save