img_load()

Decode a frame from a stream

Synopsis:

#include <img/img.h>

int img_load( img_lib_t                    ilib,
              io_stream_t*                 input,
              const img_decode_callouts_t* callouts,
              img_t*                       img );

Arguments:

ilib
A handle for the image library, returned by img_lib_attach() .
input
The input stream.
callouts
A pointer to an img_decode_callouts_t structure that provides system callouts for the decoder. If you specify NULL for this value, a set of default callouts is supplied.
img
The address of an img_t structure the function fills in with information about the decoded frame.

Library:

libimg

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

Description:

This function decodes a frame from a streaming source. This function decodes only the first frame encountered.

Returns:

IMG_ERR_OK
Success
IMG_ERR_MEM
Memory-allocation failure.
IMG_ERR_FORMAT
No appopriate codec could be found. The codec you require could be missing or corrupt, or the file could be corrupt.
IMG_ERR_NOSUPPORT
Output data not supported; the codec and application could not agree on an output format.
IMG_ERR_NODATA
No frame data was present.
IMG_ERR_CORRUPT
Invalid data encountered in the file, preventing the decode from proceeding. Some of the frame may be intact.
IMG_ERR_TRUNC
Premature end of file encountered. Some of the frame may be intact.
IMG_ERR_INTR
Decode was interrupted by application.

Classification:

Image library

Safety:
Interrupt handler No
Signal handler No
Thread No