2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_AUDIO_OUT_H
20 #define MPLAYER_AUDIO_OUT_H
26 typedef struct ao_info
{
27 /* driver name ("Matrox Millennium G200/G400" */
29 /* short name (for config strings) ("mga") */
30 const char *short_name
;
31 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
33 /* any additional comments */
37 /* interface towards mplayer and */
38 typedef struct ao_old_functions
{
39 int (*control
)(int cmd
, void *arg
);
40 int (*init
)(int rate
, int channels
, int format
, int flags
);
41 void (*uninit
)(int immed
);
43 int (*get_space
)(void);
44 int (*play
)(void *data
, int len
, int flags
);
45 float (*get_delay
)(void);
54 const struct ao_info
*info
;
55 const struct ao_old_functions
*old_functions
;
56 int (*control
)(struct ao
*ao
, int cmd
, void *arg
);
57 int (*init
)(struct ao
*ao
, char *params
);
58 void (*uninit
)(struct ao
*ao
, bool cut_audio
);
59 void (*reset
)(struct ao
*ao
);
60 int (*get_space
)(struct ao
*ao
);
61 int (*play
)(struct ao
*ao
, void *data
, int len
, int flags
);
62 float (*get_delay
)(struct ao
*ao
);
63 void (*pause
)(struct ao
*ao
);
64 void (*resume
)(struct ao
*ao
);
67 /* global data used by mplayer and plugins */
78 int buffer_playable_size
;
81 const struct ao_driver
*driver
;
85 extern char *ao_subdevice
;
87 void list_audio_out(void);
90 #define CONTROL_TRUE 1
91 #define CONTROL_FALSE 0
92 #define CONTROL_UNKNOWN -1
93 #define CONTROL_ERROR -2
96 #define AOCONTROL_SET_DEVICE 1
97 #define AOCONTROL_GET_DEVICE 2
98 #define AOCONTROL_QUERY_FORMAT 3 /* test for availabilty of a format */
99 #define AOCONTROL_GET_VOLUME 4
100 #define AOCONTROL_SET_VOLUME 5
101 #define AOCONTROL_SET_PLUGIN_DRIVER 6
102 #define AOCONTROL_SET_PLUGIN_LIST 7
104 #define AOPLAY_FINAL_CHUNK 1
106 typedef struct ao_control_vol
{
111 struct ao
*ao_create(void);
112 void ao_init(struct ao
*ao
, char **ao_list
);
113 void ao_uninit(struct ao
*ao
, bool cut_audio
);
114 int ao_play(struct ao
*ao
, void *data
, int len
, int flags
);
115 int ao_control(struct ao
*ao
, int cmd
, void *arg
);
116 double ao_get_delay(struct ao
*ao
);
117 int ao_get_space(struct ao
*ao
);
118 void ao_reset(struct ao
*ao
);
119 void ao_pause(struct ao
*ao
);
120 void ao_resume(struct ao
*ao
);
122 int old_ao_control(struct ao
*ao
, int cmd
, void *arg
);
123 int old_ao_init(struct ao
*ao
, char *params
);
124 void old_ao_uninit(struct ao
*ao
, bool cut_audio
);
125 void old_ao_reset(struct ao
*ao
);
126 int old_ao_get_space(struct ao
*ao
);
127 int old_ao_play(struct ao
*ao
, void *data
, int len
, int flags
);
128 float old_ao_get_delay(struct ao
*ao
);
129 void old_ao_pause(struct ao
*ao
);
130 void old_ao_resume(struct ao
*ao
);
132 #endif /* MPLAYER_AUDIO_OUT_H */