diff options
-rw-r--r-- | doc/APIchanges | 4 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 18 | ||||
-rw-r--r-- | libavcodec/mpegaudiodec.c | 16 | ||||
-rw-r--r-- | libavcodec/mpegaudiodec_float.c | 8 | ||||
-rw-r--r-- | libavcodec/version.h | 5 |
5 files changed, 42 insertions, 9 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index bd55cb0172..79aa202ec1 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,10 @@ libavutil: 2011-04-18 API changes, most recent first: +2011-xx-xx - xxxxxxx - lavc 53.15.0 + Remove avcodec_parse_frame. + Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY. + 2011-10-xx - xxxxxxx - lavf 53.10.0 Add avformat_new_stream(). Deprecate av_new_stream(). diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 28dde3fe85..1c9bd96a5f 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -668,8 +668,10 @@ typedef struct RcOverride{ * assume the buffer was allocated by avcodec_default_get_buffer. */ #define CODEC_CAP_DR1 0x0002 +#if FF_API_PARSE_FRAME /* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */ #define CODEC_CAP_PARSE_ONLY 0x0004 +#endif #define CODEC_CAP_TRUNCATED 0x0008 /* Codec can export data for HW decoding (XvMC). */ #define CODEC_CAP_HWACCEL 0x0010 @@ -1530,9 +1532,15 @@ typedef struct AVCodecContext { */ int block_align; - int parse_only; /* - decoding only: If true, only parsing is done - (function avcodec_parse_frame()). The frame - data is returned. Only MPEG codecs support this now. */ +#if FF_API_PARSE_FRAME + /** + * If true, only parsing is done. The frame data is returned. + * Only MPEG audio decoders support this now. + * - encoding: unused + * - decoding: Set by user + */ + attribute_deprecated int parse_only; +#endif /** * 0-> h263 quant 1-> mpeg quant @@ -3925,10 +3933,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, */ void avsubtitle_free(AVSubtitle *sub); -int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, - int *data_size_ptr, - uint8_t *buf, int buf_size); - /** * Encode an audio frame from samples into buf. * diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 13a3c56447..3aef5fb08d 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -279,7 +279,11 @@ static av_cold int decode_init(AVCodecContext * avctx) avctx->sample_fmt= OUT_FMT; s->err_recognition = avctx->err_recognition; +#if FF_API_PARSE_FRAME if (!init && !avctx->parse_only) { +#else + if (!init) { +#endif int offset; /* scale factors table for layer 1/2 */ @@ -1869,10 +1873,12 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, int *data_size, s->frame_size = len; +#if FF_API_PARSE_FRAME if (avctx->parse_only) out_size = buf_size; else - out_size = mp_decode_frame(s, out_samples, buf, buf_size); +#endif + out_size = mp_decode_frame(s, out_samples, buf, buf_size); *data_size = out_size; return buf_size; @@ -2110,7 +2116,9 @@ AVCodec ff_mp1_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), }; @@ -2123,7 +2131,9 @@ AVCodec ff_mp2_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }; @@ -2136,7 +2146,9 @@ AVCodec ff_mp3_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), }; @@ -2149,7 +2161,9 @@ AVCodec ff_mp3adu_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), }; diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index 7f512500b3..9300de29b9 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -30,7 +30,9 @@ AVCodec ff_mp1float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), }; @@ -43,7 +45,9 @@ AVCodec ff_mp2float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }; @@ -56,7 +60,9 @@ AVCodec ff_mp3float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), }; @@ -69,7 +75,9 @@ AVCodec ff_mp3adufloat_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, +#if FF_API_PARSE_FRAME .capabilities = CODEC_CAP_PARSE_ONLY, +#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), }; diff --git a/libavcodec/version.h b/libavcodec/version.h index a361bbdf8c..65cc5594cc 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -21,7 +21,7 @@ #define AVCODEC_VERSION_H #define LIBAVCODEC_VERSION_MAJOR 53 -#define LIBAVCODEC_VERSION_MINOR 14 +#define LIBAVCODEC_VERSION_MINOR 15 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -101,5 +101,8 @@ #ifndef FF_API_GET_ALPHA_INFO #define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54) #endif +#ifndef FF_API_PARSE_FRAME +#define FF_API_PARSE_FRAME (LIBAVCODEC_VERSION_MAJOR < 54) +#endif #endif /* AVCODEC_VERSION_H */ |