root/rat/trunk/pdb.h @ 2918

Revision 2918, 3.7 KB (checked in by ucacoxh, 15 years ago)

- Added VAT trick of subtracting a few of frame durations when marker

bit set since VAD algorithms cause packet compression at talkspurt
starts.

- Added check for jitter larger than current playout. If so we obviously

have wrong playout and need to recalculate.

- Fixed equality in cont_toged checked. >= rather than ==.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[2709]1/*
2 * FILE:    pdb.h
3 * PROGRAM: RAT
4 * AUTHOR:  O.Hodson
5 *
6 * $Revision$
7 * $Date$
8 *
9 * Copyright (c) 1999 University College London
10 * All rights reserved.
11 *
12 * These functions provide a means of maintaining persistent
13 * information on conference participants that is not contained in the
14 * RTCP database.  Entries are stored in a binary table, identified with
15 * a unique 32 bit unsigned identifer (probably the same as SSRC).
16 */
17
18#ifndef __PERSIST_DB_H__
19#define __PERSIST_DB_H__
20
[2719]21/* RAT specific includes for entries in pdb_entry_t */
[2733]22#include "channel_types.h"
[2719]23#include "codec_types.h"
24#include "timers.h"
25#include "ts.h"
26#include "render_3D.h"
27
[2709]28typedef struct s_pdb pdb_t;
29 
30typedef struct {
[2719]31        u_int32         ssrc;                        /* Unique Id */
32        u_char          first_mix:1;
33        struct s_render_3D_dbentry  *render_3D_data; /* Participant 3d state */
34        double          gain;                        /* Participant gain */
35        u_char          mute:1;                      /* source muted */
36        struct s_time  *clock;
37        u_int16         units_per_packet;
38        u_int16         inter_pkt_gap;               /* expected time between pkt arrivals */
[2918]39        ts_t            frame_dur;
[2719]40        u_char          enc;
41        char*           enc_fmt;
[2735]42        int             enc_fmt_len;
43        u_int32         last_ts;
44        u_int32         last_seq;
45        ts_t            last_arr;                    /* ts_t representation of last_ts */
46
47        /* Playout info */
48        ts_t            jitter;
49        ts_t            transit;
50        ts_t            last_transit;
[2911]51        ts_t            avg_transit;
[2719]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 */
[2709]55
[2780]56
[2742]57        /* Display Info */
58        ts_t            last_ui_update;              /* Used for periodic update of packet counts, etc */
59
[2741]60        /* Packet info */
[2742]61        u_int32         received;
[2741]62        u_int32         duplicates;
63        u_int32         misordered;
[2780]64        u_int32         jit_toged;                   /* Packets discarded because late ("Thrown on ground") */
65        u_char          cont_toged;                  /* Toged in a row */
[2741]66
[2719]67        /* Variables for playout time calculation */
68        int             video_playout;               /* Playout delay in the video tool -- for lip-sync [csp] */
69        u_char          video_playout_received:1;    /* video playout is relevent */
70        int             sync_playout_delay;          /* same interpretation as delay, used when sync is on [dm] */
71
72        /* Mapping between rtp time and NTP time for this sender */
73        int             mapping_valid;
74        u_int32         last_ntp_sec;   /* NTP timestamp */
75        u_int32         last_ntp_frac;
76        u_int32         last_rtp_ts;    /* RTP timestamp */
77} pdb_entry_t;
78
[2709]79/* Functions for creating and destroying persistent database.  Return
80 * TRUE on success and fill in p accordingly, FALSE on failure.  */
81
82int pdb_create  (pdb_t **p);
83int pdb_destroy (pdb_t **p);
84
85/* pdb_get_{first,next}_id attempt to get keys from database.  Return
86 * TRUE on succes and fill in id.  FALSE on failure.  */
87
88int pdb_get_first_id (pdb_t *p, u_int32 *id);
[2719]89
[2709]90int pdb_get_next_id  (pdb_t *p, u_int32 cur_id, u_int32 *next_id);
91
92/* Functions for manipulating persistent database items. id is key in
93 * database and must be unique. */
94
[2719]95int     pdb_item_get     (pdb_t *p, u_int32 id, pdb_entry_t **item);
96
97int     pdb_item_create  (pdb_t *p,
98                          struct s_fast_time *clock,
99                          u_int16 freq,
100                          u_int32 id);
101
[2709]102int     pdb_item_destroy (pdb_t *p, u_int32 id);
[2719]103
[2709]104u_int32 pdb_item_count   (pdb_t *p);
105
106#endif /* __PERSIST_DB_H__ */
Note: See TracBrowser for help on using the browser.