Asterisk - The Open Source Telephony Project
21.4.1
|
jitterbuf: an application-independent jitterbuffer More...
Go to the source code of this file.
Macros | |
#define | jb_dbg(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0) |
#define | jb_dbg2(...) ((void)0) |
#define | jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0) |
#define | JB_LONGMAX 2147483647L |
#define | JB_LONGMIN (-JB_LONGMAX - 1L) |
#define | jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0) |
Functions | |
static enum jb_return_code | _jb_get (jitterbuf *jb, jb_frame *frameout, long now, long interpl) |
static jb_frame * | _queue_get (jitterbuf *jb, long ts, int all) |
static int | check_resync (jitterbuf *jb, long ts, long now, long ms, const enum jb_frame_type type, long *delay) |
static void | decrement_losspct (jitterbuf *jb) |
static void | history_calc_maxbuf (jitterbuf *jb) |
static void | history_get (jitterbuf *jb) |
static int | history_put (jitterbuf *jb, long ts, long now, long ms, long delay) |
static void | increment_losspct (jitterbuf *jb) |
void | jb_destroy (jitterbuf *jb) |
destroy jitterbuf | |
enum jb_return_code | jb_get (jitterbuf *jb, jb_frame *frameout, long now, long interpl) |
get a frame for time now (receiver's time) return value is one of JB_OK: You've got frame! JB_DROP: Here's an audio frame you should just drop. Ask me again for this time.. JB_NOFRAME: There's no frame scheduled for this time. JB_INTERP: Please interpolate an interpl-length frame for this time (either we need to grow, or there was a lost frame) JB_EMPTY: The jb is empty. | |
enum jb_return_code | jb_getall (jitterbuf *jb, jb_frame *frameout) |
unconditionally get frames from jitterbuf until empty | |
enum jb_return_code | jb_getinfo (jitterbuf *jb, jb_info *stats) |
get jitterbuf info: only "statistics" may be valid | |
int | jb_is_late (jitterbuf *jb, long ts) |
Checks if the given time stamp is late. | |
jitterbuf * | jb_new () |
new jitterbuf | |
long | jb_next (jitterbuf *jb) |
when is the next frame due out, in receiver's time (0=EMPTY) This value may change as frames are added (esp non-audio frames) | |
enum jb_return_code | jb_put (jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, long ts, long now) |
queue a frame More... | |
void | jb_reset (jitterbuf *jb) |
reset jitterbuf More... | |
enum jb_return_code | jb_setconf (jitterbuf *jb, jb_conf *conf) |
set jitterbuf conf | |
void | jb_setoutput (jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg) |
static jb_frame * | queue_get (jitterbuf *jb, long ts) |
static jb_frame * | queue_getall (jitterbuf *jb) |
static long | queue_last (jitterbuf *jb) |
static long | queue_next (jitterbuf *jb) |
static int | queue_put (jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, long ts) |
Variables | |
static jb_output_function_t | dbgf |
static jb_output_function_t | errf |
static jb_output_function_t | warnf |
jitterbuf: an application-independent jitterbuffer
Definition in file jitterbuf.c.
#define JB_LONGMAX 2147483647L |
define these here, just for ancient compiler systems
Definition at line 40 of file jitterbuf.c.
Referenced by jb_next().
enum jb_return_code jb_put | ( | jitterbuf * | jb, |
void * | data, | ||
const enum jb_frame_type | type, | ||
long | ms, | ||
long | ts, | ||
long | now | ||
) |
queue a frame
data=frame data, timings (in ms): ms=length of frame (for voice), ts=ts (sender's time) now=now (in receiver's time) return value is one of JB_OK: Frame added. Last call to jb_next() still valid JB_DROP: Drop this frame immediately JB_SCHED: Frame added. Call jb_next() to get a new time for the next frame
Definition at line 525 of file jitterbuf.c.
References jb_info::frames_in, JB_TYPE_VOICE, and jb_info::resync_offset.
Referenced by schedule_delivery().
void jb_reset | ( | jitterbuf * | jb | ) |
reset jitterbuf
Definition at line 72 of file jitterbuf.c.
References jb_info::current, jitterbuf::free, JB_TARGET_EXTRA, jb_info::silence_begin_ts, jb_info::target, and jb_conf::target_extra.
Referenced by jb_new().