Asterisk - The Open Source Telephony Project GIT-master-a358458
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)
30extern "C" {
31#endif
32
33
34/* return codes */
35enum {
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;
64};
65
66
67struct fixed_jb;
68
69
70/* jb interface */
71
72struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf);
73
74void fixed_jb_destroy(struct fixed_jb *jb);
75
76int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now);
77
78int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now);
79
80int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl);
81
82long fixed_jb_next(struct fixed_jb *jb);
83
84int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout);
85
87
88/*! \brief Checks if the given time stamp is late */
89int 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)
int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now)
int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now)
long fixed_jb_next(struct fixed_jb *jb)
int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl)
int fixed_jb_is_late(struct fixed_jb *jb, long ts)
Checks if the given time stamp is late.
void fixed_jb_destroy(struct fixed_jb *jb)
int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout)
@ FIXED_JB_INTERP
@ FIXED_JB_OK
@ FIXED_JB_NOFRAME
@ FIXED_JB_DROP
void fixed_jb_set_force_resynch(struct fixed_jb *jb)
All configuration options for http media cache.
struct fixed_jb_frame * prev
struct fixed_jb_frame * next
private fixed_jb structure