2009-01-26 15:06:44 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_AUDIO_OUT_H
|
|
|
|
#define MPLAYER_AUDIO_OUT_H
|
2002-07-25 20:28:47 +00:00
|
|
|
|
2011-04-09 00:03:22 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2013-12-17 01:39:45 +00:00
|
|
|
#include "bstr/bstr.h"
|
|
|
|
#include "common/common.h"
|
2013-04-05 21:06:22 +00:00
|
|
|
#include "audio/chmap.h"
|
2013-05-09 13:12:16 +00:00
|
|
|
#include "audio/chmap_sel.h"
|
2012-04-07 13:26:56 +00:00
|
|
|
|
|
|
|
enum aocontrol {
|
|
|
|
// _VOLUME commands take struct ao_control_vol pointer for input/output.
|
|
|
|
// If there's only one volume, SET should use average of left/right.
|
|
|
|
AOCONTROL_GET_VOLUME,
|
|
|
|
AOCONTROL_SET_VOLUME,
|
2012-04-10 01:45:53 +00:00
|
|
|
// _MUTE commands take a pointer to bool
|
|
|
|
AOCONTROL_GET_MUTE,
|
|
|
|
AOCONTROL_SET_MUTE,
|
2013-11-09 23:49:13 +00:00
|
|
|
// Has char* as argument, which contains the desired stream title.
|
|
|
|
AOCONTROL_UPDATE_STREAM_TITLE,
|
2014-03-07 14:24:32 +00:00
|
|
|
AOCONTROL_HAS_TEMP_VOLUME,
|
|
|
|
AOCONTROL_HAS_PER_APP_VOLUME,
|
2012-04-07 13:26:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-27 23:56:10 +00:00
|
|
|
// If set, then the queued audio data is the last. Note that after a while, new
|
|
|
|
// data might be written again, instead of closing the AO.
|
2012-04-07 13:26:56 +00:00
|
|
|
#define AOPLAY_FINAL_CHUNK 1
|
|
|
|
|
|
|
|
typedef struct ao_control_vol {
|
|
|
|
float left;
|
|
|
|
float right;
|
|
|
|
} ao_control_vol_t;
|
|
|
|
|
2011-05-04 11:55:15 +00:00
|
|
|
struct ao;
|
2013-08-01 15:41:32 +00:00
|
|
|
struct mpv_global;
|
2014-03-07 14:24:32 +00:00
|
|
|
struct input_ctx;
|
|
|
|
struct encode_lavc_context;
|
|
|
|
struct mp_audio;
|
|
|
|
|
2013-08-01 15:41:32 +00:00
|
|
|
struct ao *ao_init_best(struct mpv_global *global,
|
2013-07-21 19:33:17 +00:00
|
|
|
struct input_ctx *input_ctx,
|
|
|
|
struct encode_lavc_context *encode_lavc_ctx,
|
|
|
|
int samplerate, int format, struct mp_chmap channels);
|
2014-03-08 23:49:39 +00:00
|
|
|
void ao_uninit(struct ao *ao);
|
2014-03-07 14:24:32 +00:00
|
|
|
void ao_get_format(struct ao *ao, struct mp_audio *format);
|
|
|
|
const char *ao_get_name(struct ao *ao);
|
|
|
|
const char *ao_get_description(struct ao *ao);
|
|
|
|
bool ao_untimed(struct ao *ao);
|
2013-11-10 22:38:18 +00:00
|
|
|
int ao_play(struct ao *ao, void **data, int samples, int flags);
|
2012-04-07 13:26:56 +00:00
|
|
|
int ao_control(struct ao *ao, enum aocontrol cmd, void *arg);
|
2011-04-09 00:03:22 +00:00
|
|
|
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);
|
2014-03-08 23:49:39 +00:00
|
|
|
void ao_drain(struct ao *ao);
|
2014-04-17 21:48:09 +00:00
|
|
|
bool ao_eof_reached(struct ao *ao);
|
2011-04-09 00:03:22 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_AUDIO_OUT_H */
|