img_decode_begin()

Prepare to decode a frame from a stream

Synopsis:

#include <img/img.h>

int img_decode_begin( img_codec_t codec,
                      io_stream_t *input,
                      uintptr_t *decode_data );

Arguments:

codec
The codec to use. To figure out a codec to use, see img_codec_list, list_byext, list_bymime, and img_decode_validate.
input
The input source.
decode_data
An address of a uintptr_t which the decoder uses to store data it needs across the decode process. You should not pass NULL, but instead pass a valid address of a uintptr_t initialized to 0.

Library:

libimg

Use the -l img option to qcc to link against this library.

Description:

This function prepares to decode a frame (or series of frames) from a stream.

Returns:

IMG_ERR_OK
Success.
IMG_ERR_NOTIMPL
The codec doesn't support decoding (Currently, all codecs shipped with the Neutrino image library support decoding).
Other
Any other code that a decoder's begin() function may pass back to flag an error (see img_errno.h for a list of defined errors).

Classification:

Image library

Safety:
Interrupt handler No
Signal handler No
Thread No