annotate libaf/af_dummy.c @ 7993:ea0680d87f3f

Changing the behavour of the commandline parameter -af to conform with -vop. Adding new commanline parameter -af-adv for advanced af options. Adding changes to volume control to support commandline parameters.
author anders
date Thu, 31 Oct 2002 08:03:51 +0000
parents c67328dd459a
children e8832e66babd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
1 /* The name speaks for itself this filter is a dummy and will not blow
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
2 up regardless of what you do with it. */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
3 #include <stdio.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
4 #include <stdlib.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
5 #include <string.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
6
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
7 #include "../config.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
8 #include "../mp_msg.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
9
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
10 #include "af.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
11
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
12 // Initialization and runtime control
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
13 static int control(struct af_instance_s* af, int cmd, void* arg)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
14 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
15 switch(cmd){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
16 case AF_CONTROL_REINIT:
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
17 memcpy(af->data,(af_data_t*)arg,sizeof(af_data_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
18 mp_msg(MSGT_AFILTER,MSGL_V,"[dummy] Was reinitialized, rate=%iHz, nch = %i, format = 0x%08X and bps = %i\n",af->data->rate,af->data->nch,af->data->format,af->data->bps);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
19 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
20 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
21 return AF_UNKNOWN;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
22 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
23
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
24 // Deallocate memory
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
25 static void uninit(struct af_instance_s* af)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
26 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
27 if(af->data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
28 free(af->data);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
29 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
30
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
31 // Filter data through filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
32 static af_data_t* play(struct af_instance_s* af, af_data_t* data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
33 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
34 // Do something necessary to get rid of annoying warning during compile
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
35 if(!af)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
36 printf("EEEK: Argument af == NULL in af_dummy.c play().");
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
37 return data;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
38 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
39
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
40 // Allocate memory and set function pointers
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
41 static int open(af_instance_t* af){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
42 af->control=control;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
43 af->uninit=uninit;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
44 af->play=play;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
45 af->mul.d=1;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
46 af->mul.n=1;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
47 af->data=malloc(sizeof(af_data_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
48 if(af->data == NULL)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
49 return AF_ERROR;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
50 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
51 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
52
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
53 // Description of this filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
54 af_info_t af_info_dummy = {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
55 "dummy",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
56 "dummy",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
57 "Anders",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
58 "",
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7568
diff changeset
59 AF_FLAGS_REENTRANT,
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
60 open
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
61 };