| 1 | #ifndef RAOP_BUFFER_H |
| 2 | #define RAOP_BUFFER_H |
| 3 | |
| 4 | typedef struct raop_buffer_s raop_buffer_t; |
| 5 | |
| 6 | /* From ALACMagicCookieDescription.txt at http://http://alac.macosforge.org/ */ |
| 7 | typedef struct { |
| 8 | unsigned int frameLength; |
| 9 | unsigned char compatibleVersion; |
| 10 | unsigned char bitDepth; |
| 11 | unsigned char pb; |
| 12 | unsigned char mb; |
| 13 | unsigned char kb; |
| 14 | unsigned char numChannels; |
| 15 | unsigned short maxRun; |
| 16 | unsigned int maxFrameBytes; |
| 17 | unsigned int avgBitRate; |
| 18 | unsigned int sampleRate; |
| 19 | } ALACSpecificConfig; |
| 20 | |
| 21 | typedef int (*raop_resend_cb_t)(void *opaque, unsigned short seqno, unsigned short count); |
| 22 | |
| 23 | raop_buffer_t *raop_buffer_init(const char *fmtp, |
| 24 | const unsigned char *aeskey, |
| 25 | const unsigned char *aesiv); |
| 26 | |
| 27 | const ALACSpecificConfig *raop_buffer_get_config(raop_buffer_t *raop_buffer); |
| 28 | int raop_buffer_queue(raop_buffer_t *raop_buffer, unsigned char *data, unsigned short datalen, int use_seqnum); |
| 29 | const void *raop_buffer_dequeue(raop_buffer_t *raop_buffer, int *length, int no_resend); |
| 30 | void raop_buffer_handle_resends(raop_buffer_t *raop_buffer, raop_resend_cb_t resend_cb, void *opaque); |
| 31 | void raop_buffer_flush(raop_buffer_t *raop_buffer, int next_seq); |
| 32 | |
| 33 | void raop_buffer_destroy(raop_buffer_t *raop_buffer); |
| 34 | |
| 35 | #endif |