Browse Source

Merge branch 'master' of https://github.com/smititelu/rtpengine

Change-Id: Ib42cd413eea01b829922687a717f978813065a8a
pull/1026/head
Richard Fuchs 6 years ago
parent
commit
11bcdf60f5
17 changed files with 97 additions and 5 deletions
  1. +21
    -0
      daemon/call_interfaces.c
  2. +4
    -0
      daemon/ice.c
  3. +5
    -0
      daemon/jitter_buffer.c
  4. +15
    -5
      daemon/main.c
  5. +7
    -0
      daemon/media_player.c
  6. +20
    -0
      daemon/statistics.c
  7. +5
    -0
      daemon/timerthread.c
  8. +1
    -0
      include/call_interfaces.h
  9. +1
    -0
      include/ice.h
  10. +1
    -0
      include/jitter_buffer.h
  11. +1
    -0
      include/media_player.h
  12. +1
    -0
      include/statistics.h
  13. +1
    -0
      include/timerthread.h
  14. +6
    -0
      lib/codeclib.c
  15. +1
    -0
      lib/codeclib.h
  16. +6
    -0
      lib/loglib.c
  17. +1
    -0
      lib/loglib.h

+ 21
- 0
daemon/call_interfaces.c View File

@ -2102,6 +2102,27 @@ out:
#endif
}
void call_interfaces_free() {
if (info_re) {
pcre_free(info_re);
info_re = NULL;
}
if (streams_re) {
pcre_free(streams_re);
streams_re= NULL;
}
if (info_ree) {
pcre_free_study(info_ree);
info_ree = NULL;
}
if (streams_ree) {
pcre_free_study(streams_ree);
streams_ree = NULL;
}
}
int call_interfaces_init() {
const char *errptr;


+ 4
- 0
daemon/ice.c View File

@ -554,6 +554,10 @@ void ice_init(void) {
timerthread_init(&ice_agents_timer_thread, ice_agents_timer_run);
}
void ice_free(void) {
timerthread_free(&ice_agents_timer_thread);
}
static void __fail_pair(struct ice_candidate_pair *pair) {


+ 5
- 0
daemon/jitter_buffer.c View File

@ -23,6 +23,11 @@ void jitter_buffer_init(void) {
timerthread_init(&jitter_buffer_thread, timerthread_queue_run);
}
void jitter_buffer_init_free(void) {
ilog(LOG_DEBUG, "jitter_buffer_free");
timerthread_free(&jitter_buffer_thread);
}
static void jitter_buffer_flush(struct jitter_buffer *jb) {
mutex_unlock(&jb->lock);
timerthread_queue_flush_data(&jb->ttq);


+ 15
- 5
daemon/main.c View File

@ -960,16 +960,26 @@ int main(int argc, char **argv) {
ilog(LOG_INFO, "Version %s shutting down", RTPENGINE_VERSION);
unfill_initial_rtpe_cfg(&initial_rtpe_config);
call_free();
jitter_buffer_init_free();
media_player_free();
codeclib_free();
statistics_free();
call_interfaces_free();
interfaces_free();
ice_free();
dtls_cert_free();
redis_close(rtpe_redis);
redis_close(rtpe_redis_write);
redis_close(rtpe_redis_notify);
dtls_cert_free();
unfill_initial_rtpe_cfg(&initial_rtpe_config);
options_free();
call_free();
interfaces_free();
log_free();
obj_release(rtpe_cli);
obj_release(rtpe_udp);


+ 7
- 0
daemon/media_player.c View File

@ -753,6 +753,13 @@ void media_player_init(void) {
timerthread_init(&send_timer_thread, timerthread_queue_run);
}
void media_player_free(void) {
#ifdef WITH_TRANSCODING
timerthread_free(&media_player_thread);
#endif
timerthread_free(&send_timer_thread);
}
#ifdef WITH_TRANSCODING
void media_player_loop(void *p) {


+ 20
- 0
daemon/statistics.c View File

@ -634,6 +634,26 @@ void statistics_free_metrics(GQueue **q) {
*q = NULL;
}
void statistics_free() {
mutex_destroy(&rtpe_totalstats.total_average_lock);
mutex_destroy(&rtpe_totalstats_interval.total_average_lock);
mutex_destroy(&rtpe_totalstats_interval.managed_sess_lock);
mutex_destroy(&rtpe_totalstats_interval.total_calls_duration_lock);
mutex_destroy(&rtpe_totalstats_lastinterval_lock);
mutex_destroy(&rtpe_totalstats_interval.offer.lock);
mutex_destroy(&rtpe_totalstats_interval.answer.lock);
mutex_destroy(&rtpe_totalstats_interval.delete.lock);
mutex_destroy(&rtpe_totalstats_interval.offers_ps.lock);
mutex_destroy(&rtpe_totalstats_interval.answers_ps.lock);
mutex_destroy(&rtpe_totalstats_interval.deletes_ps.lock);
mutex_destroy(&rtpe_codec_stats_lock);
g_hash_table_destroy(rtpe_codec_stats);
}
void statistics_init() {
mutex_init(&rtpe_totalstats.total_average_lock);
mutex_init(&rtpe_totalstats_interval.total_average_lock);


+ 5
- 0
daemon/timerthread.c View File

@ -14,6 +14,11 @@ void timerthread_init(struct timerthread *tt, void (*func)(void *)) {
tt->func = func;
}
void timerthread_free(struct timerthread *tt) {
g_tree_destroy(tt->tree);
mutex_destroy(&tt->lock);
}
void timerthread_run(void *p) {
struct timerthread *tt = p;


+ 1
- 0
include/call_interfaces.h View File

@ -139,6 +139,7 @@ void ng_call_stats(struct call *call, const str *fromtag, const str *totag, benc
struct call_stats *totals);
int call_interfaces_init(void);
void call_interfaces_free(void);
#endif

+ 1
- 0
include/ice.h View File

@ -141,6 +141,7 @@ extern const char * const ice_type_strings[];
void ice_init(void);
void ice_free(void);
enum ice_candidate_type ice_candidate_type(const str *s);
int ice_has_related(enum ice_candidate_type);


+ 1
- 0
include/jitter_buffer.h View File

@ -42,6 +42,7 @@ struct jitter_buffer {
};
void jitter_buffer_init(void);
void jitter_buffer_init_free(void);
struct jitter_buffer *jitter_buffer_new(struct call *);
void jitter_buffer_free(struct jitter_buffer **);


+ 1
- 0
include/media_player.h View File

@ -87,6 +87,7 @@ void media_player_add_packet(struct media_player *mp, char *buf, size_t len,
long long us_dur, unsigned long long pts);
void media_player_init(void);
void media_player_free(void);
void media_player_loop(void *);
struct send_timer *send_timer_new(struct packet_stream *);


+ 1
- 0
include/statistics.h View File

@ -130,5 +130,6 @@ void statistics_free_metrics(GQueue **);
const char *statistics_ng(bencode_item_t *input, bencode_item_t *output);
void statistics_init(void);
void statistics_free(void);
#endif /* STATISTICS_H_ */

+ 1
- 0
include/timerthread.h View File

@ -41,6 +41,7 @@ struct timerthread_queue_entry {
void timerthread_init(struct timerthread *, void (*)(void *));
void timerthread_free(struct timerthread *);
void timerthread_run(void *);
void timerthread_obj_schedule_abs_nl(struct timerthread_obj *, const struct timeval *);


+ 6
- 0
lib/codeclib.c View File

@ -759,6 +759,12 @@ static void avc_def_init(codec_def_t *def) {
}
}
void codeclib_free(void) {
g_hash_table_destroy(codecs_ht);
g_hash_table_destroy(codecs_ht_by_av);
avformat_network_deinit();
}
void codeclib_init(int print) {
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all();


+ 1
- 0
lib/codeclib.h View File

@ -211,6 +211,7 @@ struct packet_sequencer_s {
void codeclib_init(int);
void codeclib_free(void);
const codec_def_t *codec_find(const str *name, enum media_type);


+ 6
- 0
lib/loglib.c View File

@ -230,6 +230,12 @@ void log_init(const char *handle) {
openlog(handle, LOG_PID | LOG_NDELAY, ilog_facility);
}
void log_free() {
g_hash_table_destroy(__log_limiter);
g_string_chunk_free(__log_limiter_strings);
pthread_mutex_destroy(&__log_limiter_lock);
}
int parse_log_facility(const char *name, int *dst) {
int i;
for (i = 0 ; _facilitynames[i].c_name; i++) {


+ 1
- 0
lib/loglib.h View File

@ -23,6 +23,7 @@ void print_available_log_facilities (void);
void log_to_stderr(int facility_priority, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
void log_init(const char *);
void log_free(void);
void __vpilog(int prio, const char *prefix, const char *fmt, va_list);
void __ilog_np(int prio, const char *format, ...) __attribute__ ((format (printf, 2, 3)));


Loading…
Cancel
Save