2 * Copyright (C) 2011-2012 Juho Vähä-Herttua
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
18 typedef struct raop_buffer_s raop_buffer_t
;
20 /* From ALACMagicCookieDescription.txt at http://http://alac.macosforge.org/ */
22 unsigned int frameLength
;
23 unsigned char compatibleVersion
;
24 unsigned char bitDepth
;
28 unsigned char numChannels
;
29 unsigned short maxRun
;
30 unsigned int maxFrameBytes
;
31 unsigned int avgBitRate
;
32 unsigned int sampleRate
;
35 typedef int (*raop_resend_cb_t
)(void *opaque
, unsigned short seqno
, unsigned short count
);
37 raop_buffer_t
*raop_buffer_init(const char *fmtp
,
38 const unsigned char *aeskey
,
39 const unsigned char *aesiv
);
41 const ALACSpecificConfig
*raop_buffer_get_config(raop_buffer_t
*raop_buffer
);
42 int raop_buffer_queue(raop_buffer_t
*raop_buffer
, unsigned char *data
, unsigned short datalen
, int use_seqnum
);
43 const void *raop_buffer_dequeue(raop_buffer_t
*raop_buffer
, int *length
, int no_resend
);
44 void raop_buffer_handle_resends(raop_buffer_t
*raop_buffer
, raop_resend_cb_t resend_cb
, void *opaque
);
45 void raop_buffer_flush(raop_buffer_t
*raop_buffer
, int next_seq
);
47 void raop_buffer_destroy(raop_buffer_t
*raop_buffer
);