| 1 |
/* |
| 2 |
buffer.h: output buffer |
| 3 |
|
| 4 |
copyright 1999-2015 by the mpg123 project - free software under the terms of the LGPL 2.1 |
| 5 |
see COPYING and AUTHORS files in distribution or http://mpg123.org |
| 6 |
initially written by Daniel Kobras / Oliver Fromme |
| 7 |
*/ |
| 8 |
|
| 9 |
/* |
| 10 |
* Application specific interaction between main and buffer |
| 11 |
* process. This is much less generic than the functions in |
| 12 |
* xfermem so I chose to put it in buffer.[hc]. |
| 13 |
* 01/28/99 [dk] |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef _MPG123_BUFFER_H_ |
| 17 |
#define _MPG123_BUFFER_H_ |
| 18 |
|
| 19 |
#include "out123_int.h" |
| 20 |
#include "../compat/compat.h" |
| 21 |
|
| 22 |
int INT123_buffer_init(out123_handle *ao, size_t bytes); |
| 23 |
void INT123_buffer_exit(out123_handle *ao); |
| 24 |
|
| 25 |
/* Messages with payload. */ |
| 26 |
|
| 27 |
int INT123_buffer_sync_param(out123_handle *ao); |
| 28 |
int INT123_buffer_open(out123_handle *ao, const char* driver, const char* device); |
| 29 |
int INT123_buffer_encodings(out123_handle *ao); |
| 30 |
int INT123_buffer_formats( out123_handle *ao, const long *rates, int ratecount |
| 31 |
, int minchannels, int maxchannels |
| 32 |
, struct mpg123_fmt **fmtlist ); |
| 33 |
int INT123_buffer_start(out123_handle *ao); |
| 34 |
void INT123_buffer_ndrain(out123_handle *ao, size_t bytes); |
| 35 |
|
| 36 |
/* Simple messages to be deal with after playback. */ |
| 37 |
|
| 38 |
void INT123_buffer_stop(out123_handle *ao); |
| 39 |
void INT123_buffer_close(out123_handle *ao); |
| 40 |
void INT123_buffer_continue(out123_handle *ao); |
| 41 |
/* Still undecided if that one is to be used anywhere. */ |
| 42 |
void INT123_buffer_ignore_lowmem(out123_handle *ao); |
| 43 |
void INT123_buffer_drain(out123_handle *ao); |
| 44 |
void INT123_buffer_end(out123_handle *ao); |
| 45 |
|
| 46 |
/* Simple messages with interruption of playback. */ |
| 47 |
|
| 48 |
void INT123_buffer_pause(out123_handle *ao); |
| 49 |
void INT123_buffer_drop(out123_handle *ao); |
| 50 |
|
| 51 |
/* The actual work: Hand over audio data. */ |
| 52 |
size_t INT123_buffer_write(out123_handle *ao, void *buffer, size_t bytes); |
| 53 |
|
| 54 |
/* Thin wrapper over xfermem giving the current buffer fill. */ |
| 55 |
size_t INT123_buffer_fill(out123_handle *ao); |
| 56 |
|
| 57 |
#endif |