[−][src]Function flac_sys::FLAC__stream_decoder_init_ogg_stream
pub unsafe extern "C" fn FLAC__stream_decoder_init_ogg_stream(
decoder: *mut FLAC__StreamDecoder,
read_callback: FLAC__StreamDecoderReadCallback,
seek_callback: FLAC__StreamDecoderSeekCallback,
tell_callback: FLAC__StreamDecoderTellCallback,
length_callback: FLAC__StreamDecoderLengthCallback,
eof_callback: FLAC__StreamDecoderEofCallback,
write_callback: FLAC__StreamDecoderWriteCallback,
metadata_callback: FLAC__StreamDecoderMetadataCallback,
error_callback: FLAC__StreamDecoderErrorCallback,
client_data: *mut c_void
) -> FLAC__StreamDecoderInitStatus
Initialize the decoder instance to decode Ogg FLAC streams.
This flavor of initialization sets up the decoder to decode from a FLAC stream in an Ogg container. I/O is performed via callbacks to the client. For decoding from a plain file via filename or open FILE*, FLAC__stream_decoder_init_ogg_file() and FLAC__stream_decoder_init_ogg_FILE() provide a simpler interface.
This function should be called after FLAC__stream_decoder_new() and FLAC__stream_decoder_set_() but before any of the FLAC__stream_decoder_process_() functions. Will set and return the decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA if initialization succeeded.
\note Support for Ogg FLAC in the library is optional. If this library has been built without support for Ogg FLAC, this function will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER.
\param decoder An uninitialized decoder instance. \param read_callback See FLAC__StreamDecoderReadCallback. This pointer must not be \c NULL. \param seek_callback See FLAC__StreamDecoderSeekCallback. This pointer may be \c NULL if seeking is not supported. If \a seek_callback is not \c NULL then a \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. Alternatively, a dummy seek callback that just returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED may also be supplied, all though this is slightly less efficient for the decoder. \param tell_callback See FLAC__StreamDecoderTellCallback. This pointer may be \c NULL if not supported by the client. If \a seek_callback is not \c NULL then a \a tell_callback must also be supplied. Alternatively, a dummy tell callback that just returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED may also be supplied, all though this is slightly less efficient for the decoder. \param length_callback See FLAC__StreamDecoderLengthCallback. This pointer may be \c NULL if not supported by the client. If \a seek_callback is not \c NULL then a \a length_callback must also be supplied. Alternatively, a dummy length callback that just returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED may also be supplied, all though this is slightly less efficient for the decoder. \param eof_callback See FLAC__StreamDecoderEofCallback. This pointer may be \c NULL if not supported by the client. If \a seek_callback is not \c NULL then a \a eof_callback must also be supplied. Alternatively, a dummy length callback that just returns \c false may also be supplied, all though this is slightly less efficient for the decoder. \param write_callback See FLAC__StreamDecoderWriteCallback. This pointer must not be \c NULL. \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This pointer may be \c NULL if the callback is not desired. \param error_callback See FLAC__StreamDecoderErrorCallback. This pointer must not be \c NULL. \param client_data This value will be supplied to callbacks in their \a client_data argument. \assert \code decoder != NULL \endcode \retval FLAC__StreamDecoderInitStatus \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; see FLAC__StreamDecoderInitStatus for the meanings of other return values.