30#ifndef _ABSTRACT_JB_H_
31#define _ABSTRACT_JB_H_
37#if defined(__cplusplus) || defined(c_plusplus)
64#define AST_JB_IMPL_NAME_SIZE 12
85#define AST_JB_CONF_PREFIX "jb"
86#define AST_JB_CONF_ENABLE "enable"
87#define AST_JB_CONF_FORCE "force"
88#define AST_JB_CONF_MAX_SIZE "maxsize"
89#define AST_JB_CONF_RESYNCH_THRESHOLD "resyncthreshold"
90#define AST_JB_CONF_TARGET_EXTRA "targetextra"
91#define AST_JB_CONF_IMPL "impl"
92#define AST_JB_CONF_LOG "log"
93#define AST_JB_CONF_SYNC_VIDEO "syncvideo"
97typedef void * (*jb_create_impl)(
struct ast_jb_conf *general_config);
308#if defined(__cplusplus) || defined(c_plusplus)
void(* jb_destroy_impl)(void *jb)
Destroy.
void ast_jb_create_framehook(struct ast_channel *chan, struct ast_jb_conf *jb_conf, int prefer_existing)
Applies a jitterbuffer framehook to a channel based on a provided jitterbuffer config.
void ast_jb_configure(struct ast_channel *chan, const struct ast_jb_conf *conf)
Configures a jitterbuffer on a channel.
void ast_jb_empty_and_reset(struct ast_channel *c0, struct ast_channel *c1)
drops all frames from a jitterbuffer and resets it
void(* jb_empty_and_reset_impl)(void *jb)
Empty and reset jb.
void ast_jb_get_and_deliver(struct ast_channel *c0, struct ast_channel *c1)
Deliver the queued frames that should be delivered now for both channels.
void *(* jb_create_impl)(struct ast_jb_conf *general_config)
Create.
void ast_jb_conf_default(struct ast_jb_conf *conf)
Sets the contents of an ast_jb_conf struct to the default jitterbuffer settings.
void ast_jb_enable_for_channel(struct ast_channel *chan)
Sets a jitterbuffer frame hook on the channel based on the channel's stored jitterbuffer configuratio...
int ast_jb_put(struct ast_channel *chan, struct ast_frame *f)
Puts a frame into a channel jitterbuffer.
void ast_jb_destroy(struct ast_channel *chan)
Destroys jitterbuffer on a channel.
int(* jb_get_impl)(void *jb, struct ast_frame **fout, long now, long interpl)
Get frame for now.
int(* jb_remove_impl)(void *jb, struct ast_frame **fout)
Remove first frame.
int(* jb_put_impl)(void *jb, struct ast_frame *fin, long now)
Put frame.
const struct ast_jb_impl * ast_jb_get_impl(enum ast_jb_type type)
long(* jb_next_impl)(void *jb)
Get next.
int(* jb_is_late_impl)(void *jb, long ts)
Check if late.
int ast_jb_do_usecheck(struct ast_channel *c0, struct ast_channel *c1)
Checks the need of a jb use in a generic bridge.
int ast_jb_get_when_to_wakeup(struct ast_channel *c0, struct ast_channel *c1, int time_left)
Calculates the time, left to the closest delivery moment in a bridge.
void ast_jb_get_config(const struct ast_channel *chan, struct ast_jb_conf *conf)
Copies a channel's jitterbuffer configuration.
int ast_jb_read_conf(struct ast_jb_conf *conf, const char *varname, const char *value)
Sets jitterbuffer configuration property.
void(* jb_force_resynch_impl)(void *jb)
Force resynch.
#define AST_JB_IMPL_NAME_SIZE
int(* jb_put_first_impl)(void *jb, struct ast_frame *fin, long now)
Put first frame.
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
General jitterbuffer configuration.
long target_extra
amount of additional jitterbuffer adjustment
char impl[AST_JB_IMPL_NAME_SIZE]
Name of the jitterbuffer implementation to be used.
long max_size
Max size of the jitterbuffer implementation.
long resync_threshold
Resynchronization threshold of the jitterbuffer implementation.
unsigned int flags
Combination of the AST_JB_ENABLED, AST_JB_FORCED and AST_JB_LOG flags.
Jitterbuffer implementation struct.
jb_put_first_impl put_first
char name[AST_JB_IMPL_NAME_SIZE]
jb_empty_and_reset_impl empty_and_reset
jb_force_resynch_impl force_resync
General jitterbuffer state.
void * jbobj
Jitterbuffer object, passed to the implementation.
long next
The time the next frame should be played.
struct ast_format * last_format
Voice format of the last frame in.
struct timeval timebase
The time the jitterbuffer was created.
FILE * logfile
File for frame timestamp tracing.
unsigned int flags
Jitterbuffer internal state flags.
const struct ast_jb_impl * impl
Jitterbuffer implementation to be used.
All configuration options for http media cache.