diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-13 19:35:22 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-12-04 21:45:36 +0100 |
commit | df9b9567518f2840d79a4a96b447ebe1aa326408 (patch) | |
tree | 7f247e6d290e56536306d6ce157e76f6025fee66 | |
parent | 387bef95d28019c13c6805cfa4079e59948284e5 (diff) | |
download | ffmpeg-df9b9567518f2840d79a4a96b447ebe1aa326408.tar.gz |
lavc: fix decode_frame() third parameter semantics for video decoders
It's got_frame, not data size
133 files changed, 305 insertions, 293 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index e3f49b37c4..f78a0a21b2 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -753,7 +753,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length) } static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -870,7 +870,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, p->key_frame = p->pict_type == AV_PICTURE_TYPE_I; *picture = *p; - *data_size = sizeof(AVPicture); + *got_frame = 1; emms_c(); diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index ea428da628..306fd52bf4 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -64,7 +64,7 @@ typedef struct EightBpsContext { * */ static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -149,7 +149,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 60bf7c626d..cd1df36ae2 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -50,7 +50,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) } static int aasc_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -85,7 +85,7 @@ static int aasc_decode_frame(AVCodecContext *avctx, return -1; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/anm.c b/libavcodec/anm.c index de563dda2b..fc328bb06b 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -105,7 +105,7 @@ exhausted: } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { AnmContext *s = avctx->priv_data; @@ -170,7 +170,7 @@ static int decode_frame(AVCodecContext *avctx, memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index bee14b86f1..edd373db45 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -311,7 +311,7 @@ static int execute_code(AVCodecContext * avctx, int c) } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { AnsiContext *s = avctx->priv_data; @@ -411,7 +411,7 @@ static int decode_frame(AVCodecContext *avctx, buf++; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index 9f6b93d4db..a53ba77fc5 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -181,7 +181,7 @@ static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){ } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -247,7 +247,7 @@ static int decode_frame(AVCodecContext *avctx, } *picture = a->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; emms_c(); diff --git a/libavcodec/aura.c b/libavcodec/aura.c index 9ca2ef8d02..d0fe9466a3 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -46,7 +46,7 @@ static av_cold int aura_decode_init(AVCodecContext *avctx) } static int aura_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *pkt) { AuraDecodeContext *s=avctx->priv_data; @@ -108,7 +108,7 @@ static int aura_decode_frame(AVCodecContext *avctx, V += s->frame.linesize[2] - (avctx->width >> 1); } - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data= s->frame; return pkt->size; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index f6535a26a6..98a53f20bc 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -44,7 +44,7 @@ typedef enum { static int avs_decode_frame(AVCodecContext * avctx, - void *data, int *data_size, AVPacket *avpkt) + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; @@ -150,7 +150,7 @@ avs_decode_frame(AVCodecContext * avctx, } *picture = avs->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index c1f95ed889..316adb6c79 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -63,7 +63,7 @@ static int set_palette(BethsoftvidContext *ctx) } static int bethsoftvid_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { BethsoftvidContext * vid = avctx->priv_data; @@ -95,7 +95,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, switch(block_type = bytestream2_get_byte(&vid->g)){ case PALETTE_BLOCK: { - *data_size = 0; + *got_frame = 0; if ((ret = set_palette(vid)) < 0) { av_log(avctx, AV_LOG_ERROR, "error reading palette\n"); return ret; @@ -136,7 +136,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, } end: - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = vid->frame; return avpkt->size; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 03d06fa489..50b20bacf9 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -46,7 +46,7 @@ static av_cold int bfi_decode_init(AVCodecContext *avctx) } static int bfi_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { GetByteContext g; int buf_size = avpkt->size; @@ -164,7 +164,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, src += avctx->width; dst += bfi->frame.linesize[0]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = bfi->frame; return buf_size; } diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 733b5bdbd7..059601debf 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1161,7 +1161,7 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) { BinkContext * const c = avctx->priv_data; GetBitContext gb; @@ -1208,7 +1208,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } emms_c(); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; if (c->version > 'b') diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index ae168556d9..648d0ac31b 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -35,7 +35,7 @@ static av_cold int bmp_decode_init(AVCodecContext *avctx){ } static int bmp_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -347,7 +347,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c index 762a7fb261..a7f21eceb2 100644 --- a/libavcodec/bmv.c +++ b/libavcodec/bmv.c @@ -194,7 +194,8 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *pkt) { BMVDecContext * const c = avctx->priv_data; int type, scr_off; @@ -265,7 +266,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac outptr += c->pic.linesize[0]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 07acb26a72..e8071ac69b 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -113,7 +113,7 @@ static inline void draw_n_color(uint8_t *out, int stride, int width, } static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -239,7 +239,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } *picture = *newpic; - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 5619071a10..af0309c41b 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1096,7 +1096,7 @@ static void cavs_flush(AVCodecContext * avctx) { h->got_keyframe = 0; } -static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, +static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -1112,7 +1112,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, if (buf_size == 0) { if (!s->low_delay && h->DPB[0].f.data[0]) { - *data_size = sizeof(AVPicture); + *got_frame = 1; *picture = h->DPB[0].f; memset(&h->DPB[0], 0, sizeof(h->DPB[0])); } @@ -1140,19 +1140,19 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, h->got_keyframe = 1; } case PIC_PB_START_CODE: - *data_size = 0; + *got_frame = 0; if(!h->got_keyframe) break; init_get_bits(&s->gb, buf_ptr, input_size); h->stc = stc; if(decode_pic(h)) break; - *data_size = sizeof(AVPicture); + *got_frame = 1; if(h->pic_type != AV_PICTURE_TYPE_B) { if(h->DPB[1].f.data[0]) { *picture = h->DPB[1].f; } else { - *data_size = 0; + *got_frame = 0; } } else *picture = h->picture.f; diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 9c9583d06a..e4ed83b9d4 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -267,7 +267,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, } static int cdg_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, AVPacket *avpkt) + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -348,9 +348,9 @@ static int cdg_decode_frame(AVCodecContext *avctx, break; } - *data_size = sizeof(AVFrame); + *got_frame = 1; } else { - *data_size = 0; + *got_frame = 0; buf_size = 0; } diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index b51a2cb00f..0b3d59cb80 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -208,7 +208,7 @@ static void cdxl_decode_ham8(CDXLVideoContext *c) } static int cdxl_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *pkt) + int *got_frame, AVPacket *pkt) { CDXLVideoContext *c = avctx->priv_data; AVFrame * const p = &c->frame; @@ -281,7 +281,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data, } else { cdxl_decode_rgb(c); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->frame; return buf_size; diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index e6e2df2a27..c6f4ffa25c 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -419,7 +419,7 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) } static int cinepak_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -450,7 +450,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, if (s->palette_video) memcpy (s->frame.data[1], s->pal, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index c4b12b1d1f..9ba513845b 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -44,7 +44,7 @@ static av_cold int common_init(AVCodecContext *avctx) #if CONFIG_CLJR_DECODER static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -95,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, } *picture = a->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 188df1b4b7..2c1b2e7858 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -137,7 +137,7 @@ static void add_frame_32(AVFrame *f, const uint8_t *src, } #endif -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = c->pic; - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index a11fee2672..49cf64c08d 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -60,7 +60,7 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx) } static int cyuv_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -163,7 +163,7 @@ static int cyuv_decode_frame(AVCodecContext *avctx, } } - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data= s->frame; return buf_size; diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 4f148336f4..119be7066c 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -308,7 +308,7 @@ static const char* chunk_name[8] = { }; static int dfa_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { DfaContext *s = avctx->priv_data; @@ -363,7 +363,7 @@ static int dfa_decode_frame(AVCodecContext *avctx, } memcpy(s->pic.data[1], s->pal, sizeof(s->pal)); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->pic; return avpkt->size; diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index e988d68036..7cc17c4db3 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -329,7 +329,7 @@ static int dnxhd_decode_macroblocks(DNXHDContext *ctx, const uint8_t *buf, int b return 0; } -static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -374,7 +374,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = ctx->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 2b1c7f8b64..7c01babb74 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -52,7 +52,7 @@ static inline unsigned make_16bit(unsigned value) static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -213,7 +213,7 @@ static int decode_frame(AVCodecContext *avctx, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index 87979525de..39b6a4cabb 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -201,7 +201,7 @@ static void cin_decode_rle(const unsigned char *src, int src_size, unsigned char } static int cinvideo_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -297,7 +297,7 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_table[CIN_PRE_BMP]); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = cin->frame; return buf_size; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index b4cb23f604..bc1bb55eb9 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -311,7 +311,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) /* NOTE: exactly one frame must be given (120000 bytes for NTSC, 144000 bytes for PAL - or twice those for 50Mbps) */ static int dvvideo_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { uint8_t *buf = avpkt->data; @@ -349,7 +349,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, emms_c(); /* return image */ - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->picture; /* Determine the codec's sample_aspect ratio from the packet */ diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index e634bbecfc..0f590f1ed9 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -189,7 +189,7 @@ static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, uint return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -282,7 +282,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac if(c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->prev; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index 4ee364bab1..30983f8056 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -35,7 +35,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int h, w; @@ -83,7 +83,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, V += pic->linesize[2]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = *pic; return avpkt->size; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index d3233bb96d..0dce066f1e 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -147,7 +147,7 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') static int cmv_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -192,7 +192,7 @@ static int cmv_decode_frame(AVCodecContext *avctx, cmv_decode_intra(s, buf+2, buf_end); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index ec74051b2f..9f4d85878a 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -219,7 +219,7 @@ static void calc_quant_matrix(MadContext *s, int qscale) } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -232,7 +232,7 @@ static int decode_frame(AVCodecContext *avctx, if (buf_size < 17) { av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n"); - *data_size = 0; + *got_frame = 0; return -1; } @@ -274,7 +274,7 @@ static int decode_frame(AVCodecContext *avctx, for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++) decode_mb(s, inter); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; if (chunk_type != MADe_TAG) diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index 9e3a3e6529..d6a6e55ff1 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -184,7 +184,7 @@ static void tgq_calculate_qtable(TgqContext *s, int quant){ } static int tgq_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -227,7 +227,7 @@ static int tgq_decode_frame(AVCodecContext *avctx, for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++) tgq_decode_mb(s, y, x); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return avpkt->size; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 170eeb10d5..46644abead 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -249,7 +249,7 @@ static void cond_release_buffer(AVFrame *pic) } static int tgv_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -325,7 +325,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, } } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 51232d0ba2..f9141e2017 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -97,7 +97,7 @@ static void tqi_calculate_qtable(MpegEncContext *s, int quant) } static int tqi_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -138,7 +138,7 @@ static int tqi_decode_frame(AVCodecContext *avctx, tqi_idct_put(t, t->block); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = t->frame; return buf_size; } diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index dce4d0493e..a27ab6890d 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -197,7 +197,7 @@ static const uint16_t mask_matrix[] = {0x1, 0x2, 0x10, 0x20, 0x400, 0x800, 0x4000, 0x8000}; static int escape124_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -232,7 +232,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, if (!(frame_flags & 0x114) || !(frame_flags & 0x7800000)) { av_log(NULL, AV_LOG_DEBUG, "Skipping frame\n"); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return frame_size; @@ -358,7 +358,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, avctx->release_buffer(avctx, &s->frame); *(AVFrame*)data = s->frame = new_frame; - *data_size = sizeof(AVFrame); + *got_frame = 1; return frame_size; } diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 5b1c80cf24..b1dec7de3f 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -794,7 +794,7 @@ static av_cold int ffv1_decode_init(AVCodecContext *avctx) } static int ffv1_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -901,7 +901,7 @@ static int ffv1_decode_frame(AVCodecContext *avctx, void *data, f->picture_number++; *picture = *p; - *data_size = sizeof(AVFrame); + *got_frame = 1; FFSWAP(AVFrame, f->picture, f->last_picture); diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index d12e2342c1..3c5a35c0dd 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -234,7 +234,7 @@ static int calc_deflate_block_size(int tmpblock_size) } static int flashsv_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { int buf_size = avpkt->size; FlashSVContext *s = avctx->priv_data; @@ -441,7 +441,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, memcpy(s->keyframe, s->frame.data[0], s->frame.linesize[0] * avctx->height); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; if ((get_bits_count(&gb) / 8) != buf_size) diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 2b9b290ba7..02bfc75da4 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -129,7 +129,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } static int flic_decode_frame_8BPP(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, const uint8_t *buf, int buf_size) { FlicDecodeContext *s = avctx->priv_data; @@ -419,14 +419,14 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, s->new_palette = 0; } - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, const uint8_t *buf, int buf_size) { /* Note, the only difference between the 15Bpp and 16Bpp */ @@ -681,14 +681,14 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, "and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2)); - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } static int flic_decode_frame_24BPP(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, const uint8_t *buf, int buf_size) { av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n"); @@ -696,22 +696,22 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, } static int flic_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { - return flic_decode_frame_8BPP(avctx, data, data_size, + return flic_decode_frame_8BPP(avctx, data, got_frame, buf, buf_size); } else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || (avctx->pix_fmt == AV_PIX_FMT_RGB565)) { - return flic_decode_frame_15_16BPP(avctx, data, data_size, + return flic_decode_frame_15_16BPP(avctx, data, got_frame, buf, buf_size); } else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) { - return flic_decode_frame_24BPP(avctx, data, data_size, + return flic_decode_frame_24BPP(avctx, data, got_frame, buf, buf_size); } diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index 3df12809b0..ba2f32af2a 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -124,7 +124,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -343,7 +343,7 @@ static int decode_frame(AVCodecContext *avctx, } *frame = *f; - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index f4d1cc1967..3f8f6baf6a 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -39,7 +39,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int field, ret; @@ -97,7 +97,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, buf += field_size - min_field_size; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = *pic; return avpkt->size; diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index d5f1c42255..8f1d6941bc 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -282,7 +282,8 @@ static av_cold int gif_decode_init(AVCodecContext *avctx) return 0; } -static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -312,7 +313,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A return ret; *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return s->bytestream - buf; } diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 778088870a..55453c112d 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -543,7 +543,7 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size){ } static int h261_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -628,7 +628,7 @@ assert(s->current_picture.f.pict_type == s->pict_type); *pict = s->current_picture_ptr->f; ff_print_debug_info(s, pict); - *data_size = sizeof(AVFrame); + *got_frame = 1; return get_consumed_bytes(s, buf_size); } diff --git a/libavcodec/h263.h b/libavcodec/h263.h index 2a1ae4839d..beb32c4f18 100644 --- a/libavcodec/h263.h +++ b/libavcodec/h263.h @@ -69,7 +69,7 @@ int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code); av_const int ff_h263_aspect_to_info(AVRational aspect); int ff_h263_decode_init(AVCodecContext *avctx); int ff_h263_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt); int ff_h263_decode_end(AVCodecContext *avctx); void ff_h263_encode_mb(MpegEncContext *s, diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 72bf05243c..6281ed2832 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -340,7 +340,7 @@ static int decode_slice(MpegEncContext *s){ } int ff_h263_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -362,7 +362,7 @@ uint64_t time= rdtsc(); *pict = s->next_picture_ptr->f; s->next_picture_ptr= NULL; - *data_size = sizeof(AVFrame); + *got_frame = 1; } return 0; @@ -729,7 +729,7 @@ intrax8_decoded: } if(s->last_picture_ptr || s->low_delay){ - *data_size = sizeof(AVFrame); + *got_frame = 1; ff_print_debug_info(s, pict); } diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7bdd6f1ed2..f04d8787b0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3988,7 +3988,7 @@ static int get_consumed_bytes(MpegEncContext *s, int pos, int buf_size) } static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -4025,7 +4025,7 @@ out: h->delayed_pic[i] = h->delayed_pic[i + 1]; if (out) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *pict = out->f; } @@ -4057,14 +4057,14 @@ out: if (!h->next_output_pic) { /* Wait for second field. */ - *data_size = 0; + *got_frame = 0; } else { - *data_size = sizeof(AVFrame); + *got_frame = 1; *pict = h->next_output_pic->f; } } - assert(pict->data[0] || !*data_size); + assert(pict->data[0] || !*got_frame); ff_print_debug_info(s, pict); return get_consumed_bytes(s, buf_index, buf_size); diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 3da1de8fc5..511b326698 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -928,7 +928,7 @@ static void draw_slice(HYuvContext *s, int y) s->last_slice_end = y + h; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -1181,7 +1181,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, emms_c(); *picture = *p; - *data_size = sizeof(AVFrame); + *got_frame = 1; return (get_bits_count(&s->gb) + 31) / 32 * 4 + table_size; } diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 8ce045dc0f..273eca60dd 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -210,7 +210,7 @@ static void idcin_decode_vlcs(IdcinContext *s) } static int idcin_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -238,7 +238,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, /* make the palette available on the way out */ memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 4bbb5dda1f..99da7b5d61 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -247,7 +247,7 @@ static int decode_byterun(uint8_t *dst, int dst_size, } static int decode_frame_ilbm(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { IffContext *s = avctx->priv_data; @@ -298,13 +298,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx, } } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } static int decode_frame_byterun1(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { IffContext *s = avctx->priv_data; @@ -354,7 +354,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx, } } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; } diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 76592d67c3..1dd151dfbe 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -138,7 +138,7 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_ } static int ir2_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -194,7 +194,7 @@ static int ir2_decode_frame(AVCodecContext *avctx, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index fe2ee935bb..261c651b52 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1025,7 +1025,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { Indeo3DecodeContext *ctx = avctx->priv_data; @@ -1040,7 +1040,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, /* skip sync(null) frames */ if (res) { // we have processed 16 bytes but no data was decoded - *data_size = 0; + *got_frame = 0; return buf_size; } @@ -1086,7 +1086,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ctx->frame.data[2], ctx->frame.linesize[2], (avctx->height + 3) >> 2); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = ctx->frame; return buf_size; diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 49db10df2a..3f098ac31d 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -953,7 +953,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) } static int ipvideo_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -988,7 +988,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, ipvideo_decode_opcodes(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->current_frame; /* shuffle frames */ diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 58a00ce70e..cc5224cf39 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -743,7 +743,7 @@ static int decode_band(IVI45DecContext *ctx, return result; } -int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { IVI45DecContext *ctx = avctx->priv_data; @@ -820,7 +820,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, ff_ivi_output_plane(&ctx->planes[2], ctx->frame.data[1], ctx->frame.linesize[1]); ff_ivi_output_plane(&ctx->planes[1], ctx->frame.data[2], ctx->frame.linesize[2]); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = ctx->frame; return buf_size; diff --git a/libavcodec/ivi_common.h b/libavcodec/ivi_common.h index 7c6d1314de..22867f9d83 100644 --- a/libavcodec/ivi_common.h +++ b/libavcodec/ivi_common.h @@ -386,7 +386,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile); */ void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch); -int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt); av_cold int ff_ivi_decode_close(AVCodecContext *avctx); diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index ed44e152cc..8c919d290e 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -129,7 +129,7 @@ static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPC } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { JvContext *s = avctx->priv_data; @@ -185,7 +185,7 @@ static int decode_frame(AVCodecContext *avctx, s->palette_has_changed = 0; memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; } diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 719192cc9b..fc99b21a58 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -43,7 +43,8 @@ static void decode_flush(AVCodecContext *avctx) avctx->release_buffer(avctx, &c->prev); } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = buf + avpkt->size; @@ -155,7 +156,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac if (outcnt - maxcnt) av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->cur; if (c->prev.data[0]) diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 2598590956..d9fbbb0d71 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -243,7 +243,8 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, int w, int h) return 0; } -static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame, + AVPacket *avpkt) { KmvcContext *const ctx = avctx->priv_data; uint8_t *out, *src; @@ -344,7 +345,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa ctx->prev = ctx->frm1; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *) data = ctx->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index f8db42e0ea..7d7a1a7ff1 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -497,7 +497,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, * @return number of consumed bytes on success or negative if decode fails */ static int lag_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, AVPacket *avpkt) + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -664,7 +664,7 @@ static int lag_decode_frame(AVCodecContext *avctx, } *picture = *p; - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 4ae2c99d95..f78401d09f 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -158,7 +158,7 @@ static int zlib_decomp(AVCodecContext *avctx, const uint8_t *src, int src_len, i * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -461,7 +461,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac return -1; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index f9cf7e724a..8f956f473f 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -253,7 +253,7 @@ static av_cold int libopenjpeg_decode_init_thread_copy(AVCodecContext *avctx) } static int libopenjpeg_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { uint8_t *buf = avpkt->data; @@ -269,7 +269,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, int ispacked = 0; int i; - *data_size = 0; + *got_frame = 0; // Check if input is a raw jpeg2k codestream or in jp2 wrapping if ((AV_RB32(buf) == 12) && @@ -412,7 +412,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, } *output = ctx->image; - *data_size = sizeof(AVPicture); + *got_frame = 1; ret = buf_size; done: diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index ae11cc5e2f..2411fe63dd 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -207,7 +207,7 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext) } static int libschroedinger_decode_frame(AVCodecContext *avccontext, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -225,7 +225,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, SchroParseUnitContext parse_ctx; LibSchroFrameContext *framewithpts = NULL; - *data_size = 0; + *got_frame = 0; parse_context_init(&parse_ctx, buf, buf_size); if (!buf_size) { @@ -341,14 +341,14 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, p_schro_params->dec_frame.linesize[2] = framewithpts->frame->components[2].stride; *(AVFrame*)data = p_schro_params->dec_frame; - *data_size = sizeof(AVFrame); + *got_frame = 1; /* Now free the frame resources. */ libschroedinger_decode_frame_free(framewithpts->frame); av_free(framewithpts); } else { data = NULL; - *data_size = 0; + *got_frame = 0; } return buf_size; } diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 56f706ed50..6419e281b7 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -59,7 +59,7 @@ static av_cold int vp8_init(AVCodecContext *avctx) } static int vp8_decode(AVCodecContext *avctx, - void *data, int *data_size, AVPacket *avpkt) + void *data, int *got_frame, AVPacket *avpkt) { VP8Context *ctx = avctx->priv_data; AVFrame *picture = data; @@ -100,7 +100,7 @@ static int vp8_decode(AVCodecContext *avctx, picture->linesize[1] = img->stride[1]; picture->linesize[2] = img->stride[2]; picture->linesize[3] = 0; - *data_size = sizeof(AVPicture); + *got_frame = 1; } return avpkt->size; } diff --git a/libavcodec/loco.c b/libavcodec/loco.c index a837e4b9bd..6f49992a61 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -158,7 +158,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -223,7 +223,7 @@ static int decode_frame(AVCodecContext *avctx, break; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = l->pic; return buf_size; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index a07d6e564b..b5a9d571a3 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -153,7 +153,7 @@ static inline void idct_put(MDECContext *a, int mb_x, int mb_y){ } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -206,7 +206,7 @@ static int decode_frame(AVCodecContext *avctx, memset(p->qscale_table, a->qscale, a->mb_width); *picture = a->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return (get_bits_count(&a->gb)+31)/32*4; } diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index fd7efef343..8e35f9228c 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -301,7 +301,7 @@ static void prepare_avpic(MimicContext *ctx, AVPicture *dst, AVPicture *src) } static int mimic_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -390,7 +390,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, } *(AVFrame*)data = ctx->buf_ptrs[ctx->cur_index]; - *data_size = sizeof(AVFrame); + *got_frame = 1; ctx->prev_index = ctx->next_prev_index; ctx->cur_index = ctx->next_cur_index; diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index 8c8514f2c5..9d5a8f31ef 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -38,7 +38,7 @@ static uint32_t read_offs(AVCodecContext *avctx, GetBitContext *gb, uint32_t siz } static int mjpegb_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -137,7 +137,7 @@ read_header: //XXX FIXME factorize, this looks very similar to the EOI code *picture= *s->picture_ptr; - *data_size = sizeof(AVFrame); + *got_frame = 1; if(!s->lossless){ picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]); diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 04249dd97d..104a63d5fd 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1436,7 +1436,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s, return start_code; } -int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -1551,7 +1551,7 @@ eoi_parser: goto not_the_end; } *picture = *s->picture_ptr; - *data_size = sizeof(AVFrame); + *got_frame = 1; if (!s->lossless) { picture->quality = FFMAX3(s->qscale[0], diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index bfa987d3c5..89325ba7d7 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -116,7 +116,7 @@ typedef struct MJpegDecodeContext { int ff_mjpeg_decode_init(AVCodecContext *avctx); int ff_mjpeg_decode_end(AVCodecContext *avctx); int ff_mjpeg_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt); int ff_mjpeg_decode_dqt(MJpegDecodeContext *s); int ff_mjpeg_decode_dht(MJpegDecodeContext *s); diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 9959d5fe03..784b939734 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -172,7 +172,7 @@ static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert) } static int mm_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -209,7 +209,7 @@ static int mm_decode_frame(AVCodecContext *avctx, memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return buf_size; diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index a33d8d3eb0..c2bd0f4d2b 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -237,7 +237,7 @@ static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) } static int mp_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -295,7 +295,7 @@ static int mp_decode_frame(AVCodecContext *avctx, ff_free_vlc(&mp->vlc); end: - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = mp->frame; return buf_size; } diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 06305bf276..7cd8823682 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -72,7 +72,7 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) } static int msrle_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -128,7 +128,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, &s->gb); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index f72385f9fe..c9edb2e2d7 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -135,7 +135,7 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder) return !!ncol; } -static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -180,7 +180,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, memcpy(ctx->pic.data[1], c->pal, AVPALETTE_SIZE); ctx->pic.palette_has_changed = pal_changed; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = ctx->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index 7c65f14fc6..9746335132 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -461,7 +461,7 @@ typedef struct Rectangle { #define MAX_WMV9_RECTANGLES 20 #define ARITH2_PADDING 2 -static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -744,7 +744,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (buf_size) av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n"); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = ctx->pic; return avpkt->size; diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c index a41db22249..689daeee5d 100644 --- a/libavcodec/mss3.c +++ b/libavcodec/mss3.c @@ -674,7 +674,7 @@ static av_cold void init_coders(MSS3Context *ctx) } } -static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -740,7 +740,7 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, c->pic.key_frame = keyframe; c->pic.pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; if (!bytestream2_get_bytes_left(&gb)) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; return buf_size; @@ -798,7 +798,7 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, dst[2] += c->pic.linesize[2] * 8; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; return buf_size; diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index 1c850bc1c3..7c714cb264 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -506,7 +506,7 @@ static inline void mss4_update_dc_cache(MSS4Context *c, int mb_x) } } -static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -566,7 +566,7 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *data_size, c->pic.pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; if (frame_type == SKIP_FRAME) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; return buf_size; @@ -623,7 +623,7 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *data_size, dst[2] += c->pic.linesize[2] * 16; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; return buf_size; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 644fecf66b..860a893118 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -286,7 +286,7 @@ static void msvideo1_decode_16bit(Msvideo1Context *s) } static int msvideo1_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -317,7 +317,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, else msvideo1_decode_16bit(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index 13a0d4c078..d81e9fc853 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -156,7 +156,7 @@ static int mxpeg_check_dimensions(MXpegDecodeContext *s, MJpegDecodeContext *jpg } static int mxpeg_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -293,7 +293,7 @@ static int mxpeg_decode_frame(AVCodecContext *avctx, the_end: if (jpg->got_picture) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *picture = *jpg->picture_ptr; s->picture_index ^= 1; jpg->picture_ptr = &s->picture[s->picture_index]; @@ -302,7 +302,7 @@ the_end: if (!s->got_mxm_bitmask) s->has_complete_frame = 1; else - *data_size = 0; + *got_frame = 0; } } diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 4beed8f918..0b47e974f5 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -138,7 +138,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, return 1; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -262,7 +262,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = c->pic; - *data_size = sizeof(AVFrame); + *got_frame = 1; return orig_size; } diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index a5c13960bd..1bd861215e 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -77,7 +77,7 @@ static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) memset(dst, 0, (256 - pallen) * sizeof(*dst)); } -static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -231,7 +231,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = s->picture; - *data_size = sizeof(AVFrame); + *got_frame = 1; ret = buf - bufstart; end: diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 97d46ad946..e769537706 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -98,7 +98,7 @@ static const uint8_t cga_mode45_index[6][4] = { }; static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; @@ -238,7 +238,7 @@ static int decode_frame(AVCodecContext *avctx, return avpkt->size; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; return avpkt->size; } diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 0e3805bdb4..9c340eacb4 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -383,7 +383,7 @@ static int png_decode_idat(PNGDecContext *s, int length) } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -611,7 +611,7 @@ static int decode_frame(AVCodecContext *avctx, } *picture= *s->current_picture; - *data_size = sizeof(AVFrame); + *got_frame = 1; ret = bytestream2_tell(&s->gb); the_end: diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 6d2473831b..b4b042cdf8 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -27,7 +27,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -182,7 +182,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, break; } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return s->bytestream - s->bytestream_start; } diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index 79995791d6..f7e32c998b 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.c @@ -599,7 +599,7 @@ static int decode_picture(ProresContext *ctx, int pic_num, #define MOVE_DATA_PTR(nbytes) buf += (nbytes); buf_size -= (nbytes) -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { ProresContext *ctx = avctx->priv_data; @@ -641,7 +641,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, MOVE_DATA_PTR(pic_data_size); } - *data_size = sizeof(AVPicture); + *got_frame = 1; *(AVFrame*) data = *avctx->coded_frame; return avpkt->size; diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index c9b3564409..77fd19615a 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -38,7 +38,7 @@ static av_cold int ptx_init(AVCodecContext *avctx) { return 0; } -static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; @@ -99,7 +99,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; if (y < h) { av_log(avctx, AV_LOG_WARNING, "incomplete packet\n"); diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 99692dc170..ca982f340d 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -35,7 +35,7 @@ typedef struct QdrawContext{ } QdrawContext; static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -140,7 +140,7 @@ static int decode_frame(AVCodecContext *avctx, outdata += a->pic.linesize[0]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = a->pic; return buf_size; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 1ee764bb99..4a918e71ec 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -240,7 +240,7 @@ static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { uint8_t ctable[128]; @@ -280,7 +280,7 @@ static int decode_frame(AVCodecContext *avctx, } memcpy(a->pic.data[1], a->pal, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = a->pic; return avpkt->size; diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index 3f173a596b..02091d04bf 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -382,7 +382,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) } static int qtrle_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { QtrleContext *s = avctx->priv_data; @@ -478,7 +478,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, } done: - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index 2224e32966..fd6d521dd0 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -35,7 +35,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int h, w; @@ -82,7 +82,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, dst_line += pic->linesize[0]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = *avctx->coded_frame; return avpkt->size; diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 449755f9b2..16ee64e47a 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -113,7 +113,7 @@ static void flip(AVCodecContext *avctx, AVPicture * picture){ } static int raw_decode(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -196,7 +196,7 @@ static int raw_decode(AVCodecContext *avctx, } } - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 9eea92a4ee..c9eb93eb62 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -172,7 +172,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) static int rl2_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -195,7 +195,7 @@ static int rl2_decode_frame(AVCodecContext *avctx, /** make the palette available on the way out */ memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /** report that the buffer was completely consumed */ diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index bf5664b9e5..2543cecb27 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -169,7 +169,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) } static int roq_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -190,7 +190,7 @@ static int roq_decode_frame(AVCodecContext *avctx, bytestream2_init(&s->gb, buf, buf_size); roqvideo_decode_frame(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = *s->current_frame; /* shuffle frames */ diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index 876c9b7f8f..57d4d2d228 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -244,7 +244,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) } static int rpza_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -263,7 +263,7 @@ static int rpza_decode_frame(AVCodecContext *avctx, rpza_decode_stream(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 8769eae209..73af3622e6 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -638,7 +638,7 @@ static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n) } static int rv10_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -703,7 +703,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, } if(s->last_picture_ptr || s->low_delay){ - *data_size = sizeof(AVFrame); + *got_frame = 1; ff_print_debug_info(s, pict); } s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...) diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h index e7a59c4bed..f40e2828ab 100644 --- a/libavcodec/rv34.h +++ b/libavcodec/rv34.h @@ -133,7 +133,7 @@ typedef struct RV34DecContext{ */ int ff_rv34_get_start_offset(GetBitContext *gb, int blocks); int ff_rv34_decode_init(AVCodecContext *avctx); -int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt); +int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt); int ff_rv34_decode_end(AVCodecContext *avctx); int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx); int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index e7791b7e05..0e72751564 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -151,7 +151,7 @@ static int read_uncompressed_sgi(unsigned char* out_buf, uint8_t* out_end, } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { SgiState *s = avctx->priv_data; @@ -233,7 +233,7 @@ static int decode_frame(AVCodecContext *avctx, if (ret == 0) { *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return avpkt->size; } else { return ret; diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 0d11e9cd82..b20a7b6d10 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -349,7 +349,8 @@ static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *la return v; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { SmackVContext * const smk = avctx->priv_data; uint8_t *out; @@ -496,7 +497,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = smk->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 38bf804c8c..1834003a39 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -422,7 +422,7 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) } static int smc_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -447,7 +447,7 @@ static int smc_decode_frame(AVCodecContext *avctx, smc_decode_stream(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 50c55425ab..603cef0c07 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -382,7 +382,9 @@ static int decode_blocks(SnowContext *s){ return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) +{ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SnowContext *s = avctx->priv_data; @@ -542,7 +544,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac else *picture= s->mconly_picture; - *data_size = sizeof(AVFrame); + *got_frame = 1; bytes_read= c->bytestream - c->bytestream_start; if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 29b00592f1..90c34911bd 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -31,7 +31,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -86,7 +86,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx, av_init_packet(&avpkt_recoded); avpkt_recoded.data = recoded; avpkt_recoded.size = j; - i = ff_mjpeg_decode_frame(avctx, data, data_size, &avpkt_recoded); + i = ff_mjpeg_decode_frame(avctx, data, got_frame, &avpkt_recoded); av_free(recoded); diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 310ac2c7b9..a44cdf026a 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -40,7 +40,8 @@ static av_cold int sunrast_init(AVCodecContext *avctx) { } static int sunrast_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) { + int *got_frame, AVPacket *avpkt) +{ const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; SUNRASTContext * const s = avctx->priv_data; @@ -181,7 +182,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, } *picture = s->picture; - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf - bufstart; } diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 6e096f3f43..4fc3a588f4 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -587,7 +587,7 @@ static int svq1_decode_frame_header(GetBitContext *bitbuf, MpegEncContext *s) } static int svq1_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -708,7 +708,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data, ff_MPV_frame_end(s); - *data_size = sizeof(AVFrame); + *got_frame = 1; result = buf_size; err: diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index ac8d9c1a89..f2c14ea739 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1003,7 +1003,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) } static int svq3_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; SVQ3Context *svq3 = avctx->priv_data; @@ -1017,7 +1017,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, if (s->next_picture_ptr && !s->low_delay) { *(AVFrame *) data = s->next_picture.f; s->next_picture_ptr = NULL; - *data_size = sizeof(AVFrame); + *got_frame = 1; } return 0; } @@ -1139,7 +1139,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, /* Do not output the last pic after seeking. */ if (s->last_picture_ptr || s->low_delay) - *data_size = sizeof(AVFrame); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 027275bd2c..3bbed94dcd 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -95,7 +95,7 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { TargaContext * const s = avctx->priv_data; @@ -233,7 +233,7 @@ static int decode_frame(AVCodecContext *avctx, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return avpkt->size; } diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 98f6477b76..a9064eca24 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -222,7 +222,7 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) } static int seqvideo_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -240,7 +240,7 @@ static int seqvideo_decode_frame(AVCodecContext *avctx, if (seqvideo_decode(seq, buf, buf_size)) return AVERROR_INVALIDDATA; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = seq->frame; return buf_size; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index c42a65b9f4..8c40006aa5 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -540,7 +540,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, AVPacket *avpkt) + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -655,7 +655,7 @@ static int decode_frame(AVCodecContext *avctx, } } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index c56635e722..d4e5aa1398 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -39,7 +39,7 @@ typedef struct TMVContext { } TMVContext; static int tmv_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { TMVContext *tmv = avctx->priv_data; const uint8_t *src = avpkt->data; @@ -59,7 +59,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, if (avpkt->size < 2*char_rows*char_cols) { av_log(avctx, AV_LOG_ERROR, "Input buffer too small, truncated sample?\n"); - *data_size = 0; + *got_frame = 0; return -1; } @@ -81,7 +81,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, dst += tmv->pic.linesize[0] * 8; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = tmv->pic; return avpkt->size; } diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index c2e15894e4..f6ca35c7b7 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -839,7 +839,7 @@ static void truemotion1_decode_24bit(TrueMotion1Context *s) static int truemotion1_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -866,7 +866,7 @@ static int truemotion1_decode_frame(AVCodecContext *avctx, truemotion1_decode_16bit(s); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index b540eda3f6..5b441e11eb 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -811,7 +811,7 @@ static const int tm2_stream_order[TM2_NUM_STREAMS] = { }; static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -861,7 +861,7 @@ static int decode_frame(AVCodecContext *avctx, p->pict_type = AV_PICTURE_TYPE_P; l->cur = !l->cur; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = l->pic; av_free(swbuf); diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index db2805ebaf..5b1c7be16e 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -71,7 +71,8 @@ typedef struct TsccContext { * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -124,7 +125,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac memcpy(c->pic.data[1], c->pal, AVPALETTE_SIZE); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 36287137ad..b7f1b8899b 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -211,7 +211,7 @@ static int tscc2_decode_slice(TSCC2Context *c, int mb_y, } static int tscc2_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -238,7 +238,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data, } if (frame_type == 0) { - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; return buf_size; @@ -322,7 +322,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data, bytestream2_skip(&gb, size); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 8e2605f053..8a10385b92 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -41,7 +41,7 @@ static av_cold int txd_init(AVCodecContext *avctx) { return 0; } -static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { TXDContext * const s = avctx->priv_data; GetByteContext gb; @@ -135,7 +135,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } *picture = s->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return avpkt->size; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 41faa3de97..275319605d 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -209,7 +209,7 @@ static void ulti_grad(AVFrame *frame, int x, int y, uint8_t *Y, int chroma, int } static int ulti_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -406,7 +406,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, } } - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data= s->frame; return buf_size; diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index c35a5692fe..3f8f690ee0 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -320,7 +320,7 @@ static void restore_median_il(uint8_t *src, int step, int stride, } } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -465,7 +465,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, c->pic.pict_type = AV_PICTURE_TYPE_I; c->pic.interlaced_frame = !!c->interlaced; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index 29a93a8917..6c53e362ba 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -43,7 +43,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int h, w; @@ -109,7 +109,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, v += pic->linesize[2] / 2 - avctx->width / 2; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = *avctx->coded_frame; return avpkt->size; diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 0b9753f733..0b1b721617 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -38,7 +38,8 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { int y=0; int width= avctx->width; @@ -119,7 +120,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } } - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data= *avctx->coded_frame; return avpkt->size; diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 1f44b417a6..efd2093134 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -50,7 +50,7 @@ static av_cold int v410_decode_init(AVCodecContext *avctx) } static int v410_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { AVFrame *pic = avctx->coded_frame; uint8_t *src = avpkt->data; @@ -96,7 +96,7 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data, v += pic->linesize[2] >> 1; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = *pic; return avpkt->size; diff --git a/libavcodec/vb.c b/libavcodec/vb.c index f5e15cdb18..1e241e7d5a 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -185,7 +185,8 @@ static int vb_decode_framedata(VBDecContext *c, int offset) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { VBDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr; @@ -235,7 +236,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac FFSWAP(uint8_t*, c->frame, c->prev_frame); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/vble.c b/libavcodec/vble.c index b761787ef0..228b1bd61a 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -112,7 +112,7 @@ static void vble_restore_plane(VBLEContext *ctx, int plane, int offset, } } -static int vble_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { VBLEContext *ctx = avctx->priv_data; @@ -165,7 +165,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *data_size, vble_restore_plane(ctx, 2, offset, width_uv, height_uv); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = *pic; return avpkt->size; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 5e3f96416b..ce690f4196 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5308,7 +5308,7 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx) * @todo TODO: Handle VC-1 IDUs (Transport level?) */ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size, n_slices = 0, i; @@ -5331,7 +5331,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, *pict = s->next_picture_ptr->f; s->next_picture_ptr = NULL; - *data_size = sizeof(AVFrame); + *got_frame = 1; } return 0; @@ -5647,7 +5647,7 @@ image: goto err; #endif *pict = v->sprite_output_frame; - *data_size = sizeof(AVFrame); + *got_frame = 1; } else { if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { *pict = s->current_picture_ptr->f; @@ -5655,7 +5655,7 @@ image: *pict = s->last_picture_ptr->f; } if (s->last_picture_ptr || s->low_delay) { - *data_size = sizeof(AVFrame); + *got_frame = 1; ff_print_debug_info(s, pict); } } diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 1614dd3061..d0805a3759 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -64,7 +64,7 @@ static av_cold int vcr1_decode_end(AVCodecContext *avctx) } static int vcr1_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -133,7 +133,7 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data, } *picture = a->picture; - *data_size = sizeof(AVPicture); + *got_frame = 1; return buf_size; } diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 14b512acb1..cffc00aa40 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -419,7 +419,7 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx) } static int vmdvideo_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -448,7 +448,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->prev_frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index 3153be6844..4071cdf51a 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -285,7 +285,8 @@ static int decode_hextile(VmncContext *c, uint8_t* dst, const uint8_t* src, int return src - ssrc; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -446,7 +447,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac put_cursor(outptr, c->pic.linesize[0], c, c->cur_x, c->cur_y); } } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index e8127597c6..de23f285e5 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1910,7 +1910,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * } static int vp3_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -2046,7 +2046,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, } vp3_draw_horiz_band(s, s->avctx->height); - *data_size=sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data= s->current_frame; if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME)) diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index c9490e770b..47fe2fb11c 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -487,7 +487,7 @@ static int vp56_size_changed(AVCodecContext *avctx) return 0; } -int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -654,7 +654,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, p->qscale_table = s->qscale_table; p->qscale_type = FF_QSCALE_TYPE_VP56; *(AVFrame*)data = *p; - *data_size = sizeof(AVFrame); + *got_frame = 1; return avpkt->size; } diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index 27539c7932..d5feaa381a 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -176,7 +176,7 @@ struct vp56_context { void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha); int ff_vp56_free(AVCodecContext *avctx); void ff_vp56_init_dequant(VP56Context *s, int quantizer); -int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt); diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index d9902c4c48..8044e8db33 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1855,7 +1855,7 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, return 0; } -static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { VP8Context *s = avctx->priv_data; @@ -2004,7 +2004,7 @@ skip_decode: if (!s->invisible) { *(AVFrame*)data = *curframe; - *data_size = sizeof(AVFrame); + *got_frame = 1; } return avpkt->size; diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index e641a75830..182f2ce997 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -580,7 +580,7 @@ static int vqa_decode_chunk(VqaContext *s) } static int vqa_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { VqaContext *s = avctx->priv_data; @@ -602,7 +602,7 @@ static int vqa_decode_frame(AVCodecContext *avctx, memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4); s->frame.palette_has_changed = 1; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 3daac0b160..9021ec6a62 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -59,7 +59,7 @@ static inline int wnv1_get_code(WNV1Context *w, int base_value) } static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -124,7 +124,7 @@ static int decode_frame(AVCodecContext *avctx, } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = l->pic; av_free(rbuf); diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 871bc13681..f036d78eb8 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -493,7 +493,7 @@ static const uint8_t gamma_lookup[256] = { #endif static int xan_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -582,7 +582,7 @@ static int xan_decode_frame(AVCodecContext *avctx, if (s->last_frame.data[0]) avctx->release_buffer(avctx, &s->last_frame); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->current_frame; /* shuffle frames */ diff --git a/libavcodec/xl.c b/libavcodec/xl.c index a8c392a767..1cadeab561 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -41,7 +41,7 @@ static const int xl_table[32] = { 120, 121, 122, 123, 124, 125, 126, 127}; static int decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -122,7 +122,7 @@ static int decode_frame(AVCodecContext *avctx, V += a->pic.linesize[2]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = a->pic; return buf_size; diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 07d1e2ce57..274e4fa103 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -36,7 +36,7 @@ static av_cold int xwd_decode_init(AVCodecContext *avctx) } static int xwd_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { AVFrame *p = avctx->coded_frame; const uint8_t *buf = avpkt->data; @@ -242,7 +242,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, ptr += p->linesize[0]; } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = *p; return buf_size; diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 2a5a8ca631..9e874540b5 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -357,7 +357,7 @@ static int xan_decode_frame_type1(AVCodecContext *avctx) } static int xan_decode_frame(AVCodecContext *avctx, - void *data, int *data_size, + void *data, int *got_frame, AVPacket *avpkt) { XanContext *s = avctx->priv_data; @@ -389,7 +389,7 @@ static int xan_decode_frame(AVCodecContext *avctx, if (ret) return ret; - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = s->pic; return avpkt->size; diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 0240a8cc9f..c3bb577119 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -188,7 +188,7 @@ static void yop_next_macroblock(YopDecContext *s) s->dstptr += 2; } -static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, +static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { YopDecContext *s = avctx->priv_data; @@ -243,7 +243,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, yop_next_macroblock(s); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *) data = s->frame; return avpkt->size; } diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index e5edb5f0ed..f54abb1c1b 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -29,7 +29,7 @@ typedef struct { } ZeroCodecContext; static int zerocodec_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) + int *got_frame, AVPacket *avpkt) { ZeroCodecContext *zc = avctx->priv_data; AVFrame *pic = avctx->coded_frame; @@ -98,7 +98,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data, if (prev_pic->data[0]) avctx->release_buffer(avctx, prev_pic); - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame *)data = *pic; /* Store the previous frame for use later. diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 33949ce25a..761974c902 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -398,7 +398,7 @@ static int zmbv_decode_intra(ZmbvContext *c) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -599,7 +599,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } FFSWAP(uint8_t *, c->cur, c->prev); } - *data_size = sizeof(AVFrame); + *got_frame = 1; *(AVFrame*)data = c->pic; /* always report that the buffer was completely consumed */ |