FLAC  1.2.1
stream_decoder.h
Go to the documentation of this file.
1 /* libFLAC - Free Lossless Audio Codec library
2  * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * - Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * - Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * - Neither the name of the Xiph.org Foundation nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef FLAC__STREAM_DECODER_H
33 #define FLAC__STREAM_DECODER_H
34 
35 #include <stdio.h> /* for FILE */
36 #include "export.h"
37 #include "format.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
201 typedef enum {
202 
244 
250 extern FLAC_API const char * const FLAC__StreamDecoderStateString[];
251 
252 
255 typedef enum {
256 
282 
288 extern FLAC_API const char * const FLAC__StreamDecoderInitStatusString[];
289 
290 
293 typedef enum {
294 
313 
319 extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[];
320 
321 
324 typedef enum {
325 
336 
342 extern FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[];
343 
344 
347 typedef enum {
348 
359 
365 extern FLAC_API const char * const FLAC__StreamDecoderTellStatusString[];
366 
367 
370 typedef enum {
371 
382 
388 extern FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[];
389 
390 
393 typedef enum {
394 
402 
408 extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[];
409 
410 
426 typedef enum {
427 
441 
447 extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[];
448 
449 
450 /***********************************************************************
451  *
452  * class FLAC__StreamDecoder
453  *
454  ***********************************************************************/
455 
456 struct FLAC__StreamDecoderProtected;
457 struct FLAC__StreamDecoderPrivate;
462 typedef struct {
463  struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
464  struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
466 
516 typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
517 
551 typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
552 
589 typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
590 
627 typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
628 
654 typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data);
655 
682 typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
683 
709 typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
710 
726 typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
727 
728 
729 /***********************************************************************
730  *
731  * Class constructor/destructor
732  *
733  ***********************************************************************/
734 
743 
750 FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder);
751 
752 
753 /***********************************************************************
754  *
755  * Public class method prototypes
756  *
757  ***********************************************************************/
758 
775 FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number);
776 
797 FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value);
798 
812 
826 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
827 
839 
853 
867 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
868 
880 
890 
899 FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder);
900 
913 FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder);
914 
925 FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder);
926 
937 FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
938 
950 
961 FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
962 
973 FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
974 
985 FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
986 
1006 FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position);
1007 
1073  FLAC__StreamDecoder *decoder,
1074  FLAC__StreamDecoderReadCallback read_callback,
1075  FLAC__StreamDecoderSeekCallback seek_callback,
1076  FLAC__StreamDecoderTellCallback tell_callback,
1077  FLAC__StreamDecoderLengthCallback length_callback,
1078  FLAC__StreamDecoderEofCallback eof_callback,
1079  FLAC__StreamDecoderWriteCallback write_callback,
1080  FLAC__StreamDecoderMetadataCallback metadata_callback,
1081  FLAC__StreamDecoderErrorCallback error_callback,
1082  void *client_data
1083 );
1084 
1154  FLAC__StreamDecoder *decoder,
1155  FLAC__StreamDecoderReadCallback read_callback,
1156  FLAC__StreamDecoderSeekCallback seek_callback,
1157  FLAC__StreamDecoderTellCallback tell_callback,
1158  FLAC__StreamDecoderLengthCallback length_callback,
1159  FLAC__StreamDecoderEofCallback eof_callback,
1160  FLAC__StreamDecoderWriteCallback write_callback,
1161  FLAC__StreamDecoderMetadataCallback metadata_callback,
1162  FLAC__StreamDecoderErrorCallback error_callback,
1163  void *client_data
1164 );
1165 
1204  FLAC__StreamDecoder *decoder,
1205  FILE *file,
1206  FLAC__StreamDecoderWriteCallback write_callback,
1207  FLAC__StreamDecoderMetadataCallback metadata_callback,
1208  FLAC__StreamDecoderErrorCallback error_callback,
1209  void *client_data
1210 );
1211 
1254  FLAC__StreamDecoder *decoder,
1255  FILE *file,
1256  FLAC__StreamDecoderWriteCallback write_callback,
1257  FLAC__StreamDecoderMetadataCallback metadata_callback,
1258  FLAC__StreamDecoderErrorCallback error_callback,
1259  void *client_data
1260 );
1261 
1296  FLAC__StreamDecoder *decoder,
1297  const char *filename,
1298  FLAC__StreamDecoderWriteCallback write_callback,
1299  FLAC__StreamDecoderMetadataCallback metadata_callback,
1300  FLAC__StreamDecoderErrorCallback error_callback,
1301  void *client_data
1302 );
1303 
1342  FLAC__StreamDecoder *decoder,
1343  const char *filename,
1344  FLAC__StreamDecoderWriteCallback write_callback,
1345  FLAC__StreamDecoderMetadataCallback metadata_callback,
1346  FLAC__StreamDecoderErrorCallback error_callback,
1347  void *client_data
1348 );
1349 
1369 FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
1370 
1384 FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
1385 
1417 FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
1418 
1450 FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder);
1451 
1472 
1493 
1533 FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder);
1534 
1551 FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample);
1552 
1553 /* \} */
1554 
1555 #ifdef __cplusplus
1556 }
1557 #endif
1558 
1559 #endif