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
24 typedef struct ao_info_s
26 /* driver name ("Matrox Millennium G200/G400" */
28 /* short name (for config strings) ("mga") */
29 const char *short_name
;
30 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
32 /* any additional comments */
36 /* interface towards mplayer and */
37 typedef struct ao_functions
39 const ao_info_t
*info
;
40 int (*control
)(int cmd
,void *arg
);
41 int (*init
)(int rate
,int channels
,int format
,int flags
);
42 void (*uninit
)(int immed
);
44 int (*get_space
)(void);
45 int (*play
)(void* data
,int len
,int flags
);
46 float (*get_delay
)(void);
51 /* global data used by mplayer and plugins */
61 const struct ao_functions
*driver
;
64 extern char *ao_subdevice
;
66 void list_audio_out(void);
68 // NULL terminated array of all drivers
69 extern const ao_functions_t
* const audio_out_drivers
[];
72 #define CONTROL_TRUE 1
73 #define CONTROL_FALSE 0
74 #define CONTROL_UNKNOWN -1
75 #define CONTROL_ERROR -2
78 #define AOCONTROL_SET_DEVICE 1
79 #define AOCONTROL_GET_DEVICE 2
80 #define AOCONTROL_QUERY_FORMAT 3 /* test for availabilty of a format */
81 #define AOCONTROL_GET_VOLUME 4
82 #define AOCONTROL_SET_VOLUME 5
83 #define AOCONTROL_SET_PLUGIN_DRIVER 6
84 #define AOCONTROL_SET_PLUGIN_LIST 7
86 #define AOPLAY_FINAL_CHUNK 1
88 typedef struct ao_control_vol_s
{
93 struct ao
*ao_create(void);
94 void ao_init(struct ao
*ao
, char **ao_list
);
95 void ao_uninit(struct ao
*ao
, bool drain_audio
);
96 int ao_play(struct ao
*ao
, void *data
, int len
, int flags
);
97 int ao_control(struct ao
*ao
, int cmd
, void *arg
);
98 double ao_get_delay(struct ao
*ao
);
99 int ao_get_space(struct ao
*ao
);
100 void ao_reset(struct ao
*ao
);
101 void ao_pause(struct ao
*ao
);
102 void ao_resume(struct ao
*ao
);
104 #endif /* MPLAYER_AUDIO_OUT_H */