38 const uint8_t **poutbuf,
int *poutbuf_size,
39 const uint8_t *buf,
int buf_size)
50 if (
ctx->pc.frame_start_found <= 8) {
51 for (;
i < buf_size;
i++) {
53 if (
ctx->pc.frame_start_found == 0) {
56 if (
ctx->fsize > 15 &&
ctx->fsize <= UINT32_MAX - 10) {
57 ctx->pc.frame_start_found = 1;
61 }
else if (
ctx->pc.frame_start_found == 8) {
63 ctx->pc.frame_start_found = 0;
66 ctx->pc.frame_start_found++;
67 ctx->remaining_size =
ctx->fsize +
i - 15;
68 if (
ctx->pc.index +
i > 15) {
76 }
else if (
ctx->pc.frame_start_found)
77 ctx->pc.frame_start_found++;
81 if (
ctx->remaining_size) {
83 ctx->remaining_size -=
i;
84 if (
ctx->remaining_size)
87 ctx->pc.frame_start_found = 0;
97 ctx->pc.frame_start_found =
FFMAX(
ctx->pc.frame_start_found -
i - 1, 0);
99 ctx->pc.frame_start_found = 0;
102 *poutbuf_size = buf_size;
static void flush(AVCodecContext *avctx)
common internal and external API header
#define MKBETAG(a, b, c, d)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
void ff_parse_close(AVCodecParserContext *s)
main external API structure.
AVCodecParser ff_webp_parser
static int webp_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)