diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
commit | 8b0c007ad990aa27d9868da49215fd1076ac77cc (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 /main/fixedjitterbuf.h | |
parent | a42edc84034f91932a3e12d503e07f76a6eb498a (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/fixedjitterbuf.h')
-rw-r--r-- | main/fixedjitterbuf.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/main/fixedjitterbuf.h b/main/fixedjitterbuf.h new file mode 100644 index 000000000..541e99d2d --- /dev/null +++ b/main/fixedjitterbuf.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2005, Attractel OOD + * + * Contributors: + * Slav Klenov <slav@securax.org> + * + * Copyright on this file is disclaimed to Digium for inclusion in Asterisk + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Jitterbuffering algorithm. + * + */ + +#ifndef _FIXEDJITTERBUF_H_ +#define _FIXEDJITTERBUF_H_ + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + + +/* return codes */ +enum { + FIXED_JB_OK, + FIXED_JB_DROP, + FIXED_JB_INTERP, + FIXED_JB_NOFRAME +}; + + +/* defaults */ +#define FIXED_JB_SIZE_DEFAULT 200 +#define FIXED_JB_RESYNCH_THRESHOLD_DEFAULT 1000 + + +/* jb configuration properties */ +struct fixed_jb_conf +{ + long jbsize; + long resync_threshold; +}; + + +struct fixed_jb_frame +{ + void *data; + long ts; + long ms; + long delivery; + struct fixed_jb_frame *next; + struct fixed_jb_frame *prev; +}; + + +struct fixed_jb; + + +/* jb interface */ + +struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf); + +void fixed_jb_destroy(struct fixed_jb *jb); + +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); + +int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl); + +long fixed_jb_next(struct fixed_jb *jb); + +int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout); + +void fixed_jb_set_force_resynch(struct fixed_jb *jb); + + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* _FIXEDJITTERBUF_H_ */ |