00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef FLAC__STREAM_DECODER_H
00033 #define FLAC__STREAM_DECODER_H
00034
00035 #include "export.h"
00036 #include "format.h"
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042
00196 typedef enum {
00197
00198 FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0,
00201 FLAC__STREAM_DECODER_READ_METADATA,
00204 FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC,
00207 FLAC__STREAM_DECODER_READ_FRAME,
00210 FLAC__STREAM_DECODER_END_OF_STREAM,
00213 FLAC__STREAM_DECODER_ABORTED,
00216 FLAC__STREAM_DECODER_UNPARSEABLE_STREAM,
00219 FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
00222 FLAC__STREAM_DECODER_ALREADY_INITIALIZED,
00228 FLAC__STREAM_DECODER_INVALID_CALLBACK,
00231 FLAC__STREAM_DECODER_UNINITIALIZED
00234 } FLAC__StreamDecoderState;
00235
00241 extern FLAC_API const char * const FLAC__StreamDecoderStateString[];
00242
00243
00246 typedef enum {
00247
00248 FLAC__STREAM_DECODER_READ_STATUS_CONTINUE,
00251 FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM,
00254 FLAC__STREAM_DECODER_READ_STATUS_ABORT
00257 } FLAC__StreamDecoderReadStatus;
00258
00264 extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[];
00265
00266
00269 typedef enum {
00270
00271 FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE,
00274 FLAC__STREAM_DECODER_WRITE_STATUS_ABORT
00277 } FLAC__StreamDecoderWriteStatus;
00278
00284 extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[];
00285
00286
00289 typedef enum {
00290
00291 FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC,
00294 FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER,
00297 FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH
00300 } FLAC__StreamDecoderErrorStatus;
00301
00307 extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[];
00308
00309
00310
00311
00312
00313
00314
00315
00316 struct FLAC__StreamDecoderProtected;
00317 struct FLAC__StreamDecoderPrivate;
00322 typedef struct {
00323 struct FLAC__StreamDecoderProtected *protected_;
00324 struct FLAC__StreamDecoderPrivate *private_;
00325 } FLAC__StreamDecoder;
00326
00344 typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
00345
00363 typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
00364
00373 typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
00374
00383 typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
00384
00385
00386
00387
00388
00389
00390
00391
00399 FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new();
00400
00407 FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder);
00408
00409
00410
00411
00412
00413
00414
00415
00436 FLAC_API FLAC__bool FLAC__stream_decoder_set_read_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadCallback value);
00437
00456 FLAC_API FLAC__bool FLAC__stream_decoder_set_write_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderWriteCallback value);
00457
00484 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderMetadataCallback value);
00485
00502 FLAC_API FLAC__bool FLAC__stream_decoder_set_error_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorCallback value);
00503
00516 FLAC_API FLAC__bool FLAC__stream_decoder_set_client_data(FLAC__StreamDecoder *decoder, void *value);
00517
00530 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
00531
00545 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
00546
00557 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder);
00558
00571 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
00572
00586 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
00587
00598 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder);
00599
00608 FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder);
00609
00618 FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder);
00619
00630 FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
00631
00642 FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder);
00643
00654 FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
00655
00666 FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
00667
00678 FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
00679
00695 FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder);
00696
00711 FLAC_API void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
00712
00724 FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
00725
00740 FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
00741
00776 FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder);
00777
00799 FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder);
00800
00822 FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder);
00823
00865 FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder);
00866
00867
00868
00869 #ifdef __cplusplus
00870 }
00871 #endif
00872
00873 #endif