Asterisk - The Open Source Telephony Project  GIT-master-e8cda4b
fixedjitterbuf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005, Attractel OOD
3  *
4  * Contributors:
5  * Slav Klenov <slav@securax.org>
6  *
7  * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
8  *
9  * See http://www.asterisk.org for more information about
10  * the Asterisk project. Please do not directly contact
11  * any of the maintainers of this project for assistance;
12  * the project provides a web site, mailing lists and IRC
13  * channels for your use.
14  *
15  * This program is free software, distributed under the terms of
16  * the GNU General Public License Version 2. See the LICENSE file
17  * at the top of the source tree.
18  */
19 
20 /*! \file
21  *
22  * \brief Jitterbuffering algorithm.
23  *
24  */
25 
26 #ifndef _FIXEDJITTERBUF_H_
27 #define _FIXEDJITTERBUF_H_
28 
29 #if defined(__cplusplus) || defined(c_plusplus)
30 extern "C" {
31 #endif
32 
33 
34 /* return codes */
35 enum {
40 };
41 
42 
43 /* defaults */
44 #define FIXED_JB_SIZE_DEFAULT 200
45 #define FIXED_JB_RESYNCH_THRESHOLD_DEFAULT 1000
46 
47 
48 /* jb configuration properties */
50 {
51  long jbsize;
53 };
54 
55 
57 {
58  void *data;
59  long ts;
60  long ms;
61  long delivery;
64 };
65 
66 
67 struct fixed_jb;
68 
69 
70 /* jb interface */
71 
72 struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf);
73 
74 void fixed_jb_destroy(struct fixed_jb *jb);
75 
76 int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now);
77 
78 int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now);
79 
80 int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl);
81 
82 long fixed_jb_next(struct fixed_jb *jb);
83 
84 int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout);
85 
86 void fixed_jb_set_force_resynch(struct fixed_jb *jb);
87 
88 /*! \brief Checks if the given time stamp is late */
89 int fixed_jb_is_late(struct fixed_jb *jb, long ts);
90 
91 #if defined(__cplusplus) || defined(c_plusplus)
92 }
93 #endif
94 
95 #endif /* _FIXEDJITTERBUF_H_ */
struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf)
private fixed_jb structure
int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl)
void fixed_jb_destroy(struct fixed_jb *jb)
int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now)
struct fixed_jb_frame * next
All configuration options for statsd client.
Definition: res_statsd.c:95
int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now)
long fixed_jb_next(struct fixed_jb *jb)
struct fixed_jb_frame * prev
int fixed_jb_is_late(struct fixed_jb *jb, long ts)
Checks if the given time stamp is late.
int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout)
void fixed_jb_set_force_resynch(struct fixed_jb *jb)