avcodec: remove avcodec_parse_frame and deprecate associated elements.
The documentation for CODEC_CAP_PARSE_ONLY and AVCodecContext.parse_only indicates that they are utilized through avcodec_parse_frame(), which was never actually implemented.
This commit is contained in:
parent
cd816d9bbb
commit
512557b291
@ -13,6 +13,10 @@ libavutil: 2011-04-18
|
|||||||
|
|
||||||
API changes, most recent first:
|
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
|
2011-10-xx - xxxxxxx - lavf 53.10.0
|
||||||
Add avformat_new_stream(). Deprecate av_new_stream().
|
Add avformat_new_stream(). Deprecate av_new_stream().
|
||||||
|
|
||||||
|
@ -668,8 +668,10 @@ typedef struct RcOverride{
|
|||||||
* assume the buffer was allocated by avcodec_default_get_buffer.
|
* assume the buffer was allocated by avcodec_default_get_buffer.
|
||||||
*/
|
*/
|
||||||
#define CODEC_CAP_DR1 0x0002
|
#define CODEC_CAP_DR1 0x0002
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
|
/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
|
||||||
#define CODEC_CAP_PARSE_ONLY 0x0004
|
#define CODEC_CAP_PARSE_ONLY 0x0004
|
||||||
|
#endif
|
||||||
#define CODEC_CAP_TRUNCATED 0x0008
|
#define CODEC_CAP_TRUNCATED 0x0008
|
||||||
/* Codec can export data for HW decoding (XvMC). */
|
/* Codec can export data for HW decoding (XvMC). */
|
||||||
#define CODEC_CAP_HWACCEL 0x0010
|
#define CODEC_CAP_HWACCEL 0x0010
|
||||||
@ -1530,9 +1532,15 @@ typedef struct AVCodecContext {
|
|||||||
*/
|
*/
|
||||||
int block_align;
|
int block_align;
|
||||||
|
|
||||||
int parse_only; /* - decoding only: If true, only parsing is done
|
#if FF_API_PARSE_FRAME
|
||||||
(function avcodec_parse_frame()). The frame
|
/**
|
||||||
data is returned. Only MPEG codecs support this now. */
|
* 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
|
* 0-> h263 quant 1-> mpeg quant
|
||||||
@ -3925,10 +3933,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
|
|||||||
*/
|
*/
|
||||||
void avsubtitle_free(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.
|
* Encode an audio frame from samples into buf.
|
||||||
*
|
*
|
||||||
|
@ -279,7 +279,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
|
|||||||
avctx->sample_fmt= OUT_FMT;
|
avctx->sample_fmt= OUT_FMT;
|
||||||
s->err_recognition = avctx->err_recognition;
|
s->err_recognition = avctx->err_recognition;
|
||||||
|
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
if (!init && !avctx->parse_only) {
|
if (!init && !avctx->parse_only) {
|
||||||
|
#else
|
||||||
|
if (!init) {
|
||||||
|
#endif
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
/* scale factors table for layer 1/2 */
|
/* 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;
|
s->frame_size = len;
|
||||||
|
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
if (avctx->parse_only)
|
if (avctx->parse_only)
|
||||||
out_size = buf_size;
|
out_size = buf_size;
|
||||||
else
|
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;
|
*data_size = out_size;
|
||||||
return buf_size;
|
return buf_size;
|
||||||
@ -2110,7 +2116,9 @@ AVCodec ff_mp1_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
|
||||||
};
|
};
|
||||||
@ -2123,7 +2131,9 @@ AVCodec ff_mp2_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
|
||||||
};
|
};
|
||||||
@ -2136,7 +2146,9 @@ AVCodec ff_mp3_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
|
||||||
};
|
};
|
||||||
@ -2149,7 +2161,9 @@ AVCodec ff_mp3adu_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame_adu,
|
.decode = decode_frame_adu,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
|
||||||
};
|
};
|
||||||
|
@ -30,7 +30,9 @@ AVCodec ff_mp1float_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
|
||||||
};
|
};
|
||||||
@ -43,7 +45,9 @@ AVCodec ff_mp2float_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
|
||||||
};
|
};
|
||||||
@ -56,7 +60,9 @@ AVCodec ff_mp3float_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
|
||||||
};
|
};
|
||||||
@ -69,7 +75,9 @@ AVCodec ff_mp3adufloat_decoder = {
|
|||||||
.priv_data_size = sizeof(MPADecodeContext),
|
.priv_data_size = sizeof(MPADecodeContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.decode = decode_frame_adu,
|
.decode = decode_frame_adu,
|
||||||
|
#if FF_API_PARSE_FRAME
|
||||||
.capabilities = CODEC_CAP_PARSE_ONLY,
|
.capabilities = CODEC_CAP_PARSE_ONLY,
|
||||||
|
#endif
|
||||||
.flush = flush,
|
.flush = flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define AVCODEC_VERSION_H
|
#define AVCODEC_VERSION_H
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 53
|
#define LIBAVCODEC_VERSION_MAJOR 53
|
||||||
#define LIBAVCODEC_VERSION_MINOR 14
|
#define LIBAVCODEC_VERSION_MINOR 15
|
||||||
#define LIBAVCODEC_VERSION_MICRO 0
|
#define LIBAVCODEC_VERSION_MICRO 0
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
@ -101,5 +101,8 @@
|
|||||||
#ifndef FF_API_GET_ALPHA_INFO
|
#ifndef FF_API_GET_ALPHA_INFO
|
||||||
#define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54)
|
#define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef FF_API_PARSE_FRAME
|
||||||
|
#define FF_API_PARSE_FRAME (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user