* make (*put)() hook return a bool for abort request.

* add an enum for VP8Status() to make things clearer

Change-Id: I458aeabab93f95d28e8ee10be699b677c04b4acb
This commit is contained in:
Pascal Massimino
2011-02-16 14:33:16 -08:00
parent 73c973e6da
commit 746a4820b9
7 changed files with 83 additions and 49 deletions

View File

@ -96,4 +96,4 @@ uint8_t* WebPDecodeYUVInto(const uint8_t* data, uint32_t data_size,
} // extern "C"
#endif
#endif // WEBP_WEBP_DECODE_H_
#endif /* WEBP_WEBP_DECODE_H_ */

View File

@ -53,8 +53,9 @@ struct VP8Io {
// called when fresh samples are available. Currently, samples are in
// YUV420 format, and can be up to width x 24 in size (depending on the
// in-loop filtering level, e.g.).
void (*put)(const VP8Io* io);
// in-loop filtering level, e.g.). Should return false in case of error
// or abort request.
int (*put)(const VP8Io* io);
// called just before starting to decode the blocks.
// Should returns 0 in case of error.
@ -86,15 +87,23 @@ void VP8InitIo(VP8Io* const io);
int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io);
// Decode a picture. Will call VP8GetHeaders() if it wasn't done already.
// Returns false in case of error.
int VP8Decode(VP8Decoder* const dec, VP8Io* const io);
// Enumeration of the codes returned by VP8Status()
typedef enum {
VP8_STATUS_OK = 0,
VP8_STATUS_OUT_OF_MEMORY,
VP8_STATUS_INVALID_PARAM,
VP8_STATUS_BITSTREAM_ERROR,
VP8_STATUS_UNSUPPORTED_FEATURE,
VP8_STATUS_SUSPENDED,
VP8_STATUS_USER_ABORT,
VP8_STATUS_NOT_ENOUGH_DATA,
} VP8StatusCode;
// Return current status of the decoder:
// 0 = OK
// 1 = OUT_OF_MEMORY
// 2 = INVALID_PARAM
// 3 = BITSTREAM_ERROR
// 4 = UNSUPPORTED_FEATURE
int VP8Status(VP8Decoder* const dec);
VP8StatusCode VP8Status(VP8Decoder* const dec);
// return readable string corresponding to the last status.
const char* VP8StatusMessage(VP8Decoder* const dec);
@ -112,4 +121,4 @@ void VP8Delete(VP8Decoder* const dec);
} // extern "C"
#endif
#endif // WEBP_WEBP_DECODE_VP8_H_
#endif /* WEBP_WEBP_DECODE_VP8_H_ */

View File

@ -22,6 +22,7 @@ typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef long long int int64_t;
#define inline __forceinline
#endif /* _MSC_VER */