TT#98901 add codec timers thread

Change-Id: If50d2d42ce918961588dfc79793a26ba15416991
pull/1116/head
Richard Fuchs 5 years ago
parent 58c436e5a7
commit fa64e2261e

@ -14,6 +14,7 @@
#include "dtmflib.h"
#include "t38.h"
#include "media_player.h"
#include "timerthread.h"
@ -108,6 +109,10 @@ struct codec_tracker {
};
static struct timerthread codec_timers_thread;
static codec_handler_func handler_func_passthrough_ssrc;
static codec_handler_func handler_func_transcode;
static codec_handler_func handler_func_playback;
@ -2766,3 +2771,20 @@ void codec_rtp_payload_types(struct call_media *media, struct call_media *other_
g_hash_table_destroy(stripped);
g_hash_table_destroy(masked);
}
void codecs_init(void) {
#ifdef WITH_TRANSCODING
timerthread_init(&codec_timers_thread, timerthread_queue_run);
#endif
}
void codecs_cleanup(void) {
#ifdef WITH_TRANSCODING
timerthread_free(&codec_timers_thread);
#endif
}
void codec_timers_loop(void *p) {
#ifdef WITH_TRANSCODING
ilog(LOG_DEBUG, "codec_timers_loop");
timerthread_run(&codec_timers_thread);
#endif
}

@ -48,6 +48,7 @@
#include "dtmf.h"
#include "jitter_buffer.h"
#include "websocket.h"
#include "codec.h"
@ -840,6 +841,7 @@ static void init_everything(void) {
dtmf_init();
jitter_buffer_init();
t38_init();
codecs_init();
}
@ -1025,6 +1027,7 @@ int main(int argc, char **argv) {
if (rtpe_config.jb_length > 0)
thread_create_detach_prio(jitter_buffer_loop, NULL, rtpe_config.scheduling,
rtpe_config.priority);
thread_create_detach_prio(codec_timers_loop, NULL, rtpe_config.scheduling, rtpe_config.priority);
}
@ -1071,6 +1074,7 @@ int main(int argc, char **argv) {
ice_free();
dtls_cert_free();
control_ng_cleanup();
codecs_cleanup();
redis_close(rtpe_redis);
if (rtpe_redis_write != rtpe_redis)

@ -61,6 +61,10 @@ struct codec_packet {
};
void codecs_init(void);
void codecs_cleanup(void);
void codec_timers_loop(void *);
struct codec_handler *codec_handler_get(struct call_media *, int payload_type);
void codec_handlers_free(struct call_media *);
struct codec_handler *codec_handler_make_playback(const struct rtp_payload_type *src_pt,

Loading…
Cancel
Save