Wed Oct 28 11:51:03 2009

Asterisk developer's documentation


fixedjitterbuf.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2005, Attractel OOD
00003  *
00004  * Contributors:
00005  * Slav Klenov <slav@securax.org>
00006  *
00007  * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
00008  *
00009  * See http://www.asterisk.org for more information about
00010  * the Asterisk project. Please do not directly contact
00011  * any of the maintainers of this project for assistance;
00012  * the project provides a web site, mailing lists and IRC
00013  * channels for your use.
00014  *
00015  * This program is free software, distributed under the terms of
00016  * the GNU General Public License Version 2. See the LICENSE file
00017  * at the top of the source tree.
00018  */
00019 
00020 /*! \file 
00021  * 
00022  * \brief Jitterbuffering algorithm.
00023  * 
00024  */
00025 
00026 #ifndef _FIXEDJITTERBUF_H_
00027 #define _FIXEDJITTERBUF_H_
00028 
00029 #if defined(__cplusplus) || defined(c_plusplus)
00030 extern "C" {
00031 #endif
00032 
00033 
00034 /* return codes */
00035 enum {
00036    FIXED_JB_OK,
00037    FIXED_JB_DROP,
00038    FIXED_JB_INTERP,
00039    FIXED_JB_NOFRAME
00040 };
00041 
00042 
00043 /* defaults */
00044 #define FIXED_JB_SIZE_DEFAULT 200
00045 #define FIXED_JB_RESYNCH_THRESHOLD_DEFAULT 1000
00046 
00047 
00048 /* jb configuration properties */
00049 struct fixed_jb_conf
00050 {
00051    long jbsize;
00052    long resync_threshold;
00053 };
00054 
00055 
00056 struct fixed_jb_frame
00057 {
00058    void *data;
00059    long ts;
00060    long ms;
00061    long delivery;
00062    struct fixed_jb_frame *next;
00063    struct fixed_jb_frame *prev;
00064 };
00065 
00066 
00067 struct fixed_jb;
00068 
00069 
00070 /* jb interface */
00071 
00072 struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf);
00073 
00074 void fixed_jb_destroy(struct fixed_jb *jb);
00075 
00076 int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now);
00077 
00078 int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now);
00079 
00080 int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl);
00081 
00082 long fixed_jb_next(struct fixed_jb *jb);
00083 
00084 int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout);
00085 
00086 void fixed_jb_set_force_resynch(struct fixed_jb *jb);
00087 
00088 #if defined(__cplusplus) || defined(c_plusplus)
00089 }
00090 #endif
00091 
00092 #endif /* _FIXEDJITTERBUF_H_ */

Generated on Wed Oct 28 11:51:03 2009 for Asterisk - the Open Source PBX by  doxygen 1.5.6