Browse Source

MT#55283 sequencer cache

Change-Id: Ie5903be9b202507f84eba6a000abab812a577c90
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
ac2d404904
2 changed files with 11 additions and 1 deletions
  1. +9
    -1
      daemon/codec.c
  2. +2
    -0
      include/ssrc.h

+ 9
- 1
daemon/codec.c View File

@ -739,6 +739,8 @@ static void __reset_sequencer(void *p, void *dummy) {
if (s->sequencers)
g_hash_table_destroy(s->sequencers);
s->sequencers = NULL;
s->media_cache = NULL;
s->sequencer_cache = NULL;
}
static bool __make_transcoder_full(struct codec_handler *handler, rtp_payload_type *dest,
GHashTable *output_transcoders, int dtmf_payload_type, bool pcm_dtmf_detect,
@ -2200,11 +2202,17 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
// get sequencer appropriate for our output
if (!ssrc_in->sequencers)
ssrc_in->sequencers = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, __seq_free);
packet_sequencer_t *seq = g_hash_table_lookup(ssrc_in->sequencers, mp->media_out);
packet_sequencer_t *seq;
if (mp->media_out == ssrc_in->media_cache)
seq = ssrc_in->sequencer_cache;
else
seq = g_hash_table_lookup(ssrc_in->sequencers, mp->media_out);
if (!seq) {
seq = g_new0(__typeof(*seq), 1);
packet_sequencer_init(seq, (GDestroyNotify) __transcode_packet_free);
g_hash_table_insert(ssrc_in->sequencers, mp->media_out, seq);
ssrc_in->media_cache = mp->media_out;
ssrc_in->sequencer_cache = seq;
// this is a quick fix to restore sequencer values until upper layer behavior will be fixed
unsigned int stats_ext_seq = atomic_get_na(&ssrc_in->stats->ext_seq);
if(stats_ext_seq) {


+ 2
- 0
include/ssrc.h View File

@ -99,6 +99,8 @@ struct ssrc_entry_call {
// for transcoding
// input only
GHashTable *sequencers;
packet_sequencer_t *sequencer_cache; // to skip hash lookup
struct call_media *media_cache; // to skip hash lookup
uint32_t jitter, transit;
// output only
uint16_t seq_diff;


Loading…
Cancel
Save