The basic usage of this decoder is as follows:
The seekable stream decoder is a wrapper around the stream decoder which also provides seeking capability. In addition to the Read/Write/Metadata/Error callbacks of the stream decoder, the user must also provide the following:
Seeking is exposed through the FLAC__seekable_stream_decoder_seek_absolute() method. At any point after the seekable stream decoder has been initialized, the user can call this function to seek to an exact sample within the stream. Subsequently, the first time the write callback is called it will be passed a (possibly partial) block starting at that sample.
The seekable stream decoder also provides MD5 signature checking. If this is turned on before initialization, FLAC__seekable_stream_decoder_finish() will report when the decoded MD5 signature does not match the one stored in the STREAMINFO block. MD5 checking is automatically turned off (until the next FLAC__seekable_stream_decoder_reset()) if there is no signature in the STREAMINFO block or when a seek is attempted.
Make sure to read the detailed description of the stream decoder module since the seekable stream decoder inherits much of its behavior.
true
, otherwise false
.FLAC__stream_decoder_finish() resets all settings to the constructor defaults, including the callbacks.
|
Signature for the read callback. See FLAC__seekable_stream_decoder_set_read_callback() and FLAC__StreamDecoderReadCallback for more info.
|
|
Signature for the seek callback. See FLAC__seekable_stream_decoder_set_seek_callback() for more info.
|
|
Signature for the tell callback. See FLAC__seekable_stream_decoder_set_tell_callback() for more info.
|
|
Signature for the length callback. See FLAC__seekable_stream_decoder_set_length_callback() for more info.
|
|
Signature for the EOF callback. See FLAC__seekable_stream_decoder_set_eof_callback() for more info.
|
|
Signature for the write callback. See FLAC__seekable_stream_decoder_set_write_callback() and FLAC__StreamDecoderWriteCallback for more info.
|
|
Signature for the metadata callback. See FLAC__seekable_stream_decoder_set_metadata_callback() and FLAC__StreamDecoderMetadataCallback for more info.
|
|
Signature for the error callback. See FLAC__seekable_stream_decoder_set_error_callback() and FLAC__StreamDecoderErrorCallback for more info.
|
|
State values for a FLAC__SeekableStreamDecoder The decoder's state can be obtained by calling FLAC__seekable_stream_decoder_get_state().
|
|
Return values for the FLAC__SeekableStreamDecoder read callback. |
|
Return values for the FLAC__SeekableStreamDecoder seek callback. |
|
Return values for the FLAC__SeekableStreamDecoder tell callback. |
|
Return values for the FLAC__SeekableStreamDecoder length callback. |
|
Create a new seekable stream decoder instance. The instance is created with default settings; see the individual FLAC__seekable_stream_decoder_set_*() functions for each setting's default.
|
|
Free a decoder instance. Deletes the object pointed to by decoder.
|
|
Set the "MD5 signature checking" flag. If MD5 signature checking will be turned off (until the next FLAC__seekable_stream_decoder_reset()) if there is no signature in the STREAMINFO block or when a seek is attempted.
|
|
Set the read callback. This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_read_callback().
|
|
Set the seek callback. The supplied function will be called when the decoder needs to seek the input stream. The decoder will pass the absolute byte offset to seek to, 0 meaning the beginning of the stream.
|
|
Set the tell callback. The supplied function will be called when the decoder wants to know the current position of the stream. The callback should return the byte offset from the beginning of the stream.
|
|
Set the length callback. The supplied function will be called when the decoder wants to know the total length of the stream in bytes.
|
|
Set the eof callback. The supplied function will be called when the decoder needs to know if the end of the stream has been reached.
|
|
Set the write callback. This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_write_callback().
|
|
Set the metadata callback. This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_callback().
|
|
Set the error callback. This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_error_callback().
|
|
Set the client data to be passed back to callbacks. This value will be supplied to callbacks in their client_data argument.
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_respond().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_respond_application().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_respond_all().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_ignore().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_ignore_application().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_set_metadata_ignore_all().
|
|
Get the current decoder state.
|
|
Get the state of the underlying stream decoder. Useful when the seekable stream decoder state is
|
|
Get the current decoder state as a C string. This version automatically resolves
|
|
Get the "MD5 signature checking" flag. This is the value of the setting, not whether or not the decoder is currently checking the MD5 (remember, it can be turned off automatically by a seek). When the decoder is reset the flag will be restored to the value returned by this function.
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_get_channels().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_get_channel_assignment().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_get_bits_per_sample().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_get_sample_rate().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_get_blocksize().
|
|
Returns the decoder's current read position within the stream. The position is the byte offset from the start of the stream. Bytes before this position have been fully decoded. Note that there may still be undecoded bytes in the decoder's read FIFO. The returned position is correct even after a seek.
|
|
Initialize the decoder instance. Should be called after FLAC__seekable_stream_decoder_new() and FLAC__seekable_stream_decoder_set_*() but before any of the FLAC__seekable_stream_decoder_process_*() functions. Will set and return the decoder state, which will be FLAC__SEEKABLE_STREAM_DECODER_OK if initialization succeeded.
|
|
Finish the decoding process. Flushes the decoding buffer, releases resources, resets the decoder settings to their defaults, and returns the decoder state to FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED. In the event of a prematurely-terminated decode, it is not strictly necessary to call this immediately before FLAC__seekable_stream_decoder_delete() but it is good practice to match every FLAC__seekable_stream_decoder_init() with a FLAC__seekable_stream_decoder_finish().
|
|
Flush the stream input. The decoder's input buffer will be cleared and the state set to
|
|
Reset the decoding process. The decoder's input buffer will be cleared and the state set to
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_single().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_until_end_of_metadata().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_until_end_of_stream().
|
|
This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_skip_single_frame().
|
|
Flush the input and seek to an absolute sample. Decoding will resume at the given sample. Note that because of this, the next write callback may contain a partial block.
|
|
Maps a FLAC__SeekableStreamDecoderState to a C string. Using a FLAC__SeekableStreamDecoderState as the index to this array will give the string equivalent. The contents should not be modified. |
|
Maps a FLAC__SeekableStreamDecoderReadStatus to a C string. Using a FLAC__SeekableStreamDecoderReadStatus as the index to this array will give the string equivalent. The contents should not be modified. |
|
Maps a FLAC__SeekableStreamDecoderSeekStatus to a C string. Using a FLAC__SeekableStreamDecoderSeekStatus as the index to this array will give the string equivalent. The contents should not be modified. |
|
Maps a FLAC__SeekableStreamDecoderTellStatus to a C string. Using a FLAC__SeekableStreamDecoderTellStatus as the index to this array will give the string equivalent. The contents should not be modified. |
|
Maps a FLAC__SeekableStreamDecoderLengthStatus to a C string. Using a FLAC__SeekableStreamDecoderLengthStatus as the index to this array will give the string equivalent. The contents should not be modified. |