MPD: FlacDecoder Struct Reference

MPD 0.20.18

Public Member Functions | Data Fields
FlacDecoder Struct Reference

`#include <FlacCommon.hxx>`

Inheritance diagram for FlacDecoder:
[legend]
Collaboration diagram for FlacDecoder:
[legend]

## Public Member Functions
| FlacDecoder (DecoderClient &_client, InputStream &_input_stream)
bool | Initialize (unsigned sample_rate, unsigned bits_per_sample, unsigned channels, FLAC__uint64 total_frames)
| Wrapper for DecoderClient::Ready(). More...
void | OnMetadata (const FLAC__StreamMetadata &metadata)
FLAC__StreamDecoderWriteStatus | OnWrite (const FLAC__Frame &frame, const FLAC__int32 *const buf[], FLAC__uint64 nbytes)
FLAC__uint64 | GetDeltaPosition (const FLAC__StreamDecoder &sd)
| Calculate the delta (in bytes) between the last frame and the current frame. More...
Public Member Functions inherited from FlacInput
| FlacInput (InputStream &_input_stream, DecoderClient *_client=nullptr)
DecoderClient * | GetClient ()
InputStream & | GetInputStream ()

## Data Fields
bool | initialized = false
| Has DecoderClient::Ready() been called yet? More...
bool | unsupported = false
| Does the FLAC file contain an unsupported audio format? More...
uint16_t | kbit_rate
| The kbit_rate parameter for the next DecoderBridge::SubmitData() call. More...
FlacPcmImport | pcm_import
FLAC__uint64 | position = 0
| End of last frame's position within the stream. More...
Tag | tag
ConstBuffer< void > | chunk = nullptr
| Decoded PCM data obtained by our libFLAC write callback. More...

## Additional Inherited Members
Static Public Member Functions inherited from FlacInput
static FLAC__StreamDecoderReadStatus | Read (const FLAC__StreamDecoder *flac_decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
static FLAC__StreamDecoderSeekStatus | Seek (const FLAC__StreamDecoder *flac_decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
static FLAC__StreamDecoderTellStatus | Tell (const FLAC__StreamDecoder *flac_decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
static FLAC__StreamDecoderLengthStatus | Length (const FLAC__StreamDecoder *flac_decoder, FLAC__uint64 *stream_length, void *client_data)
static FLAC__bool | Eof (const FLAC__StreamDecoder *flac_decoder, void *client_data)
static void | Error (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
Protected Member Functions inherited from FlacInput
FLAC__StreamDecoderReadStatus | Read (FLAC__byte buffer[], size_t *bytes)
FLAC__StreamDecoderSeekStatus | Seek (FLAC__uint64 absolute_byte_offset)
FLAC__StreamDecoderTellStatus | Tell (FLAC__uint64 *absolute_byte_offset)
FLAC__StreamDecoderLengthStatus | Length (FLAC__uint64 *stream_length)
FLAC__bool | Eof ()
void | Error (FLAC__StreamDecoderErrorStatus status)

## Detailed Description

Definition at line 34 of file FlacCommon.hxx.

## Constructor & Destructor Documentation

## ◆ FlacDecoder()

FlacDecoder::FlacDecoder | ( | DecoderClient & | _client,
|  | InputStream & | _input_stream
| ) |  |
| inline

Definition at line 68 of file FlacCommon.hxx.

## Member Function Documentation

## ◆ GetDeltaPosition()

FLAC__uint64 FlacDecoder::GetDeltaPosition | ( | const FLAC__StreamDecoder & | sd | ) |

Calculate the delta (in bytes) between the last frame and the current frame.

## ◆ Initialize()

bool FlacDecoder::Initialize | ( | unsigned | sample_rate,
|  | unsigned | bits_per_sample,
|  | unsigned | channels,
|  | FLAC__uint64 | total_frames
| ) |  |

Wrapper for DecoderClient::Ready().

## ◆ OnMetadata()

void FlacDecoder::OnMetadata | ( | const FLAC__StreamMetadata & | metadata | ) |

## ◆ OnWrite()

FLAC__StreamDecoderWriteStatus FlacDecoder::OnWrite | ( | const FLAC__Frame & | frame,
|  | const FLAC__int32 *const | buf[],
|  | FLAC__uint64 | nbytes
| ) |  |

## Field Documentation

## ◆ chunk

ConstBuffer<void> FlacDecoder::chunk = nullptr

Decoded PCM data obtained by our libFLAC write callback.

If this is non-empty, then DecoderBridge::SubmitData() should be called.

Definition at line 66 of file FlacCommon.hxx.

## ◆ initialized

bool FlacDecoder::initialized = false

Has DecoderClient::Ready() been called yet?

Definition at line 38 of file FlacCommon.hxx.

## ◆ kbit_rate

uint16_t FlacDecoder::kbit_rate

The kbit_rate parameter for the next DecoderBridge::SubmitData() call.

Definition at line 49 of file FlacCommon.hxx.

## ◆ pcm_import

FlacPcmImport FlacDecoder::pcm_import

Definition at line 51 of file FlacCommon.hxx.

## ◆ position

FLAC__uint64 FlacDecoder::position = 0

End of last frame's position within the stream.

This is used for bit rate calculations.

Definition at line 57 of file FlacCommon.hxx.

## ◆ tag

Tag FlacDecoder::tag

Definition at line 59 of file FlacCommon.hxx.

## ◆ unsupported

bool FlacDecoder::unsupported = false

Does the FLAC file contain an unsupported audio format?

Definition at line 43 of file FlacCommon.hxx.

The documentation for this struct was generated from the following file:

- decoder/plugins/FlacCommon.hxx