LMMS
Loading...
Searching...
No Matches
stream_decoder.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "../compat.h"
#include "../assert.h"
#include "../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"

Classes

struct  FLAC__StreamDecoderPrivate

Typedefs

typedef struct FLAC__StreamDecoderPrivate FLAC__StreamDecoderPrivate

Functions

static void set_defaults_ (FLAC__StreamDecoder *decoder)
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)
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)
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
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

typedef struct FLAC__StreamDecoderPrivate FLAC__StreamDecoderPrivate

Function Documentation

◆ allocate_output_()

FLAC__bool allocate_output_ ( FLAC__StreamDecoder * decoder,
unsigned size,
unsigned channels )
static

◆ find_metadata_()

FLAC__bool find_metadata_ ( FLAC__StreamDecoder * decoder)
static

◆ FLAC__stream_decoder_get_input_bytes_unconsumed()

unsigned FLAC__stream_decoder_get_input_bytes_unconsumed ( const FLAC__StreamDecoder * decoder)

◆ frame_sync_()

FLAC__bool frame_sync_ ( FLAC__StreamDecoder * decoder)
static

◆ has_id_filtered_()

FLAC__bool has_id_filtered_ ( FLAC__StreamDecoder * decoder,
FLAC__byte * id )
static

◆ init_stream_internal_()

◆ read_callback_()

FLAC__bool read_callback_ ( FLAC__byte buffer[],
size_t * bytes,
void * client_data )
static

◆ read_frame_()

FLAC__bool read_frame_ ( FLAC__StreamDecoder * decoder,
FLAC__bool * got_a_frame,
FLAC__bool do_full_decode )
static

◆ read_frame_header_()

FLAC__bool read_frame_header_ ( FLAC__StreamDecoder * decoder)
static

◆ read_metadata_()

FLAC__bool read_metadata_ ( FLAC__StreamDecoder * decoder)
static

◆ read_metadata_cuesheet_()

FLAC__bool read_metadata_cuesheet_ ( FLAC__StreamDecoder * decoder,
FLAC__StreamMetadata_CueSheet * obj )
static

◆ read_metadata_picture_()

FLAC__bool read_metadata_picture_ ( FLAC__StreamDecoder * decoder,
FLAC__StreamMetadata_Picture * obj )
static

◆ read_metadata_seektable_()

FLAC__bool read_metadata_seektable_ ( FLAC__StreamDecoder * decoder,
FLAC__bool is_last,
unsigned length )
static

◆ read_metadata_streaminfo_()

FLAC__bool read_metadata_streaminfo_ ( FLAC__StreamDecoder * decoder,
FLAC__bool is_last,
unsigned length )
static

◆ read_metadata_vorbiscomment_()

FLAC__bool read_metadata_vorbiscomment_ ( FLAC__StreamDecoder * decoder,
FLAC__StreamMetadata_VorbisComment * obj,
unsigned length )
static

◆ 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

◆ read_subframe_()

FLAC__bool read_subframe_ ( FLAC__StreamDecoder * decoder,
unsigned channel,
unsigned bps,
FLAC__bool do_full_decode )
static

◆ read_subframe_constant_()

FLAC__bool read_subframe_constant_ ( FLAC__StreamDecoder * decoder,
unsigned channel,
unsigned bps,
FLAC__bool do_full_decode )
static

◆ read_subframe_fixed_()

FLAC__bool read_subframe_fixed_ ( FLAC__StreamDecoder * decoder,
unsigned channel,
unsigned bps,
const unsigned order,
FLAC__bool do_full_decode )
static

◆ read_subframe_lpc_()

FLAC__bool read_subframe_lpc_ ( FLAC__StreamDecoder * decoder,
unsigned channel,
unsigned bps,
const unsigned order,
FLAC__bool do_full_decode )
static

◆ read_subframe_verbatim_()

FLAC__bool read_subframe_verbatim_ ( FLAC__StreamDecoder * decoder,
unsigned channel,
unsigned bps,
FLAC__bool do_full_decode )
static

◆ read_zero_padding_()

FLAC__bool read_zero_padding_ ( FLAC__StreamDecoder * decoder)
static

◆ seek_to_absolute_sample_()

FLAC__bool seek_to_absolute_sample_ ( FLAC__StreamDecoder * decoder,
FLAC__uint64 stream_length,
FLAC__uint64 target_sample )
static

◆ send_error_to_client_()

void send_error_to_client_ ( const FLAC__StreamDecoder * decoder,
FLAC__StreamDecoderErrorStatus status )
static

◆ set_defaults_()

void set_defaults_ ( FLAC__StreamDecoder * decoder)
static

◆ skip_id3v2_tag_()

FLAC__bool skip_id3v2_tag_ ( FLAC__StreamDecoder * decoder)
static

◆ 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

Variable Documentation

◆ ID3V2_TAG_

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