summaryrefslogtreecommitdiffstats
path: root/libao2/audio_out.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-09 03:03:22 +0300
committerUoti Urpala <uau@mplayer2.org>2011-04-09 03:03:22 +0300
commit2a7c5a1365ad194a42e3f667f85828a152544857 (patch)
tree76c8ec2336e1f90f2e282bf130b876931fdb66cc /libao2/audio_out.h
parent9ef15ac4fc28ecf85a497bc664246f227b40c135 (diff)
downloadmpv-2a7c5a1365ad194a42e3f667f85828a152544857.tar.bz2
mpv-2a7c5a1365ad194a42e3f667f85828a152544857.tar.xz
audio: change external AO interface to "ao_[method](ao, ...)"
Make the outside interface of audio output handling similar to the video output one. An AO object is first created, and then methods called with ao_[methodname](ao, args...). However internally libao2/ still holds all data in globals, and trying to create multiple simultaneous AO instances won't work.
Diffstat (limited to 'libao2/audio_out.h')
-rw-r--r--libao2/audio_out.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/libao2/audio_out.h b/libao2/audio_out.h
index e483a88422..8c10a47784 100644
--- a/libao2/audio_out.h
+++ b/libao2/audio_out.h
@@ -19,6 +19,8 @@
#ifndef MPLAYER_AUDIO_OUT_H
#define MPLAYER_AUDIO_OUT_H
+#include <stdbool.h>
+
typedef struct ao_info_s
{
/* driver name ("Matrox Millennium G200/G400" */
@@ -32,7 +34,7 @@ typedef struct ao_info_s
} ao_info_t;
/* interface towards mplayer and */
-typedef struct ao_functions_s
+typedef struct ao_functions
{
const ao_info_t *info;
int (*control)(int cmd,void *arg);
@@ -47,7 +49,7 @@ typedef struct ao_functions_s
} ao_functions_t;
/* global data used by mplayer and plugins */
-typedef struct ao_data {
+struct ao {
int samplerate;
int channels;
int format;
@@ -55,13 +57,13 @@ typedef struct ao_data {
int outburst;
int buffersize;
int pts;
-} ao_data_t;
+ bool initialized;
+ const struct ao_functions *driver;
+};
extern char *ao_subdevice;
-extern ao_data_t ao_data;
void list_audio_out(void);
-const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags);
// NULL terminated array of all drivers
extern const ao_functions_t* const audio_out_drivers[];
@@ -88,4 +90,15 @@ typedef struct ao_control_vol_s {
float right;
} ao_control_vol_t;
+struct ao *ao_create(void);
+void ao_init(struct ao *ao, char **ao_list);
+void ao_uninit(struct ao *ao, bool drain_audio);
+int ao_play(struct ao *ao, void *data, int len, int flags);
+int ao_control(struct ao *ao, int cmd, void *arg);
+double ao_get_delay(struct ao *ao);
+int ao_get_space(struct ao *ao);
+void ao_reset(struct ao *ao);
+void ao_pause(struct ao *ao);
+void ao_resume(struct ao *ao);
+
#endif /* MPLAYER_AUDIO_OUT_H */