72#define PDB_MAGIC 0x10101010
73#define PDB_NODE_MAGIC 0x01010101
95#define BTREE_MAGIC 0x10101010
96#define BTREE_NODE_MAGIC 0x01010101
110 if (node->
left != NULL) {
111 pdb_validate_node(node->
left, node);
113 if (node->
right != NULL) {
114 pdb_validate_node(node->
right, node);
124 if (t->
root != NULL) {
125 pdb_validate_node(t->
root, NULL);
127 assert(pdb_count == t->
count);
150 if (x->
right != NULL) {
155 while (y != NULL && x == y->
right) {
165 while (x != NULL &&
key != x->
key) {
195 }
else if (z->
key < y->
key) {
209 if (z->
left == NULL || z->
right == NULL) {
215 if (y->
left != NULL) {
246 struct pdb *db = malloc(
sizeof(
struct pdb));
258 struct pdb *db = *db_p;
261 if (db->
root != NULL) {
279 struct pdb_e *p = malloc(
sizeof(
struct pdb_e));
316 debug_msg(
"Unable to create database entry - ssrc %x\n",
ssrc);
373 free(
item->sdes_cname);
374 free(
item->sdes_name);
375 free(
item->sdes_email);
376 free(
item->sdes_phone);
377 free(
item->sdes_loc);
378 free(
item->sdes_tool);
379 free(
item->sdes_note);
380 if (
item->decoder_state_deleter &&
item->decoder_state) {
381 item->decoder_state_deleter(
item->decoder_state);
395 if (db->
root == NULL) {
#define debug_msg(...)
#define debug_msg(...) log_msg(LOG_LEVEL_DEBUG, "[pid/%d +%d %s] ", getpid(), LINE,...
void pbuf_destroy(struct pbuf *playout_buf)
struct pbuf * pbuf_init(volatile int *delay_ms)
void pdb_iter_done(pdb_iter_t *it)
struct pdb_e * pdb_iter_next(pdb_iter_t *it)
struct s_pdb_node pdb_node_t
static struct pdb_e * pdb_create_item(uint32_t ssrc, volatile int *delay_ms)
struct pdb_e * pdb_iter_init(struct pdb *db, pdb_iter_t *it)
static void pdb_validate(struct pdb *t)
static pdb_node_t * pdb_delete_node(struct pdb *tree, pdb_node_t *z)
struct pdb * pdb_init(volatile int *delay_ms)
int pdb_add(struct pdb *db, uint32_t ssrc)
void pdb_destroy_item(struct pdb_e *item)
static pdb_node_t * pdb_min(pdb_node_t *x)
void pdb_destroy(struct pdb **db_p)
static pdb_node_t * pdb_search(pdb_node_t *x, uint32_t key)
static pdb_node_t * pdb_successor(pdb_node_t *x)
static void pdb_insert_node(struct pdb *tree, pdb_node_t *z)
int pdb_remove(struct pdb *db, uint32_t ssrc, struct pdb_e **item)
struct pdb_e * pdb_get(struct pdb *db, uint32_t ssrc)
decoder_state_deleter_t decoder_state_deleter
decoder state deleter
void * decoder_state
state of decoder for participant
struct pbuf * playout_buffer
struct s_pdb_node * parent
struct s_pdb_node * right
struct tfrc * tfrc_init(time_ns_t curr_time)
void tfrc_done(struct tfrc *state)
static time_ns_t get_time_in_ns()