annotate libaf/af.h @ 28721:267dd38c800e

When converting from a non alpha format to an alpha format, defaults to all ones rather than all zeroes
author sdrik
date Sat, 28 Feb 2009 08:01:52 +0000
parents 31287e75b5d8
children 8c706ce21c6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28229
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
1 /*
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
2 * This file is part of MPlayer.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
3 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
5 * it under the terms of the GNU General Public License as published by
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
7 * (at your option) any later version.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
8 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
12 * GNU General Public License for more details.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
13 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
14 * You should have received a copy of the GNU General Public License along
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
17 */
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 26203
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25551
diff changeset
19 #ifndef MPLAYER_AF_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25551
diff changeset
20 #define MPLAYER_AF_H
12676
alex
parents: 12668
diff changeset
21
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
22 #include <stdio.h>
e8832e66babd New features:
anders
parents: 8073
diff changeset
23
26203
0d255d03016f #include config.h before all other headers.
diego
parents: 26029
diff changeset
24 #include "config.h"
8180
4ba9aed295f2 Fixing segfault bug and addnig support for lrintf() in format conversion
anders
parents: 8167
diff changeset
25 #include "af_mp.h"
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
26 #include "control.h"
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
27 #include "af_format.h"
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
28
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
29 struct af_instance_s;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
30
21233
0b17f818d393 Remove config.h and move its content to af.h. There are multiple files under
diego
parents: 21232
diff changeset
31 // Number of channels
0b17f818d393 Remove config.h and move its content to af.h. There are multiple files under
diego
parents: 21232
diff changeset
32 #ifndef AF_NCH
0b17f818d393 Remove config.h and move its content to af.h. There are multiple files under
diego
parents: 21232
diff changeset
33 #define AF_NCH 6
0b17f818d393 Remove config.h and move its content to af.h. There are multiple files under
diego
parents: 21232
diff changeset
34 #endif
0b17f818d393 Remove config.h and move its content to af.h. There are multiple files under
diego
parents: 21232
diff changeset
35
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
36 // Audio data chunk
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
37 typedef struct af_data_s
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 void* audio; // data buffer
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
40 int len; // buffer length
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
41 int rate; // sample rate
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
42 int nch; // number of channels
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
43 int format; // format
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
44 int bps; // bytes per sample
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
45 } af_data_t;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
46
14433
95bb94a930a3 always cancel down fractions (frac_t) to avoid overflows and playback
reimar
parents: 14292
diff changeset
47
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
48 // Flags used for defining the behavior of an audio filter
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7598
diff changeset
49 #define AF_FLAGS_REENTRANT 0x00000000
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7598
diff changeset
50 #define AF_FLAGS_NOT_REENTRANT 0x00000001
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7598
diff changeset
51
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
52 /* Audio filter information not specific for current instance, but for
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
53 a specific filter */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
54 typedef struct af_info_s
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
55 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
56 const char *info;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
57 const char *name;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
58 const char *author;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
59 const char *comment;
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7598
diff changeset
60 const int flags;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
61 int (*open)(struct af_instance_s* vf);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
62 } af_info_t;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
63
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
64 // Linked list of audio filters
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
65 typedef struct af_instance_s
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
66 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
67 af_info_t* info;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
68 int (*control)(struct af_instance_s* af, int cmd, void* arg);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
69 void (*uninit)(struct af_instance_s* af);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
70 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
71 void* setup; // setup data for this specific instance and filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
72 af_data_t* data; // configuration for outgoing data stream
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
73 struct af_instance_s* next;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
74 struct af_instance_s* prev;
24900
9079c9745ff9 A/V sync: take audio filter buffers into account
uau
parents: 24892
diff changeset
75 double delay; /* Delay caused by the filter, in units of bytes read without
9079c9745ff9 A/V sync: take audio filter buffers into account
uau
parents: 24892
diff changeset
76 * corresponding output */
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 24887
diff changeset
77 double mul; /* length multiplier: how much does this instance change
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
78 the length of the buffer. */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
79 }af_instance_t;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
80
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
81 // Initialization flags
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
82 extern int* af_cpu_speed;
e8832e66babd New features:
anders
parents: 8073
diff changeset
83
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
84 #define AF_INIT_AUTO 0x00000000
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
85 #define AF_INIT_SLOW 0x00000001
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
86 #define AF_INIT_FAST 0x00000002
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
87 #define AF_INIT_FORCE 0x00000003
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
88 #define AF_INIT_TYPE_MASK 0x00000003
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
89
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8674
diff changeset
90 #define AF_INIT_INT 0x00000000
8868
398e3fb7c103 10l bug for float conversion control + feature fix in volume control
anders
parents: 8867
diff changeset
91 #define AF_INIT_FLOAT 0x00000004
398e3fb7c103 10l bug for float conversion control + feature fix in volume control
anders
parents: 8867
diff changeset
92 #define AF_INIT_FORMAT_MASK 0x00000004
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8674
diff changeset
93
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
94 // Default init type
e8832e66babd New features:
anders
parents: 8073
diff changeset
95 #ifndef AF_INIT_TYPE
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28291
diff changeset
96 #if HAVE_SSE || HAVE_AMD3DNOW
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
97 #define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_FAST)
e8832e66babd New features:
anders
parents: 8073
diff changeset
98 #else
e8832e66babd New features:
anders
parents: 8073
diff changeset
99 #define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_SLOW)
e8832e66babd New features:
anders
parents: 8073
diff changeset
100 #endif
e8832e66babd New features:
anders
parents: 8073
diff changeset
101 #endif
e8832e66babd New features:
anders
parents: 8073
diff changeset
102
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
103 // Configuration switches
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
104 typedef struct af_cfg_s{
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
105 int force; // Initialization type
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
106 char** list; /* list of names of filters that are added to filter
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
107 list during first initialization of stream */
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
108 }af_cfg_t;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
109
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
110 // Current audio stream
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
111 typedef struct af_stream_s
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
112 {
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
113 // The first and last filter in the list
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
114 af_instance_t* first;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
115 af_instance_t* last;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
116 // Storage for input and output data formats
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
117 af_data_t input;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
118 af_data_t output;
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
119 // Configuration for this stream
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
120 af_cfg_t cfg;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
121 }af_stream_t;
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
122
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
123 /*********************************************
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
124 // Return values
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
125 */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
126
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
127 #define AF_DETACH 2
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
128 #define AF_OK 1
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
129 #define AF_TRUE 1
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
130 #define AF_FALSE 0
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
131 #define AF_UNKNOWN -1
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
132 #define AF_ERROR -2
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
133 #define AF_FATAL -3
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
134
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
135
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
136
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
137 /*********************************************
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
138 // Export functions
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
139 */
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
140
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
141 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
142 * \defgroup af_chain Audio filter chain functions
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
143 * \{
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
144 * \param s filter chain
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
145 */
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
146
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
147 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
148 * \brief Initialize the stream "s".
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
149 * \return 0 on success, -1 on failure
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
150 *
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
151 * This function creates a new filter list if necessary, according
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
152 * to the values set in input and output. Input and output should contain
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
153 * the format of the current movie and the format of the preferred output
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
154 * respectively.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
155 * Filters to convert to the preferred output format are inserted
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
156 * automatically, except when they are set to 0.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
157 * The function is reentrant i.e. if called with an already initialized
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
158 * stream the stream will be reinitialized.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
159 */
15811
9b4bbb6098f6 make -srate work again, unify audio filter init and preinit.
reimar
parents: 14883
diff changeset
160 int af_init(af_stream_t* s);
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
161
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
162 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
163 * \brief Uninit and remove all filters from audio filter chain
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
164 */
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
165 void af_uninit(af_stream_t* s);
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
166
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
167 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
168 * \brief This function adds the filter "name" to the stream s.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
169 * \param name name of filter to add
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
170 * \return pointer to the new filter, NULL if insert failed
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
171 *
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
172 * The filter will be inserted somewhere nice in the
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
173 * list of filters (i.e. at the beginning unless the
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
174 * first filter is the format filter (why??).
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
175 */
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
176 af_instance_t* af_add(af_stream_t* s, char* name);
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
177
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
178 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
179 * \brief Uninit and remove the filter "af"
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
180 * \param af filter to remove
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
181 */
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
182 void af_remove(af_stream_t* s, af_instance_t* af);
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
183
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
184 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
185 * \brief find filter in chain by name
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
186 * \param name name of the filter to find
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
187 * \return first filter with right name or NULL if not found
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
188 *
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
189 * This function is used for finding already initialized filters
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
190 */
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
191 af_instance_t* af_get(af_stream_t* s, char* name);
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
192
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
193 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
194 * \brief filter data chunk through the filters in the list
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
195 * \param data data to play
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
196 * \return resulting data
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
197 * \ingroup af_chain
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
198 */
7571
8819fdf88b5d Adding support for multiple audio streams and removing annoying message from resample and format
anders
parents: 7568
diff changeset
199 af_data_t* af_play(af_stream_t* s, af_data_t* data);
7649
90e16aa8ae5f Adding functionality for adding filters during execution
anders
parents: 7615
diff changeset
200
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
201 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
202 * \brief send control to all filters, starting with the last until
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
203 * one accepts the command with AF_OK.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
204 * \param cmd filter control command
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
205 * \param arg argument for filter command
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
206 * \return the accepting filter or NULL if none was found
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
207 */
14292
12239a0d5408 Make af_control_any_rev return the matching filter
reimar
parents: 13269
diff changeset
208 af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg);
12668
ce6ab8cb8597 Send a command throught the filter chain until some item returns AF_OK. Patch by Reimar Doeffinger
alex
parents: 8969
diff changeset
209
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
210 /**
24892
80180dc13565 Change decode_audio() interface
uau
parents: 24889
diff changeset
211 * \brief calculate average ratio of filter output lenth to input length
80180dc13565 Change decode_audio() interface
uau
parents: 24889
diff changeset
212 * \return the ratio
80180dc13565 Change decode_audio() interface
uau
parents: 24889
diff changeset
213 */
80180dc13565 Change decode_audio() interface
uau
parents: 24889
diff changeset
214 double af_calc_filter_multiplier(af_stream_t* s);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
215
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
216 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
217 * \brief Calculate the total delay caused by the filters
24900
9079c9745ff9 A/V sync: take audio filter buffers into account
uau
parents: 24892
diff changeset
218 * \return delay in bytes of "missing" output
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
219 */
7665
fbd5445cc853 Adding function for calculating the delay caused by the filters
anders
parents: 7649
diff changeset
220 double af_calc_delay(af_stream_t* s);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
221
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
222 /** \} */ // end of af_chain group
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
223
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
224 // Helper functions and macros used inside the audio filters
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
225
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
226 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
227 * \defgroup af_filter Audio filter helper functions
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
228 * \{
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
229 */
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
230
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
231 /* Helper function called by the macro with the same name only to be
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
232 called from inside filters */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
233 int af_resize_local_buffer(af_instance_t* af, af_data_t* data);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
234
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
235 /* Helper function used to calculate the exact buffer length needed
7589
443b440798a5 Redesign of buffer length calculation
anders
parents: 7571
diff changeset
236 when buffers are resized. The returned length is >= than what is
443b440798a5 Redesign of buffer length calculation
anders
parents: 7571
diff changeset
237 needed */
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 24887
diff changeset
238 int af_lencalc(double mul, af_data_t* data);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
239
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
240 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
241 * \brief convert dB to gain value
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
242 * \param n number of values to convert
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
243 * \param in [in] values in dB, <= -200 will become 0 gain
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
244 * \param out [out] gain values
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
245 * \param k input values are divided by this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
246 * \param mi minimum dB value, input will be clamped to this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
247 * \param ma maximum dB value, input will be clamped to this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
248 * \return AF_ERROR on error, AF_OK otherwise
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
249 */
8607
d6f40a06867b Changes includes:
anders
parents: 8180
diff changeset
250 int af_from_dB(int n, float* in, float* out, float k, float mi, float ma);
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
251
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
252 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
253 * \brief convert gain value to dB
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
254 * \param n number of values to convert
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
255 * \param in [in] gain values, 0 wil become -200 dB
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
256 * \param out [out] values in dB
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
257 * \param k output values will be multiplied by this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
258 * \return AF_ERROR on error, AF_OK otherwise
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
259 */
8607
d6f40a06867b Changes includes:
anders
parents: 8180
diff changeset
260 int af_to_dB(int n, float* in, float* out, float k);
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
261
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
262 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
263 * \brief convert milliseconds to sample time
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
264 * \param n number of values to convert
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
265 * \param in [in] values in milliseconds
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
266 * \param out [out] sample time values
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
267 * \param rate sample rate
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
268 * \param mi minimum ms value, input will be clamped to this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
269 * \param ma maximum ms value, input will be clamped to this
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
270 * \return AF_ERROR on error, AF_OK otherwise
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
271 */
8674
93212da0032e 10l memory leak + bug fixes in ms to sample time conversion
anders
parents: 8607
diff changeset
272 int af_from_ms(int n, float* in, int* out, int rate, float mi, float ma);
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
273
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
274 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
275 * \brief convert sample time to milliseconds
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
276 * \param n number of values to convert
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
277 * \param in [in] sample time values
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
278 * \param out [out] values in milliseconds
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
279 * \param rate sample rate
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
280 * \return AF_ERROR on error, AF_OK otherwise
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
281 */
8674
93212da0032e 10l memory leak + bug fixes in ms to sample time conversion
anders
parents: 8607
diff changeset
282 int af_to_ms(int n, int* in, float* out, int rate);
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
283
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
284 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
285 * \brief test if output format matches
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
286 * \param af audio filter
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
287 * \param out needed format, will be overwritten by available
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
288 * format if they do not match
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
289 * \return AF_FALSE if formats do not match, AF_OK if they match
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
290 *
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
291 * compares the format, bps, rate and nch values of af->data with out
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
292 */
8607
d6f40a06867b Changes includes:
anders
parents: 8180
diff changeset
293 int af_test_output(struct af_instance_s* af, af_data_t* out);
d6f40a06867b Changes includes:
anders
parents: 8180
diff changeset
294
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
295 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
296 * \brief soft clipping function using sin()
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
297 * \param a input value
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
298 * \return clipped value
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
299 */
14622
637fbaa8f56c af_softclip
alex
parents: 14433
diff changeset
300 float af_softclip(float a);
637fbaa8f56c af_softclip
alex
parents: 14433
diff changeset
301
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
302 /** \} */ // end of af_filter group, but more functions of this group below
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
303
13269
aa13937da8a0 mplayer -af help now lists all available audio filters.
ivo
parents: 12676
diff changeset
304 /** Print a list of all available audio filters */
aa13937da8a0 mplayer -af help now lists all available audio filters.
ivo
parents: 12676
diff changeset
305 void af_help(void);
aa13937da8a0 mplayer -af help now lists all available audio filters.
ivo
parents: 12676
diff changeset
306
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
307 /**
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
308 * \brief fill the missing parameters in the af_data_t structure
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
309 * \param data structure to fill
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
310 * \ingroup af_filter
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
311 *
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
312 * Currently only sets bps based on format
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
313 */
14883
0c0ef2177115 obvious typo
rathann
parents: 14818
diff changeset
314 void af_fix_parameters(af_data_t *data);
14818
663c1ea5f595 finally remove the refences to bps outside libaf. also simplification of some messages and removed redundants
alex
parents: 14622
diff changeset
315
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
316 /** Memory reallocation macro: if a local buffer is used (i.e. if the
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
317 filter doesn't operate on the incoming buffer this macro must be
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
318 called to ensure the buffer is big enough.
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
319 * \ingroup af_filter
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
320 */
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
321 #define RESIZE_LOCAL_BUFFER(a,d)\
7591
5ef4d009f950 Correcting error in macro
anders
parents: 7589
diff changeset
322 ((a->data->len < af_lencalc(a->mul,d))?af_resize_local_buffer(a,d):AF_OK)
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
323
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
324 /* Some other useful macro definitions*/
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
325 #ifndef min
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
326 #define min(a,b)(((a)>(b))?(b):(a))
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
327 #endif
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
328
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
329 #ifndef max
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
330 #define max(a,b)(((a)>(b))?(a):(b))
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
331 #endif
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
332
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
333 #ifndef clamp
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
334 #define clamp(a,min,max) (((a)>(max))?(max):(((a)<(min))?(min):(a)))
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
335 #endif
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
336
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
337 #ifndef sign
8073
c0e556f9986b Adding equalizer filter + some cosmetics
anders
parents: 7745
diff changeset
338 #define sign(a) (((a)>0)?(1):(-1))
c0e556f9986b Adding equalizer filter + some cosmetics
anders
parents: 7745
diff changeset
339 #endif
c0e556f9986b Adding equalizer filter + some cosmetics
anders
parents: 7745
diff changeset
340
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
341 #ifndef lrnd
e8832e66babd New features:
anders
parents: 8073
diff changeset
342 #define lrnd(a,b) ((b)((a)>=0.0?(a)+0.5:(a)-0.5))
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
343 #endif
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
344
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
345 /* Error messages */
e8832e66babd New features:
anders
parents: 8073
diff changeset
346
e8832e66babd New features:
anders
parents: 8073
diff changeset
347 typedef struct af_msg_cfg_s
e8832e66babd New features:
anders
parents: 8073
diff changeset
348 {
e8832e66babd New features:
anders
parents: 8073
diff changeset
349 int level; /* Message level for debug and error messages max = 2
e8832e66babd New features:
anders
parents: 8073
diff changeset
350 min = -2 default = 0 */
e8832e66babd New features:
anders
parents: 8073
diff changeset
351 FILE* err; // Stream to print error messages to
e8832e66babd New features:
anders
parents: 8073
diff changeset
352 FILE* msg; // Stream to print information messages to
e8832e66babd New features:
anders
parents: 8073
diff changeset
353 }af_msg_cfg_t;
e8832e66babd New features:
anders
parents: 8073
diff changeset
354
e8832e66babd New features:
anders
parents: 8073
diff changeset
355 extern af_msg_cfg_t af_msg_cfg; // Message
e8832e66babd New features:
anders
parents: 8073
diff changeset
356
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
357 //! \addtogroup af_filter
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
358 //! \{
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
359 #define AF_MSG_FATAL -3 ///< Fatal error exit immediately
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
360 #define AF_MSG_ERROR -2 ///< Error return gracefully
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
361 #define AF_MSG_WARN -1 ///< Print warning but do not exit (can be suppressed)
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
362 #define AF_MSG_INFO 0 ///< Important information
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
363 #define AF_MSG_VERBOSE 1 ///< Print this if verbose is enabled
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
364 #define AF_MSG_DEBUG0 2 ///< Print if very verbose
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
365 #define AF_MSG_DEBUG1 3 ///< Print if very very verbose
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
366
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
367 //! Macro for printing error messages
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
368 #ifndef af_msg
e8832e66babd New features:
anders
parents: 8073
diff changeset
369 #define af_msg(lev, args... ) \
8957
36a5cdca733b bunkus: Encapsulated arguments to #define in ( ... ) so that the #defines can be safely used like functions: mydef(flag ? val1 : val2)
mosu
parents: 8868
diff changeset
370 (((lev)<AF_MSG_WARN)?(fprintf(af_msg_cfg.err?af_msg_cfg.err:stderr, ## args )): \
36a5cdca733b bunkus: Encapsulated arguments to #define in ( ... ) so that the #defines can be safely used like functions: mydef(flag ? val1 : val2)
mosu
parents: 8868
diff changeset
371 (((lev)<=af_msg_cfg.level)?(fprintf(af_msg_cfg.msg?af_msg_cfg.msg:stdout, ## args )):0))
7745
1d3a3dc1f488 Adding volume control and moving control() call parameters to a seperate file
anders
parents: 7665
diff changeset
372 #endif
16627
584bd8980d57 documentation-only patch: make doxygen compatible and create
reimar
parents: 15811
diff changeset
373 //! \}
8167
e8832e66babd New features:
anders
parents: 8073
diff changeset
374
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25551
diff changeset
375 #endif /* MPLAYER_AF_H */