root/rat/trunk/pdb.h @ 3078

Revision 3078, 3.6 KB (checked in by ucacoxh, 15 years ago)

- Added Id strings to all c file.
- Replaced $Date$ and $Revision$ with $Id$ in headers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * FILE:    pdb.h
3 * PROGRAM: RAT
4 * AUTHOR:  O.Hodson
5 *
6 * Copyright (c) 1999-2000 University College London
7 * All rights reserved.
8 *
9 * These functions provide a means of maintaining persistent
10 * information on conference participants that is not contained in the
11 * RTCP database.  Entries are stored in a binary table, identified with
12 * a unique 32 bit unsigned identifer (probably the same as SSRC).
13 *
14 * $Id$
15 */
16
17#ifndef __PERSIST_DB_H__
18#define __PERSIST_DB_H__
19
20/* RAT specific includes for entries in pdb_entry_t */
21#include "channel_types.h"
22#include "codec_types.h"
23#include "timers.h"
24#include "ts.h"
25#include "render_3D.h"
26
27typedef struct s_pdb pdb_t;
28 
29typedef struct {
30        uint32_t        ssrc;                        /* Unique Id */
31        u_char          first_mix:1;
32        struct s_render_3D_dbentry  *render_3D_data; /* Participant 3d state */
33        double          gain;                        /* Participant gain */
34        u_char          mute:1;                      /* source muted */
35        struct s_time  *clock;
36        uint16_t        units_per_packet;
37        uint16_t        inter_pkt_gap;               /* expected time between pkt arrivals */
38        ts_t            frame_dur;
39        u_char          enc;
40        char*           enc_fmt;
41        int             enc_fmt_len;
42        uint32_t        last_ts;
43        uint32_t        last_seq;
44        ts_t            last_arr;                    /* ts_t representation of last_ts */
45
46        /* Playout info */
47        ts_t            jitter;
48        ts_t            transit;
49        ts_t            last_transit;
50        ts_t            last_last_transit;
51        ts_t            avg_transit;
52        cc_id_t         channel_coder_id;            /* channel_coder of last received packet    */
53        ts_t            last_mixed;                  /* Used to check mixing                     */
54        ts_t            playout;                     /* Playout delay for this talkspurt         */
55        ts_sequencer    seq;                         /* Mapper from RTP time rep to rat time rep */
56        uint32_t        spike_events;                /* Number of spike events                   */
57        uint32_t        spike_toged;                 /* Number of packets dropped in spike mode  */
58        /* Display Info */
59        ts_t            last_ui_update;              /* Used for periodic update of packet counts, etc */
60
61        /* Packet info */
62        uint32_t        received;
63        uint32_t        duplicates;
64        uint32_t        misordered;
65        uint32_t        jit_toged;                   /* Packets discarded because late ("Thrown on ground") */
66
67        uint32_t        magic;  /* For debugging */
68} pdb_entry_t;
69
70/* Functions for creating and destroying persistent database.  Return
71 * TRUE on success and fill in p accordingly, FALSE on failure.  */
72
73int pdb_create  (pdb_t **p);
74int pdb_destroy (pdb_t **p);
75
76/* pdb_get_{first,next}_id attempt to get keys from database.  Return
77 * TRUE on succes and fill in id.  FALSE on failure.  */
78
79int pdb_get_first_id (pdb_t *p, uint32_t *id);
80
81int pdb_get_next_id  (pdb_t *p, uint32_t cur_id, uint32_t *next_id);
82
83/* Functions for manipulating persistent database items. id is key in
84 * database and must be unique. */
85
86int     pdb_item_get     (pdb_t *p, uint32_t id, pdb_entry_t **item);
87
88int     pdb_item_create  (pdb_t *p,
89                          struct s_fast_time *clock,
90                          uint16_t freq,
91                          uint32_t id);
92
93int     pdb_item_destroy (pdb_t *p, uint32_t id);
94void    pdb_item_validate(pdb_entry_t *item);
95
96uint32_t pdb_item_count   (pdb_t *p);
97
98#endif /* __PERSIST_DB_H__ */
Note: See TracBrowser for help on using the browser.