2009-01-26 16:06:44 +01: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 10:09:46 +01:00
|
|
|
#ifndef MPLAYER_AUDIO_OUT_H
|
|
|
|
#define MPLAYER_AUDIO_OUT_H
|
2002-07-25 22:28:47 +02:00
|
|
|
|
2011-04-09 02:03:22 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2013-12-17 02:39:45 +01:00
|
|
|
#include "bstr/bstr.h"
|
|
|
|
#include "common/common.h"
|
2013-04-05 23:06:22 +02:00
|
|
|
#include "audio/chmap.h"
|
2013-05-09 15:12:16 +02:00
|
|
|
#include "audio/chmap_sel.h"
|
2012-04-07 15:26:56 +02: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 03:45:53 +02:00
|
|
|
// _MUTE commands take a pointer to bool
|
|
|
|
AOCONTROL_GET_MUTE,
|
|
|
|
AOCONTROL_SET_MUTE,
|
2013-11-10 00:49:13 +01:00
|
|
|
// Has char* as argument, which contains the desired stream title.
|
|
|
|
AOCONTROL_UPDATE_STREAM_TITLE,
|
2014-03-07 15:24:32 +01:00
|
|
|
AOCONTROL_HAS_TEMP_VOLUME,
|
|
|
|
AOCONTROL_HAS_PER_APP_VOLUME,
|
2012-04-07 15:26:56 +02:00
|
|
|
};
|
|
|
|
|
2014-02-28 00:56:10 +01: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 15:26:56 +02:00
|
|
|
#define AOPLAY_FINAL_CHUNK 1
|
|
|
|
|
|
|
|
typedef struct ao_control_vol {
|
|
|
|
float left;
|
|
|
|
float right;
|
|
|
|
} ao_control_vol_t;
|
|
|
|
|
2014-04-17 22:45:49 +02:00
|
|
|
// If ao_get_delay() reaches this value after ao_play() was called with the
|
|
|
|
// AOPLAY_FINAL_CHUNK flag set, the playback core expects that the audio has
|
|
|
|
// all been played.
|
|
|
|
#define AO_EOF_DELAY 0.05
|
|
|
|
|
2011-05-04 13:55:15 +02:00
|
|
|
struct ao;
|
2013-08-01 17:41:32 +02:00
|
|
|
struct mpv_global;
|
2014-03-07 15:24:32 +01:00
|
|
|
struct input_ctx;
|
|
|
|
struct encode_lavc_context;
|
|
|
|
struct mp_audio;
|
|
|
|
|
2013-08-01 17:41:32 +02:00
|
|
|
struct ao *ao_init_best(struct mpv_global *global,
|
2013-07-21 21:33:17 +02:00
|
|
|
struct input_ctx *input_ctx,
|
|
|
|
struct encode_lavc_context *encode_lavc_ctx,
|
|
|
|
int samplerate, int format, struct mp_chmap channels);
|
2014-03-09 00:49:39 +01:00
|
|
|
void ao_uninit(struct ao *ao);
|
2014-03-07 15:24:32 +01: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 23:38:18 +01:00
|
|
|
int ao_play(struct ao *ao, void **data, int samples, int flags);
|
2012-04-07 15:26:56 +02:00
|
|
|
int ao_control(struct ao *ao, enum aocontrol cmd, void *arg);
|
2011-04-09 02:03:22 +02: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-09 00:49:39 +01:00
|
|
|
void ao_drain(struct ao *ao);
|
2011-04-09 02:03:22 +02:00
|
|
|
|
2008-02-22 10:09:46 +01:00
|
|
|
#endif /* MPLAYER_AUDIO_OUT_H */
|