# HG changeset patch # User rbultje # Date 1239119990 0 # Node ID 54bc8a2727b0aec4ae1736961710745e7c0f149e # Parent 17430938651245b57699bd2f8fdb3870a0a4fd1d Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows passing of packet-specific flags from demuxer to decoder, such as the keyframe flag, which appears necessary to playback corePNG P-frames. Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread "Google Summer of Code participation" on the mailinglist. diff -r 174309386512 -r 54bc8a2727b0 4xm.c --- a/4xm.c Tue Apr 07 15:37:26 2009 +0000 +++ b/4xm.c Tue Apr 07 15:59:50 2009 +0000 @@ -677,8 +677,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 8bps.c --- a/8bps.c Tue Apr 07 15:37:26 2009 +0000 +++ b/8bps.c Tue Apr 07 15:59:50 2009 +0000 @@ -58,8 +58,10 @@ * 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 -r 174309386512 -r 54bc8a2727b0 8svx.c --- a/8svx.c Tue Apr 07 15:37:26 2009 +0000 +++ b/8svx.c Tue Apr 07 15:59:50 2009 +0000 @@ -42,8 +42,10 @@ /** 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 -r 174309386512 -r 54bc8a2727b0 aac.c --- a/aac.c Tue Apr 07 15:37:26 2009 +0000 +++ b/aac.c Tue Apr 07 15:59:50 2009 +0000 @@ -1604,7 +1604,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 aasc.c --- a/aasc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/aasc.c Tue Apr 07 15:59:50 2009 +0000 @@ -59,8 +59,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 ac3dec.c --- a/ac3dec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ac3dec.c Tue Apr 07 15:59:50 2009 +0000 @@ -1226,8 +1226,10 @@ * 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 -r 174309386512 -r 54bc8a2727b0 adpcm.c --- a/adpcm.c Tue Apr 07 15:37:26 2009 +0000 +++ b/adpcm.c Tue Apr 07 15:59:50 2009 +0000 @@ -877,8 +877,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 adxdec.c --- a/adxdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/adxdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -104,8 +104,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 alac.c --- a/alac.c Tue Apr 07 15:37:26 2009 +0000 +++ b/alac.c Tue Apr 07 15:59:50 2009 +0000 @@ -400,8 +400,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 apedec.c --- a/apedec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/apedec.c Tue Apr 07 15:59:50 2009 +0000 @@ -806,8 +806,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 asv1.c --- a/asv1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/asv1.c Tue Apr 07 15:59:50 2009 +0000 @@ -387,8 +387,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 atrac3.c --- a/atrac3.c Tue Apr 07 15:37:26 2009 +0000 +++ b/atrac3.c Tue Apr 07 15:59:50 2009 +0000 @@ -878,7 +878,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 avcodec.h --- a/avcodec.h Tue Apr 07 15:37:26 2009 +0000 +++ b/avcodec.h Tue Apr 07 15:59:50 2009 +0000 @@ -2429,8 +2429,7 @@ 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_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 @@ * @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, + AVPacket *avpkt); + +#if LIBAVCODEC_VERSION_MAJOR < 53 +/** + * Decodes a video frame from \p buf into \p picture. + * 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 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 + * 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 @@ * @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 @@ * 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 -r 174309386512 -r 54bc8a2727b0 avs.c --- a/avs.c Tue Apr 07 15:37:26 2009 +0000 +++ b/avs.c Tue Apr 07 15:59:50 2009 +0000 @@ -44,8 +44,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 bethsoftvideo.c --- a/bethsoftvideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/bethsoftvideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -58,8 +58,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 bfi.c --- a/bfi.c Tue Apr 07 15:37:26 2009 +0000 +++ b/bfi.c Tue Apr 07 15:59:50 2009 +0000 @@ -45,9 +45,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 bmp.c --- a/bmp.c Tue Apr 07 15:37:26 2009 +0000 +++ b/bmp.c Tue Apr 07 15:59:50 2009 +0000 @@ -35,8 +35,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 c93.c --- a/c93.c Tue Apr 07 15:37:26 2009 +0000 +++ b/c93.c Tue Apr 07 15:59:50 2009 +0000 @@ -113,8 +113,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 cavsdec.c --- a/cavsdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cavsdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -625,7 +625,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 cinepak.c --- a/cinepak.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cinepak.c Tue Apr 07 15:59:50 2009 +0000 @@ -411,8 +411,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 cljr.c --- a/cljr.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cljr.c Tue Apr 07 15:59:50 2009 +0000 @@ -42,8 +42,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 cook.c --- a/cook.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cook.c Tue Apr 07 15:59:50 2009 +0000 @@ -979,7 +979,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 cscd.c --- a/cscd.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cscd.c Tue Apr 07 15:59:50 2009 +0000 @@ -135,7 +135,9 @@ #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 -r 174309386512 -r 54bc8a2727b0 cyuv.c --- a/cyuv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/cyuv.c Tue Apr 07 15:59:50 2009 +0000 @@ -60,8 +60,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 dca.c --- a/dca.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dca.c Tue Apr 07 15:59:50 2009 +0000 @@ -1209,8 +1209,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 dnxhddec.c --- a/dnxhddec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dnxhddec.c Tue Apr 07 15:59:50 2009 +0000 @@ -278,8 +278,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 dpcm.c --- a/dpcm.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dpcm.c Tue Apr 07 15:59:50 2009 +0000 @@ -161,8 +161,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 dsicinav.c --- a/dsicinav.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dsicinav.c Tue Apr 07 15:59:50 2009 +0000 @@ -195,8 +195,10 @@ 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 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 -r 174309386512 -r 54bc8a2727b0 dv.c --- a/dv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dv.c Tue Apr 07 15:59:50 2009 +0000 @@ -1111,8 +1111,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 dvbsubdec.c --- a/dvbsubdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dvbsubdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -1345,8 +1345,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 dvdsubdec.c --- a/dvdsubdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dvdsubdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -475,8 +475,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 dxa.c --- a/dxa.c Tue Apr 07 15:37:26 2009 +0000 +++ b/dxa.c Tue Apr 07 15:59:50 2009 +0000 @@ -188,8 +188,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 eacmv.c --- a/eacmv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/eacmv.c Tue Apr 07 15:59:50 2009 +0000 @@ -144,8 +144,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 eatgq.c --- a/eatgq.c Tue Apr 07 15:37:26 2009 +0000 +++ b/eatgq.c Tue Apr 07 15:59:50 2009 +0000 @@ -190,7 +190,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 eatgv.c --- a/eatgv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/eatgv.c Tue Apr 07 15:59:50 2009 +0000 @@ -237,8 +237,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 eatqi.c --- a/eatqi.c Tue Apr 07 15:37:26 2009 +0000 +++ b/eatqi.c Tue Apr 07 15:59:50 2009 +0000 @@ -101,8 +101,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 escape124.c --- a/escape124.c Tue Apr 07 15:37:26 2009 +0000 +++ b/escape124.c Tue Apr 07 15:59:50 2009 +0000 @@ -206,8 +206,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 ffv1.c --- a/ffv1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ffv1.c Tue Apr 07 15:59:50 2009 +0000 @@ -936,7 +936,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 flacdec.c --- a/flacdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/flacdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -636,8 +636,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 flashsv.c --- a/flashsv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/flashsv.c Tue Apr 07 15:59:50 2009 +0000 @@ -102,8 +102,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 flicvideo.c --- a/flicvideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/flicvideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -701,8 +701,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 fraps.c --- a/fraps.c Tue Apr 07 15:37:26 2009 +0000 +++ b/fraps.c Tue Apr 07 15:59:50 2009 +0000 @@ -130,8 +130,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 g726.c --- a/g726.c Tue Apr 07 15:37:26 2009 +0000 +++ b/g726.c Tue Apr 07 15:59:50 2009 +0000 @@ -363,8 +363,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 gifdec.c --- a/gifdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/gifdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -282,8 +282,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 h261dec.c --- a/h261dec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/h261dec.c Tue Apr 07 15:59:50 2009 +0000 @@ -543,8 +543,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 h263dec.c --- a/h263dec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/h263dec.c Tue Apr 07 15:59:50 2009 +0000 @@ -331,8 +331,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 h264.c --- a/h264.c Tue Apr 07 15:37:26 2009 +0000 +++ b/h264.c Tue Apr 07 15:59:50 2009 +0000 @@ -7618,8 +7618,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 huffyuv.c --- a/huffyuv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/huffyuv.c Tue Apr 07 15:59:50 2009 +0000 @@ -942,7 +942,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 idcinvideo.c --- a/idcinvideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/idcinvideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -209,8 +209,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 imc.c --- a/imc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/imc.c Tue Apr 07 15:59:50 2009 +0000 @@ -639,8 +639,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 indeo2.c --- a/indeo2.c Tue Apr 07 15:37:26 2009 +0000 +++ b/indeo2.c Tue Apr 07 15:59:50 2009 +0000 @@ -136,8 +136,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 indeo3.c --- a/indeo3.c Tue Apr 07 15:37:26 2009 +0000 +++ b/indeo3.c Tue Apr 07 15:59:50 2009 +0000 @@ -1062,8 +1062,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 interplayvideo.c --- a/interplayvideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/interplayvideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -639,8 +639,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 kmvc.c --- a/kmvc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/kmvc.c Tue Apr 07 15:59:50 2009 +0000 @@ -224,9 +224,10 @@ } } -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 -r 174309386512 -r 54bc8a2727b0 lcldec.c --- a/lcldec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/lcldec.c Tue Apr 07 15:59:50 2009 +0000 @@ -161,8 +161,10 @@ * 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 -r 174309386512 -r 54bc8a2727b0 libamr.c --- a/libamr.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libamr.c Tue Apr 07 15:59:50 2009 +0000 @@ -245,8 +245,10 @@ 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_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 -r 174309386512 -r 54bc8a2727b0 libdiracdec.c --- a/libdiracdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libdiracdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -77,8 +77,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 libfaad.c --- a/libfaad.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libfaad.c Tue Apr 07 15:59:50 2009 +0000 @@ -149,8 +149,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 libgsm.c --- a/libgsm.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libgsm.c Tue Apr 07 15:59:50 2009 +0000 @@ -138,7 +138,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 libopenjpeg.c --- a/libopenjpeg.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libopenjpeg.c Tue Apr 07 15:59:50 2009 +0000 @@ -58,8 +58,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 libschroedingerdec.c --- a/libschroedingerdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libschroedingerdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -207,8 +207,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 libspeexdec.c --- a/libspeexdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/libspeexdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -90,8 +90,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 loco.c --- a/loco.c Tue Apr 07 15:37:26 2009 +0000 +++ b/loco.c Tue Apr 07 15:59:50 2009 +0000 @@ -158,8 +158,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mace.c --- a/mace.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mace.c Tue Apr 07 15:59:50 2009 +0000 @@ -236,8 +236,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mdec.c --- a/mdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -154,8 +154,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mimic.c --- a/mimic.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mimic.c Tue Apr 07 15:59:50 2009 +0000 @@ -274,8 +274,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 mjpegbdec.c --- a/mjpegbdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mjpegbdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -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 -r 174309386512 -r 54bc8a2727b0 mjpegdec.c --- a/mjpegdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mjpegdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -1258,8 +1258,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mjpegdec.h --- a/mjpegdec.h Tue Apr 07 15:37:26 2009 +0000 +++ b/mjpegdec.h Tue Apr 07 15:59:50 2009 +0000 @@ -106,7 +106,7 @@ 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 -r 174309386512 -r 54bc8a2727b0 mlpdec.c --- a/mlpdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mlpdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -904,8 +904,10 @@ * 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 -r 174309386512 -r 54bc8a2727b0 mmvideo.c --- a/mmvideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mmvideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -159,8 +159,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 motionpixels.c --- a/motionpixels.c Tue Apr 07 15:37:26 2009 +0000 +++ b/motionpixels.c Tue Apr 07 15:59:50 2009 +0000 @@ -281,8 +281,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mpc7.c --- a/mpc7.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mpc7.c Tue Apr 07 15:59:50 2009 +0000 @@ -156,8 +156,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mpc8.c --- a/mpc8.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mpc8.c Tue Apr 07 15:59:50 2009 +0000 @@ -180,8 +180,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 mpeg12.c --- a/mpeg12.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mpeg12.c Tue Apr 07 15:59:50 2009 +0000 @@ -2260,8 +2260,10 @@ /* 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 -r 174309386512 -r 54bc8a2727b0 mpegaudiodec.c --- a/mpegaudiodec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/mpegaudiodec.c Tue Apr 07 15:59:50 2009 +0000 @@ -2258,8 +2258,10 @@ 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 @@ #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 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 -r 174309386512 -r 54bc8a2727b0 mpegvideo.h --- a/mpegvideo.h Tue Apr 07 15:37:26 2009 +0000 +++ b/mpegvideo.h Tue Apr 07 15:59:50 2009 +0000 @@ -795,7 +795,7 @@ 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 -r 174309386512 -r 54bc8a2727b0 msrle.c --- a/msrle.c Tue Apr 07 15:37:26 2009 +0000 +++ b/msrle.c Tue Apr 07 15:59:50 2009 +0000 @@ -63,8 +63,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 msvideo1.c --- a/msvideo1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/msvideo1.c Tue Apr 07 15:59:50 2009 +0000 @@ -294,8 +294,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 nellymoserdec.c --- a/nellymoserdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/nellymoserdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -153,7 +153,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 nuv.c --- a/nuv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/nuv.c Tue Apr 07 15:59:50 2009 +0000 @@ -128,7 +128,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 pcm.c --- a/pcm.c Tue Apr 07 15:37:26 2009 +0000 +++ b/pcm.c Tue Apr 07 15:59:50 2009 +0000 @@ -323,8 +323,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 pcx.c --- a/pcx.c Tue Apr 07 15:37:26 2009 +0000 +++ b/pcx.c Tue Apr 07 15:59:50 2009 +0000 @@ -70,7 +70,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 pngdec.c --- a/pngdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/pngdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -379,8 +379,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 pnmenc.c --- a/pnmenc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/pnmenc.c Tue Apr 07 15:59:50 2009 +0000 @@ -34,8 +34,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 ptx.c --- a/ptx.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ptx.c Tue Apr 07 15:59:50 2009 +0000 @@ -36,7 +36,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 qcelpdec.c --- a/qcelpdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/qcelpdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -729,8 +729,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 qdm2.c --- a/qdm2.c Tue Apr 07 15:37:26 2009 +0000 +++ b/qdm2.c Tue Apr 07 15:59:50 2009 +0000 @@ -1968,8 +1968,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 qdrw.c --- a/qdrw.c Tue Apr 07 15:37:26 2009 +0000 +++ b/qdrw.c Tue Apr 07 15:59:50 2009 +0000 @@ -34,8 +34,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 qpeg.c --- a/qpeg.c Tue Apr 07 15:37:26 2009 +0000 +++ b/qpeg.c Tue Apr 07 15:59:50 2009 +0000 @@ -248,8 +248,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 qtrle.c --- a/qtrle.c Tue Apr 07 15:37:26 2009 +0000 +++ b/qtrle.c Tue Apr 07 15:59:50 2009 +0000 @@ -424,8 +424,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 ra144.c --- a/ra144.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ra144.c Tue Apr 07 15:59:50 2009 +0000 @@ -287,8 +287,10 @@ /** 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 -r 174309386512 -r 54bc8a2727b0 ra288.c --- a/ra288.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ra288.c Tue Apr 07 15:59:50 2009 +0000 @@ -160,9 +160,10 @@ } 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 -r 174309386512 -r 54bc8a2727b0 rawdec.c --- a/rawdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/rawdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -100,8 +100,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 rl2.c --- a/rl2.c Tue Apr 07 15:37:26 2009 +0000 +++ b/rl2.c Tue Apr 07 15:59:50 2009 +0000 @@ -181,8 +181,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 roqvideodec.c --- a/roqvideodec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/roqvideodec.c Tue Apr 07 15:59:50 2009 +0000 @@ -169,8 +169,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 rpza.c --- a/rpza.c Tue Apr 07 15:37:26 2009 +0000 +++ b/rpza.c Tue Apr 07 15:59:50 2009 +0000 @@ -241,8 +241,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 rv10.c --- a/rv10.c Tue Apr 07 15:37:26 2009 +0000 +++ b/rv10.c Tue Apr 07 15:59:50 2009 +0000 @@ -727,8 +727,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 rv34.c --- a/rv34.c Tue Apr 07 15:37:26 2009 +0000 +++ b/rv34.c Tue Apr 07 15:59:50 2009 +0000 @@ -1370,8 +1370,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 rv34.h --- a/rv34.h Tue Apr 07 15:37:26 2009 +0000 +++ b/rv34.h Tue Apr 07 15:59:50 2009 +0000 @@ -123,7 +123,7 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 sgidec.c --- a/sgidec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/sgidec.c Tue Apr 07 15:59:50 2009 +0000 @@ -147,8 +147,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 shorten.c --- a/shorten.c Tue Apr 07 15:37:26 2009 +0000 +++ b/shorten.c Tue Apr 07 15:59:50 2009 +0000 @@ -269,8 +269,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 smacker.c --- a/smacker.c Tue Apr 07 15:37:26 2009 +0000 +++ b/smacker.c Tue Apr 07 15:59:50 2009 +0000 @@ -345,8 +345,10 @@ 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 @@ /** * 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 -r 174309386512 -r 54bc8a2727b0 smc.c --- a/smc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/smc.c Tue Apr 07 15:59:50 2009 +0000 @@ -441,8 +441,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 snow.c --- a/snow.c Tue Apr 07 15:37:26 2009 +0000 +++ b/snow.c Tue Apr 07 15:59:50 2009 +0000 @@ -4483,7 +4483,9 @@ 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 -r 174309386512 -r 54bc8a2727b0 sonic.c --- a/sonic.c Tue Apr 07 15:37:26 2009 +0000 +++ b/sonic.c Tue Apr 07 15:59:50 2009 +0000 @@ -851,8 +851,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 sp5xdec.c --- a/sp5xdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/sp5xdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -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 @@ 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 -r 174309386512 -r 54bc8a2727b0 sunrast.c --- a/sunrast.c Tue Apr 07 15:37:26 2009 +0000 +++ b/sunrast.c Tue Apr 07 15:59:50 2009 +0000 @@ -43,7 +43,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 svq1dec.c --- a/svq1dec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/svq1dec.c Tue Apr 07 15:59:50 2009 +0000 @@ -642,8 +642,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 svq3.c --- a/svq3.c Tue Apr 07 15:37:26 2009 +0000 +++ b/svq3.c Tue Apr 07 15:59:50 2009 +0000 @@ -889,8 +889,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 targa.c --- a/targa.c Tue Apr 07 15:37:26 2009 +0000 +++ b/targa.c Tue Apr 07 15:59:50 2009 +0000 @@ -91,8 +91,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 tiertexseqv.c --- a/tiertexseqv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/tiertexseqv.c Tue Apr 07 15:59:50 2009 +0000 @@ -187,8 +187,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 tiff.c --- a/tiff.c Tue Apr 07 15:37:26 2009 +0000 +++ b/tiff.c Tue Apr 07 15:59:50 2009 +0000 @@ -404,8 +404,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 truemotion1.c --- a/truemotion1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/truemotion1.c Tue Apr 07 15:59:50 2009 +0000 @@ -846,8 +846,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 truemotion2.c --- a/truemotion2.c Tue Apr 07 15:37:26 2009 +0000 +++ b/truemotion2.c Tue Apr 07 15:59:50 2009 +0000 @@ -763,8 +763,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 truespeech.c --- a/truespeech.c Tue Apr 07 15:37:26 2009 +0000 +++ b/truespeech.c Tue Apr 07 15:59:50 2009 +0000 @@ -332,8 +332,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 tscc.c --- a/tscc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/tscc.c Tue Apr 07 15:59:50 2009 +0000 @@ -67,8 +67,10 @@ * 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 -r 174309386512 -r 54bc8a2727b0 tta.c --- a/tta.c Tue Apr 07 15:37:26 2009 +0000 +++ b/tta.c Tue Apr 07 15:59:50 2009 +0000 @@ -287,8 +287,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 txd.c --- a/txd.c Tue Apr 07 15:37:26 2009 +0000 +++ b/txd.c Tue Apr 07 15:59:50 2009 +0000 @@ -39,7 +39,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 ulti.c --- a/ulti.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ulti.c Tue Apr 07 15:59:50 2009 +0000 @@ -200,8 +200,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 utils.c --- a/utils.c Tue Apr 07 15:37:26 2009 +0000 +++ b/utils.c Tue Apr 07 15:59:50 2009 +0000 @@ -524,18 +524,32 @@ 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 @@ 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 @@ 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 @@ 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 -r 174309386512 -r 54bc8a2727b0 vb.c --- a/vb.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vb.c Tue Apr 07 15:59:50 2009 +0000 @@ -173,8 +173,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 vc1.c --- a/vc1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vc1.c Tue Apr 07 15:59:50 2009 +0000 @@ -4136,8 +4136,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 vcr1.c --- a/vcr1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vcr1.c Tue Apr 07 15:59:50 2009 +0000 @@ -43,8 +43,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 vmdav.c --- a/vmdav.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vmdav.c Tue Apr 07 15:59:50 2009 +0000 @@ -366,8 +366,10 @@ 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_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 -r 174309386512 -r 54bc8a2727b0 vmnc.c --- a/vmnc.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vmnc.c Tue Apr 07 15:59:50 2009 +0000 @@ -284,8 +284,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 vorbis_dec.c --- a/vorbis_dec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vorbis_dec.c Tue Apr 07 15:59:50 2009 +0000 @@ -1560,8 +1560,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 vp3.c --- a/vp3.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vp3.c Tue Apr 07 15:59:50 2009 +0000 @@ -1800,8 +1800,10 @@ */ 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 -r 174309386512 -r 54bc8a2727b0 vqavideo.c --- a/vqavideo.c Tue Apr 07 15:37:26 2009 +0000 +++ b/vqavideo.c Tue Apr 07 15:59:50 2009 +0000 @@ -565,8 +565,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 wavpack.c --- a/wavpack.c Tue Apr 07 15:37:26 2009 +0000 +++ b/wavpack.c Tue Apr 07 15:59:50 2009 +0000 @@ -476,8 +476,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 wmadec.c --- a/wmadec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/wmadec.c Tue Apr 07 15:59:50 2009 +0000 @@ -752,8 +752,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 wnv1.c --- a/wnv1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/wnv1.c Tue Apr 07 15:59:50 2009 +0000 @@ -58,8 +58,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 ws-snd1.c --- a/ws-snd1.c Tue Apr 07 15:37:26 2009 +0000 +++ b/ws-snd1.c Tue Apr 07 15:59:50 2009 +0000 @@ -48,8 +48,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 xan.c --- a/xan.c Tue Apr 07 15:37:26 2009 +0000 +++ b/xan.c Tue Apr 07 15:59:50 2009 +0000 @@ -405,8 +405,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 xl.c --- a/xl.c Tue Apr 07 15:37:26 2009 +0000 +++ b/xl.c Tue Apr 07 15:59:50 2009 +0000 @@ -40,8 +40,10 @@ 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 -r 174309386512 -r 54bc8a2727b0 xsubdec.c --- a/xsubdec.c Tue Apr 07 15:37:26 2009 +0000 +++ b/xsubdec.c Tue Apr 07 15:59:50 2009 +0000 @@ -44,7 +44,9 @@ } 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 -r 174309386512 -r 54bc8a2727b0 zmbv.c --- a/zmbv.c Tue Apr 07 15:37:26 2009 +0000 +++ b/zmbv.c Tue Apr 07 15:59:50 2009 +0000 @@ -392,8 +392,10 @@ 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