Lines Matching refs:decoder

48  *  decoder.
51 * \link flac_stream_decoder stream decoder \endlink module.
54 /** \defgroup flac_decoder FLAC/ \*_decoder.h: decoder interfaces
58 * This module describes the decoder layers provided by libFLAC.
60 * The stream decoder can be used to decode complete streams either from
65 * callback, the decoder function for sample-accurate seeking within the
69 * info see the \link flac_stream_decoder stream decoder \endlink module.
72 /** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface
77 * decoder.
79 * The stream decoder can decode native FLAC, and optionally Ogg FLAC
82 * The basic usage of this decoder is as follows:
83 * - The program creates an instance of a decoder using
96 * which flushes the input and output and resets the decoder to the
103 * functions to override the default decoder options, and call
107 * setting up the decoder to decode FLAC data from the client via
116 * \c FILE* or filename and fewer callbacks; the decoder will handle
123 * Once the decoder is initialized, your program will call one of several
126 * - FLAC__stream_decoder_process_single() - Tells the decoder to process at
128 * metadata callback or write callback, respectively, once. If the decoder
130 * - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder
134 * - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder
141 * When the decoder has finished decoding (normally or through an abort),
143 * ensures the decoder is in the correct state and frees memory. Then the
148 * At any point after the stream decoder has been initialized, the client can
154 * has another way of seeking, it can flush the decoder using
158 * The stream decoder also provides MD5 signature checking. If this is
166 * attention. By default, the decoder only calls the metadata_callback for
167 * the STREAMINFO block. These functions allow you to tell the decoder
174 * use can reduce the memory requirements of the decoder. Also note the
183 * The "set" functions may only be called when the decoder is in the
199 * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state().
204 /**< The decoder is ready to search for metadata. */
207 /**< The decoder is ready to or is in the process of reading metadata. */
210 /**< The decoder is ready to or is in the process of searching for the
215 /**< The decoder is ready to or is in the process of reading a frame. */
218 /**< The decoder has reached the end of the stream. */
224 /**< An error occurred while seeking. The decoder must be flushed
230 /**< The decoder was aborted by the read callback. */
233 /**< An error occurred allocating memory. The decoder is in an invalid
238 /**< The decoder is in the uninitialized state; one of the
276 /**< FLAC__stream_decoder_init_*() was called when the decoder was
310 /**< An unrecoverable error occurred. The decoder will return from the process call. */
330 /**< An unrecoverable error occurred. The decoder will return from the process call. */
353 /**< An unrecoverable error occurred. The decoder will return from the process call. */
376 /**< An unrecoverable error occurred. The decoder will return from the process call. */
399 /**< An unrecoverable error occurred. The decoder will return from the process call. */
415 * itself is the decoder's best guess at what happened assuming a correct
421 * could be because the decoder encountered a valid frame made by a future
429 /**< An error in the stream caused the decoder to lose synchronization. */
432 /**< The decoder encountered a corrupted frame header. */
438 /**< The decoder encountered reserved fields in use in the stream. */
458 /** The opaque structure definition for the stream decoder type.
459 * See the \link flac_stream_decoder stream decoder module \endlink
471 * called when the decoder needs more input data. The address of the
480 * FLAC__StreamDecoderReadStatus read_cb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
498 * state should not be called on the \a decoder while in the callback.
500 * \param decoder The decoder instance calling the callback.
516 typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
522 * called when the decoder needs to seek the input stream. The decoder
528 * FLAC__StreamDecoderSeekStatus seek_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
541 * state should not be called on the \a decoder while in the callback.
543 * \param decoder The decoder instance calling the callback.
551 typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
557 * called when the decoder wants to know the current position of the
563 * FLAC__StreamDecoderTellStatus tell_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
579 * state should not be called on the \a decoder while in the callback.
581 * \param decoder The decoder instance calling the callback.
589 typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
595 * called when the decoder wants to know the total length of the stream
600 * FLAC__StreamDecoderLengthStatus length_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
617 * state should not be called on the \a decoder while in the callback.
619 * \param decoder The decoder instance calling the callback.
627 typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
633 * called when the decoder needs to know if the end of the stream has
637 * FLAC__bool eof_cb(const FLAC__StreamDecoder *decoder, void *client_data)
646 * state should not be called on the \a decoder while in the callback.
648 * \param decoder The decoder instance calling the callback.
654 typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data);
660 * The supplied function will be called when the decoder has decoded a
661 * single audio frame. The decoder will pass the frame metadata as well
666 * state should not be called on the \a decoder while in the callback.
668 * \param decoder The decoder instance calling the callback.
682 typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
688 * The supplied function will be called when the decoder has decoded a
691 * These will be supplied by the decoder in the same order as they
697 * default the decoder only calls the metadata callback for the
698 * \c STREAMINFO block; you can instruct the decoder to pass or filter
702 * state should not be called on the \a decoder while in the callback.
704 * \param decoder The decoder instance calling the callback.
709 typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
719 * state should not be called on the \a decoder while in the callback.
721 * \param decoder The decoder instance calling the callback.
722 * \param status The error encountered by the decoder.
726 typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
735 /** Create a new stream decoder instance. The instance is created with
744 /** Free a decoder instance. Deletes the object pointed to by \a decoder.
746 * \param decoder A pointer to an existing decoder.
748 * \code decoder != NULL \endcode
750 FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder);
768 * \param decoder A decoder instance to set.
771 * \code decoder != NULL \endcode
773 * \c false if the decoder is already initialized, else \c true.
775 FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number);
777 /** Set the "MD5 signature checking" flag. If \c true, the decoder will
790 * \param decoder A decoder instance to set.
793 * \code decoder != NULL \endcode
795 * \c false if the decoder is already initialized, else \c true.
797 FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value);
799 /** Direct the decoder to pass on all metadata blocks of type \a type.
803 * \param decoder A decoder instance to set.
806 * \code decoder != NULL \endcode
809 * \c false if the decoder is already initialized, else \c true.
811 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
813 /** Direct the decoder to pass on all APPLICATION metadata blocks of the
818 * \param decoder A decoder instance to set.
821 * \code decoder != NULL \endcode
824 * \c false if the decoder is already initialized, else \c true.
826 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
828 /** Direct the decoder to pass on all metadata blocks of any type.
832 * \param decoder A decoder instance to set.
834 * \code decoder != NULL \endcode
836 * \c false if the decoder is already initialized, else \c true.
838 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder);
840 /** Direct the decoder to filter out all metadata blocks of type \a type.
844 * \param decoder A decoder instance to set.
847 * \code decoder != NULL \endcode
850 * \c false if the decoder is already initialized, else \c true.
852 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
854 /** Direct the decoder to filter out all APPLICATION metadata blocks of
859 * \param decoder A decoder instance to set.
862 * \code decoder != NULL \endcode
865 * \c false if the decoder is already initialized, else \c true.
867 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
869 /** Direct the decoder to filter out all metadata blocks of any type.
873 * \param decoder A decoder instance to set.
875 * \code decoder != NULL \endcode
877 * \c false if the decoder is already initialized, else \c true.
879 FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder);
881 /** Get the current decoder state.
883 * \param decoder A decoder instance to query.
885 * \code decoder != NULL \endcode
887 * The current decoder state.
889 FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder);
891 /** Get the current decoder state as a C string.
893 * \param decoder A decoder instance to query.
895 * \code decoder != NULL \endcode
897 * The decoder state as a C string. Do not modify the contents.
899 FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder);
902 * This is the value of the setting, not whether or not the decoder is
904 * by a seek). When the decoder is reset the flag will be restored to the
907 * \param decoder A decoder instance to query.
909 * \code decoder != NULL \endcode
913 FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder);
919 * \param decoder A decoder instance to query.
921 * \code decoder != NULL \endcode
925 FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder);
931 * \param decoder A decoder instance to query.
933 * \code decoder != NULL \endcode
937 FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
943 * \param decoder A decoder instance to query.
945 * \code decoder != NULL \endcode
949 FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder);
955 * \param decoder A decoder instance to query.
957 * \code decoder != NULL \endcode
961 FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
967 * \param decoder A decoder instance to query.
969 * \code decoder != NULL \endcode
973 FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
979 * \param decoder A decoder instance to query.
981 * \code decoder != NULL \endcode
985 FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
987 /** Returns the decoder's current read position within the stream.
990 * there may still be undecoded bytes in the decoder's read FIFO.
996 * \param decoder A decoder instance to query.
999 * \code decoder != NULL \endcode
1006 FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position);
1008 /** Initialize the decoder instance to decode native FLAC streams.
1010 * This flavor of initialization sets up the decoder to decode from a
1019 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1022 * \param decoder An uninitialized decoder instance.
1032 * less efficient for the decoder.
1040 * less efficient for the decoder.
1048 * less efficient for the decoder.
1056 * less efficient for the decoder.
1067 * \code decoder != NULL \endcode
1073 FLAC__StreamDecoder *decoder,
1085 /** Initialize the decoder instance to decode Ogg FLAC streams.
1087 * This flavor of initialization sets up the decoder to decode from a
1096 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1103 * \param decoder An uninitialized decoder instance.
1113 * less efficient for the decoder.
1121 * less efficient for the decoder.
1129 * less efficient for the decoder.
1137 * less efficient for the decoder.
1148 * \code decoder != NULL \endcode
1154 FLAC__StreamDecoder *decoder,
1166 /** Initialize the decoder instance to decode native FLAC files.
1168 * This flavor of initialization sets up the decoder to decode from a
1175 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1178 * \param decoder An uninitialized decoder instance.
1181 * becomes owned by the decoder and should not be
1197 * \code decoder != NULL \endcode
1204 FLAC__StreamDecoder *decoder,
1212 /** Initialize the decoder instance to decode Ogg FLAC files.
1214 * This flavor of initialization sets up the decoder to decode from a
1221 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1228 * \param decoder An uninitialized decoder instance.
1231 * becomes owned by the decoder and should not be
1247 * \code decoder != NULL \endcode
1254 FLAC__StreamDecoder *decoder,
1262 /** Initialize the decoder instance to decode native FLAC files.
1264 * This flavor of initialization sets up the decoder to decode from a plain
1273 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1276 * \param decoder An uninitialized decoder instance.
1290 * \code decoder != NULL \endcode
1296 FLAC__StreamDecoder *decoder,
1304 /** Initialize the decoder instance to decode Ogg FLAC files.
1306 * This flavor of initialization sets up the decoder to decode from a plain
1315 * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
1322 * \param decoder An uninitialized decoder instance.
1336 * \code decoder != NULL \endcode
1342 FLAC__StreamDecoder *decoder,
1351 * Flushes the decoding buffer, releases resources, resets the decoder
1352 * settings to their defaults, and returns the decoder state to
1360 * \param decoder An uninitialized decoder instance.
1362 * \code decoder != NULL \endcode
1366 * signature does not match the one computed by the decoder; else
1369 FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
1372 * The decoder's input buffer will be cleared and the state set to
1376 * \param decoder A decoder instance.
1378 * \code decoder != NULL \endcode
1384 FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
1387 * The decoder's input buffer will be cleared and the state set to
1394 * If the decoder is seekable, or was initialized with
1396 * the decoder will also attempt to seek to the beginning of the file.
1401 * If the decoder was initialized with FLAC__stream_encoder_init*_stream()
1408 * \param decoder A decoder instance.
1410 * \code decoder != NULL \endcode
1417 FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
1420 * This version instructs the decoder to decode a either a single metadata
1425 * As the decoder needs more input it will call the read callback.
1432 * decoder will continue to try and resync until it gets to a valid
1433 * frame, then decode one frame, then return. If the decoder points to
1441 * \param decoder An initialized decoder instance.
1443 * \code decoder != NULL \endcode
1447 * information about the decoder, check the decoder state with
1450 FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder);
1453 * This version instructs the decoder to decode from the current position
1458 * As the decoder needs more input it will call the read callback.
1462 * \param decoder An initialized decoder instance.
1464 * \code decoder != NULL \endcode
1468 * information about the decoder, check the decoder state with
1471 FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder);
1474 * This version instructs the decoder to decode from the current position
1479 * As the decoder needs more input it will call the read callback.
1483 * \param decoder An initialized decoder instance.
1485 * \code decoder != NULL \endcode
1489 * information about the decoder, check the decoder state with
1492 FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder);
1495 * This version instructs the decoder to 'skip' a single frame and stop,
1521 * \param decoder An initialized decoder instance not in a metadata
1524 * \code decoder != NULL \endcode
1527 * occurred (meaning decoding must stop), or if the decoder
1530 * information about the decoder, check the decoder state with
1533 FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder);
1539 * and return \c false. Furthermore, if the decoder state is
1540 * \c FLAC__STREAM_DECODER_SEEK_ERROR, then the decoder must be flushed
1544 * \param decoder A decoder instance.
1547 * \code decoder != NULL \endcode
1551 FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample);