[][src]Function flac_sys::FLAC__stream_decoder_init_file

pub unsafe extern "C" fn FLAC__stream_decoder_init_file(
    decoder: *mut FLAC__StreamDecoder,
    filename: *const c_char,
    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 native FLAC files.

This flavor of initialization sets up the decoder to decode from a plain native FLAC file. If POSIX fopen() semantics are not sufficient, (for example, with Unicode filenames on Windows), you must use FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream() and provide callbacks for the I/O.

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.

\param decoder An uninitialized decoder instance. \param filename The name of the file to decode from. The file will be opened with fopen(). Use \c NULL to decode from \c stdin. Note that \c stdin is not seekable. \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.