Mercurial > mplayer.hg
annotate libaf/control.h @ 26907:f0d0b666ee35
Fix compilation with internal dvdnav
author | rtogni |
---|---|
date | Sat, 31 May 2008 13:42:09 +0000 |
parents | 8db4448bf26c |
children | 72d0b1444141 |
rev | line source |
---|---|
26029 | 1 #ifndef MPLAYER_CONTROL_H |
2 #define MPLAYER_CONTROL_H | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
3 |
26182
8db4448bf26c
Add missing header #include to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
4 #include <sys/types.h> |
8db4448bf26c
Add missing header #include to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
5 |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
6 /********************************************* |
8607 | 7 // Control info struct. |
8 // | |
9 // This struct is the argument in a info call to a filter. | |
10 */ | |
11 | |
12 // Argument types | |
13 #define AF_CONTROL_TYPE_BOOL (0x0<<0) | |
14 #define AF_CONTROL_TYPE_CHAR (0x1<<0) | |
15 #define AF_CONTROL_TYPE_INT (0x2<<0) | |
16 #define AF_CONTROL_TYPE_FLOAT (0x3<<0) | |
17 #define AF_CONTROL_TYPE_STRUCT (0x4<<0) | |
18 #define AF_CONTROL_TYPE_SPECIAL (0x5<<0) // a pointer to a function for example | |
19 #define AF_CONTROL_TYPE_MASK (0x7<<0) | |
20 // Argument geometry | |
21 #define AF_CONTROL_GEOM_SCALAR (0x0<<3) | |
22 #define AF_CONTROL_GEOM_ARRAY (0x1<<3) | |
23 #define AF_CONTROL_GEOM_MATRIX (0x2<<3) | |
24 #define AF_CONTROL_GEOM_MASK (0x3<<3) | |
25 // Argument properties | |
26 #define AF_CONTROL_PROP_READ (0x0<<5) // The argument can be read | |
27 #define AF_CONTROL_PROP_WRITE (0x1<<5) // The argument can be written | |
28 #define AF_CONTROL_PROP_SAVE (0x2<<5) // Can be saved | |
29 #define AF_CONTROL_PROP_RUNTIME (0x4<<5) // Acessable during execution | |
30 #define AF_CONTROL_PROP_CHANNEL (0x8<<5) // Argument is set per channel | |
31 #define AF_CONTROL_PROP_MASK (0xF<<5) | |
32 | |
33 typedef struct af_control_info_s{ | |
34 int def; // Control enumrification | |
35 char* name; // Name of argument | |
36 char* info; // Description of what it does | |
37 int flags; // Flags as defined above | |
38 float max; // Max and min value | |
39 float min; // (only aplicable on float and int) | |
40 int xdim; // 1st dimension | |
41 int ydim; // 2nd dimension (=0 for everything except matrix) | |
42 size_t sz; // Size of argument in bytes | |
43 int ch; // Channel number (for future use) | |
44 void* arg; // Data (for future use) | |
45 }af_control_info_t; | |
46 | |
47 | |
48 /********************************************* | |
49 // Extended control used with arguments that operates on only one | |
50 // channel at the time | |
51 */ | |
52 typedef struct af_control_ext_s{ | |
53 void* arg; // Argument | |
54 int ch; // Chanel number | |
55 }af_control_ext_t; | |
56 | |
57 /********************************************* | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
58 // Control parameters |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
59 */ |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
60 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
61 /* The control system is divided into 3 levels |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
62 mandatory calls - all filters must answer to all of these |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
63 optional calls - are optional |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
64 filter specific calls - applies only to some filters |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
65 */ |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
66 |
8607 | 67 #define AF_CONTROL_MANDATORY 0x10000000 |
68 #define AF_CONTROL_OPTIONAL 0x20000000 | |
69 #define AF_CONTROL_FILTER_SPECIFIC 0x40000000 | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
70 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
71 // MANDATORY CALLS |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
72 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
73 /* Reinitialize filter. The optional argument contains the new |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
74 configuration in form of a af_data_t struct. If the filter does not |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
75 support the new format the struct should be changed and AF_FALSE |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
76 should be returned. If the incoming and outgoing data streams are |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
77 identical the filter can return AF_DETACH. This will remove the |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
78 filter. */ |
8607 | 79 #define AF_CONTROL_REINIT 0x00000100 | AF_CONTROL_MANDATORY |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
80 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
81 // OPTIONAL CALLS |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
82 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
83 /* Called just after creation with the af_cfg for the stream in which |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
84 the filter resides as input parameter this call can be used by the |
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.
anders
parents:
7745
diff
changeset
|
85 filter to initialize itself */ |
8607 | 86 #define AF_CONTROL_POST_CREATE 0x00000100 | AF_CONTROL_OPTIONAL |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
87 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
88 // Called just before destruction of a filter |
8607 | 89 #define AF_CONTROL_PRE_DESTROY 0x00000200 | AF_CONTROL_OPTIONAL |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
90 |
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.
anders
parents:
7745
diff
changeset
|
91 /* Commandline parameters. If there were any commandline parameters |
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.
anders
parents:
7745
diff
changeset
|
92 for this specific filter, they will be given as a char* in the |
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.
anders
parents:
7745
diff
changeset
|
93 argument */ |
8607 | 94 #define AF_CONTROL_COMMAND_LINE 0x00000300 | AF_CONTROL_OPTIONAL |
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.
anders
parents:
7745
diff
changeset
|
95 |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
96 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
97 // FILTER SPECIFIC CALLS |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
98 |
8607 | 99 // Basic operations: These can be ored with any of the below calls |
100 // Set argument | |
101 #define AF_CONTROL_SET 0x00000000 | |
102 // Get argument | |
103 #define AF_CONTROL_GET 0x00000001 | |
104 // Get info about the control, i.e fill in everything except argument | |
105 #define AF_CONTROL_INFO 0x00000002 | |
106 | |
107 // Resample | |
108 | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
109 // Set output rate in resample |
8607 | 110 #define AF_CONTROL_RESAMPLE_RATE 0x00000100 | AF_CONTROL_FILTER_SPECIFIC |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
111 |
8607 | 112 // Enable sloppy resampling |
113 #define AF_CONTROL_RESAMPLE_SLOPPY 0x00000200 | AF_CONTROL_FILTER_SPECIFIC | |
114 | |
115 // Set resampling accuracy | |
116 #define AF_CONTROL_RESAMPLE_ACCURACY 0x00000300 | AF_CONTROL_FILTER_SPECIFIC | |
117 | |
14335
8380694ba14f
af_bits2fmt and af_str2fmt_short, also removed the extra FORMAT_BPS control in format.c
alex
parents:
13550
diff
changeset
|
118 // Format |
8607 | 119 |
14335
8380694ba14f
af_bits2fmt and af_str2fmt_short, also removed the extra FORMAT_BPS control in format.c
alex
parents:
13550
diff
changeset
|
120 #define AF_CONTROL_FORMAT_FMT 0x00000400 | AF_CONTROL_FILTER_SPECIFIC |
8607 | 121 |
122 // Channels | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
123 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
124 // Set number of output channels in channels |
8607 | 125 #define AF_CONTROL_CHANNELS 0x00000600 | AF_CONTROL_FILTER_SPECIFIC |
126 | |
127 // Set number of channel routes | |
128 #define AF_CONTROL_CHANNELS_ROUTES 0x00000700 | AF_CONTROL_FILTER_SPECIFIC | |
129 | |
130 // Set channel routing pair, arg is int[2] and ch is used | |
131 #define AF_CONTROL_CHANNELS_ROUTING 0x00000800 | AF_CONTROL_FILTER_SPECIFIC | |
132 | |
133 // Set nuber of channel routing pairs, arg is int* | |
134 #define AF_CONTROL_CHANNELS_NR 0x00000900 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
135 |
8607 | 136 // Set make af_channels into a router |
137 #define AF_CONTROL_CHANNELS_ROUTER 0x00000A00 | AF_CONTROL_FILTER_SPECIFIC | |
138 | |
139 // Volume | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
140 |
8607 | 141 // Turn volume control on and off, arg is int* |
142 #define AF_CONTROL_VOLUME_ON_OFF 0x00000B00 | AF_CONTROL_FILTER_SPECIFIC | |
143 | |
144 // Turn soft clipping of the volume on and off, arg is binary | |
145 #define AF_CONTROL_VOLUME_SOFTCLIP 0x00000C00 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
146 |
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
147 // Set volume level, arg is a float* with the volume for all the channels |
8607 | 148 #define AF_CONTROL_VOLUME_LEVEL 0x00000D00 | AF_CONTROL_FILTER_SPECIFIC |
149 | |
150 // Probed power level for all channels, arg is a float* | |
151 #define AF_CONTROL_VOLUME_PROBE 0x00000E00 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
152 |
8607 | 153 // Maximum probed power level for all channels, arg is a float* |
154 #define AF_CONTROL_VOLUME_PROBE_MAX 0x00000F00 | AF_CONTROL_FILTER_SPECIFIC | |
155 | |
156 // Compressor/expander | |
157 | |
158 // Turn compressor/expander on and off | |
159 #define AF_CONTROL_COMP_ON_OFF 0x00001000 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
160 |
8607 | 161 // Compression/expansion threshold [dB] |
162 #define AF_CONTROL_COMP_THRESH 0x00001100 | AF_CONTROL_FILTER_SPECIFIC | |
163 | |
164 // Compression/expansion attack time [ms] | |
165 #define AF_CONTROL_COMP_ATTACK 0x00001200 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
166 |
8607 | 167 // Compression/expansion release time [ms] |
168 #define AF_CONTROL_COMP_RELEASE 0x00001300 | AF_CONTROL_FILTER_SPECIFIC | |
169 | |
170 // Compression/expansion gain level [dB] | |
171 #define AF_CONTROL_COMP_RATIO 0x00001400 | AF_CONTROL_FILTER_SPECIFIC | |
172 | |
173 // Noise gate | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
174 |
8607 | 175 // Turn noise gate on an off |
176 #define AF_CONTROL_GATE_ON_OFF 0x00001500 | AF_CONTROL_FILTER_SPECIFIC | |
177 | |
178 // Noise gate threshold [dB] | |
179 #define AF_CONTROL_GATE_THRESH 0x00001600 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
180 |
8607 | 181 // Noise gate attack time [ms] |
182 #define AF_CONTROL_GATE_ATTACK 0x00001700 | AF_CONTROL_FILTER_SPECIFIC | |
183 | |
184 // Noise gate release time [ms] | |
185 #define AF_CONTROL_GATE_RELEASE 0x00001800 | AF_CONTROL_FILTER_SPECIFIC | |
186 | |
187 // Noise gate release range level [dB] | |
188 #define AF_CONTROL_GATE_RANGE 0x00001900 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
189 |
8607 | 190 // Pan |
191 | |
192 // Pan levels, arg is a control_ext with a float* | |
193 #define AF_CONTROL_PAN_LEVEL 0x00001A00 | AF_CONTROL_FILTER_SPECIFIC | |
7745
1d3a3dc1f488
Adding volume control and moving control() call parameters to a seperate file
anders
parents:
diff
changeset
|
194 |
8607 | 195 // Number of outputs from pan, arg is int* |
196 #define AF_CONTROL_PAN_NOUT 0x00001B00 | AF_CONTROL_FILTER_SPECIFIC | |
197 | |
23551 | 198 // Balance, arg is float*; range -1 (left) to 1 (right), 0 center |
199 #define AF_CONTROL_PAN_BALANCE 0x00002500 | AF_CONTROL_FILTER_SPECIFIC | |
8073 | 200 |
8607 | 201 // Set equalizer gain, arg is a control_ext with a float* |
202 #define AF_CONTROL_EQUALIZER_GAIN 0x00001C00 | AF_CONTROL_FILTER_SPECIFIC | |
203 | |
204 | |
8832
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
205 // Delay length in ms, arg is a control_ext with a float* |
8607 | 206 #define AF_CONTROL_DELAY_LEN 0x00001D00 | AF_CONTROL_FILTER_SPECIFIC |
207 | |
8073 | 208 |
8832
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
209 // Subwoofer |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
210 |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
211 // Channel number which to insert the filtered data, arg in int* |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
212 #define AF_CONTROL_SUB_CH 0x00001E00 | AF_CONTROL_FILTER_SPECIFIC |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
213 |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
214 // Cutoff frequency [Hz] for lowpass filter, arg is float* |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
215 #define AF_CONTROL_SUB_FC 0x00001F00 | AF_CONTROL_FILTER_SPECIFIC |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
216 |
a1578b329cc0
Adding sub-woofer filter, use this filter to add a sub channel to the audio stream
anders
parents:
8607
diff
changeset
|
217 |
10892
2167ac4c1d72
Adding filter for exporting audio data to visual effect applications
anders
parents:
8832
diff
changeset
|
218 // Export |
2167ac4c1d72
Adding filter for exporting audio data to visual effect applications
anders
parents:
8832
diff
changeset
|
219 #define AF_CONTROL_EXPORT_SZ 0x00002000 | AF_CONTROL_FILTER_SPECIFIC |
2167ac4c1d72
Adding filter for exporting audio data to visual effect applications
anders
parents:
8832
diff
changeset
|
220 |
13550
81e62cbe57d9
reimplementation of the pl_extrastereo and pl_volnorm plugins
alex
parents:
10892
diff
changeset
|
221 |
81e62cbe57d9
reimplementation of the pl_extrastereo and pl_volnorm plugins
alex
parents:
10892
diff
changeset
|
222 // ExtraStereo Multiplier |
81e62cbe57d9
reimplementation of the pl_extrastereo and pl_volnorm plugins
alex
parents:
10892
diff
changeset
|
223 #define AF_CONTROL_ES_MUL 0x00002100 | AF_CONTROL_FILTER_SPECIFIC |
81e62cbe57d9
reimplementation of the pl_extrastereo and pl_volnorm plugins
alex
parents:
10892
diff
changeset
|
224 |
14749
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
225 |
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
226 // Center |
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
227 |
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
228 // Channel number which to inster the filtered data, arg in int* |
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
229 #define AF_CONTROL_CENTER_CH 0x00002200 | AF_CONTROL_FILTER_SPECIFIC |
ab617c2e24d3
filter for adding a center channel, adding a high pass filter would be nice
alex
parents:
14335
diff
changeset
|
230 |
18082
0aa3fef68422
very simple filter which can remove a sine at a specified frequency, usefull to get rid of the 50/60hz noise on ultra crappy equipment
michael
parents:
14749
diff
changeset
|
231 |
18611
1c2f694d5232
Rename sinesupress to sinesuppress, including af_sinesupress.c file rename.
corey
parents:
18082
diff
changeset
|
232 // SineSuppress |
18082
0aa3fef68422
very simple filter which can remove a sine at a specified frequency, usefull to get rid of the 50/60hz noise on ultra crappy equipment
michael
parents:
14749
diff
changeset
|
233 #define AF_CONTROL_SS_FREQ 0x00002300 | AF_CONTROL_FILTER_SPECIFIC |
0aa3fef68422
very simple filter which can remove a sine at a specified frequency, usefull to get rid of the 50/60hz noise on ultra crappy equipment
michael
parents:
14749
diff
changeset
|
234 #define AF_CONTROL_SS_DECAY 0x00002400 | AF_CONTROL_FILTER_SPECIFIC |
0aa3fef68422
very simple filter which can remove a sine at a specified frequency, usefull to get rid of the 50/60hz noise on ultra crappy equipment
michael
parents:
14749
diff
changeset
|
235 |
24896 | 236 #define AF_CONTROL_PLAYBACK_SPEED 0x00002500 | AF_CONTROL_FILTER_SPECIFIC |
237 #define AF_CONTROL_SCALETEMPO_AMOUNT 0x00002600 | AF_CONTROL_FILTER_SPECIFIC | |
238 | |
26029 | 239 #endif /* MPLAYER_CONTROL_H */ |