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
27 #define CONTROL_TRUE 1
28 #define CONTROL_FALSE 0
29 #define CONTROL_UNKNOWN -1
30 #define CONTROL_ERROR -2
34 // _VOLUME commands take struct ao_control_vol pointer for input/output.
35 // If there's only one volume, SET should use average of left/right.
38 // _MUTE commands take a pointer to bool
43 #define AOPLAY_FINAL_CHUNK 1
45 typedef struct ao_control_vol
{
50 typedef struct ao_info
{
51 /* driver name ("Matrox Millennium G200/G400" */
53 /* short name (for config strings) ("mga") */
54 const char *short_name
;
55 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
57 /* any additional comments */
61 /* interface towards mplayer and */
62 typedef struct ao_old_functions
{
63 int (*control
)(int cmd
, void *arg
);
64 int (*init
)(int rate
, int channels
, int format
, int flags
);
65 void (*uninit
)(int immed
);
67 int (*get_space
)(void);
68 int (*play
)(void *data
, int len
, int flags
);
69 float (*get_delay
)(void);
78 const struct ao_info
*info
;
79 const struct ao_old_functions
*old_functions
;
80 int (*control
)(struct ao
*ao
, enum aocontrol cmd
, void *arg
);
81 int (*init
)(struct ao
*ao
, char *params
);
82 void (*uninit
)(struct ao
*ao
, bool cut_audio
);
83 void (*reset
)(struct ao
*ao
);
84 int (*get_space
)(struct ao
*ao
);
85 int (*play
)(struct ao
*ao
, void *data
, int len
, int flags
);
86 float (*get_delay
)(struct ao
*ao
);
87 void (*pause
)(struct ao
*ao
);
88 void (*resume
)(struct ao
*ao
);
91 /* global data used by mplayer and plugins */
102 int buffer_playable_size
;
105 bool no_persistent_volume
;
106 const struct ao_driver
*driver
;
109 struct input_ctx
*input_ctx
;
112 extern char *ao_subdevice
;
114 void list_audio_out(void);
116 struct ao
*ao_create(struct MPOpts
*opts
, struct input_ctx
*input
);
117 void ao_init(struct ao
*ao
, char **ao_list
);
118 void ao_uninit(struct ao
*ao
, bool cut_audio
);
119 int ao_play(struct ao
*ao
, void *data
, int len
, int flags
);
120 int ao_control(struct ao
*ao
, enum aocontrol cmd
, void *arg
);
121 double ao_get_delay(struct ao
*ao
);
122 int ao_get_space(struct ao
*ao
);
123 void ao_reset(struct ao
*ao
);
124 void ao_pause(struct ao
*ao
);
125 void ao_resume(struct ao
*ao
);
127 int old_ao_control(struct ao
*ao
, enum aocontrol cmd
, void *arg
);
128 int old_ao_init(struct ao
*ao
, char *params
);
129 void old_ao_uninit(struct ao
*ao
, bool cut_audio
);
130 void old_ao_reset(struct ao
*ao
);
131 int old_ao_get_space(struct ao
*ao
);
132 int old_ao_play(struct ao
*ao
, void *data
, int len
, int flags
);
133 float old_ao_get_delay(struct ao
*ao
);
134 void old_ao_pause(struct ao
*ao
);
135 void old_ao_resume(struct ao
*ao
);
137 #endif /* MPLAYER_AUDIO_OUT_H */