[][src]Function flac_sys::FLAC__stream_encoder_init_stream

pub unsafe extern "C" fn FLAC__stream_encoder_init_stream(
    encoder: *mut FLAC__StreamEncoder,
    write_callback: FLAC__StreamEncoderWriteCallback,
    seek_callback: FLAC__StreamEncoderSeekCallback,
    tell_callback: FLAC__StreamEncoderTellCallback,
    metadata_callback: FLAC__StreamEncoderMetadataCallback,
    client_data: *mut c_void
) -> FLAC__StreamEncoderInitStatus

Initialize the encoder instance to encode native FLAC streams.

This flavor of initialization sets up the encoder to encode to a native FLAC stream. I/O is performed via callbacks to the client. For encoding to a plain file via filename or open \c FILE*, FLAC__stream_encoder_init_file() and FLAC__stream_encoder_init_FILE() provide a simpler interface.

This function should be called after FLAC__stream_encoder_new() and FLAC__stream_encoder_set_*() but before FLAC__stream_encoder_process() or FLAC__stream_encoder_process_interleaved(). initialization succeeded.

The call to FLAC__stream_encoder_init_stream() currently will also immediately call the write callback several times, once with the \c fLaC signature, and once for each encoded metadata block.

\param encoder An uninitialized encoder instance. \param write_callback See FLAC__StreamEncoderWriteCallback. This pointer must not be \c NULL. \param seek_callback See FLAC__StreamEncoderSeekCallback. This pointer may be \c NULL if seeking is not supported. The encoder uses seeking to go back and write some some stream statistics to the STREAMINFO block; this is recommended but not necessary to create a valid FLAC stream. If \a seek_callback is not \c NULL then a \a tell_callback must also be supplied. Alternatively, a dummy seek callback that just returns \c FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED may also be supplied, all though this is slightly less efficient for the encoder. \param tell_callback See FLAC__StreamEncoderTellCallback. This pointer may be \c NULL if seeking is not supported. If \a seek_callback is \c NULL then this argument will be ignored. 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_ENCODER_TELL_STATUS_UNSUPPORTED may also be supplied, all though this is slightly less efficient for the encoder. \param metadata_callback See FLAC__StreamEncoderMetadataCallback. This pointer may be \c NULL if the callback is not desired. If the client provides a seek callback, this function is not necessary as the encoder will automatically seek back and update the STREAMINFO block. It may also be \c NULL if the client does not support seeking, since it will have no way of going back to update the STREAMINFO. However the client can still supply a callback if it would like to know the details from the STREAMINFO. \param client_data This value will be supplied to callbacks in their \a client_data argument. \assert \code encoder != NULL \endcode \retval FLAC__StreamEncoderInitStatus \c FLAC__STREAM_ENCODER_INIT_STATUS_OK if initialization was successful; see FLAC__StreamEncoderInitStatus for the meanings of other return values.