48#if (defined(LOW_MEMORY) || defined(MALLOC_DEBUG)) && !defined(NO_FRAME_CACHE)
52#if !defined(NO_FRAME_CACHE)
67#define FRAME_CACHE_MAX_SIZE 10
85#if !defined(NO_FRAME_CACHE)
92 memset(f, 0,
sizeof(*f));
109#if !defined(NO_FRAME_CACHE)
127#if !defined(NO_FRAME_CACHE)
262 }
else if (
out != fr) {
266 fr->
mallocd &= ~AST_MALLOCD_SRC;
292 out->data.ptr = newdata;
294 }
else if (
out != fr) {
297 memset(&fr->
data, 0,
sizeof(fr->
data));
298 fr->
mallocd &= ~AST_MALLOCD_DATA;
311#if !defined(NO_FRAME_CACHE)
323 srclen = strlen(f->
src);
327#if !defined(NO_FRAME_CACHE)
330 if (
out->mallocd_hdr_len >=
len) {
331 size_t mallocd_len =
out->mallocd_hdr_len;
334 memset(
out, 0,
sizeof(*
out));
335 out->mallocd_hdr_len = mallocd_len;
349 out->mallocd_hdr_len =
len;
384 src = (
char *)
out->src;
399 unsigned short *dst_s = dst;
400 const unsigned short *src_s = src;
402 for (i = 0; i < samples; i++)
403 dst_s[i] = (src_s[i]<<8) | (src_s[i]>>8);
485 message =
"Negotiation Requested";
487 message =
"Negotiation Request Terminated";
495 snprintf(subclass, slen,
"T38_Parameters/%s",
message);
597 snprintf(subclass, slen,
"Synchronous Bridge Frametype %d", f->
subclass.
integer);
644 snprintf(subclass, slen,
"Unknown HTML frame '%d'\n", f->
subclass.
integer);
657 snprintf(subclass, slen,
"Unknown MODEM frame '%d'\n", f->
subclass.
integer);
733 const char noname[] =
"unknown";
734 char ftype[40] =
"Unknown Frametype";
736 char subclass[40] =
"Unknown Subclass";
738 char moreinfo[40] =
"";
748 ast_verb(-1,
"%s [ %s (NULL) ] [%s]\n",
769 ast_verb(-1,
"%s [ TYPE: %s (%u) SUBCLASS: %s (%d) '%s' ] [%s]\n",
778 ast_verb(-1,
"%s [ TYPE: %s (%u) SUBCLASS: %s (%d) ] [%s]\n",
791 short adjust_value =
abs(adjustment);
801 for (count = 0; count < f->
samples; count++) {
802 if (adjustment > 0) {
804 }
else if (adjustment < 0) {
816 float adjust_value = fabs(adjustment);
826 for (count = 0; count < f->
samples; count++) {
827 if (adjustment > 0) {
829 }
else if (adjustment < 0) {
840 short *data1, *data2;
853 count++, data1++, data2++)
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
void * __ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
General Asterisk PBX channel definitions.
Standard Command Line Interface.
Convenient Signal Processing routines.
Generic File Format Support. Should be included by clients of the file handling routines....
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static char prefix[MAX_PREFIX]
Asterisk internal frame definitions.
@ AST_FRFLAG_HAS_TIMING_INFO
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
#define AST_HTML_NOSUPPORT
#define AST_HTML_LDCOMPLETE
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
#define AST_HTML_LINKREJECT
ast_frame_type
Frame types.
@ AST_FRAME_BRIDGE_ACTION_SYNC
@ AST_FRAME_BRIDGE_ACTION
@ AST_CONTROL_RECORD_CANCEL
@ AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED
@ AST_CONTROL_STREAM_RESTART
@ AST_CONTROL_STREAM_SUSPEND
@ AST_CONTROL_RADIO_UNKEY
@ AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE
@ AST_CONTROL_STREAM_REVERSE
@ AST_CONTROL_REDIRECTING
@ AST_CONTROL_TAKEOFFHOOK
@ AST_CONTROL_T38_PARAMETERS
@ AST_CONTROL_READ_ACTION
@ AST_CONTROL_RECORD_STOP
@ AST_CONTROL_RECORD_MUTE
@ AST_CONTROL_STREAM_STOP
@ AST_CONTROL_STREAM_TOPOLOGY_CHANGED
@ AST_CONTROL_CONNECTED_LINE
@ AST_CONTROL_STREAM_FORWARD
@ AST_CONTROL_RECORD_SUSPEND
@ AST_CONTROL_MASQUERADE_NOTIFY
@ AST_CONTROL_PVT_CAUSE_CODE
@ AST_CONTROL_UPDATE_RTP_PEER
#define ast_verb(level,...)
A set of macros to manage forward-linked lists.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Asterisk locking-related definitions:
void ast_frame_dtor(struct ast_frame *f)
NULL-safe wrapper for ast_frfree, good for RAII_VAR.
static struct ast_threadstorage frame_cache
int ast_frame_clear(struct ast_frame *frame)
Clear all audio samples from an ast_frame. The frame must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR.
static struct ast_frame * ast_frame_header_new(const char *file, int line, const char *func)
struct ast_frame * __ast_frdup(const struct ast_frame *f, const char *file, int line, const char *func)
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
void ast_frame_free(struct ast_frame *frame, int cache)
Frees a frame or list of frames.
char * ast_frame_type2str(enum ast_frame_type frame_type, char *ftype, size_t len)
Copy the discription of a frame type into the provided string.
#define FRAME_CACHE_MAX_SIZE
Maximum ast_frame cache size.
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
char * ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, char *moreinfo, size_t mlen)
Copy the discription of a frame's subclass into the provided string.
static void __frame_free(struct ast_frame *fr, int cache)
struct ast_frame * __ast_frisolate(struct ast_frame *fr, const char *file, int line, const char *func)
'isolates' a frame by duplicating non-malloc'ed components (header, src, data). On return all compone...
int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2)
Sums two frames of audio samples.
int ast_frame_adjust_volume_float(struct ast_frame *f, float adjustment)
Adjusts the volume of the audio samples contained in a frame.
void ast_swapcopy_samples(void *dst, const void *src, int samples)
static void frame_cache_cleanup(void *data)
struct ast_frame ast_null_frame
#define ast_opt_cache_media_frames
struct ao2_container * cache
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
enum ast_control_t38 request_response
struct ast_stream_topology * topology
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
This is just so ast_frames, a list head struct for holding a list of ast_frame structures,...
Handy terminal functions for vt* terms.
char * term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout)
Colorize a specified string by adding terminal color codes.
Definitions to aid in the use of thread local storage.
#define AST_THREADSTORAGE_CUSTOM(a, b, c)
Define a thread storage variable, with custom initialization and cleanup.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
Support for translation of data formats. translate.c.
#define ast_test_flag(p, flag)
static force_inline void ast_slinear_saturated_divide_float(short *input, float *value)
static force_inline void ast_slinear_saturated_multiply_float(short *input, float *value)
static force_inline void ast_slinear_saturated_multiply(short *input, short *value)
static force_inline void ast_slinear_saturated_add(short *input, short *value)
#define ast_copy_flags(dest, src, flagz)
static force_inline void ast_slinear_saturated_divide(short *input, short *value)