30#ifndef _ASTERISK_BRIDGE_SOFTMIX_INTERNAL_H
31#define _ASTERISK_BRIDGE_SOFTMIX_INTERNAL_H
56#ifdef BINAURAL_RENDERING
60#if defined(__Darwin__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__CYGWIN__)
66#define MAX_DATALEN 8096
67#define DEFAULT_ENERGY_HISTORY_LEN 150
70#define SOFTMIX_BINAURAL_SAMPLE_RATE 48000
72#define BINAURAL_MIXING_INTERVAL 20
85#ifdef BINAURAL_RENDERING
89 fftw_plan fftw_plan_inverse;
238 unsigned int default_sample_size);
259 unsigned int in_sample_size,
unsigned int hrtf_length);
274 unsigned int pos_id,
int16_t *in_samples,
unsigned int in_sample_size,
275 const char *channel_name);
289float *
get_hrir(
unsigned int chan_pos,
unsigned int chan_side);
304 unsigned int chan_pos,
unsigned int chan_side,
unsigned int default_sample_size);
319 unsigned int hrtf_len,
unsigned int chan_pos,
unsigned int default_sample_size);
379 unsigned int default_sample_size);
388 unsigned int default_sample_size);
442 unsigned int softmix_datalen,
unsigned int softmix_samples,
int16_t *
buf);
Asterisk main include file. File version handling, generic pbx functions.
int set_binaural_data_join(struct convolve_data *data, unsigned int default_sample_size)
Joins a channel into a virtual enviroment build with the help of binaural synthesis.
int do_convolve(struct convolve_channel *chan, int16_t *in_samples, unsigned int in_sample_size, unsigned int hrtf_length)
Binaural convolving of audio data for a channel.
float * get_hrir(unsigned int chan_pos, unsigned int chan_side)
Provides a head related impulse response for the given position in the virtual enviroment.
void create_binaural_frame(struct ast_bridge_channel *bridge_channel, struct softmix_channel *sc, int16_t *bin_buf, int16_t *ann_buf, unsigned int softmix_datalen, unsigned int softmix_samples, int16_t *buf)
Creates a frame out of binaural audio data.
int init_convolve_channel(struct convolve_channel *channel, unsigned int hrtf_len, unsigned int chan_pos, unsigned int chan_side, unsigned int default_sample_size)
Initializes all data needed for binaural audio processing.
void softmix_process_write_binaural_audio(struct softmix_channel *sc, unsigned int default_sample_size)
Writes the binaural audio to a channel.
void binaural_mixing(struct ast_bridge *bridge, struct softmix_bridge_data *softmix_data, struct softmix_mixing_array *mixing_array, int16_t *bin_buf, int16_t *ann_buf)
Mixes all binaural audio data contained in the mixing array.
void reset_channel_pair(struct convolve_channel_pair *channel_pair, unsigned int default_sample_size)
Deletes left over signals on a channel that it can be reused.
void add_binaural_mixing(struct ast_bridge *bridge, struct softmix_bridge_data *softmix_data, unsigned int softmix_samples, struct softmix_mixing_array *mixing_array, struct softmix_channel *sc, const char *channel_name)
Processes audio data with the binaural synthesis and adds the result to the mixing array.
#define DEFAULT_ENERGY_HISTORY_LEN
void free_convolve_channel_pair(struct convolve_channel_pair *cchan_pair)
Frees all data needed for binaural processing by a pair of audio channels (left and right).
void free_convolve_channel(struct convolve_channel *cchan)
Frees all data needed for binaural processing by an audio channel.
int init_convolve_data(struct convolve_data *data, unsigned int default_sample_size)
Preinits a specific number of channels (CONVOLVE_CHANNEL_PREALLOC) at the beginning of a conference.
void random_binaural_pos_change(struct softmix_bridge_data *softmix_data)
Randomly changes the virtual positions of conference participants.
int init_convolve_channel_pair(struct convolve_channel_pair *cchan_pair, unsigned int hrtf_len, unsigned int chan_pos, unsigned int default_sample_size)
Initializes all data needed for binaural audio processing of a channel pair (left and right).
void check_binaural_position_change(struct ast_bridge *bridge, struct softmix_bridge_data *softmix_data)
Checks if a position change in the virtual enviroment is requested by one of the participants.
struct convolve_channel_pair * do_convolve_pair(struct convolve_data *data, unsigned int pos_id, int16_t *in_samples, unsigned int in_sample_size, const char *channel_name)
Binaural convolving of audio data for a channel pair (left and right channel).
void free_convolve_data(struct convolve_data *data)
Frees all channels and data needed for binaural audio processing.
void set_binaural_data_leave(struct convolve_data *data, unsigned int pos, unsigned int default_sample_size)
Removes a channel from the binaural conference bridge. Marks the position in the virtual room as unus...
General Asterisk PBX channel definitions.
Asterisk internal frame definitions.
Support for logging to various files, console and syslog Configuration in file logger....
pthread_cond_t ast_cond_t
Asterisk module definitions.
Options provided by main asterisk program.
Pluggable RTP Architecture.
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
Structure that contains information regarding a channel in a bridge.
Structure that contains information about a bridge.
Data structure associated with a single frame of data.
Structure for mutex and tracking information.
A REMB feedback message (see draft-alvestrand-rmcat-remb-03 for details)
struct convolve_channel chan_left
struct convolve_channel chan_right
struct convolve_channel_pair ** cchan_pair
unsigned int internal_rate
struct convolve_data convolve
struct ast_bridge * bridge
Bridge pointer passed to the softmix mixing thread.
struct timeval last_video_update
unsigned int binaural_init
struct timeval last_remb_update
unsigned int default_sample_size
unsigned int internal_mixing_interval
struct softmix_bridge_data::@102 remb_collectors
Structure which contains per-channel mixing information.
unsigned int talking
TRUE if a channel is talking.
struct ast_stream_topology * topology
struct softmix_remb_collector * remb_collector
struct softmix_channel::@101 video_sources
unsigned int binaural_pos
unsigned int binaural_suspended
struct convolve_channel_pair * our_chan_pair
short final_buf[MAX_DATALEN]
short our_buf[MAX_DATALEN]
struct ast_format * read_slin_format
unsigned int is_announcement
struct ast_slinfactory factory
struct video_follow_talker_data video_talker
struct ast_frame write_frame
struct ast_rtp_rtcp_feedback_remb remb
unsigned int used_entries
struct convolve_channel_pair ** chan_pairs
unsigned int max_num_entries
int energy_history[DEFAULT_ENERGY_HISTORY_LEN]
int energy_history_cur_slot
Timing source management.
Support for translation of data formats. translate.c.
Vector container support.
#define AST_VECTOR(name, type)
Define a vector structure.