1 | //codecfilter_flac.h: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2012 |
---|
5 | * |
---|
6 | * This file is part of roard a part of RoarAudio, |
---|
7 | * a cross-platform sound system for both, home and professional use. |
---|
8 | * See README for details. |
---|
9 | * |
---|
10 | * This file is free software; you can redistribute it and/or modify |
---|
11 | * it under the terms of the GNU General Public License version 3 |
---|
12 | * as published by the Free Software Foundation. |
---|
13 | * |
---|
14 | * RoarAudio is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this software; see the file COPYING. If not, write to |
---|
21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
22 | * Boston, MA 02110-1301, USA. |
---|
23 | * |
---|
24 | */ |
---|
25 | |
---|
26 | #ifndef _CODECFILTER_FLAC_H_ |
---|
27 | #define _CODECFILTER_FLAC_H_ |
---|
28 | |
---|
29 | #include <roaraudio.h> |
---|
30 | |
---|
31 | #if defined(ROAR_HAVE_LIBFLAC) |
---|
32 | |
---|
33 | #include <FLAC/all.h> |
---|
34 | |
---|
35 | struct codecfilter_flac_inst { |
---|
36 | struct roar_stream_server * ss; |
---|
37 | struct { |
---|
38 | FLAC__StreamDecoder * decoder; |
---|
39 | struct roar_buffer * written; |
---|
40 | ssize_t readret; |
---|
41 | size_t readc; |
---|
42 | } decoder; |
---|
43 | }; |
---|
44 | |
---|
45 | FLAC__StreamDecoderReadStatus cf_flac_cb_read(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data); |
---|
46 | FLAC__StreamDecoderWriteStatus cf_flac_cb_write(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); |
---|
47 | void cf_flac_cb_metadata(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); |
---|
48 | void cf_flac_cb_error(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); |
---|
49 | |
---|
50 | int cf_flac_open(CODECFILTER_USERDATA_T * inst, int codec, |
---|
51 | struct roar_stream_server * info, |
---|
52 | struct roar_codecfilter * filter); |
---|
53 | |
---|
54 | int cf_flac_close(CODECFILTER_USERDATA_T inst); |
---|
55 | |
---|
56 | int cf_flac_write(CODECFILTER_USERDATA_T inst, char * buf, int len); |
---|
57 | int cf_flac_read(CODECFILTER_USERDATA_T inst, char * buf, int len); |
---|
58 | |
---|
59 | int cf_flac_ctl(CODECFILTER_USERDATA_T inst, int cmd, void * data); |
---|
60 | |
---|
61 | #endif |
---|
62 | |
---|
63 | #endif |
---|
64 | |
---|
65 | //ll |
---|