1 /* libOggFLAC - Free Lossless Audio Codec + Ogg library
2 * Copyright (C) 2002,2003,2004,2005,2006 Josh Coalson
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * - Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * - Neither the name of the Xiph.org Foundation nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef OggFLAC__SEEKABLE_STREAM_DECODER_H
33 #define OggFLAC__SEEKABLE_STREAM_DECODER_H
36 #include "stream_decoder.h"
43 /** \file include/OggFLAC/seekable_stream_decoder.h
46 * This module contains the functions which implement the seekable stream
49 * See the detailed documentation in the
50 * \link oggflac_seekable_stream_decoder seekable stream decoder \endlink module.
53 /** \defgroup oggflac_seekable_stream_decoder OggFLAC/seekable_stream_decoder.h: seekable stream decoder interface
54 * \ingroup oggflac_decoder
57 * This module contains the functions which implement the seekable stream
60 * The interface here is nearly identical to FLAC's seekable stream decoder,
61 * including the callbacks, with the addition of
62 * OggFLAC__seekable_stream_decoder_set_serial_number(). See the
63 * \link flac_seekable_stream_decoder FLAC seekable stream decoder module \endlink
64 * for full documentation.
70 /** State values for an OggFLAC__SeekableStreamDecoder
72 * The decoder's state can be obtained by calling OggFLAC__seekable_stream_decoder_get_state().
76 OggFLAC__SEEKABLE_STREAM_DECODER_OK = 0,
77 /**< The decoder is in the normal OK state. */
79 OggFLAC__SEEKABLE_STREAM_DECODER_SEEKING,
80 /**< The decoder is in the process of seeking. */
82 OggFLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM,
83 /**< The decoder has reached the end of the stream. */
85 OggFLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
86 /**< Memory allocation failed. */
88 OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR,
89 /**< An error occurred in the underlying stream decoder;
90 * check OggFLAC__seekable_stream_decoder_get_stream_decoder_state().
93 OggFLAC__SEEKABLE_STREAM_DECODER_READ_ERROR,
94 /**< The read callback returned an error. */
96 OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR,
97 /**< An error occurred while seeking or the seek or tell
98 * callback returned an error.
101 OggFLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED,
102 /**< OggFLAC__seekable_stream_decoder_init() was called when the decoder was
103 * already initialized, usually because
104 * OggFLAC__seekable_stream_decoder_finish() was not called.
107 OggFLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK,
108 /**< The decoder was initialized before setting all the required callbacks. */
110 OggFLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
111 /**< The decoder is in the uninitialized state. */
113 } OggFLAC__SeekableStreamDecoderState;
115 /** Maps an OggFLAC__SeekableStreamDecoderState to a C string.
117 * Using an OggFLAC__SeekableStreamDecoderState as the index to this array
118 * will give the string equivalent. The contents should not be modified.
120 extern OggFLAC_API const char * const OggFLAC__SeekableStreamDecoderStateString[];
123 /** Return values for the OggFLAC__SeekableStreamDecoder read callback.
127 OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK,
128 /**< The read was OK and decoding can continue. */
130 OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR
131 /**< An unrecoverable error occurred. The decoder will return from the process call. */
133 } OggFLAC__SeekableStreamDecoderReadStatus;
135 /** Maps a OggFLAC__SeekableStreamDecoderReadStatus to a C string.
137 * Using a OggFLAC__SeekableStreamDecoderReadStatus as the index to this array
138 * will give the string equivalent. The contents should not be modified.
140 extern OggFLAC_API const char * const OggFLAC__SeekableStreamDecoderReadStatusString[];
143 /** Return values for the OggFLAC__SeekableStreamDecoder seek callback.
147 OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK,
148 /**< The seek was OK and decoding can continue. */
150 OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
151 /**< An unrecoverable error occurred. The decoder will return from the process call. */
153 } OggFLAC__SeekableStreamDecoderSeekStatus;
155 /** Maps a OggFLAC__SeekableStreamDecoderSeekStatus to a C string.
157 * Using a OggFLAC__SeekableStreamDecoderSeekStatus as the index to this array
158 * will give the string equivalent. The contents should not be modified.
160 extern OggFLAC_API const char * const OggFLAC__SeekableStreamDecoderSeekStatusString[];
163 /** Return values for the OggFLAC__SeekableStreamDecoder tell callback.
167 OggFLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK,
168 /**< The tell was OK and decoding can continue. */
170 OggFLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR
171 /**< An unrecoverable error occurred. The decoder will return from the process call. */
173 } OggFLAC__SeekableStreamDecoderTellStatus;
175 /** Maps a OggFLAC__SeekableStreamDecoderTellStatus to a C string.
177 * Using a OggFLAC__SeekableStreamDecoderTellStatus as the index to this array
178 * will give the string equivalent. The contents should not be modified.
180 extern OggFLAC_API const char * const OggFLAC__SeekableStreamDecoderTellStatusString[];
183 /** Return values for the OggFLAC__SeekableStreamDecoder length callback.
187 OggFLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK,
188 /**< The length call was OK and decoding can continue. */
190 OggFLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR
191 /**< An unrecoverable error occurred. The decoder will return from the process call. */
193 } OggFLAC__SeekableStreamDecoderLengthStatus;
195 /** Maps a OggFLAC__SeekableStreamDecoderLengthStatus to a C string.
197 * Using a OggFLAC__SeekableStreamDecoderLengthStatus as the index to this array
198 * will give the string equivalent. The contents should not be modified.
200 extern OggFLAC_API const char * const OggFLAC__SeekableStreamDecoderLengthStatusString[];
203 /***********************************************************************
205 * class OggFLAC__SeekableStreamDecoder : public FLAC__StreamDecoder
207 ***********************************************************************/
209 struct OggFLAC__SeekableStreamDecoderProtected;
210 struct OggFLAC__SeekableStreamDecoderPrivate;
211 /** The opaque structure definition for the seekable stream decoder type.
213 * \link oggflac_seekable_stream_decoder seekable stream decoder module \endlink
214 * for a detailed description.
217 struct OggFLAC__SeekableStreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
218 struct OggFLAC__SeekableStreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
219 } OggFLAC__SeekableStreamDecoder;
221 /** Signature for the read callback.
222 * See OggFLAC__seekable_stream_decoder_set_read_callback()
223 * and OggFLAC__StreamDecoderReadCallback for more info.
225 * \param decoder The decoder instance calling the callback.
226 * \param buffer A pointer to a location for the callee to store
227 * data to be decoded.
228 * \param bytes A pointer to the size of the buffer.
229 * \param client_data The callee's client data set through
230 * OggFLAC__seekable_stream_decoder_set_client_data().
231 * \retval FLAC__SeekableStreamDecoderReadStatus
232 * The callee's return status.
234 typedef OggFLAC__SeekableStreamDecoderReadStatus (*OggFLAC__SeekableStreamDecoderReadCallback)(const OggFLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
236 /** Signature for the seek callback.
237 * See OggFLAC__seekable_stream_decoder_set_seek_callback() for more info.
239 * \param decoder The decoder instance calling the callback.
240 * \param absolute_byte_offset The offset from the beginning of the stream
242 * \param client_data The callee's client data set through
243 * OggFLAC__seekable_stream_decoder_set_client_data().
244 * \retval FLAC__SeekableStreamDecoderSeekStatus
245 * The callee's return status.
247 typedef OggFLAC__SeekableStreamDecoderSeekStatus (*OggFLAC__SeekableStreamDecoderSeekCallback)(const OggFLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
249 /** Signature for the tell callback.
250 * See OggFLAC__seekable_stream_decoder_set_tell_callback() for more info.
252 * \param decoder The decoder instance calling the callback.
253 * \param absolute_byte_offset A pointer to storage for the current offset
254 * from the beginning of the stream.
255 * \param client_data The callee's client data set through
256 * OggFLAC__seekable_stream_decoder_set_client_data().
257 * \retval FLAC__SeekableStreamDecoderTellStatus
258 * The callee's return status.
260 typedef OggFLAC__SeekableStreamDecoderTellStatus (*OggFLAC__SeekableStreamDecoderTellCallback)(const OggFLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
262 /** Signature for the length callback.
263 * See OggFLAC__seekable_stream_decoder_set_length_callback() for more info.
265 * \param decoder The decoder instance calling the callback.
266 * \param stream_length A pointer to storage for the length of the stream
268 * \param client_data The callee's client data set through
269 * OggFLAC__seekable_stream_decoder_set_client_data().
270 * \retval FLAC__SeekableStreamDecoderLengthStatus
271 * The callee's return status.
273 typedef OggFLAC__SeekableStreamDecoderLengthStatus (*OggFLAC__SeekableStreamDecoderLengthCallback)(const OggFLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
275 /** Signature for the EOF callback.
276 * See OggFLAC__seekable_stream_decoder_set_eof_callback() for more info.
278 * \param decoder The decoder instance calling the callback.
279 * \param client_data The callee's client data set through
280 * OggFLAC__seekable_stream_decoder_set_client_data().
282 * \c true if the currently at the end of the stream, else \c false.
284 typedef FLAC__bool (*OggFLAC__SeekableStreamDecoderEofCallback)(const OggFLAC__SeekableStreamDecoder *decoder, void *client_data);
286 /** Signature for the write callback.
287 * See OggFLAC__seekable_stream_decoder_set_write_callback()
288 * and OggFLAC__StreamDecoderWriteCallback for more info.
290 * \param decoder The decoder instance calling the callback.
291 * \param frame The description of the decoded frame.
292 * \param buffer An array of pointers to decoded channels of data.
293 * \param client_data The callee's client data set through
294 * OggFLAC__seekable_stream_decoder_set_client_data().
295 * \retval FLAC__StreamDecoderWriteStatus
296 * The callee's return status.
298 typedef FLAC__StreamDecoderWriteStatus (*OggFLAC__SeekableStreamDecoderWriteCallback)(const OggFLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
300 /** Signature for the metadata callback.
301 * See OggFLAC__seekable_stream_decoder_set_metadata_callback()
302 * and OggFLAC__StreamDecoderMetadataCallback for more info.
304 * \param decoder The decoder instance calling the callback.
305 * \param metadata The decoded metadata block.
306 * \param client_data The callee's client data set through
307 * OggFLAC__seekable_stream_decoder_set_client_data().
309 typedef void (*OggFLAC__SeekableStreamDecoderMetadataCallback)(const OggFLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
311 /** Signature for the error callback.
312 * See OggFLAC__seekable_stream_decoder_set_error_callback()
313 * and OggFLAC__StreamDecoderErrorCallback for more info.
315 * \param decoder The decoder instance calling the callback.
316 * \param status The error encountered by the decoder.
317 * \param client_data The callee's client data set through
318 * OggFLAC__seekable_stream_decoder_set_client_data().
320 typedef void (*OggFLAC__SeekableStreamDecoderErrorCallback)(const OggFLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
323 /***********************************************************************
325 * Class constructor/destructor
327 ***********************************************************************/
329 /** Create a new seekable stream decoder instance. The instance is created
330 * with default settings; see the individual
331 * OggFLAC__seekable_stream_decoder_set_*() functions for each setting's
334 * \retval OggFLAC__SeekableStreamDecoder*
335 * \c NULL if there was an error allocating memory, else the new instance.
337 OggFLAC_API OggFLAC__SeekableStreamDecoder *OggFLAC__seekable_stream_decoder_new();
339 /** Free a decoder instance. Deletes the object pointed to by \a decoder.
341 * \param decoder A pointer to an existing decoder.
343 * \code decoder != NULL \endcode
345 OggFLAC_API void OggFLAC__seekable_stream_decoder_delete(OggFLAC__SeekableStreamDecoder *decoder);
348 /***********************************************************************
350 * Public class method prototypes
352 ***********************************************************************/
354 /** Set the "MD5 signature checking" flag.
355 * This is inherited from FLAC__SeekableStreamDecoder; see
356 * FLAC__seekable_stream_decoder_set_md5_checking().
359 * \param decoder A decoder instance to set.
360 * \param value Flag value (see above).
362 * \code decoder != NULL \endcode
364 * \c false if the decoder is already initialized, else \c true.
366 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_md5_checking(OggFLAC__SeekableStreamDecoder *decoder, FLAC__bool value);
368 /** Set the read callback.
369 * This is inherited from FLAC__SeekableStreamDecoder; see
370 * FLAC__seekable_stream_decoder_set_read_callback().
373 * The callback is mandatory and must be set before initialization.
376 * \param decoder A decoder instance to set.
377 * \param value See above.
379 * \code decoder != NULL \endcode
380 * \code value != NULL \endcode
382 * \c false if the decoder is already initialized, else \c true.
384 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_read_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderReadCallback value);
386 /** Set the seek callback.
387 * This is inherited from FLAC__SeekableStreamDecoder; see
388 * FLAC__seekable_stream_decoder_set_seek_callback().
391 * The callback is mandatory and must be set before initialization.
394 * \param decoder A decoder instance to set.
395 * \param value See above.
397 * \code decoder != NULL \endcode
398 * \code value != NULL \endcode
400 * \c false if the decoder is already initialized, else \c true.
402 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_seek_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderSeekCallback value);
404 /** Set the tell callback.
405 * This is inherited from FLAC__SeekableStreamDecoder; see
406 * FLAC__seekable_stream_decoder_set_tell_callback().
409 * The callback is mandatory and must be set before initialization.
412 * \param decoder A decoder instance to set.
413 * \param value See above.
415 * \code decoder != NULL \endcode
416 * \code value != NULL \endcode
418 * \c false if the decoder is already initialized, else \c true.
420 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_tell_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderTellCallback value);
422 /** Set the length callback.
423 * This is inherited from FLAC__SeekableStreamDecoder; see
424 * FLAC__seekable_stream_decoder_set_length_callback().
427 * The callback is mandatory and must be set before initialization.
430 * \param decoder A decoder instance to set.
431 * \param value See above.
433 * \code decoder != NULL \endcode
434 * \code value != NULL \endcode
436 * \c false if the decoder is already initialized, else \c true.
438 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_length_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderLengthCallback value);
440 /** Set the eof callback.
441 * This is inherited from FLAC__SeekableStreamDecoder; see
442 * FLAC__seekable_stream_decoder_set_eof_callback().
445 * The callback is mandatory and must be set before initialization.
448 * \param decoder A decoder instance to set.
449 * \param value See above.
451 * \code decoder != NULL \endcode
452 * \code value != NULL \endcode
454 * \c false if the decoder is already initialized, else \c true.
456 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_eof_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderEofCallback value);
458 /** Set the write callback.
459 * This is inherited from FLAC__SeekableStreamDecoder; see
460 * FLAC__seekable_stream_decoder_set_write_callback().
463 * The callback is mandatory and must be set before initialization.
466 * \param decoder A decoder instance to set.
467 * \param value See above.
469 * \code decoder != NULL \endcode
470 * \code value != NULL \endcode
472 * \c false if the decoder is already initialized, else \c true.
474 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_write_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderWriteCallback value);
476 /** Set the metadata callback.
477 * This is inherited from FLAC__SeekableStreamDecoder; see
478 * FLAC__seekable_stream_decoder_set_metadata_callback().
481 * The callback is mandatory and must be set before initialization.
484 * \param decoder A decoder instance to set.
485 * \param value See above.
487 * \code decoder != NULL \endcode
488 * \code value != NULL \endcode
490 * \c false if the decoder is already initialized, else \c true.
492 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderMetadataCallback value);
494 /** Set the error callback.
495 * This is inherited from FLAC__SeekableStreamDecoder; see
496 * FLAC__seekable_stream_decoder_set_error_callback().
499 * The callback is mandatory and must be set before initialization.
502 * \param decoder A decoder instance to set.
503 * \param value See above.
505 * \code decoder != NULL \endcode
506 * \code value != NULL \endcode
508 * \c false if the decoder is already initialized, else \c true.
510 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_error_callback(OggFLAC__SeekableStreamDecoder *decoder, OggFLAC__SeekableStreamDecoderErrorCallback value);
512 /** Set the client data to be passed back to callbacks.
513 * This value will be supplied to callbacks in their \a client_data
517 * \param decoder A decoder instance to set.
518 * \param value See above.
520 * \code decoder != NULL \endcode
522 * \c false if the decoder is already initialized, else \c true.
524 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_client_data(OggFLAC__SeekableStreamDecoder *decoder, void *value);
526 /** Set the serial number for the Ogg stream.
527 * The default behavior is to use the serial number of the first Ogg
528 * page. Setting a serial number here will explicitly specify which
529 * stream is to be decoded.
531 * \default \c use serial number of first page
532 * \param decoder A decoder instance to set.
533 * \param serial_number See above.
535 * \code decoder != NULL \endcode
537 * \c false if the decoder is already initialized, else \c true.
539 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_serial_number(OggFLAC__SeekableStreamDecoder *decoder, long serial_number);
541 /** This is inherited from FLAC__SeekableStreamDecoder; see
542 * FLAC__seekable_stream_decoder_set_metadata_respond().
544 * \default By default, only the \c STREAMINFO block is returned via the
546 * \param decoder A decoder instance to set.
547 * \param type See above.
549 * \code decoder != NULL \endcode
552 * \c false if the decoder is already initialized, else \c true.
554 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_respond(OggFLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
556 /** This is inherited from FLAC__SeekableStreamDecoder; see
557 * FLAC__seekable_stream_decoder_set_metadata_respond_application().
559 * \default By default, only the \c STREAMINFO block is returned via the
561 * \param decoder A decoder instance to set.
562 * \param id See above.
564 * \code decoder != NULL \endcode
565 * \code id != NULL \endcode
567 * \c false if the decoder is already initialized, else \c true.
569 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_respond_application(OggFLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
571 /** This is inherited from FLAC__SeekableStreamDecoder; see
572 * FLAC__seekable_stream_decoder_set_metadata_respond_all().
574 * \default By default, only the \c STREAMINFO block is returned via the
576 * \param decoder A decoder instance to set.
578 * \code decoder != NULL \endcode
580 * \c false if the decoder is already initialized, else \c true.
582 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_respond_all(OggFLAC__SeekableStreamDecoder *decoder);
584 /** This is inherited from FLAC__SeekableStreamDecoder; see
585 * FLAC__seekable_stream_decoder_set_metadata_ignore().
587 * \default By default, only the \c STREAMINFO block is returned via the
589 * \param decoder A decoder instance to set.
590 * \param type See above.
592 * \code decoder != NULL \endcode
595 * \c false if the decoder is already initialized, else \c true.
597 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_ignore(OggFLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
599 /** This is inherited from FLAC__SeekableStreamDecoder; see
600 * FLAC__seekable_stream_decoder_set_metadata_ignore_application().
602 * \default By default, only the \c STREAMINFO block is returned via the
604 * \param decoder A decoder instance to set.
605 * \param id See above.
607 * \code decoder != NULL \endcode
608 * \code id != NULL \endcode
610 * \c false if the decoder is already initialized, else \c true.
612 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_ignore_application(OggFLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
614 /** This is inherited from FLAC__SeekableStreamDecoder; see
615 * FLAC__seekable_stream_decoder_set_metadata_ignore_all().
617 * \default By default, only the \c STREAMINFO block is returned via the
619 * \param decoder A decoder instance to set.
621 * \code decoder != NULL \endcode
623 * \c false if the decoder is already initialized, else \c true.
625 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_set_metadata_ignore_all(OggFLAC__SeekableStreamDecoder *decoder);
627 /** Get the current decoder state.
629 * \param decoder A decoder instance to query.
631 * \code decoder != NULL \endcode
632 * \retval OggFLAC__SeekableStreamDecoderState
633 * The current decoder state.
635 OggFLAC_API OggFLAC__SeekableStreamDecoderState OggFLAC__seekable_stream_decoder_get_state(const OggFLAC__SeekableStreamDecoder *decoder);
637 /** Get the state of the underlying stream decoder.
638 * Useful when the seekable stream decoder state is
639 * \c OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR.
641 * \param decoder A decoder instance to query.
643 * \code decoder != NULL \endcode
644 * \retval OggFLAC__StreamDecoderState
645 * The stream decoder state.
647 OggFLAC_API OggFLAC__StreamDecoderState OggFLAC__seekable_stream_decoder_get_stream_decoder_state(const OggFLAC__SeekableStreamDecoder *decoder);
649 /** Get the state of the underlying stream decoder's FLAC stream decoder.
650 * Useful when the seekable stream decoder state is
651 * \c OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR and the
652 * stream decoder state is \c OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR
654 * \param decoder A decoder instance to query.
656 * \code decoder != NULL \endcode
657 * \retval FLAC__StreamDecoderState
658 * The FLAC stream decoder state.
660 OggFLAC_API FLAC__StreamDecoderState OggFLAC__seekable_stream_decoder_get_FLAC_stream_decoder_state(const OggFLAC__SeekableStreamDecoder *decoder);
662 /** Get the current decoder state as a C string.
663 * This version automatically resolves
664 * \c OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR
665 * by getting the stream decoder's state.
667 * \param decoder A decoder instance to query.
669 * \code decoder != NULL \endcode
670 * \retval const char *
671 * The decoder state as a C string. Do not modify the contents.
673 OggFLAC_API const char *OggFLAC__seekable_stream_decoder_get_resolved_state_string(const OggFLAC__SeekableStreamDecoder *decoder);
675 /** This is inherited from FLAC__SeekableStreamDecoder; see
676 * FLAC__seekable_stream_decoder_get_md5_checking().
678 * \param decoder A decoder instance to query.
680 * \code decoder != NULL \endcode
684 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_get_md5_checking(const OggFLAC__SeekableStreamDecoder *decoder);
686 /** This is inherited from FLAC__SeekableStreamDecoder; see
687 * FLAC__seekable_stream_decoder_get_channels().
689 * \param decoder A decoder instance to query.
691 * \code decoder != NULL \endcode
695 OggFLAC_API unsigned OggFLAC__seekable_stream_decoder_get_channels(const OggFLAC__SeekableStreamDecoder *decoder);
697 /** This is inherited from FLAC__SeekableStreamDecoder; see
698 * FLAC__seekable_stream_decoder_get_channel_assignment().
700 * \param decoder A decoder instance to query.
702 * \code decoder != NULL \endcode
703 * \retval OggFLAC__ChannelAssignment
706 OggFLAC_API FLAC__ChannelAssignment OggFLAC__seekable_stream_decoder_get_channel_assignment(const OggFLAC__SeekableStreamDecoder *decoder);
708 /** This is inherited from FLAC__SeekableStreamDecoder; see
709 * FLAC__seekable_stream_decoder_get_bits_per_sample().
711 * \param decoder A decoder instance to query.
713 * \code decoder != NULL \endcode
717 OggFLAC_API unsigned OggFLAC__seekable_stream_decoder_get_bits_per_sample(const OggFLAC__SeekableStreamDecoder *decoder);
719 /** This is inherited from FLAC__SeekableStreamDecoder; see
720 * FLAC__seekable_stream_decoder_get_sample_rate().
722 * \param decoder A decoder instance to query.
724 * \code decoder != NULL \endcode
728 OggFLAC_API unsigned OggFLAC__seekable_stream_decoder_get_sample_rate(const OggFLAC__SeekableStreamDecoder *decoder);
730 /** This is inherited from FLAC__SeekableStreamDecoder; see
731 * FLAC__seekable_stream_decoder_get_blocksize().
733 * \param decoder A decoder instance to query.
735 * \code decoder != NULL \endcode
739 OggFLAC_API unsigned OggFLAC__seekable_stream_decoder_get_blocksize(const OggFLAC__SeekableStreamDecoder *decoder);
741 /** Initialize the decoder instance.
742 * Should be called after OggFLAC__seekable_stream_decoder_new() and
743 * OggFLAC__seekable_stream_decoder_set_*() but before any of the
744 * OggFLAC__seekable_stream_decoder_process_*() functions. Will set and return
745 * the decoder state, which will be OggFLAC__SEEKABLE_STREAM_DECODER_OK
746 * if initialization succeeded.
748 * \param decoder An uninitialized decoder instance.
750 * \code decoder != NULL \endcode
751 * \retval OggFLAC__SeekableStreamDecoderState
752 * \c OggFLAC__SEEKABLE_STREAM_DECODER_OK if initialization was
753 * successful; see OggFLAC__SeekableStreamDecoderState for the meanings
754 * of other return values.
756 OggFLAC_API OggFLAC__SeekableStreamDecoderState OggFLAC__seekable_stream_decoder_init(OggFLAC__SeekableStreamDecoder *decoder);
758 /** Finish the decoding process.
759 * Flushes the decoding buffer, releases resources, resets the decoder
760 * settings to their defaults, and returns the decoder state to
761 * OggFLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED.
763 * In the event of a prematurely-terminated decode, it is not strictly
764 * necessary to call this immediately before
765 * OggFLAC__seekable_stream_decoder_delete() but it is good practice to match
766 * every OggFLAC__seekable_stream_decoder_init() with a
767 * OggFLAC__seekable_stream_decoder_finish().
769 * \param decoder An uninitialized decoder instance.
771 * \code decoder != NULL \endcode
773 * \c false if MD5 checking is on AND a STREAMINFO block was available
774 * AND the MD5 signature in the STREAMINFO block was non-zero AND the
775 * signature does not match the one computed by the decoder; else
778 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_finish(OggFLAC__SeekableStreamDecoder *decoder);
780 /** This is inherited from FLAC__SeekableStreamDecoder; see
781 * FLAC__seekable_stream_decoder_flush().
783 * \param decoder A decoder instance.
785 * \code decoder != NULL \endcode
787 * \c true if successful, else \c false if a memory allocation
788 * or stream decoder error occurs.
790 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_flush(OggFLAC__SeekableStreamDecoder *decoder);
792 /** This is inherited from FLAC__SeekableStreamDecoder; see
793 * FLAC__seekable_stream_decoder_reset().
795 * \param decoder A decoder instance.
797 * \code decoder != NULL \endcode
799 * \c true if successful, else \c false if a memory allocation
800 * or stream decoder error occurs.
802 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_reset(OggFLAC__SeekableStreamDecoder *decoder);
804 /** This is inherited from FLAC__SeekableStreamDecoder; see
805 * FLAC__seekable_stream_decoder_process_single().
807 * \param decoder A decoder instance.
809 * \code decoder != NULL \endcode
813 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_process_single(OggFLAC__SeekableStreamDecoder *decoder);
815 /** This is inherited from FLAC__SeekableStreamDecoder; see
816 * FLAC__seekable_stream_decoder_process_until_end_of_metadata().
818 * \param decoder A decoder instance.
820 * \code decoder != NULL \endcode
824 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_process_until_end_of_metadata(OggFLAC__SeekableStreamDecoder *decoder);
826 /** This is inherited from FLAC__SeekableStreamDecoder; see
827 * FLAC__seekable_stream_decoder_process_until_end_of_stream().
829 * \param decoder A decoder instance.
831 * \code decoder != NULL \endcode
835 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_process_until_end_of_stream(OggFLAC__SeekableStreamDecoder *decoder);
837 /** This is inherited from FLAC__SeekableStreamDecoder; see
838 * FLAC__seekable_stream_decoder_seek_absolute().
840 * \param decoder A decoder instance.
841 * \param sample The target sample number to seek to.
843 * \code decoder != NULL \endcode
845 * \c true if successful, else \c false.
847 OggFLAC_API FLAC__bool OggFLAC__seekable_stream_decoder_seek_absolute(OggFLAC__SeekableStreamDecoder *decoder, FLAC__uint64 sample);