|
Packit |
c32a2d |
/*
|
|
Packit |
c32a2d |
buffer.h: output buffer
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
copyright 1999-2015 by the mpg123 project - free software under the terms of the LGPL 2.1
|
|
Packit |
c32a2d |
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
|
Packit |
c32a2d |
initially written by Daniel Kobras / Oliver Fromme
|
|
Packit |
c32a2d |
*/
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/*
|
|
Packit |
c32a2d |
* Application specific interaction between main and buffer
|
|
Packit |
c32a2d |
* process. This is much less generic than the functions in
|
|
Packit |
c32a2d |
* xfermem so I chose to put it in buffer.[hc].
|
|
Packit |
c32a2d |
* 01/28/99 [dk]
|
|
Packit |
c32a2d |
*/
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
#ifndef _MPG123_BUFFER_H_
|
|
Packit |
c32a2d |
#define _MPG123_BUFFER_H_
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
#include "out123_int.h"
|
|
Packit |
c32a2d |
#include "compat.h"
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
int buffer_init(out123_handle *ao, size_t bytes);
|
|
Packit |
c32a2d |
void buffer_exit(out123_handle *ao);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Messages with payload. */
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
int buffer_sync_param(out123_handle *ao);
|
|
Packit |
c32a2d |
int buffer_open(out123_handle *ao, const char* driver, const char* device);
|
|
Packit |
c32a2d |
int buffer_encodings(out123_handle *ao);
|
|
Packit |
c32a2d |
int buffer_formats( out123_handle *ao, const long *rates, int ratecount
|
|
Packit |
c32a2d |
, int minchannels, int maxchannels
|
|
Packit |
c32a2d |
, struct mpg123_fmt **fmtlist );
|
|
Packit |
c32a2d |
int buffer_start(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_ndrain(out123_handle *ao, size_t bytes);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Simple messages to be deal with after playback. */
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
void buffer_stop(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_close(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_continue(out123_handle *ao);
|
|
Packit |
c32a2d |
/* Still undecided if that one is to be used anywhere. */
|
|
Packit |
c32a2d |
void buffer_ignore_lowmem(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_drain(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_end(out123_handle *ao);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Simple messages with interruption of playback. */
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
void buffer_pause(out123_handle *ao);
|
|
Packit |
c32a2d |
void buffer_drop(out123_handle *ao);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* The actual work: Hand over audio data. */
|
|
Packit |
c32a2d |
size_t buffer_write(out123_handle *ao, void *buffer, size_t bytes);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Thin wrapper over xfermem giving the current buffer fill. */
|
|
Packit |
c32a2d |
size_t buffer_fill(out123_handle *ao);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Special handler to safely read values from command channel with
|
|
Packit |
c32a2d |
an additional buffer handed in. Exported for read_parameters(). */
|
|
Packit |
c32a2d |
int read_buf(int fd, void *addr, size_t size
|
|
Packit |
c32a2d |
, byte *prebuf, int *preoff, int presize);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
/* Read/write strings from/to command channel. 0 on success. */
|
|
Packit |
c32a2d |
int xfer_write_string(out123_handle *ao, int who, const char *buf);
|
|
Packit |
c32a2d |
int xfer_read_string(out123_handle *ao, int who, char* *buf);
|
|
Packit |
c32a2d |
|
|
Packit |
c32a2d |
#endif
|