diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 5c96baaf3f2bc4ca0262359d14456eca89d7b876..dd7daa5adddbb87a7cd108719ccb5110f9284aef 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -677,8 +677,10 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FourXContext * const f = avctx->priv_data; AVFrame *picture = data; AVFrame *p, temp; diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 03b7ffd4199336d51d1ccf485ade8d98ac45bfb2..47c90c9fe28e3e8594461d7fbfc0b429ac38c32c 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -58,8 +58,10 @@ typedef struct EightBpsContext { * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; EightBpsContext * const c = avctx->priv_data; const unsigned char *encoded = buf; unsigned char *pixptr, *pixptr_end; diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 3a69f3d74739fdad94afe69542d149234ac1186d..c139e5d40b3aa1e403230b6811c1bb0cbe7d4819 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -42,8 +42,10 @@ static const int16_t exponential[16] = { -128<<8, -64<<8, -32<<8, -16<<8, -8<<8, /** decode a frame */ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; EightSvxContext *esc = avctx->priv_data; int16_t *out_data = data; int consumed = buf_size; diff --git a/libavcodec/aac.c b/libavcodec/aac.c index dcd560d0cccfa08888894536342f555b0e56684b..7ba3d946fc85aa0b2ed1cf87016f60e9ef4d3c03 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -1604,7 +1604,9 @@ static int parse_adts_frame_header(AACContext * ac, GetBitContext * gb) { return size; } -static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, const uint8_t * buf, int buf_size) { +static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AACContext * ac = avccontext->priv_data; ChannelElement * che = NULL; GetBitContext gb; diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 1f66780154307e3bfb17795e0fcf8349d259be7b..daabb2cd306f9a618398ad2478d6d5a7a7bfecfd 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -59,8 +59,10 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) static int aasc_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AascContext *s = avctx->priv_data; int compr, i, stride; diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 766b262e492b6a77d12c9344413d80a2be237c77..854a38f32b2faa68555d9da5b54006fae5443279 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1226,8 +1226,10 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) * Decode a single AC-3 frame. */ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AC3DecodeContext *s = avctx->priv_data; int16_t *out_samples = (int16_t *)data; int blk, ch, err; diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 994c0c68650a7d65e1c968d165a00c7713b3920f..7ddd72375a9fe929deb01c4d5fcddaac41aa6742 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -877,8 +877,10 @@ static void xa_decode(short *out, const unsigned char *in, static int adpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; ADPCMContext *c = avctx->priv_data; ADPCMChannelStatus *cs; int n, m, channel, i; diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 0af26013bbd680cd986cb834dfaeb3716c71854d..94ee793cfa82d01a10229eba18691039923023bf 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -104,8 +104,10 @@ static int adx_decode_header(AVCodecContext *avctx,const unsigned char *buf,size static int adx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf0, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf0 = avpkt->data; + int buf_size = avpkt->size; ADXContext *c = avctx->priv_data; short *samples = data; const uint8_t *buf = buf0; diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 436329f560895944edf2262955366b3380b7b9e9..b9715eef8509fbaf8c8936e17cfa0cb2ed5fd743 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -400,8 +400,10 @@ static void reconstruct_stereo_16(int32_t *buffer[MAX_CHANNELS], static int alac_decode_frame(AVCodecContext *avctx, void *outbuffer, int *outputsize, - const uint8_t *inbuffer, int input_buffer_size) + AVPacket *avpkt) { + const uint8_t *inbuffer = avpkt->data; + int input_buffer_size = avpkt->size; ALACContext *alac = avctx->priv_data; int channels; diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 59be99694e4799f3bce45625e351455d2cddfd6f..0305d7b4ecfa3b354a3ad295fa4641689698e62e 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -806,8 +806,10 @@ static void ape_unpack_stereo(APEContext * ctx, int count) static int ape_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; APEContext *s = avctx->priv_data; int16_t *samples = data; int nblocks; diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 7626873133178dea26e1ad738178646bcc9f6a2e..81dc18daccf218df5e1e8e4b2f40b033e6124890 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -387,8 +387,10 @@ static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; ASV1Context * const a = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&a->picture; diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index bdb8a8a8d4db22fc991de6008ab5f373d2a3298b..811dc4fe0c416d2da0cfd6f141ce27ad0f856d16 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -878,7 +878,9 @@ static int decodeFrame(ATRAC3Context *q, const uint8_t* databuf) static int atrac3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; ATRAC3Context *q = avctx->priv_data; int result = 0, i; const uint8_t* databuf; diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1414c945b12ce95388a3b85bcce1266f89fb74c9..1d1b9310f60478a44ef7bdf1198b18fa07817e65 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2429,8 +2429,7 @@ typedef struct AVCodec { int (*init)(AVCodecContext *); int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); int (*close)(AVCodecContext *); - int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, - const uint8_t *buf, int buf_size); + int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); /** * Codec capabilities. * see CODEC_CAP_* @@ -3020,26 +3019,45 @@ int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, v */ int avcodec_open(AVCodecContext *avctx, AVCodec *codec); +#if LIBAVCODEC_VERSION_MAJOR < 53 /** * Decodes an audio frame from \p buf into \p samples. - * The avcodec_decode_audio2() function decodes an audio frame from the input - * buffer \p buf of size \p buf_size. To decode it, it makes use of the + * Wrapper function which calls avcodec_decode_audio3. + * + * @deprecated Use avcodec_decode_audio3 instead. + * @param avctx the codec context + * @param[out] samples the output buffer + * @param[in,out] frame_size_ptr the output buffer size in bytes + * @param[in] buf the input buffer + * @param[in] buf_size the input buffer size in bytes + * @return On error a negative value is returned, otherwise the number of bytes + * used or zero if no frame could be decompressed. + */ +attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, + int *frame_size_ptr, + const uint8_t *buf, int buf_size); +#endif + +/** + * Decodes an audio frame from \p avpkt->data into \p samples. + * The avcodec_decode_audio3() function decodes an audio frame from the input + * buffer \p avpkt->data of size \p avpkt->size. To decode it, it makes use of the * audio codec which was coupled with \p avctx using avcodec_open(). The * resulting decoded frame is stored in output buffer \p samples. If no frame * could be decompressed, \p frame_size_ptr is zero. Otherwise, it is the * decompressed frame size in \e bytes. * * @warning You \e must set \p frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio2(). + * output buffer before calling avcodec_decode_audio3(). * * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than * the actual read bytes because some optimized bitstream readers read 32 or 64 * bits at once and could read over the end. * - * @warning The end of the input buffer \p buf should be set to 0 to ensure that + * @warning The end of the input buffer \p avpkt->data should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * - * @note You might have to align the input buffer \p buf and output buffer \p + * @note You might have to align the input buffer \p avpkt->data and output buffer \p * samples. The alignment requirements depend on the CPU: On some CPUs it isn't * necessary at all, on others it won't work at all if not aligned and on others * it will work but it will have an impact on performance. In practice, the @@ -3051,19 +3069,37 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec); * @param avctx the codec context * @param[out] samples the output buffer * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] buf the input buffer - * @param[in] buf_size the input buffer size in bytes + * @param[in] avpkt The input AVPacket containing the input buffer. * @return On error a negative value is returned, otherwise the number of bytes * used or zero if no frame could be decompressed. */ -int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, +int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, - const uint8_t *buf, int buf_size); + AVPacket *avpkt); +#if LIBAVCODEC_VERSION_MAJOR < 53 /** * Decodes a video frame from \p buf into \p picture. - * The avcodec_decode_video() function decodes a video frame from the input - * buffer \p buf of size \p buf_size. To decode it, it makes use of the + * Wrapper function which calls avcodec_decode_video2. + * + * @deprecated Use avcodec_decode_video2 instead. + * @param avctx the codec context + * @param[out] picture The AVFrame in which the decoded video frame will be stored. + * @param[in] buf the input buffer + * @param[in] buf_size the size of the input buffer in bytes + * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. + * @return On error a negative value is returned, otherwise the number of bytes + * used or zero if no frame could be decompressed. + */ +attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, + int *got_picture_ptr, + const uint8_t *buf, int buf_size); +#endif + +/** + * Decodes a video frame from \p avpkt->data into \p picture. + * The avcodec_decode_video2() function decodes a video frame from the input + * buffer \p avpkt->data of size \p avpkt->size. To decode it, it makes use of the * video codec which was coupled with \p avctx using avcodec_open(). The * resulting decoded frame is stored in \p picture. * @@ -3074,7 +3110,7 @@ int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, * @warning The end of the input buffer \p buf should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * - * @note You might have to align the input buffer \p buf and output buffer \p + * @note You might have to align the input buffer \p avpkt->data and output buffer \p * samples. The alignment requirements depend on the CPU: on some CPUs it isn't * necessary at all, on others it won't work at all if not aligned and on others * it will work but it will have an impact on performance. In practice, the @@ -3084,26 +3120,42 @@ int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, * start of the buffer to 16. * * @note Some codecs have a delay between input and output, these need to be - * feeded with buf=NULL, buf_size=0 at the end to return the remaining frames. + * feeded with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames. * * @param avctx the codec context * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] buf the input buffer - * @param[in] buf_size the size of the input buffer in bytes + * @param[in] avpkt The input AVpacket containing the input buffer. * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. * @return On error a negative value is returned, otherwise the number of bytes * used or zero if no frame could be decompressed. */ -int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, +int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, - const uint8_t *buf, int buf_size); + AVPacket *avpkt); +#if LIBAVCODEC_VERSION_MAJOR < 53 /* Decode a subtitle message. Return -1 if error, otherwise return the * number of bytes used. If no subtitle could be decompressed, * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */ -int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, +attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size); +#endif + +/** + * Decodes a subtitle message. + * Returns -1 if error, otherwise returns the number of bytes used. + * If no subtitle could be decompressed, \p got_sub_ptr is zero. + * Otherwise, the subtitle is stored in \p *sub. + * + * @param avctx the codec context + * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored. + * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. + * @param[in] avpkt The input AVPacket containing the input buffer. + */ +int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, + AVPacket *avpkt); int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, int *data_size_ptr, uint8_t *buf, int buf_size); diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 3b29c853b4b5c499caf070aaf359a418fe6406d8..c00ff5eaf575fb2dcb60674f5ea7a806ca6002c4 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -44,8 +44,10 @@ typedef enum { static int avs_decode_frame(AVCodecContext * avctx, - void *data, int *data_size, const uint8_t * buf, int buf_size) + void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AvsContext *const avs = avctx->priv_data; AVFrame *picture = data; AVFrame *const p = (AVFrame *) & avs->picture; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 54bc46c555f8a2f1defb7a245d1e04765c4d0180..92de25777aa552b90f111bf145c763b634458a63 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -58,8 +58,10 @@ static void set_palette(AVFrame * frame, const uint8_t * palette_buffer) static int bethsoftvid_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; BethsoftvidContext * vid = avctx->priv_data; char block_type; uint8_t * dst; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index d611144df3bcae581226e0af4344306afc9b6ce3..aaadb2f41e4fb3d774e351716305b71bf5cc96b9 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -45,9 +45,10 @@ static av_cold int bfi_decode_init(AVCodecContext * avctx) } static int bfi_decode_frame(AVCodecContext * avctx, void *data, - int *data_size, const uint8_t * buf, - int buf_size) + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; BFIContext *bfi = avctx->priv_data; uint8_t *dst = bfi->dst; uint8_t *src, *dst_offset, colour1, colour2; diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 5de1c46b135a0c7bb605695ea0355622c9b45111..735c085273fb3d840ca335c8530618e30039705e 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -35,8 +35,10 @@ static av_cold int bmp_decode_init(AVCodecContext *avctx){ static int bmp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; BMPContext *s = avctx->priv_data; AVFrame *picture = data; AVFrame *p = &s->picture; diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 18ed7afcb4f8d85e065f49ca7c8d638fb892dcfd..0e362cad981c2011cb9964f484fbd173dc235a35 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -113,8 +113,10 @@ static inline void draw_n_color(uint8_t *out, int stride, int width, } static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, const uint8_t * buf, int buf_size) + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; C93DecoderContext * const c93 = avctx->priv_data; AVFrame * const newpic = &c93->pictures[c93->currentpic]; AVFrame * const oldpic = &c93->pictures[c93->currentpic^1]; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index a1895bcb8816c20ebc128bc0a1f0cd663d64083b..c04cc39982910b70fdf525b918a8a61c97f66005 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -625,7 +625,9 @@ static void cavs_flush(AVCodecContext * avctx) { } static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, - const uint8_t * buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AVSContext *h = avctx->priv_data; MpegEncContext *s = &h->s; int input_size; diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index d0f5adb7fc3f2ccd067952ea1428c24c9f785ff9..5030165bd02727af1f1fe24635689eb082d6cdbe 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -411,8 +411,10 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) static int cinepak_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CinepakContext *s = avctx->priv_data; s->data = buf; diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 9f7ab61efdc879d42d12569f10747b7d4211c55b..9157b0013719bc433fe7e55cd6da650ce4353537 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -42,8 +42,10 @@ typedef struct CLJRContext{ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CLJRContext * const a = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&a->picture; diff --git a/libavcodec/cook.c b/libavcodec/cook.c index cee69fe14ab7ef0f653ff248ca56d1d17ed6a1b3..9dd13bfef8f61ed468a83f58fb8faf5ae53d52b3 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -979,7 +979,9 @@ static int decode_subpacket(COOKContext *q, const uint8_t *inbuffer, static int cook_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; COOKContext *q = avctx->priv_data; if (buf_size < avctx->block_align) diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 9379b2c7f3fecfc7cbeb511b8f4bfa712f651d5f..5fe097712d2d70897bc0b762cf52b09deabeebca 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -135,7 +135,9 @@ static void add_frame_32(AVFrame *f, const uint8_t *src, #endif static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CamStudioContext *c = avctx->priv_data; AVFrame *picture = data; diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index 2b15814b31c66bde1f2e7d1e171be18d0a62474b..944d778198a149a06ca20d3bf26c18734ceb9f72 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -60,8 +60,10 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx) static int cyuv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CyuvDecodeContext *s=avctx->priv_data; unsigned char *y_plane; diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 3bc895bc16aa4bca5edf366a603c2319ce359942..8dfec8e9a913df08d1d635445eea7a52377321d8 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1209,8 +1209,10 @@ static int dca_convert_bitstream(const uint8_t * src, int src_size, uint8_t * ds */ static int dca_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; int i; int16_t *samples = data; diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 861a0301de01179cdba11b3cc38f17479268f125..2d3762b39632593bb9a25185e927b3b1c47524b3 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -278,8 +278,10 @@ static int dnxhd_decode_macroblocks(DNXHDContext *ctx, const uint8_t *buf, int b } static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DNXHDContext *ctx = avctx->priv_data; AVFrame *picture = data; int first_field = 1; diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index daa21cd09ef8e09b85ed56e449c62f0c8494ea9a..69c7002ad73c31be144393087a337168cc755f77 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -161,8 +161,10 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx) static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DPCMContext *s = avctx->priv_data; int in, out = 0; int predictor[2]; diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index f8093fccf22402da7df70ccbda6c267ba1ecef2e..6e5ff1244607007c74f72dbea94c8fae421f0fa5 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -195,8 +195,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CinVideoContext *cin = avctx->priv_data; int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size; @@ -312,8 +314,10 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx) static int cinaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CinAudioContext *cin = avctx->priv_data; const uint8_t *src = buf; int16_t *samples = (int16_t *)data; diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 59ebb088e664c4a17e50944358e23a9432db8c05..31325f68096a9fc069ddc813181cd03ee154cbb1 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -1111,8 +1111,10 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) 144000 bytes for PAL - or twice those for 50Mbps) */ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DVVideoContext *s = avctx->priv_data; s->sys = dv_frame_profile(buf); diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 2a05390d39085ef0f300374e74ef5ac91310f802..a10f97bb2fe882f447a7b3b829b80a11f1def1b5 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1345,8 +1345,10 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, static int dvbsub_decode(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; AVSubtitle *sub = (AVSubtitle*) data; const uint8_t *p, *p_end; diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 9691e384f43dd706e863cd25cd94fb2bac6e14c5..ba1738089dbff60cc7026415771e5ce91dd65a08 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -475,8 +475,10 @@ static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h, static int dvdsub_decode(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AVSubtitle *sub = (void *)data; int is_menu; diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index e415da7187d5797e44d68b4ae284f8715d9ddb85..5339580c02c7de6a8bf1c322921cf72e83afb430 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -188,8 +188,10 @@ 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, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DxaDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr, *tmpptr; unsigned long dsize; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 18321aada5fa9cb236f2210009dac5b28a81281f..3de08cc1a092ad739270691af1b858e2353b6d1f 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -144,8 +144,10 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t static int cmv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CmvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index dd833f52c9567706a11d4230ee585db639223914..05f03e7b057c7b130e4a2a80f96559ee89007b50 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -190,7 +190,9 @@ static void tgq_calculate_qtable(TgqContext *s, int quant){ static int tgq_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size){ + AVPacket *avpkt){ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; const uint8_t *buf_start = buf; const uint8_t *buf_end = buf + buf_size; TgqContext *s = avctx->priv_data; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 90e3ebf489138685c67de4556edd2f4367bcab77..93a722ff25601d16a19ff8441ed27738395cdba8 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -237,8 +237,10 @@ static void cond_release_buffer(AVFrame *pic) static int tgv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TgvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int chunk_type; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 66123a2aae75090da1c0c86d29406c709076dfbe..3b6b8ebf9d96fd396000ce84178069fffeee86fd 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -101,8 +101,10 @@ static void tqi_calculate_qtable(MpegEncContext *s, int quant) static int tqi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size; TqiContext *t = avctx->priv_data; MpegEncContext *s = &t->s; diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 90ba4795ebc6fdea74a8ac96a232951f171c471c..7f22b84c67a174e37f63eb3bbecccd36b059ffab 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -206,8 +206,10 @@ static const uint16_t mask_matrix[] = {0x1, 0x2, 0x10, 0x20, */ static int escape124_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Escape124Context *s = avctx->priv_data; GetBitContext gb; diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 72c5fbd881e75db05ea393c81e0e88069f272f87..570999a32ff2c23c3f8c6dbe693f7fcde9ec2222 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -936,7 +936,9 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){ +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FFV1Context *f = avctx->priv_data; RangeCoder * const c= &f->c; const int width= f->width; diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 04e81c6faadf1125c518736a94245d872789d840..e6b52c7d1b7e59f356ab9926f6c4453144ece6d7 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -636,8 +636,10 @@ static int decode_frame(FLACContext *s) static int flac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FLACContext *s = avctx->priv_data; int i, j = 0, input_buf_size = 0, bytes_read = 0; int16_t *samples_16 = data; diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 7937efce258e5770840318020103e646c9974f2a..91c04996eb508b60e8b7a598b0d8f3687141a274 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -102,8 +102,10 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) static int flashsv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FlashSVContext *s = avctx->priv_data; int h_blocks, v_blocks, h_part, v_part, i, j; GetBitContext gb; diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 2261c40524a2d403e01890c4b0e4cfd2392bee72..37bed0a0de9047dba0adaa24f18976f346f79d76 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -701,8 +701,10 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, static int flic_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; if (avctx->pix_fmt == PIX_FMT_PAL8) { return flic_decode_frame_8BPP(avctx, data, data_size, buf, buf_size); diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index 14da1a0b616bdcb0f1524a934e643f19d57fc940..6fac1680a73318dff51392f098bbd19c5d85505c 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -130,8 +130,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FrapsContext * const s = avctx->priv_data; AVFrame *frame = data; AVFrame * const f = (AVFrame*)&s->frame; diff --git a/libavcodec/g726.c b/libavcodec/g726.c index fe1cc3d6f2eb2e4c70b9cba4e42b08f6a88b9985..ea72d398851e46fce28c55033efbf7ea2007bc7f 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -363,8 +363,10 @@ static int g726_encode_frame(AVCodecContext *avctx, static int g726_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; G726Context *c = avctx->priv_data; short *samples = data; GetBitContext gb; diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index d24550c84611117753c8c2700d3b4ec7ac69d0bc..137e7b2c23312c1ef65a7bc77a2fc52b9a8f9a58 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -282,8 +282,10 @@ static av_cold int gif_decode_init(AVCodecContext *avctx) return 0; } -static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; GifState *s = avctx->priv_data; AVFrame *picture = data; int ret; diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 70542869c5f0234c0ce3e2c4221c88c8e04fa8ea..3509e9f17155a06368585b158b7b8ec3cd5a5495 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -543,8 +543,10 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size){ static int h261_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; H261Context *h= avctx->priv_data; MpegEncContext *s = &h->s; int ret; diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 4d0322385675cb05102f9c3765cd255bf0789dd8..2f57573394dca7124735f27be203572f889d7168 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -331,8 +331,10 @@ static int decode_slice(MpegEncContext *s){ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; AVFrame *pict = data; diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 8ae32561085036fdc0571aa57b0440670d31f50e..1b5aeb2ceb434e5d9f71b0da5abad159f1327319 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -7618,8 +7618,10 @@ static int get_consumed_bytes(MpegEncContext *s, int pos, int buf_size){ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; H264Context *h = avctx->priv_data; MpegEncContext *s = &h->s; AVFrame *pict = data; diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 237b05fa94c163dd0085e0b98c904003e81d452c..e02bea2be8e6fc5ca455f78a4134e2b00b40f7c1 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -942,7 +942,9 @@ 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, const uint8_t *buf, int buf_size){ +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; HYuvContext *s = avctx->priv_data; const int width= s->width; const int width2= s->width>>1; diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 63123663c0b10c2bc026b74660e6ee326edc4e0a..05a3088852e215ec5a33f6919e585bb01d026831 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -209,8 +209,10 @@ static void idcin_decode_vlcs(IdcinContext *s) static int idcin_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; IdcinContext *s = avctx->priv_data; AVPaletteControl *palette_control = avctx->palctrl; diff --git a/libavcodec/imc.c b/libavcodec/imc.c index e8d43e6b0878c709eae12872825392b5d0f5a3bd..ff50d4b59b57106d45176709d62ab8421bb49df3 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -639,8 +639,10 @@ static int imc_get_coeffs (IMCContext* q) { static int imc_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; IMCContext *q = avctx->priv_data; diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 40c561a559ddc5a9ad4aba1ae53122d47e6d1295..75b9ee983662a2fdd16922efd761ca9e8c2824f9 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -136,8 +136,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Ir2Context * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&s->picture; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 915bceed65690671641ee94f73be7dc2c8afe610..b5a9a4dba78dd07fc96885d23785ae67de3459ff 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1062,8 +1062,10 @@ static int iv_decode_frame(Indeo3DecodeContext *s, static int indeo3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Indeo3DecodeContext *s=avctx->priv_data; uint8_t *src, *dest; int y; diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 50db2e95da3bb36b7c8369b872f0f0fc6a129891..51ee759ead092e2d3b96804e7af1033d8a783b98 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -639,8 +639,10 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) static int ipvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; IpvideoContext *s = avctx->priv_data; AVPaletteControl *palette_control = avctx->palctrl; diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 30939ab411e3e9db1f3c0f68025d4a7f27354c11..a3389da1add1b86c386f396a2a9de18b0eec8818 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -224,9 +224,10 @@ static void kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int w, } } -static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, const uint8_t * buf, - int buf_size) +static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; KmvcContext *const ctx = avctx->priv_data; uint8_t *out, *src; int i; diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 026be4f0b0b548e41701016bc7c6d547b5d872f4..9c0d8d75d66b2c6263f63d21dde28b1da06bd26a 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -161,8 +161,10 @@ static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned cha * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; LclDecContext * const c = avctx->priv_data; unsigned char *encoded = (unsigned char *)buf; unsigned int pixel_ptr; diff --git a/libavcodec/libamr.c b/libavcodec/libamr.c index 6a9de50fdc5cd86516c4ff844b5cf3ccdb18b35e..29325c91408c0df30bfe5d442bd7cb8dcf0eb86b 100644 --- a/libavcodec/libamr.c +++ b/libavcodec/libamr.c @@ -245,8 +245,10 @@ static av_cold int amr_nb_decode_close(AVCodecContext * avctx) static int amr_nb_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AMRContext *s = avctx->priv_data; const uint8_t*amrData=buf; int offset=0; @@ -654,8 +656,10 @@ static int amr_wb_decode_init(AVCodecContext * avctx) static int amr_wb_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AMRWBContext *s = avctx->priv_data; const uint8_t*amrData=buf; int mode; diff --git a/libavcodec/libdiracdec.c b/libavcodec/libdiracdec.c index 2c484a410c7fb456ca743ae555ba69930e7654f5..9050f8829cac2e20c260bab4e85dec294046b499 100644 --- a/libavcodec/libdiracdec.c +++ b/libavcodec/libdiracdec.c @@ -77,8 +77,10 @@ static av_cold int libdirac_decode_init(AVCodecContext *avccontext) static int libdirac_decode_frame(AVCodecContext *avccontext, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FfmpegDiracDecoderParams *p_dirac_params = avccontext->priv_data; AVPicture *picture = data; diff --git a/libavcodec/libfaad.c b/libavcodec/libfaad.c index 37468862377045661033ce9a7d80093442fdc7d3..953c2a1ed222283a20af4ae00c69c540daa8e7d1 100644 --- a/libavcodec/libfaad.c +++ b/libavcodec/libfaad.c @@ -149,8 +149,10 @@ static av_cold int faac_init_mp4(AVCodecContext *avctx) static int faac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FAACContext *s = avctx->priv_data; #ifndef FAAD2_VERSION unsigned long bytesconsumed; diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index e036afd3c4533dbf769b8cf770ab7449585025ee..7dc2af840591ec55c5dc57d891e8cd378ebc703e 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -138,7 +138,9 @@ AVCodec libgsm_ms_encoder = { static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; *data_size = 0; /* In case of error */ if(buf_size < avctx->block_align) return -1; switch(avctx->codec_id) { diff --git a/libavcodec/libopenjpeg.c b/libavcodec/libopenjpeg.c index 70581ee73c1aa68cbbb0372771d792fbaf76ed0d..a3035fd290d591d746dcc827ce9db6366aaefc8c 100644 --- a/libavcodec/libopenjpeg.c +++ b/libavcodec/libopenjpeg.c @@ -58,8 +58,10 @@ static av_cold int libopenjpeg_decode_init(AVCodecContext *avctx) static int libopenjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; LibOpenJPEGContext *ctx = avctx->priv_data; AVFrame *picture = &ctx->image, *output = data; opj_dinfo_t *dec; diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index 1512ec79fc78ae701361a235776846446e02c69a..3985a1ca2de2e1ad7f824a66377454f73d2d9ff2 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -207,8 +207,10 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext) static int libschroedinger_decode_frame(AVCodecContext *avccontext, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data; SchroDecoder *decoder = p_schro_params->decoder; diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index d44466b841f108adc84e4eadb09b07cb4ca7d482..8c3dc293dfdcc70461d41d125c2e068bfa6f77d6 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -90,8 +90,10 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) static int libspeex_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; LibSpeexContext *s = avctx->priv_data; int16_t *output = data, *end; int i, num_samples; diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 64b718fb81e29f631308828da94629211e09d47c..fc7b44075f43dae29f17e1d2a6e3302c73322f91 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -158,8 +158,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; LOCOContext * const l = avctx->priv_data; AVFrame * const p= (AVFrame*)&l->pic; int decoded; diff --git a/libavcodec/mace.c b/libavcodec/mace.c index d26164706aa14b18a9b2e79e3124bbe02f21200d..ae7b4dc83323e6992024666c33b44a45efde1bdd 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -236,8 +236,10 @@ static av_cold int mace_decode_init(AVCodecContext * avctx) static int mace_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; int16_t *samples = data; MACEContext *ctx = avctx->priv_data; int i, j, k, l; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index ccde88df7d3697bd3a26e1d5bcda72905558107c..ad998649ed725b967f04fef71d5d61c78bbb270c 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -154,8 +154,10 @@ static inline void idct_put(MDECContext *a, int mb_x, int mb_y){ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MDECContext * const a = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= &a->picture; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index a6ab090e2db14375ab6ce1e4c6c57d0f8ceaacee..da5bba3c2ebe7cec318816ab778f58b44465cee8 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -274,8 +274,10 @@ static void prepare_avpic(MimicContext *ctx, AVPicture *dst, AVPicture *src) } static int mimic_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, const uint8_t *buf, int buf_size) + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MimicContext *ctx = avctx->priv_data; int is_pframe; int width, height; diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index 62b29e06238fb7dee57ba4c2ed495c6f5cacdb7d..04ad6c106c63243d7595d27a246733ffd516018e 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -31,8 +31,10 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; AVFrame *picture = data; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 145719c16e9c7f8440161bb2d6dd7b45f8112f7e..1463d115d32cf83e0fbf11da5613510b9d02fdc9 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1258,8 +1258,10 @@ found: int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; int start_code; diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index ab034d79ba4e187ae0ac904fa1bc3c04b0d4bf3a..a0974201d2f9e24b4e670d4b2c4e222bbe415d8b 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -106,7 +106,7 @@ 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, - const uint8_t *buf, int buf_size); + AVPacket *avpkt); int ff_mjpeg_decode_dqt(MJpegDecodeContext *s); int ff_mjpeg_decode_dht(MJpegDecodeContext *s); int ff_mjpeg_decode_sof(MJpegDecodeContext *s); diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 9642104a5f4b5ceea579003bc43fe35843d55f3f..ba374c9dfa4909f7898115a8810947a3ee199d36 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -904,8 +904,10 @@ static int output_data(MLPDecodeContext *m, unsigned int substr, * otherwise returns the number of bytes consumed. */ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MLPDecodeContext *m = avctx->priv_data; GetBitContext gb; unsigned int length, substr; diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 238b991a8d766d7d2ded026ece9785760ddad3f1..6dc95589c6df3a79bc80f0aa45dfc4708cda677f 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -159,8 +159,10 @@ static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const static int mm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MmContext *s = avctx->priv_data; const uint8_t *buf_end = buf+buf_size; int type; diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index f69dcf95fe948ad86e7156ee8d85530e6d5e8334..02ea04986a2309df702baf00a99abe3388ae723a 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -281,8 +281,10 @@ static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) static int mp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MotionPixelsContext *mp = avctx->priv_data; GetBitContext gb; int i, count1, count2, sz; diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 7362a19192f479c09a9fbbcd3b055051202e79f3..8bc05d5375594567bf781ca1a6788ed31f6e9002 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -156,8 +156,10 @@ static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int * static int mpc7_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MPCContext *c = avctx->priv_data; GetBitContext gb; uint8_t *bits; diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index ff7d5e5805c873104dacb3cf498ff7bc3706640a..d72e36f306ce0b87968c8013db5ac904e5275402 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -180,8 +180,10 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) static int mpc8_decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MPCContext *c = avctx->priv_data; GetBitContext gb2, *gb = &gb2; int i, j, k, ch, cnt, res, t; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index b353b88f4c6f52711238644e7b5c8d5affde396f..f4e4958bfaccfca21683ac777f41ba0017e52bf5 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2260,8 +2260,10 @@ static int decode_chunks(AVCodecContext *avctx, /* handle buffering and image synchronisation */ static int mpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Mpeg1Context *s = avctx->priv_data; AVFrame *picture = data; MpegEncContext *s2 = &s->mpeg_enc_ctx; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index ce0066bbf7b6fd3e6655840644385c2dfbad6f6d..8c052a4d5d924f99ac3ad4830dbedf2693e771af 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -2258,8 +2258,10 @@ static int mp_decode_frame(MPADecodeContext *s, static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; int out_size; @@ -2315,8 +2317,10 @@ static void flush(AVCodecContext *avctx){ #if CONFIG_MP3ADU_DECODER static int decode_frame_adu(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; int len, out_size; @@ -2459,8 +2463,10 @@ static av_cold int decode_close_mp3on4(AVCodecContext * avctx) static int decode_frame_mp3on4(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MP3On4DecodeContext *s = avctx->priv_data; MPADecodeContext *m; int fsize, len = buf_size, out_size = 0; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 615c0faf2252738f86e0ca442cdbf33a5f06f2ca..10dd48ca1ecf405583854ebb95345e67ead5ce15 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -795,7 +795,7 @@ int ff_h261_get_picture_format(int width, int height); int ff_h263_decode_init(AVCodecContext *avctx); int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size); + AVPacket *avpkt); int ff_h263_decode_end(AVCodecContext *avctx); void h263_encode_mb(MpegEncContext *s, DCTELEM block[6][64], diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 2b477d9427e807f823e9305aa5b40f5d2bf5cc1e..0d77e30c5efb257d826af05ba6815de142c2f0aa 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -63,8 +63,10 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) static int msrle_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MsrleContext *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 4b27b42ed1f75b7e124c739d4e6ba3c63180558b..78d358ed3288dff4e9b2a328c379d0ee61fad465 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -294,8 +294,10 @@ static void msvideo1_decode_16bit(Msvideo1Context *s) static int msvideo1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Msvideo1Context *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index ff70854800401af6abb6c4adbaf986dc454d6633..5ea2547a76265213d21cb70fb043023243092dcd 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -153,7 +153,9 @@ static av_cold int decode_init(AVCodecContext * avctx) { static int decode_tag(AVCodecContext * avctx, void *data, int *data_size, - const uint8_t * buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; NellyMoserDecodeContext *s = avctx->priv_data; int blocks, i; int16_t* samples; diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index a89953c29c1754c285e69985134e277fbf5a0b80..4f049baf901b529e9aced1d833e4004a1e294f19 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -128,7 +128,9 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit } static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; NuvContext *c = avctx->priv_data; AVFrame *picture = data; int orig_size = buf_size; diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index e8d6a798344119c3cb7a713b534a57fdc63d1e94..b30e2fe70bc89779c2c99d7a41e41b7cbfea3e09 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -323,8 +323,10 @@ static av_cold int pcm_decode_init(AVCodecContext * avctx) static int pcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; PCMDecode *s = avctx->priv_data; int sample_size, c, n; short *samples; diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index bf80e437fef8af660dde649bac0a3722c14adbf8..23a808d633dbc4c56d39df2a16fe88780b5d4dfe 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -70,7 +70,9 @@ static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) } static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; PCXContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index a3431525b6f08e7ecb3d3b80cf44b82710180c06..fadbcd07c945ec0acd92dae487e544abc6afa6a6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -379,8 +379,10 @@ static int png_decode_idat(PNGDecContext *s, int length) static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; PNGDecContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= &s->picture; diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index 69e6bed657b7624d4c464b9e293cfdd82637c788..2619d90c857c3ba1bd0d592968f2ef3712251246 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -34,8 +34,10 @@ static av_cold int common_init(AVCodecContext *avctx){ static int pnm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; PNMContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&s->picture; diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 2ab45b08a7c4b0eeae6ed7903b31714b332aca3c..67799fac9ec32b396f4972587e2c402f171aa419 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -36,7 +36,9 @@ static av_cold int ptx_init(AVCodecContext *avctx) { } static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; PTXContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 9bef200670f568b6dcdb12fcfb6532c0db5966a0..516965c7cfddf55a5d43001ddebab93ca4a88cb4 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -729,8 +729,10 @@ static void warn_insufficient_frame_quality(AVCodecContext *avctx, } static int qcelp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; QCELPContext *q = avctx->priv_data; float *outbuffer = data; int i; diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index a3373a16d963b98550f666ec1597bfcbe2f0892f..6dafd0aabddec28fec6d99590629b68a470d7dfa 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1968,8 +1968,10 @@ static void qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out) static int qdm2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; QDM2Context *s = avctx->priv_data; if(!buf) diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 4349e168e0301f1e610ade6a76ef8fcb2d520fb6..0f9609159ccfc64f41dfeefd64861b90431d31e8 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -34,8 +34,10 @@ typedef struct QdrawContext{ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; QdrawContext * const a = avctx->priv_data; AVFrame * const p= (AVFrame*)&a->pic; uint8_t* outdata; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index aa8f69c0cf079a901c4830c96e3069fdc737a989..64ab74b2b2ce10f656214ca962fc9ba9b7134f18 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -248,8 +248,10 @@ static void qpeg_decode_inter(const uint8_t *src, uint8_t *dst, int size, static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; QpegContext * const a = avctx->priv_data; AVFrame * const p= (AVFrame*)&a->pic; uint8_t* outdata; diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index d535c38dd9add5af2c954b762c70157131278a10..998ba702d8c637ba374a39c815245225af8e01e4 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -424,8 +424,10 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) static int qtrle_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; QtrleContext *s = avctx->priv_data; int header, start_line; int stream_ptr, height, row_ptr; diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 5126b07bdcef44985b74b42e9aae7bf2bc4d2ac9..a4e4943952e2ec8e2fe98452ce37a5819cea27fa 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -287,8 +287,10 @@ static int interp(RA144Context *ractx, int16_t *out, int a, /** Uncompress one block (20 bytes -> 160*2 bytes). */ static int ra144_decode_frame(AVCodecContext * avctx, void *vdata, - int *data_size, const uint8_t *buf, int buf_size) + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; unsigned int refl_rms[4]; // RMS of the reflection coefficients uint16_t block_coefs[4][30]; // LPC coefficients of each sub-block diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 746075e97263ceeda90122ec7e232e228e2c8252..437adb355b8c4ff92bdbbb01bb6963cf0e846068 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -160,9 +160,10 @@ static void backward_filter(float *hist, float *rec, const float *window, } static int ra288_decode_frame(AVCodecContext * avctx, void *data, - int *data_size, const uint8_t * buf, - int buf_size) + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; float *out = data; int i, j; RA288Context *ractx = avctx->priv_data; diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 963e148aa17d0d2e8cec8b784b0a6013bc78e44a..25f5c91aa75c2a28dba7b27308b87e7027da48f0 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -100,8 +100,10 @@ static void flip(AVCodecContext *avctx, AVPicture * picture){ static int raw_decode(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; RawVideoContext *context = avctx->priv_data; AVFrame * frame = (AVFrame *) data; diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 7cbaca077c8b08e1d746ee807605d15b5adb5ac6..afef8a77e8159ed08fbb73854685ea88b054d772 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -181,8 +181,10 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) */ static int rl2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Rl2Context *s = avctx->priv_data; if(s->frame.data[0]) diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index c9daec729fa5ed473fbc3d7cf1510ab7d84a9c60..64924a5ce682e7ce75fc004959d841ef33835415 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -169,8 +169,10 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) static int roq_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; RoqContext *s = avctx->priv_data; int copy= !s->current_frame->data[0]; diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index 27ed71f9371c743c801e4ecc00b7378250d8a176..ba276c55e0a1a6b790f433df01467a7d16cd83dd 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -241,8 +241,10 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) static int rpza_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; RpzaContext *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 71a25d650fffc1d01e8dab0ede61878a74a776e5..99fb904417266d8fcf1bac18e6a5c7e50263856f 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -727,8 +727,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int i; AVFrame *pict = data; diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 66036414d547cc44753f9734b8bfc147dead3b6e..0e83f77ff5ba55881bebd9fb50c00c2e00e8bf89 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1370,8 +1370,10 @@ static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n) int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; AVFrame *pict = data; diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h index b14ba828ddfb3dad84e1fde055090389da1e6a7d..a4f768eb2a3f10aa83a2538b5256522ce605fb4e 100644 --- a/libavcodec/rv34.h +++ b/libavcodec/rv34.h @@ -123,7 +123,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, const uint8_t *buf, int buf_size); +int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt); int ff_rv34_decode_end(AVCodecContext *avctx); #endif /* AVCODEC_RV34_H */ diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index f6ca7438ee0a2dd9793cc42cf6e498aea0757d7e..dadbc19d2228bea5438659b48be92bb23c18581f 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -147,8 +147,10 @@ static int read_uncompressed_sgi(unsigned char* out_buf, uint8_t* out_end, static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *in_buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *in_buf = avpkt->data; + int buf_size = avpkt->size; SgiState *s = avctx->priv_data; AVFrame *picture = data; AVFrame *p = &s->picture; diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 053f5c2ed1a8afb94345cd00b85f9576dee05a25..8f7149af0abbb443dd46461e0326a7fb6954fc82 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -269,8 +269,10 @@ static void decode_subframe_lpc(ShortenContext *s, int channel, int residual_siz static int shorten_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; ShortenContext *s = avctx->priv_data; int i, input_buf_size = 0; int16_t *samples = data; diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index ad5827ea22bf3b812a9106451c95b9de8a5cf0e1..ac638f852269ab904aaea15200f56ca5cdb482f8 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -345,8 +345,10 @@ 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, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SmackVContext * const smk = avctx->priv_data; uint8_t *out; uint32_t *pal; @@ -565,8 +567,10 @@ static av_cold int smka_decode_init(AVCodecContext *avctx) /** * Decode Smacker audio data */ -static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; GetBitContext gb; HuffContext h[4]; VLC vlc[4]; diff --git a/libavcodec/smc.c b/libavcodec/smc.c index d0102eaa9c8a6992f7369a5f5c7b0ed95ae0dc81..75ecd4f18663f0c4bcbd3e95beaeed6961eaabce 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -441,8 +441,10 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) static int smc_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SmcContext *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/snow.c b/libavcodec/snow.c index ca85ad676d10749e4db0b4082d78d9ece169c32c..a8de940949f2a01e0eb8719f1dba06d94dc0f2ef 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -4483,7 +4483,9 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){ +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SnowContext *s = avctx->priv_data; RangeCoder * const c= &s->c; int bytes_read; diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 14e19ad6391dfe0b7d5e87aa2e8b59dbeeb0960d..7db8b3c95719325e848ceca8cb094dc03f431f5e 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -851,8 +851,10 @@ static av_cold int sonic_decode_close(AVCodecContext *avctx) static int sonic_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SonicContext *s = avctx->priv_data; GetBitContext gb; int i, quant, ch, j; diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 920b32d8cd0f5945f0da5d8a4ab6b9f654eacc1d..62214aadd3afcb2689a0f34c75c53650ef958820 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -32,8 +32,11 @@ static int sp5x_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + AVPacket avpkt_recoded; #if 0 MJpegDecodeContext *s = avctx->priv_data; #endif @@ -89,7 +92,10 @@ static int sp5x_decode_frame(AVCodecContext *avctx, recoded[j++] = 0xD9; avctx->flags &= ~CODEC_FLAG_EMU_EDGE; - i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j); + av_init_packet(&avpkt_recoded); + avpkt_recoded.data = recoded; + avpkt_recoded.size = j; + i = ff_mjpeg_decode_frame(avctx, data, data_size, &avpkt_recoded); av_free(recoded); diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index f7a7f9c6c03b26a54f1c61029cded2c8e9095b07..8a78f1aab4e6ac0b8141a5d270d129a401742ebb 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -43,7 +43,9 @@ static av_cold int sunrast_init(AVCodecContext *avctx) { } static int sunrast_decode_frame(AVCodecContext *avctx, void *data, - int *data_size, const uint8_t *buf, int buf_size) { + int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SUNRASTContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 7fef10bb99bd62883e23a461f5b849fd9dba3ac5..225c9e8c4d562e9d2dc34475ae6766b789fa6505 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -642,8 +642,10 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) { static int svq1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MpegEncContext *s=avctx->priv_data; uint8_t *current, *previous; int result, i, x, y, width, height; diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index bef7075a2626e273f18bd6ddd90142b1cbff2e57..28dacf79a2e7ec31ad5211a37b1df01ed56f693c 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -889,8 +889,10 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) static int svq3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; MpegEncContext *const s = avctx->priv_data; H264Context *const h = avctx->priv_data; int m, mb_type; diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 56a6876ec4a30f8f9cd98cd9201dd0df70a9ad1f..10b1aa47f251fc5b5800b4cb3c50e8641ff092d7 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -91,8 +91,10 @@ static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TargaContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&s->picture; diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index fdf635864e5ed4c77ad45032e0157f5c13f04d8a..09703707134487e17f3442b7b875a7465a631026 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -187,8 +187,10 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) static int seqvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; SeqVideoContext *seq = avctx->priv_data; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 503f8312f0690f2db7e9a1cfe40a1d0d37f38b74..78051933c9c45f47fbb2161c15d351d9107e9577 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -404,8 +404,10 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t * static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TiffContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&s->picture; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index 1cf56ed3dd53da8cb76c8a074e5266aad8c3612d..303dfb5c15fc5f46716697397ba13f47d97bb0b1 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -846,8 +846,10 @@ static void truemotion1_decode_24bit(TrueMotion1Context *s) static int truemotion1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TrueMotion1Context *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 6349565f2d784d1f2eff52b79ac256cc4d9290d7..b3289162ee0f943885fe01122345512cbdf1176f 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -763,8 +763,10 @@ static const int tm2_stream_order[TM2_NUM_STREAMS] = { static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TM2Context * const l = avctx->priv_data; AVFrame * const p= (AVFrame*)&l->pic; int i, skip, t; diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index df5d57bbcc35fde40d6555ec6da32b3363473201..598d414832a3e8f8d9e7198f22ec8d838f355a3f 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -332,8 +332,10 @@ static void truespeech_save_prevvec(TSContext *c) static int truespeech_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TSContext *c = avctx->priv_data; int i, j; diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index 0ffb1644ba8c2053c5671a2e673fa92dc1240e6f..8e5edbd6083955532aaf29a47e6e7f4c76fc4711 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -67,8 +67,10 @@ typedef struct TsccContext { * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; CamtasiaContext * const c = avctx->priv_data; const unsigned char *encoded = buf; unsigned char *outptr; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 5536aa4cd9bec8b99d2359199bbab48d55f0ed63..3ab31e66295acac3a8ae70a6963a2352964efa13 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -287,8 +287,10 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) static int tta_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TTAContext *s = avctx->priv_data; int i; diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 44bbad4cab10da800b6259d448fc4fce7084f98f..d2c743feed74f1fa37c6340f2c0dde5abd9edd48 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -39,7 +39,9 @@ static av_cold int txd_init(AVCodecContext *avctx) { } static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; TXDContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index efc05924c361c8f5b7551b62d3f3e6c44419dc97..31649f865839032ff6c2e32cd7a486b10cc92e01 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -200,8 +200,10 @@ 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, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; UltimotionDecodeContext *s=avctx->priv_data; int modifier = 0; int uniq = 0; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4113382997d7f9eab158e260877d48bbedb2a733..f39b49d5119845c05eef511c9cc042924632151b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -524,18 +524,32 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, return ret; } +#if LIBAVCODEC_VERSION_MAJOR < 53 int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const uint8_t *buf, int buf_size) +{ + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = buf; + avpkt.size = buf_size; + + return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt); +} +#endif + +int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, + int *got_picture_ptr, + AVPacket *avpkt) { int ret; *got_picture_ptr= 0; if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)) return -1; - if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){ + if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){ ret = avctx->codec->decode(avctx, picture, got_picture_ptr, - buf, buf_size); + avpkt); emms_c(); //needed to avoid an emms_c() call before every return; @@ -547,13 +561,27 @@ int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *pic return ret; } +#if LIBAVCODEC_VERSION_MAJOR < 53 int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size) +{ + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = buf; + avpkt.size = buf_size; + + return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt); +} +#endif + +int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, + int *frame_size_ptr, + AVPacket *avpkt) { int ret; - if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){ + if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){ //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){ av_log(avctx, AV_LOG_ERROR, "buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE\n"); @@ -565,8 +593,7 @@ int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *sa return -1; } - ret = avctx->codec->decode(avctx, samples, frame_size_ptr, - buf, buf_size); + ret = avctx->codec->decode(avctx, samples, frame_size_ptr, avpkt); avctx->frame_number++; }else{ ret= 0; @@ -575,15 +602,28 @@ int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *sa return ret; } +#if LIBAVCODEC_VERSION_MAJOR < 53 int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size) +{ + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = buf; + avpkt.size = buf_size; + + return avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, &avpkt); +} +#endif + +int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, + AVPacket *avpkt) { int ret; *got_sub_ptr = 0; - ret = avctx->codec->decode(avctx, sub, got_sub_ptr, - buf, buf_size); + ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt); if (*got_sub_ptr) avctx->frame_number++; return ret; diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 4c927888975558f242e9d38da5adcd84dec2b227..b95fa1a9c7c9f645d0367432310863ddc1682883 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -173,8 +173,10 @@ static int vb_decode_framedata(VBDecContext *c, const uint8_t *buf, int offset) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VBDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr; int i, j; diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 3c391c678a7bdc5e62c2475d01ce050b4f1c2362..f3d3cd4ed1bc43e787b1573143a4edae5347a1df 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -4136,8 +4136,10 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) */ static int vc1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VC1Context *v = avctx->priv_data; MpegEncContext *s = &v->s; AVFrame *pict = data; diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 21136289d510cd0946dd201cb46a6c8c00e2abb4..6218c7c63483ea32b40ec1c9914574acf8569af7 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -43,8 +43,10 @@ typedef struct VCR1Context{ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VCR1Context * const a = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&a->picture; diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 1921c81ca2726e3be54c1046d6ab6183c3351b72..2c24355a5fee9a55a971deb199d7b0094fc5a835 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -366,8 +366,10 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx) static int vmdvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VmdVideoContext *s = avctx->priv_data; s->buf = buf; @@ -521,8 +523,10 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data, static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VmdAudioContext *s = avctx->priv_data; unsigned char *output_samples = (unsigned char *)data; diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index c7efaf8a2f958558764cf00dba8d47f2eff0b3c1..fb78449d28506a53781bb25553550fa58b6e37cb 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -284,8 +284,10 @@ 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, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VmncContext * const c = avctx->priv_data; uint8_t *outptr; const uint8_t *src = buf; diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c index 6ca8763bb3ff43700dc7ec43bef2ebffe78163c9..77dbfa2e93e278c02c755873741eae0b18e3ea85 100644 --- a/libavcodec/vorbis_dec.c +++ b/libavcodec/vorbis_dec.c @@ -1560,8 +1560,10 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) { static int vorbis_decode_frame(AVCodecContext *avccontext, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; vorbis_context *vc = avccontext->priv_data ; GetBitContext *gb = &(vc->gb); const float *channel_ptrs[vc->audio_channels]; diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 64901616cca8634dad42a1bf277f28ab1eda6a7a..33d6c8f74b69b8aac684eaf8d208e3ab57c43f07 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1800,8 +1800,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) */ static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; static int counter = 0; diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 00df736d3bd6a98a4f17c5a9ba691aca0dd1af0a..5026989070b9a9dc433e59eb0dc9eaf4aa709e49 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -565,8 +565,10 @@ static void vqa_decode_chunk(VqaContext *s) static int vqa_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VqaContext *s = avctx->priv_data; s->buf = buf; diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 12eac33fe7685c9619c50303f172f8b0baad26f1..1c1406f8c73ea275bbd330afefe568cbe49acd62 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -476,8 +476,10 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx) static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; WavpackContext *s = avctx->priv_data; int16_t *samples = data; int samplecount; diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index e7936ce49f2e668100ca9caa35b2ac2d90395dda..323f69d303bb8f913d3dd10dfe0b0e34a8bfb983 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -752,8 +752,10 @@ static int wma_decode_frame(WMACodecContext *s, int16_t *samples) static int wma_decode_superframe(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; WMACodecContext *s = avctx->priv_data; int nb_frames, bit_offset, i, pos, len; uint8_t *q; diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 7c0105f1eff85f3ba7359266e7acf9d37c7a0179..fa3a308dc06bd6b31ede29f8dee1ededc67fc78d 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -58,8 +58,10 @@ static inline int wnv1_get_code(WNV1Context *w, int base_value) static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; WNV1Context * const l = avctx->priv_data; AVFrame * const p= (AVFrame*)&l->pic; unsigned char *Y,*U,*V; diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index b27b155135901468cebb3725a80878c76d05f0c0..85e04f55d4fba4d58ad1d684459f2fc040573a15 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -48,8 +48,10 @@ static av_cold int ws_snd_decode_init(AVCodecContext * avctx) static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; // WSSNDContext *c = avctx->priv_data; int in_size, out_size; diff --git a/libavcodec/xan.c b/libavcodec/xan.c index e269c2fcf63a1cd8fe2866e3d770250b3aad69c3..65c65283b18e7f57826dae05bac1818c60741480 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -405,8 +405,10 @@ static void xan_wc4_decode_frame(XanContext *s) { static int xan_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; XanContext *s = avctx->priv_data; AVPaletteControl *palette_control = avctx->palctrl; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index ccff40e17a4bef7943f54abf9b9a523a531880ce..fb4241f255aeae5d901be84c9a1e40c46ebf8fb7 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -40,8 +40,10 @@ static const int xl_table[32] = { static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; VideoXLContext * const a = avctx->priv_data; AVFrame * const p= (AVFrame*)&a->pic; uint8_t *Y, *U, *V; diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 35b00a54b4c489a69f1bcba7c8ec13d492f4c62f..942db0cd1bf64bb36b651d5ea03dd14e50f13fa6 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -44,7 +44,9 @@ static uint64_t parse_timecode(const uint8_t *buf) { } static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) { + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; AVSubtitle *sub = data; const uint8_t *buf_end = buf + buf_size; uint8_t *bitmap; diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 33c1087e2d88bbf6e1838f99ea45361df825c4ab..7b3c7dd3f6dbb32c18df654ade3a28cff0e91004 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -392,8 +392,10 @@ static int zmbv_decode_intra(ZmbvContext *c) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; ZmbvContext * const c = avctx->priv_data; uint8_t *outptr; int zret = Z_OK; // Zlib return code