60 #define SOFTMIX_INTERVAL 20
63 #define SOFTMIX_DATALEN (160 * (SOFTMIX_INTERVAL / 10))
66 #define SOFTMIX_SAMPLES (SOFTMIX_DATALEN / 2)
132 #ifdef SOFTMIX_16_SUPPORT
182 #ifdef SOFTMIX_16_SUPPORT
240 short *data1, *data2;
274 pthread_kill(bridge_channel->
thread, SIGURG);
298 #ifdef SOFTMIX_16_SUPPORT
union ast_frame_subclass subclass
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static int softmix_bridge_leave(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
Function called when a channel leaves the bridge.
static int softmix_bridge_create(struct ast_bridge *bridge)
Function called when a bridge is created.
#define SOFTMIX_DATALEN
Size of the buffer used for sample manipulation.
static int softmix_bridge_destroy(struct ast_bridge *bridge)
Function called when a bridge is destroyed.
static int softmix_bridge_poke(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
Function called when the channel's thread is poked.
int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f)
Feed audio into a slinfactory.
void ast_timer_close(struct ast_timer *handle)
Close an opened timing handle.
struct ast_timer * ast_timer_open(void)
Open a timer.
#define ast_mutex_lock(a)
#define ast_bridge_technology_register(technology)
See __ast_bridge_technology_register()
unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf)
Retrieve number of samples currently in a slinfactory.
int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
Waits for input on an fd.
General Asterisk PBX channel definitions.
static enum ast_bridge_write_result softmix_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
Function called when a channel writes a frame into the bridge.
static int softmix_bridge_thread(struct ast_bridge *bridge)
Function which acts as the mixing thread.
Asterisk internal frame definitions.
static force_inline void ast_slinear_saturated_add(short *input, short *value)
#define AST_FORMAT_SLINEAR16
int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
Unregister a bridge technology from use.
void ast_slinfactory_destroy(struct ast_slinfactory *sf)
Destroy the contents of a slinfactory.
#define SOFTMIX_SAMPLES
Number of samples we are dealing with.
static int unload_module(void)
Structure that contains information about a bridge.
int ast_timer_ack(const struct ast_timer *handle, unsigned int quantity)
Acknowledge a timer event.
static int softmix_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
Function called when a channel is joined into the bridge.
Define used to turn on 16 kHz audio support.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
struct ast_slinfactory factory
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
static struct ast_bridge_technology softmix_bridge
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
void ast_slinfactory_init(struct ast_slinfactory *sf)
Initialize a slinfactory.
int ast_timer_fd(const struct ast_timer *handle)
Get a poll()-able file descriptor for a timer.
int ast_timer_set_rate(const struct ast_timer *handle, unsigned int rate)
Set the timing tick rate.
Support for logging to various files, console and syslog Configuration in file logger.conf.
short our_buf[SOFTMIX_DATALEN]
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
#define AST_FORMAT_SLINEAR
Structure that is the essence of a bridge technology.
#define SOFTMIX_INTERVAL
Interval at which mixing will take place. Valid options are 10, 20, and 40.
ast_bridge_write_result
Return values for bridge technology write function.
Data structure associated with a single frame of data.
int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples)
Read samples from a slinfactory.
Options provided by main asterisk program.
static force_inline void ast_slinear_saturated_subtract(short *input, short *value)
short final_buf[SOFTMIX_DATALEN]
enum ast_frame_type frametype
#define ast_mutex_init(pmutex)
#define ast_mutex_destroy(a)
#define ASTERISK_GPL_KEY
The text the key() function should return.
static struct ast_timer * timer
Asterisk module definitions.
static int load_module(void)
union ast_frame::@172 data
Timing source management.
Structure for mutex and tracking information.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
#define ast_mutex_unlock(a)