static VP8StatusCode GetFeatures(const uint8_t* const data, size_t data_size, WebPBitstreamFeatures* const features) { if (features == NULL || data == NULL) { return VP8_STATUS_INVALID_PARAM; } DefaultFeatures(features); // Only parse enough of the data to retrieve width/height/has_alpha. return ParseHeadersInternal(data, data_size, &features->width, &features->height, &features->has_alpha, NULL); }
static VP8StatusCode GetFeatures(const uint8_t* const data, size_t data_size, WebPBitstreamFeatures* const features) { if (features == NULL || data == NULL) { return VP8_STATUS_INVALID_PARAM; } DefaultFeatures(features); return ParseHeadersInternal(data, data_size, &features->width, &features->height, &features->has_alpha, &features->has_animation, NULL); }
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { VP8StatusCode status; int has_animation = 0; assert(headers != NULL); // fill out headers, ignore width/height/has_alpha. status = ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL, NULL, &has_animation, headers); if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) { // TODO(jzern): full support of animation frames will require API additions. if (has_animation) { status = VP8_STATUS_UNSUPPORTED_FEATURE; } } return status; }
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { VP8StatusCode status; int has_animation = 0; assert(headers != NULL); status = ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL, NULL, &has_animation, headers); if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) { if (has_animation) { status = VP8_STATUS_UNSUPPORTED_FEATURE; } } return status; }
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { // status is marked volatile as a workaround for a clang-3.8 (aarch64) bug volatile VP8StatusCode status; int has_animation = 0; assert(headers != NULL); // fill out headers, ignore width/height/has_alpha. status = ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL, NULL, &has_animation, NULL, headers); if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) { // The WebPDemux API + libwebp can be used to decode individual // uncomposited frames or the WebPAnimDecoder can be used to fully // reconstruct them (see webp/demux.h). if (has_animation) { status = VP8_STATUS_UNSUPPORTED_FEATURE; } } return status; }
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { assert(headers != NULL); // fill out headers, ignore width/height/has_alpha. return ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL, NULL, headers); }