mirror of https://github.com/sipwise/rtpengine.git
Change-Id: Ib9b9f7d2a55920f99a5224c86a7e563d76a316e7mr26.1
parent
c05ba00dd3
commit
4cf920c19d
@ -1,7 +1,24 @@
|
||||
.PHONY: clean distclean
|
||||
export top_srcdir = ..
|
||||
|
||||
.DEFAULT:
|
||||
true
|
||||
include ../lib/deps.Makefile
|
||||
|
||||
clean distclean:
|
||||
rm -f *.strhash.*
|
||||
include ../lib/flags.Makefile
|
||||
|
||||
CFLAGS += $(CFLAGS_GLIB)
|
||||
CFLAGS += $(CFLAGS_JSON_GLIB)
|
||||
CFLAGS += $(CFLAGS_LIBPCRE)
|
||||
ifeq ($(with_transcoding),yes)
|
||||
CFLAGS += $(CFLAGS_OPUS)
|
||||
endif
|
||||
|
||||
SRCS = auxlib.c bencode.c bufferpool.c codeclib.strhash.c dtmflib.c
|
||||
SRCS += http.c loglib.c mix_buffer.c
|
||||
SRCS += netfilter_api.c oauth.c poller.c resample.c
|
||||
SRCS += rtplib.c s3utils.c socket.c
|
||||
SRCS += ssllib.c str.c streambuf.c uring.c
|
||||
|
||||
ASM = mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S mvr2s_x64_avx2.S mvr2s_x64_avx512.S
|
||||
|
||||
include common.Makefile
|
||||
|
||||
all: $(OBJS)
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
#ifndef _SSRCLIB_H_
|
||||
#define _SSRCLIB_H_
|
||||
|
||||
#include "obj.h"
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
|
||||
struct ssrc_entry {
|
||||
struct obj obj;
|
||||
GList link;
|
||||
mutex_t lock;
|
||||
uint32_t ssrc;
|
||||
};
|
||||
|
||||
typedef struct ssrc_entry *(*ssrc_create_func_t)(void *uptr);
|
||||
|
||||
struct ssrc_hash {
|
||||
GQueue nq;
|
||||
mutex_t lock;
|
||||
ssrc_create_func_t create_func;
|
||||
void *uptr;
|
||||
struct ssrc_entry *precreat; // next used entry
|
||||
unsigned int iters; // tracks changes
|
||||
};
|
||||
|
||||
void ssrc_hash_foreach(struct ssrc_hash *, void (*)(void *, void *), void *);
|
||||
void ssrc_hash_full_init(struct ssrc_hash *, ssrc_create_func_t, void *uptr); // pre-creates one object
|
||||
void ssrc_hash_full_fast_init(struct ssrc_hash *, ssrc_create_func_t, void *uptr); // doesn't pre-create object
|
||||
void ssrc_hash_destroy(struct ssrc_hash *);
|
||||
|
||||
void *get_ssrc_full(uint32_t, struct ssrc_hash *, bool *created); // creates new entry if not found
|
||||
INLINE void *get_ssrc(uint32_t ssrc, struct ssrc_hash *ht) {
|
||||
return get_ssrc_full(ssrc, ht, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Reference in new issue