Find a codec for decoding
#include <img/img.h> int img_decode_validate( const img_codec_t* codecs, size_t ncodecs, io_stream_t* input, unsigned* codec );
- A pointer to an array of img_codec_t handles providing a list of codecs to try. The function will try each codec in order until it finds one that validates the data in the stream.
- The number of items in the codecs array.
- The input source.
- The address of an unsigned value where the function stores the index of the codec that validated the datastream. This memory is left untouched if no such codec is found.
Use the -l img option to qcc to link against this library.
This function finds a suitable codec for decoding.
Status of the operation:
- Success; an appropriate codec was found. Check codec for the index of the codec in the codecs array which validated the datastream.
- An error occurred processing the DLL that handles the file type. Check to make sure that the DLL is not missing or corrupt.
- No installed codec recognized the input data as a format it supports. This could mean the data is of a format that's not supported, or the datastream is corrupt.
- The codec that recognized the input data as the format it supports doesn't have a validate method.