RetroArch
Classes | Typedefs | Functions | Variables
stream_decoder.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <retro_miscellaneous.h>
#include "include/share/compat.h"
#include "include/FLAC/assert.h"
#include "include/share/alloc.h"
#include "include/protected/stream_decoder.h"
#include "include/private/bitreader.h"
#include "include/private/bitmath.h"
#include "include/private/cpu.h"
#include "include/private/crc.h"
#include "include/private/fixed.h"
#include "include/private/format.h"
#include "include/private/lpc.h"
#include "include/private/md5.h"
#include "include/private/memory.h"
#include "include/private/macros.h"
Include dependency graph for stream_decoder.c:

Classes

struct  FLAC__StreamDecoderPrivate
 

Typedefs

typedef struct FLAC__StreamDecoderPrivate FLAC__StreamDecoderPrivate
 

Functions

static void set_defaults_ (FLAC__StreamDecoder *decoder)
 
static FILEget_binary_stdin_ (void)
 
static FLAC__bool allocate_output_ (FLAC__StreamDecoder *decoder, unsigned size, unsigned channels)
 
static FLAC__bool has_id_filtered_ (FLAC__StreamDecoder *decoder, FLAC__byte *id)
 
static FLAC__bool find_metadata_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool read_metadata_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool read_metadata_streaminfo_ (FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length)
 
static FLAC__bool read_metadata_seektable_ (FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length)
 
static FLAC__bool read_metadata_vorbiscomment_ (FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_VorbisComment *obj, unsigned length)
 
static FLAC__bool read_metadata_cuesheet_ (FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_CueSheet *obj)
 
static FLAC__bool read_metadata_picture_ (FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_Picture *obj)
 
static FLAC__bool skip_id3v2_tag_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool frame_sync_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool read_frame_ (FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FLAC__bool do_full_decode)
 
static FLAC__bool read_frame_header_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool read_subframe_ (FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode)
 
static FLAC__bool read_subframe_constant_ (FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode)
 
static FLAC__bool read_subframe_fixed_ (FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode)
 
static FLAC__bool read_subframe_lpc_ (FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode)
 
static FLAC__bool read_subframe_verbatim_ (FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode)
 
static FLAC__bool read_residual_partitioned_rice_ (FLAC__StreamDecoder *decoder, unsigned predictor_order, unsigned partition_order, FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, FLAC__int32 *residual, FLAC__bool is_extended)
 
static FLAC__bool read_zero_padding_ (FLAC__StreamDecoder *decoder)
 
static FLAC__bool read_callback_ (FLAC__byte buffer[], size_t *bytes, void *client_data)
 
static FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_ (FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[])
 
static void send_error_to_client_ (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status)
 
static FLAC__bool seek_to_absolute_sample_ (FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample)
 
static FLAC__StreamDecoderReadStatus file_read_callback_ (const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
 
static FLAC__StreamDecoderSeekStatus file_seek_callback_ (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
 
static FLAC__StreamDecoderTellStatus file_tell_callback_ (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
 
static FLAC__StreamDecoderLengthStatus file_length_callback_ (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
 
static FLAC__bool file_eof_callback_ (const FLAC__StreamDecoder *decoder, void *client_data)
 
FLAC_API FLAC__StreamDecoderFLAC__stream_decoder_new (void)
 
FLAC_API void FLAC__stream_decoder_delete (FLAC__StreamDecoder *decoder)
 
static FLAC__StreamDecoderInitStatus init_stream_internal_ (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, FLAC__bool is_ogg)
 
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)
 
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)
 
static FLAC__StreamDecoderInitStatus init_FILE_internal_ (FLAC__StreamDecoder *decoder, FILE *file, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data, FLAC__bool is_ogg)
 
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)
 
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)
 
static FLAC__StreamDecoderInitStatus init_file_internal_ (FLAC__StreamDecoder *decoder, const char *filename, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data, FLAC__bool is_ogg)
 
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)
 
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)
 
FLAC_API FLAC__bool FLAC__stream_decoder_finish (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number (FLAC__StreamDecoder *decoder, long value)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking (FLAC__StreamDecoder *decoder, FLAC__bool value)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond (FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application (FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore (FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application (FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
 
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state (const FLAC__StreamDecoder *decoder)
 
FLAC_API const char * FLAC__stream_decoder_get_resolved_state_string (const FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking (const FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples (const FLAC__StreamDecoder *decoder)
 
FLAC_API unsigned FLAC__stream_decoder_get_channels (const FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment (const FLAC__StreamDecoder *decoder)
 
FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample (const FLAC__StreamDecoder *decoder)
 
FLAC_API unsigned FLAC__stream_decoder_get_sample_rate (const FLAC__StreamDecoder *decoder)
 
FLAC_API unsigned FLAC__stream_decoder_get_blocksize (const FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position (const FLAC__StreamDecoder *decoder, FLAC__uint64 *position)
 
FLAC_API FLAC__bool FLAC__stream_decoder_flush (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_reset (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_process_single (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame (FLAC__StreamDecoder *decoder)
 
FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute (FLAC__StreamDecoder *decoder, FLAC__uint64 sample)
 
unsigned FLAC__stream_decoder_get_input_bytes_unconsumed (const FLAC__StreamDecoder *decoder)
 

Variables

FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC = FLAC__HAS_OGG
 
static const FLAC__byte ID3V2_TAG_ [3] = { 'I', 'D', '3' }
 
FLAC_API const char *const FLAC__StreamDecoderStateString []
 
FLAC_API const char *const FLAC__StreamDecoderInitStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderReadStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderSeekStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderTellStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderLengthStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderWriteStatusString []
 
FLAC_API const char *const FLAC__StreamDecoderErrorStatusString []
 

Typedef Documentation

◆ FLAC__StreamDecoderPrivate

Function Documentation

◆ allocate_output_()

FLAC__bool allocate_output_ ( FLAC__StreamDecoder decoder,
unsigned  size,
unsigned  channels 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_eof_callback_()

FLAC__bool file_eof_callback_ ( const FLAC__StreamDecoder decoder,
void client_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_length_callback_()

FLAC__StreamDecoderLengthStatus file_length_callback_ ( const FLAC__StreamDecoder decoder,
FLAC__uint64 stream_length,
void client_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_read_callback_()

FLAC__StreamDecoderReadStatus file_read_callback_ ( const FLAC__StreamDecoder decoder,
FLAC__byte  buffer[],
size_t *  bytes,
void client_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_seek_callback_()

FLAC__StreamDecoderSeekStatus file_seek_callback_ ( const FLAC__StreamDecoder decoder,
FLAC__uint64  absolute_byte_offset,
void client_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_tell_callback_()

FLAC__StreamDecoderTellStatus file_tell_callback_ ( const FLAC__StreamDecoder decoder,
FLAC__uint64 absolute_byte_offset,
void client_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_metadata_()

FLAC__bool find_metadata_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__stream_decoder_get_input_bytes_unconsumed()

unsigned FLAC__stream_decoder_get_input_bytes_unconsumed ( const FLAC__StreamDecoder decoder)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame_sync_()

FLAC__bool frame_sync_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_binary_stdin_()

FILE * get_binary_stdin_ ( void  )
static
Here is the caller graph for this function:

◆ has_id_filtered_()

FLAC__bool has_id_filtered_ ( FLAC__StreamDecoder decoder,
FLAC__byte id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_FILE_internal_()

static FLAC__StreamDecoderInitStatus init_FILE_internal_ ( FLAC__StreamDecoder decoder,
FILE file,
FLAC__StreamDecoderWriteCallback  write_callback,
FLAC__StreamDecoderMetadataCallback  metadata_callback,
FLAC__StreamDecoderErrorCallback  error_callback,
void client_data,
FLAC__bool  is_ogg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_file_internal_()

static FLAC__StreamDecoderInitStatus init_file_internal_ ( FLAC__StreamDecoder decoder,
const char *  filename,
FLAC__StreamDecoderWriteCallback  write_callback,
FLAC__StreamDecoderMetadataCallback  metadata_callback,
FLAC__StreamDecoderErrorCallback  error_callback,
void client_data,
FLAC__bool  is_ogg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_stream_internal_()

static FLAC__StreamDecoderInitStatus init_stream_internal_ ( 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,
FLAC__bool  is_ogg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_callback_()

FLAC__bool read_callback_ ( FLAC__byte  buffer[],
size_t *  bytes,
void client_data 
)
static
Here is the caller graph for this function:

◆ read_frame_()

FLAC__bool read_frame_ ( FLAC__StreamDecoder decoder,
FLAC__bool got_a_frame,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_frame_header_()

FLAC__bool read_frame_header_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_()

FLAC__bool read_metadata_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_cuesheet_()

FLAC__bool read_metadata_cuesheet_ ( FLAC__StreamDecoder decoder,
FLAC__StreamMetadata_CueSheet obj 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_picture_()

FLAC__bool read_metadata_picture_ ( FLAC__StreamDecoder decoder,
FLAC__StreamMetadata_Picture obj 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_seektable_()

FLAC__bool read_metadata_seektable_ ( FLAC__StreamDecoder decoder,
FLAC__bool  is_last,
unsigned  length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_streaminfo_()

FLAC__bool read_metadata_streaminfo_ ( FLAC__StreamDecoder decoder,
FLAC__bool  is_last,
unsigned  length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_metadata_vorbiscomment_()

FLAC__bool read_metadata_vorbiscomment_ ( FLAC__StreamDecoder decoder,
FLAC__StreamMetadata_VorbisComment obj,
unsigned  length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_residual_partitioned_rice_()

FLAC__bool read_residual_partitioned_rice_ ( FLAC__StreamDecoder decoder,
unsigned  predictor_order,
unsigned  partition_order,
FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents,
FLAC__int32 residual,
FLAC__bool  is_extended 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_subframe_()

FLAC__bool read_subframe_ ( FLAC__StreamDecoder decoder,
unsigned  channel,
unsigned  bps,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_subframe_constant_()

FLAC__bool read_subframe_constant_ ( FLAC__StreamDecoder decoder,
unsigned  channel,
unsigned  bps,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_subframe_fixed_()

FLAC__bool read_subframe_fixed_ ( FLAC__StreamDecoder decoder,
unsigned  channel,
unsigned  bps,
const unsigned  order,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_subframe_lpc_()

FLAC__bool read_subframe_lpc_ ( FLAC__StreamDecoder decoder,
unsigned  channel,
unsigned  bps,
const unsigned  order,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_subframe_verbatim_()

FLAC__bool read_subframe_verbatim_ ( FLAC__StreamDecoder decoder,
unsigned  channel,
unsigned  bps,
FLAC__bool  do_full_decode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_zero_padding_()

FLAC__bool read_zero_padding_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ seek_to_absolute_sample_()

FLAC__bool seek_to_absolute_sample_ ( FLAC__StreamDecoder decoder,
FLAC__uint64  stream_length,
FLAC__uint64  target_sample 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_error_to_client_()

void send_error_to_client_ ( const FLAC__StreamDecoder decoder,
FLAC__StreamDecoderErrorStatus  status 
)
static
Here is the caller graph for this function:

◆ set_defaults_()

void set_defaults_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip_id3v2_tag_()

FLAC__bool skip_id3v2_tag_ ( FLAC__StreamDecoder decoder)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_audio_frame_to_client_()

FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_ ( FLAC__StreamDecoder decoder,
const FLAC__Frame frame,
const FLAC__int32 *const  buffer[] 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ID3V2_TAG_

const FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' }
static