The "GR-PEACH_Audio_Playback_7InchLCD_Sample" is a sample code that can provides high-resolution audio playback of FLAC format files. It also allows the user to audio-playback control functions such as play, pause, and stop by manipulating key switches.

Dependencies:   GR-PEACH_video R_BSP TLV320_RBSP USBHost_custom

Fork of GR-PEACH_Audio_Playback_Sample by Renesas

Embed: (wiki syntax)

« Back to documentation index

stream_decoder.h File Reference

stream_decoder.h File Reference

This module contains the functions which implement the stream decoder. More...

Go to the source code of this file.

Data Structures

struct  FLAC__StreamDecoder
 The opaque structure definition for the stream decoder type. More...

Typedefs

typedef
FLAC__StreamDecoderReadStatus(* 
FLAC__StreamDecoderReadCallback )(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
 Signature for the read callback.
typedef
FLAC__StreamDecoderSeekStatus(* 
FLAC__StreamDecoderSeekCallback )(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
 Signature for the seek callback.
typedef
FLAC__StreamDecoderTellStatus(* 
FLAC__StreamDecoderTellCallback )(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
 Signature for the tell callback.
typedef
FLAC__StreamDecoderLengthStatus(* 
FLAC__StreamDecoderLengthCallback )(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
 Signature for the length callback.
typedef FLAC__bool(* FLAC__StreamDecoderEofCallback )(const FLAC__StreamDecoder *decoder, void *client_data)
 Signature for the EOF callback.
typedef
FLAC__StreamDecoderWriteStatus(* 
FLAC__StreamDecoderWriteCallback )(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
 Signature for the write callback.
typedef void(* FLAC__StreamDecoderMetadataCallback )(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
 Signature for the metadata callback.
typedef void(* FLAC__StreamDecoderErrorCallback )(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
 Signature for the error callback.

Enumerations

enum  FLAC__StreamDecoderState {
  FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0, FLAC__STREAM_DECODER_READ_METADATA, FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, FLAC__STREAM_DECODER_READ_FRAME,
  FLAC__STREAM_DECODER_END_OF_STREAM, FLAC__STREAM_DECODER_OGG_ERROR, FLAC__STREAM_DECODER_SEEK_ERROR, FLAC__STREAM_DECODER_ABORTED,
  FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, FLAC__STREAM_DECODER_UNINITIALIZED
}
 

State values for a FLAC__StreamDecoder.

More...
enum  FLAC__StreamDecoderInitStatus {
  FLAC__STREAM_DECODER_INIT_STATUS_OK = 0, FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR,
  FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED
}
 

Possible return values for the FLAC__stream_decoder_init_*() functions.

More...
enum  FLAC__StreamDecoderReadStatus { FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, FLAC__STREAM_DECODER_READ_STATUS_ABORT }
 

Return values for the FLAC__StreamDecoder read callback.

More...
enum  FLAC__StreamDecoderSeekStatus { FLAC__STREAM_DECODER_SEEK_STATUS_OK, FLAC__STREAM_DECODER_SEEK_STATUS_ERROR, FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED }
 

Return values for the FLAC__StreamDecoder seek callback.

More...
enum  FLAC__StreamDecoderTellStatus { FLAC__STREAM_DECODER_TELL_STATUS_OK, FLAC__STREAM_DECODER_TELL_STATUS_ERROR, FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED }
 

Return values for the FLAC__StreamDecoder tell callback.

More...
enum  FLAC__StreamDecoderLengthStatus { FLAC__STREAM_DECODER_LENGTH_STATUS_OK, FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR, FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED }
 

Return values for the FLAC__StreamDecoder length callback.

More...
enum  FLAC__StreamDecoderWriteStatus { FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE, FLAC__STREAM_DECODER_WRITE_STATUS_ABORT }
 

Return values for the FLAC__StreamDecoder write callback.

More...
enum  FLAC__StreamDecoderErrorStatus { FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER, FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM }
 

Possible values passed back to the FLAC__StreamDecoder error callback.

More...

Functions

FLAC_API FLAC__StreamDecoderFLAC__stream_decoder_new (void)
 Create a new stream decoder instance.
FLAC_API void FLAC__stream_decoder_delete (FLAC__StreamDecoder *decoder)
 Free a decoder instance.
FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number (FLAC__StreamDecoder *decoder, long serial_number)
 Set the serial number for the FLAC stream within the Ogg container.
FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking (FLAC__StreamDecoder *decoder, FLAC__bool value)
 Set the "MD5 signature checking" flag.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond (FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
 Direct the decoder to pass on all metadata blocks of type type.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application (FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
 Direct the decoder to pass on all APPLICATION metadata blocks of the given id.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all (FLAC__StreamDecoder *decoder)
 Direct the decoder to pass on all metadata blocks of any type.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore (FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
 Direct the decoder to filter out all metadata blocks of type type.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application (FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
 Direct the decoder to filter out all APPLICATION metadata blocks of the given id.
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all (FLAC__StreamDecoder *decoder)
 Direct the decoder to filter out all metadata blocks of any type.
FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state (const FLAC__StreamDecoder *decoder)
 Get the current decoder state.
FLAC_API const char * FLAC__stream_decoder_get_resolved_state_string (const FLAC__StreamDecoder *decoder)
 Get the current decoder state as a C string.
FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking (const FLAC__StreamDecoder *decoder)
 Get the "MD5 signature checking" flag.
FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples (const FLAC__StreamDecoder *decoder)
 Get the total number of samples in the stream being decoded.
FLAC_API unsigned FLAC__stream_decoder_get_channels (const FLAC__StreamDecoder *decoder)
 Get the current number of channels in the stream being decoded.
FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment (const FLAC__StreamDecoder *decoder)
 Get the current channel assignment in the stream being decoded.
FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample (const FLAC__StreamDecoder *decoder)
 Get the current sample resolution in the stream being decoded.
FLAC_API unsigned FLAC__stream_decoder_get_sample_rate (const FLAC__StreamDecoder *decoder)
 Get the current sample rate in Hz of the stream being decoded.
FLAC_API unsigned FLAC__stream_decoder_get_blocksize (const FLAC__StreamDecoder *decoder)
 Get the current blocksize of the stream being decoded.
FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position (const FLAC__StreamDecoder *decoder, FLAC__uint64 *position)
 Returns the decoder's current read position within the stream.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_stream (FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadCallback read_callback, FLAC__StreamDecoderSeekCallback seek_callback, FLAC__StreamDecoderTellCallback tell_callback, FLAC__StreamDecoderLengthCallback length_callback, FLAC__StreamDecoderEofCallback eof_callback, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode native FLAC streams.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_ogg_stream (FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadCallback read_callback, FLAC__StreamDecoderSeekCallback seek_callback, FLAC__StreamDecoderTellCallback tell_callback, FLAC__StreamDecoderLengthCallback length_callback, FLAC__StreamDecoderEofCallback eof_callback, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode Ogg FLAC streams.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_FILE (FLAC__StreamDecoder *decoder, FILE *file, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode native FLAC files.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_ogg_FILE (FLAC__StreamDecoder *decoder, FILE *file, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode Ogg FLAC files.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_file (FLAC__StreamDecoder *decoder, const char *filename, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode native FLAC files.
FLAC_API
FLAC__StreamDecoderInitStatus 
FLAC__stream_decoder_init_ogg_file (FLAC__StreamDecoder *decoder, const char *filename, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
 Initialize the decoder instance to decode Ogg FLAC files.
FLAC_API FLAC__bool FLAC__stream_decoder_finish (FLAC__StreamDecoder *decoder)
 Finish the decoding process.
FLAC_API FLAC__bool FLAC__stream_decoder_flush (FLAC__StreamDecoder *decoder)
 Flush the stream input.
FLAC_API FLAC__bool FLAC__stream_decoder_reset (FLAC__StreamDecoder *decoder)
 Reset the decoding process.
FLAC_API FLAC__bool FLAC__stream_decoder_process_single (FLAC__StreamDecoder *decoder)
 Decode one metadata block or audio frame.
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata (FLAC__StreamDecoder *decoder)
 Decode until the end of the metadata.
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream (FLAC__StreamDecoder *decoder)
 Decode until the end of the stream.
FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame (FLAC__StreamDecoder *decoder)
 Skip one audio frame.
FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute (FLAC__StreamDecoder *decoder, FLAC__uint64 sample)
 Flush the input and seek to an absolute sample.

Variables

FLAC_API const char *const FLAC__StreamDecoderStateString []
 Maps a FLAC__StreamDecoderState to a C string.
FLAC_API const char *const FLAC__StreamDecoderInitStatusString []
 Maps a FLAC__StreamDecoderInitStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderReadStatusString []
 Maps a FLAC__StreamDecoderReadStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderSeekStatusString []
 Maps a FLAC__StreamDecoderSeekStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderTellStatusString []
 Maps a FLAC__StreamDecoderTellStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderLengthStatusString []
 Maps a FLAC__StreamDecoderLengthStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderWriteStatusString []
 Maps a FLAC__StreamDecoderWriteStatus to a C string.
FLAC_API const char *const FLAC__StreamDecoderErrorStatusString []
 Maps a FLAC__StreamDecoderErrorStatus to a C string.

Detailed Description

This module contains the functions which implement the stream decoder.

See the detailed documentation in the stream decoder module.

Definition in file include/FLAC/stream_decoder.h.