root/rat/trunk/pdb.h @ 3969

Revision 3969, 3.7 KB (checked in by piers, 7 years ago)

Updates for to bring the code into line with AG sources
- Site app extension
- Per participant volume sliders
- Added a new card defination to auddev_oss

  • 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-2001 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 "ts.h"
24#include "render_3D.h"
25
26typedef struct s_pdb pdb_t;
27
28typedef struct {
29        uint32_t        ssrc;                        /* Unique Id */
30        u_char          first_mix:1;
31        struct s_render_3D_dbentry  *render_3D_data; /* Participant 3d state */
32        double          gain;                        /* Participant gain */
33        u_char          mute:1;                      /* source muted */
34        uint16_t        units_per_packet;
35        uint16_t        inter_pkt_gap;               /* expected time between pkt arrivals */
36        timestamp_t            frame_dur;
37        u_char          enc;
38        char*           enc_fmt;
39        int             enc_fmt_len;
40        uint32_t        sample_rate;
41        uint32_t        last_ts;
42        uint32_t        last_seq;
43        timestamp_t            last_arr;                    /* timestamp_t representation of last_ts */
44
45        /* Playout info */
46        timestamp_t            jitter;
47        timestamp_t            transit;
48        timestamp_t            last_transit;
49        timestamp_t            last_last_transit;
50        timestamp_t            avg_transit;
51        cc_id_t         channel_coder_id;            /* channel_coder of last received packet    */
52        timestamp_t            next_mix;                    /* Used to check mixing                     */
53        timestamp_t            playout;                     /* Playout delay for this talkspurt         */
54        ts_sequencer    seq;                         /* Mapper from RTP time rep to rat time rep */
55        uint32_t        spike_events;                /* Number of spike events                   */
56        uint32_t        spike_toged;                 /* Number of packets dropped in spike mode  */
57        double          last_rtt;
58        double          avg_rtt;
59
60        /* Display Info */
61        timestamp_t            last_ui_update;              /* Used for periodic update of packet counts, etc */
62
63        /* Packet info */
64        uint32_t        received;
65        uint32_t        duplicates;
66        uint32_t        misordered;
67        uint32_t        jit_toged;                   /* Packets discarded because late ("Thrown on ground") */
68
69  /* SiteID from RTCP APP packet. */
70        char           *siteid;
71
72        uint32_t        magic;  /* For debugging */
73} pdb_entry_t;
74
75/* Functions for creating and destroying persistent database.  Return
76 * TRUE on success and fill in p accordingly, FALSE on failure.  */
77
78int pdb_create  (pdb_t **p);
79int pdb_destroy (pdb_t **p);
80
81/* pdb_get_{first,next}_id attempt to get keys from database.  Return
82 * TRUE on succes and fill in id.  FALSE on failure.  */
83
84int pdb_get_first_id (pdb_t *p, uint32_t *id);
85
86int pdb_get_next_id  (pdb_t *p, uint32_t cur_id, uint32_t *next_id);
87
88/* Functions for manipulating persistent database items. id is key in
89 * database and must be unique. */
90
91int     pdb_item_get     (pdb_t *p, uint32_t id, pdb_entry_t **item);
92
93int     pdb_item_create  (pdb_t *p,
94                          uint16_t freq,
95                          uint32_t id);
96
97int     pdb_item_destroy (pdb_t *p, uint32_t id);
98void    pdb_item_validate(pdb_entry_t *item);
99
100uint32_t pdb_item_count   (pdb_t *p);
101
102#endif /* __PERSIST_DB_H__ */
Note: See TracBrowser for help on using the browser.