audio: untypedef af_instance

This commit is contained in:
Stefano Pigozzi 2012-11-01 12:23:48 +01:00
parent 596e12fcb2
commit c9b5954851
28 changed files with 154 additions and 155 deletions

View File

@ -2265,7 +2265,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
char *af_args = strdup(cmd->args[0].v.s);
char *af_commands = af_args;
char *af_command;
af_instance_t *af;
struct af_instance *af;
while ((af_command = strsep(&af_commands, ",")) != NULL) {
if (cmd->id == MP_CMD_AF_DEL) {
af = af_get(mpctx->mixer.afilter, af_command);
@ -2287,7 +2287,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
break;
case MP_CMD_AF_CMDLINE:
if (sh_audio) {
af_instance_t *af = af_get(sh_audio->afilter, cmd->args[0].v.s);
struct af_instance *af = af_get(sh_audio->afilter, cmd->args[0].v.s);
if (!af) {
mp_msg(MSGT_CPLAYER, MSGL_WARN,
"Filter '%s' not found in chain.\n", cmd->args[0].v.s);

View File

@ -101,9 +101,9 @@ static struct af_info* af_find(char*name)
/* Find filter in the dynamic filter list using it's name This
function is used for finding already initialized filters */
af_instance_t* af_get(af_stream_t* s, char* name)
struct af_instance* af_get(af_stream_t* s, char* name)
{
af_instance_t* af=s->first;
struct af_instance* af=s->first;
// Find the filter
while(af != NULL){
if(!strcmp(af->info->name,name))
@ -115,18 +115,18 @@ af_instance_t* af_get(af_stream_t* s, char* name)
/*/ Function for creating a new filter of type name. The name may
contain the commandline parameters for the filter */
static af_instance_t* af_create(af_stream_t* s, const char* name_with_cmd)
static struct af_instance* af_create(af_stream_t* s, const char* name_with_cmd)
{
char* name = strdup(name_with_cmd);
char* cmdline = name;
// Allocate space for the new filter and reset all pointers
af_instance_t* new=malloc(sizeof(af_instance_t));
struct af_instance* new=malloc(sizeof(struct af_instance));
if (!name || !new) {
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Could not allocate memory\n");
goto err_out;
}
memset(new,0,sizeof(af_instance_t));
memset(new,0,sizeof(struct af_instance));
// Check for commandline parameters
strsep(&cmdline, "=");
@ -169,10 +169,10 @@ err_out:
/* Create and insert a new filter of type name before the filter in the
argument. This function can be called during runtime, the return
value is the new filter */
static af_instance_t* af_prepend(af_stream_t* s, af_instance_t* af, const char* name)
static struct af_instance* af_prepend(af_stream_t* s, struct af_instance* af, const char* name)
{
// Create the new filter and make sure it is OK
af_instance_t* new=af_create(s,name);
struct af_instance* new=af_create(s,name);
if(!new)
return NULL;
// Update pointers
@ -193,10 +193,10 @@ static af_instance_t* af_prepend(af_stream_t* s, af_instance_t* af, const char*
/* Create and insert a new filter of type name after the filter in the
argument. This function can be called during runtime, the return
value is the new filter */
static af_instance_t* af_append(af_stream_t* s, af_instance_t* af, const char* name)
static struct af_instance* af_append(af_stream_t* s, struct af_instance* af, const char* name)
{
// Create the new filter and make sure it is OK
af_instance_t* new=af_create(s,name);
struct af_instance* new=af_create(s,name);
if(!new)
return NULL;
// Update pointers
@ -215,7 +215,7 @@ static af_instance_t* af_append(af_stream_t* s, af_instance_t* af, const char* n
}
// Uninit and remove the filter "af"
void af_remove(af_stream_t* s, af_instance_t* af)
void af_remove(af_stream_t* s, struct af_instance* af)
{
if(!af) return;
@ -258,7 +258,7 @@ static void af_print_filter_chain(af_stream_t* s)
print_fmt(&s->input);
mp_msg(MSGT_AFILTER, MSGL_V, "\n");
af_instance_t *af = s->first;
struct af_instance *af = s->first;
while (af) {
mp_msg(MSGT_AFILTER, MSGL_V, " [%s] ", af->info->name);
print_fmt(af->data);
@ -277,7 +277,7 @@ static void af_print_filter_chain(af_stream_t* s)
// state (for example, format filters that were tentatively inserted stay
// inserted).
// In that case, you should always rebuild the filter chain, or abort.
int af_reinit(af_stream_t* s, af_instance_t* af)
int af_reinit(af_stream_t* s, struct af_instance* af)
{
do{
struct mp_audio in; // Format of the input to current filter
@ -308,7 +308,7 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
case AF_FALSE:{ // Configuration filter is needed
// Do auto insertion only if force is not specified
if((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE){
af_instance_t* new = NULL;
struct af_instance* new = NULL;
// Insert channels filter
if((af->prev?af->prev->data->nch:s->input.nch) != in.nch){
// Create channels filter
@ -359,7 +359,7 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
case AF_DETACH:{ // Filter is redundant and wants to be unloaded
// Do auto remove only if force is not specified
if((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE){
af_instance_t* aft=af->prev;
struct af_instance* aft=af->prev;
af_remove(s,af);
if(aft)
af=aft->next;
@ -393,7 +393,7 @@ void af_uninit(af_stream_t* s)
*/
static int fixup_output_format(af_stream_t* s)
{
af_instance_t* af = NULL;
struct af_instance* af = NULL;
// Check number of output channels fix if not OK
// If needed always inserted last -> easy to screw up other filters
if(s->output.nch && s->last->data->nch!=s->output.nch){
@ -515,7 +515,7 @@ int af_init(af_stream_t* s)
// Check output format
if((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE){
af_instance_t* af = NULL; // New filter
struct af_instance* af = NULL; // New filter
// Check output frequency if not OK fix with resample
if(s->output.rate && s->last->data->rate!=s->output.rate){
// try to find a filter that can change samplrate
@ -570,8 +570,8 @@ int af_init(af_stream_t* s)
to the stream s. The filter will be inserted somewhere nice in the
list of filters. The return value is a pointer to the new filter,
If the filter couldn't be added the return value is NULL. */
af_instance_t* af_add(af_stream_t* s, char* name){
af_instance_t* new;
struct af_instance* af_add(af_stream_t* s, char* name){
struct af_instance* new;
// Sanity check
if(!s || !s->first || !name)
return NULL;
@ -597,7 +597,7 @@ af_instance_t* af_add(af_stream_t* s, char* name){
// Filter data chunk through the filters in the list
struct mp_audio* af_play(af_stream_t* s, struct mp_audio* data)
{
af_instance_t* af=s->first;
struct af_instance* af=s->first;
// Iterate through all filters
do{
if (data->len <= 0) break;
@ -620,7 +620,7 @@ int af_lencalc(double mul, struct mp_audio* d)
// Calculate average ratio of filter output size to input size
double af_calc_filter_multiplier(af_stream_t* s)
{
af_instance_t* af=s->first;
struct af_instance* af=s->first;
double mul = 1;
// Iterate through all filters and calculate total multiplication factor
do{
@ -634,7 +634,7 @@ double af_calc_filter_multiplier(af_stream_t* s)
/* Calculate the total delay [bytes output] caused by the filters */
double af_calc_delay(af_stream_t* s)
{
af_instance_t* af=s->first;
struct af_instance* af=s->first;
register double delay = 0.0;
// Iterate through all filters
while(af){
@ -647,7 +647,7 @@ double af_calc_delay(af_stream_t* s)
/* Helper function called by the macro with the same name this
function should not be called directly */
int af_resize_local_buffer(af_instance_t* af, struct mp_audio* data)
int af_resize_local_buffer(struct af_instance* af, struct mp_audio* data)
{
// Calculate new length
register int len = af_lencalc(af->mul,data);
@ -666,9 +666,9 @@ int af_resize_local_buffer(af_instance_t* af, struct mp_audio* data)
}
// documentation in af.h
af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
struct af_instance *af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
int res = AF_UNKNOWN;
af_instance_t* filt = s->last;
struct af_instance* filt = s->last;
while (filt) {
res = filt->control(filt, cmd, arg);
if (res == AF_OK)

View File

@ -29,7 +29,7 @@
#include "cpudetect.h"
#include "mp_msg.h"
struct af_instance_s;
struct af_instance;
// Number of channels
#ifndef AF_NCH
@ -59,25 +59,24 @@ struct af_info {
const char *author;
const char *comment;
const int flags;
int (*open)(struct af_instance_s* vf);
int (*open)(struct af_instance* vf);
};
// Linked list of audio filters
typedef struct af_instance_s
{
struct af_instance {
struct af_info* info;
int (*control)(struct af_instance_s* af, int cmd, void* arg);
void (*uninit)(struct af_instance_s* af);
struct mp_audio* (*play)(struct af_instance_s* af, struct mp_audio* data);
int (*control)(struct af_instance* af, int cmd, void* arg);
void (*uninit)(struct af_instance* af);
struct mp_audio* (*play)(struct af_instance* af, struct mp_audio* data);
void* setup; // setup data for this specific instance and filter
struct mp_audio* data; // configuration for outgoing data stream
struct af_instance_s* next;
struct af_instance_s* prev;
struct af_instance* next;
struct af_instance* prev;
double delay; /* Delay caused by the filter, in units of bytes read without
* corresponding output */
double mul; /* length multiplier: how much does this instance change
the length of the buffer. */
}af_instance_t;
};
// Initialization flags
extern int* af_cpu_speed;
@ -108,8 +107,8 @@ typedef struct af_cfg_s{
typedef struct af_stream
{
// The first and last filter in the list
af_instance_t* first;
af_instance_t* last;
struct af_instance* first;
struct af_instance* last;
// Storage for input and output data formats
struct mp_audio input;
struct mp_audio output;
@ -167,7 +166,7 @@ void af_uninit(af_stream_t* s);
* \param Filter instance to begin the reinit from
* \return AF_OK on success or AF_ERROR on failure
*/
int af_reinit(af_stream_t* s, af_instance_t* af);
int af_reinit(af_stream_t* s, struct af_instance* af);
/**
* \brief This function adds the filter "name" to the stream s.
@ -178,13 +177,13 @@ int af_reinit(af_stream_t* s, af_instance_t* af);
* list of filters (i.e. at the beginning unless the
* first filter is the format filter (why??).
*/
af_instance_t* af_add(af_stream_t* s, char* name);
struct af_instance* af_add(af_stream_t* s, char* name);
/**
* \brief Uninit and remove the filter "af"
* \param af filter to remove
*/
void af_remove(af_stream_t* s, af_instance_t* af);
void af_remove(af_stream_t* s, struct af_instance* af);
/**
* \brief find filter in chain by name
@ -193,7 +192,7 @@ void af_remove(af_stream_t* s, af_instance_t* af);
*
* This function is used for finding already initialized filters
*/
af_instance_t* af_get(af_stream_t* s, char* name);
struct af_instance* af_get(af_stream_t* s, char* name);
/**
* \brief filter data chunk through the filters in the list
@ -210,7 +209,7 @@ struct mp_audio* af_play(af_stream_t* s, struct mp_audio* data);
* \param arg argument for filter command
* \return the accepting filter or NULL if none was found
*/
af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg);
struct af_instance *af_control_any_rev (af_stream_t* s, int cmd, void* arg);
/**
* \brief calculate average ratio of filter output lenth to input length
@ -235,7 +234,7 @@ double af_calc_delay(af_stream_t* s);
/* Helper function called by the macro with the same name only to be
called from inside filters */
int af_resize_local_buffer(af_instance_t* af, struct mp_audio* data);
int af_resize_local_buffer(struct af_instance* af, struct mp_audio* data);
/* Helper function used to calculate the exact buffer length needed
when buffers are resized. The returned length is >= than what is
@ -295,7 +294,7 @@ int af_to_ms(int n, int* in, float* out, int rate);
*
* compares the format, bps, rate and nch values of af->data with out
*/
int af_test_output(struct af_instance_s* af, struct mp_audio* out);
int af_test_output(struct af_instance* af, struct mp_audio* out);
/**
* \brief soft clipping function using sin()

View File

@ -38,7 +38,7 @@ struct af_bs2b {
};
#define PLAY(name, type) \
static struct mp_audio *play_##name(struct af_instance_s *af, struct mp_audio *data) \
static struct mp_audio *play_##name(struct af_instance *af, struct mp_audio *data) \
{ \
/* filter is called for all pairs of samples available in the buffer */ \
bs2b_cross_feed_##name(((struct af_bs2b*)(af->setup))->filter, \
@ -92,7 +92,7 @@ static int test_feed(void *par)
}
/// Initialization and runtime control
static int control(struct af_instance_s *af, int cmd, void *arg)
static int control(struct af_instance *af, int cmd, void *arg)
{
struct af_bs2b *s = af->setup;
@ -227,7 +227,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
}
/// Deallocate memory and close library
static void uninit(struct af_instance_s *af)
static void uninit(struct af_instance *af)
{
struct af_bs2b *s = af->setup;
free(af->data);
@ -237,7 +237,7 @@ static void uninit(struct af_instance_s *af)
}
/// Allocate memory, set function pointers and init library
static int af_open(af_instance_t *af)
static int af_open(struct af_instance *af)
{
struct af_bs2b *s;
af->control = control;

View File

@ -38,7 +38,7 @@ typedef struct af_center_s
}af_center_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_center_t* s = af->setup;
@ -76,14 +76,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_center_t* s = af->setup; // Setup for this instance
@ -103,7 +103,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af_center_t* s;
af->control=control;
af->uninit=uninit;

View File

@ -133,7 +133,7 @@ static int check_routes(af_channels_t* s, int nin, int nout)
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_channels_t* s = af->setup;
switch(cmd){
@ -247,7 +247,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->setup);
if (af->data)
@ -256,7 +256,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
struct mp_audio* l = af->data; // Local data
@ -283,7 +283,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -41,7 +41,7 @@ typedef struct af_delay_s
}af_delay_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_delay_t* s = af->setup;
switch(cmd){
@ -107,7 +107,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
int i;
@ -118,7 +118,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_delay_t* s = af->setup; // Setup for this instance
@ -177,7 +177,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -26,7 +26,7 @@
#include "af.h"
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:
@ -39,13 +39,13 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
// Do something necessary to get rid of annoying warning during compile
if(!af)
@ -54,7 +54,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -82,7 +82,7 @@ static void bp2(float* a, float* b, float fc, float q){
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_equalizer_t* s = (af_equalizer_t*)af->setup;
@ -179,14 +179,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_equalizer_t* s = (af_equalizer_t*)af->setup; // Setup
@ -225,7 +225,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -64,7 +64,7 @@ typedef struct af_export_s
cmd control command
arg argument
*/
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_export_t* s = af->setup;
switch (cmd){
@ -173,7 +173,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
/* Free allocated memory and clean up other stuff too.
af audio filter instance
*/
static void uninit( struct af_instance_s* af )
static void uninit( struct af_instance* af )
{
free(af->data);
af->data = NULL;
@ -201,7 +201,7 @@ static void uninit( struct af_instance_s* af )
af audio filter instance
data audio data
*/
static struct mp_audio* play( struct af_instance_s* af, struct mp_audio* data )
static struct mp_audio* play( struct af_instance* af, struct mp_audio* data )
{
struct mp_audio* c = data; // Current working data
af_export_t* s = af->setup; // Setup for this instance
@ -246,7 +246,7 @@ static struct mp_audio* play( struct af_instance_s* af, struct mp_audio* data )
af audio filter instance
returns AF_OK or AF_ERROR
*/
static int af_open( af_instance_t* af )
static int af_open( struct af_instance* af )
{
af->control = control;
af->uninit = uninit;

View File

@ -34,11 +34,11 @@ typedef struct af_extrastereo_s
float mul;
}af_extrastereo_t;
static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data);
static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data);
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_extrastereo_t* s = (af_extrastereo_t*)af->setup;
@ -80,14 +80,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data)
{
af_extrastereo_t *s = af->setup;
register int i = 0;
@ -109,7 +109,7 @@ static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data
return data;
}
static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data)
{
af_extrastereo_t *s = af->setup;
register int i = 0;
@ -132,7 +132,7 @@ static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* da
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play_s16;

View File

@ -52,10 +52,10 @@ static void float2int(float* in, void* out, int len, int bps);
// From signed int to float
static void int2float(void* in, float* out, int len, int bps);
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_swapendian(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_float_s16(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_s16_float(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data);
static struct mp_audio* play_swapendian(struct af_instance* af, struct mp_audio* data);
static struct mp_audio* play_float_s16(struct af_instance* af, struct mp_audio* data);
static struct mp_audio* play_s16_float(struct af_instance* af, struct mp_audio* data);
// Helper functions to check sanity for input arguments
@ -86,7 +86,7 @@ static int check_format(int format)
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:{
@ -168,7 +168,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
if (af->data)
free(af->data->audio);
@ -176,7 +176,7 @@ static void uninit(struct af_instance_s* af)
af->setup = 0;
}
static struct mp_audio* play_swapendian(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_swapendian(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* l = af->data; // Local data
struct mp_audio* c = data; // Current working data
@ -193,7 +193,7 @@ static struct mp_audio* play_swapendian(struct af_instance_s* af, struct mp_audi
return c;
}
static struct mp_audio* play_float_s16(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_float_s16(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* l = af->data; // Local data
struct mp_audio* c = data; // Current working data
@ -212,7 +212,7 @@ static struct mp_audio* play_float_s16(struct af_instance_s* af, struct mp_audio
return c;
}
static struct mp_audio* play_s16_float(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_s16_float(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* l = af->data; // Local data
struct mp_audio* c = data; // Current working data
@ -232,7 +232,7 @@ static struct mp_audio* play_s16_float(struct af_instance_s* af, struct mp_audio
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* l = af->data; // Local data
struct mp_audio* c = data; // Current working data
@ -313,7 +313,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -282,7 +282,7 @@ static inline void update_ch(af_hrtf_t *s, short *in, const int k)
}
/* Initialization and runtime control */
static int control(struct af_instance_s *af, int cmd, void* arg)
static int control(struct af_instance *af, int cmd, void* arg)
{
af_hrtf_t *s = af->setup;
int test_output_res;
@ -345,7 +345,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
}
/* Deallocate memory */
static void uninit(struct af_instance_s *af)
static void uninit(struct af_instance *af)
{
if(af->setup) {
af_hrtf_t *s = af->setup;
@ -381,7 +381,7 @@ frequencies).
2. A bass compensation is introduced to ensure that 0-200 Hz are not
damped (without any real 3D acoustical image, however).
*/
static struct mp_audio* play(struct af_instance_s *af, struct mp_audio *data)
static struct mp_audio* play(struct af_instance *af, struct mp_audio *data)
{
af_hrtf_t *s = af->setup;
short *in = data->audio; // Input audio data
@ -593,7 +593,7 @@ static int allocate(af_hrtf_t *s)
}
/* Allocate memory and set function pointers */
static int af_open(af_instance_t* af)
static int af_open(struct af_instance* af)
{
int i;
af_hrtf_t *s;

View File

@ -30,7 +30,7 @@
// Data for specific instances of this filter
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:
@ -44,13 +44,13 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
float* a = c->audio; // Audio data
@ -74,7 +74,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control = control;
af->uninit = uninit;
af->play = play;

View File

@ -95,7 +95,7 @@ typedef struct af_ladspa_s
/* ------------------------------------------------------------------------- */
static int af_open(af_instance_t *af);
static int af_open(struct af_instance *af);
static int af_ladspa_malloc_failed(char*);
/* ------------------------------------------------------------------------- */
@ -485,7 +485,7 @@ static int af_ladspa_malloc_failed(char *myname) {
* operation.
*/
static int control(struct af_instance_s *af, int cmd, void *arg) {
static int control(struct af_instance *af, int cmd, void *arg) {
af_ladspa_t *setup = (af_ladspa_t*) af->setup;
int i, r;
float val;
@ -650,7 +650,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
* \return No return value.
*/
static void uninit(struct af_instance_s *af) {
static void uninit(struct af_instance *af) {
int i;
free(af->data);
@ -710,7 +710,7 @@ static void uninit(struct af_instance_s *af) {
* \return Either AF_ERROR or AF_OK
*/
static struct mp_audio* play(struct af_instance_s *af, struct mp_audio *data) {
static struct mp_audio* play(struct af_instance *af, struct mp_audio *data) {
af_ladspa_t *setup = af->setup;
const LADSPA_Descriptor *pdes = setup->plugin_descriptor;
float *audio = (float*)data->audio;
@ -882,7 +882,7 @@ static struct mp_audio* play(struct af_instance_s *af, struct mp_audio *data) {
* \return Either AF_ERROR or AF_OK
*/
static int af_open(af_instance_t *af) {
static int af_open(struct af_instance *af) {
af->control=control;
af->uninit=uninit;

View File

@ -58,7 +58,7 @@ typedef struct af_ac3enc_s {
} af_ac3enc_t;
// Initialization and runtime control
static int control(struct af_instance_s *af, int cmd, void *arg)
static int control(struct af_instance *af, int cmd, void *arg)
{
af_ac3enc_t *s = af->setup;
struct mp_audio *data = arg;
@ -152,7 +152,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
if (af->data)
free(af->data->audio);
@ -170,7 +170,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_ac3enc_t *s = af->setup;
struct mp_audio *c = data; // Current working data
@ -275,7 +275,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
return c;
}
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af_ac3enc_t *s = calloc(1,sizeof(af_ac3enc_t));
af->control=control;

View File

@ -50,7 +50,7 @@ typedef struct af_resample_s{
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_resample_t* s = (af_resample_t*)af->setup;
struct mp_audio *data= (struct mp_audio*)arg;
@ -100,7 +100,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
if(af->data)
free(af->data->audio);
@ -116,7 +116,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_resample_t *s = af->setup;
int i, j, consumed, ret = 0;
@ -188,7 +188,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
return data;
}
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af_resample_t *s = calloc(1,sizeof(af_resample_t));
af->control=control;
af->uninit=uninit;

View File

@ -35,7 +35,7 @@ typedef struct af_pan_s
}af_pan_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_pan_t* s = af->setup;
@ -139,7 +139,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
if(af->data)
free(af->data->audio);
@ -148,7 +148,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
struct mp_audio* l = af->data; // Local data
@ -187,7 +187,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -122,7 +122,7 @@ static int linint(struct mp_audio* c,struct mp_audio* l, af_resample_t* s)
}
/* Determine resampling type and format */
static int set_types(struct af_instance_s* af, struct mp_audio* data)
static int set_types(struct af_instance* af, struct mp_audio* data)
{
af_resample_t* s = af->setup;
int rv = AF_OK;
@ -170,7 +170,7 @@ static int set_types(struct af_instance_s* af, struct mp_audio* data)
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:{
@ -302,7 +302,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
af_resample_t *s = af->setup;
if (s) {
@ -317,7 +317,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
int len = 0; // Length of output data
struct mp_audio* c = data; // Current working data
@ -370,7 +370,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -78,7 +78,7 @@ typedef struct af_scaletempo_s
short speed_pitch;
} af_scaletempo_t;
static int fill_queue(struct af_instance_s* af, struct mp_audio* data, int offset)
static int fill_queue(struct af_instance* af, struct mp_audio* data, int offset)
{
af_scaletempo_t* s = af->setup;
int bytes_in = data->len - offset;
@ -219,7 +219,7 @@ static void output_overlap_s16(af_scaletempo_t* s, void* buf_out,
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_scaletempo_t* s = af->setup;
int offset_in;
@ -285,7 +285,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_scaletempo_t* s = af->setup;
switch(cmd){
@ -533,7 +533,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
af_scaletempo_t* s = af->setup;
free(af->data->audio);
@ -547,7 +547,7 @@ static void uninit(struct af_instance_s* af)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af_scaletempo_t* s;
af->control = control;

View File

@ -41,11 +41,11 @@ typedef struct af_sinesuppress_s
double pos;
}af_sinesuppress_t;
static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data);
//static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data);
static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data);
//static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data);
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_sinesuppress_t* s = (af_sinesuppress_t*)af->setup;
@ -96,14 +96,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data)
{
af_sinesuppress_t *s = af->setup;
register int i = 0;
@ -134,7 +134,7 @@ static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data
}
#if 0
static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data)
{
af_sinesuppress_t *s = af->setup;
register int i = 0;
@ -158,7 +158,7 @@ static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* da
#endif
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play_s16;

View File

@ -60,7 +60,7 @@ typedef struct af_sub_s
}af_sub_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_sub_t* s = af->setup;
@ -121,7 +121,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
@ -139,7 +139,7 @@ static void uninit(struct af_instance_s* af)
#endif
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_sub_t* s = af->setup; // Setup for this instance
@ -161,7 +161,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af_sub_t* s;
af->control=control;
af->uninit=uninit;

View File

@ -86,7 +86,7 @@ typedef struct af_surround_s
}af_surround_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_surround_t *s = af->setup;
switch(cmd){
@ -147,7 +147,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
if(af->data)
free(af->data->audio);
@ -167,7 +167,7 @@ static float steering_matrix[][12] = {
//static int amp_L = 0, amp_R = 0, amp_C = 0, amp_S = 0;
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data){
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data){
af_surround_t* s = (af_surround_t*)af->setup;
float* m = steering_matrix[0];
float* in = data->audio; // Input audio data
@ -249,7 +249,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data){
return data;
}
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -34,7 +34,7 @@ typedef struct af_sweep_s{
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_sweept* s = (af_sweept*)af->setup;
struct mp_audio *data= (struct mp_audio*)arg;
@ -58,14 +58,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_sweept *s = af->setup;
int i, j;
@ -83,7 +83,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
return data;
}
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;

View File

@ -85,7 +85,7 @@ int af_to_ms(int n, int* in, float* out, int rate)
}
/* Helper function for testing the output format */
int af_test_output(struct af_instance_s* af, struct mp_audio* out)
int af_test_output(struct af_instance* af, struct mp_audio* out)
{
if((af->data->format != out->format) ||
(af->data->bps != out->bps) ||

View File

@ -78,7 +78,7 @@ typedef struct af_volume_s
}af_volnorm_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_volnorm_t* s = (af_volnorm_t*)af->setup;
@ -114,7 +114,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
@ -296,7 +296,7 @@ static void method2_float(af_volnorm_t *s, struct mp_audio *c)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_volnorm_t *s = af->setup;
@ -318,7 +318,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
int i = 0;
af->control=control;
af->uninit=uninit;

View File

@ -57,7 +57,7 @@ typedef struct af_volume_s
}af_volume_t;
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
static int control(struct af_instance* af, int cmd, void* arg)
{
af_volume_t* s = (af_volume_t*)af->setup;
@ -131,14 +131,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Deallocate memory
static void uninit(struct af_instance_s* af)
static void uninit(struct af_instance* af)
{
free(af->data);
free(af->setup);
}
// Filter data through filter
static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_volume_t* s = (af_volume_t*)af->setup; // Setup for this instance
@ -197,7 +197,7 @@ static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
}
// Allocate memory and set function pointers
static int af_open(af_instance_t* af){
static int af_open(struct af_instance* af){
int i = 0;
af->control=control;
af->uninit=uninit;

View File

@ -203,7 +203,7 @@ void mixer_setbalance(mixer_t *mixer, float val)
float level[AF_NCH];
int i;
af_control_ext_t arg_ext = { .arg = level };
af_instance_t *af_pan_balance;
struct af_instance *af_pan_balance;
mixer->balance = val;