41 memset(sf, 0,
sizeof(*sf));
48 memset(sf, 0,
sizeof(*sf));
79 struct ast_frame *begin_frame = f, *duped_frame =
NULL, *frame_ptr;
118 if (duped_frame != begin_frame) {
148 unsigned int sofar = 0, ineed, remain;
151 while (sofar < samples) {
152 ineed = samples - sofar;
163 memcpy(offset, sf->
offset, ineed *
sizeof(*offset));
172 frame_data = frame_ptr->
data.
ptr;
174 if (frame_ptr->
samples <= ineed) {
175 memcpy(offset, frame_data, frame_ptr->
samples *
sizeof(*offset));
179 remain = frame_ptr->
samples - ineed;
180 memcpy(offset, frame_data, ineed *
sizeof(*offset));
186 memcpy(sf->
hold, frame_data, remain *
sizeof(*offset));
#define ast_frdup(fr)
Copies a frame.
void ast_slinfactory_flush(struct ast_slinfactory *sf)
Flush the contents of a slinfactory.
Asterisk main include file. File version handling, generic pbx functions.
Support for translation of data formats. translate.c.
short hold[AST_SLINFACTORY_MAX_HOLD]
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
struct ast_trans_pvt * trans
struct ast_format * format
int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples)
Read samples from a slinfactory.
struct ast_frame_subclass subclass
struct ast_trans_pvt * ast_translator_build_path(struct ast_format *dest, struct ast_format *source)
Builds a translator path Build a path (possibly NULL) from source to dest.
int ast_slinfactory_init_with_format(struct ast_slinfactory *sf, struct ast_format *slin_out)
Initialize a slinfactory.
Asterisk internal frame definitions.
void ast_slinfactory_destroy(struct ast_slinfactory *sf)
Destroy the contents of a slinfactory.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
void ast_slinfactory_init(struct ast_slinfactory *sf)
Initialize a slinfactory.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
#define AST_SLINFACTORY_MAX_HOLD
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f)
Feed audio into a slinfactory.
#define ao2_replace(dst, src)
Data structure associated with a single frame of data.
unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf)
Retrieve number of samples currently in a slinfactory.
union ast_frame::@263 data
struct ast_format * format
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
struct ast_format * output_format