You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec: remove deprecated FF_API_DROPCHANGED
Deprecated since 2023-07-15. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@ -462,10 +462,6 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
|
||||
|
||||
av_bsf_free(&avci->bsf);
|
||||
|
||||
#if FF_API_DROPCHANGED
|
||||
av_channel_layout_uninit(&avci->initial_ch_layout);
|
||||
#endif
|
||||
|
||||
#if CONFIG_LCMS2
|
||||
ff_icc_context_uninit(&avci->icc);
|
||||
#endif
|
||||
|
@ -234,15 +234,6 @@ typedef struct RcOverride{
|
||||
* Use qpel MC.
|
||||
*/
|
||||
#define AV_CODEC_FLAG_QPEL (1 << 4)
|
||||
#if FF_API_DROPCHANGED
|
||||
/**
|
||||
* Don't output frames whose parameters differ from first
|
||||
* decoded frame in stream.
|
||||
*
|
||||
* @deprecated callers should implement this functionality in their own code
|
||||
*/
|
||||
#define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
|
||||
#endif
|
||||
/**
|
||||
* Request the encoder to output reconstructed frames, i.e.\ frames that would
|
||||
* be produced by decoding the encoded bistream. These frames may be retrieved
|
||||
|
@ -837,53 +837,6 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
|
||||
|
||||
avctx->frame_num++;
|
||||
|
||||
#if FF_API_DROPCHANGED
|
||||
if (avctx->flags & AV_CODEC_FLAG_DROPCHANGED) {
|
||||
|
||||
if (avctx->frame_num == 1) {
|
||||
avci->initial_format = frame->format;
|
||||
switch(avctx->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
avci->initial_width = frame->width;
|
||||
avci->initial_height = frame->height;
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
avci->initial_sample_rate = frame->sample_rate ? frame->sample_rate :
|
||||
avctx->sample_rate;
|
||||
ret = av_channel_layout_copy(&avci->initial_ch_layout, &frame->ch_layout);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->frame_num > 1) {
|
||||
int changed = avci->initial_format != frame->format;
|
||||
|
||||
switch(avctx->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
changed |= avci->initial_width != frame->width ||
|
||||
avci->initial_height != frame->height;
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
changed |= avci->initial_sample_rate != frame->sample_rate ||
|
||||
avci->initial_sample_rate != avctx->sample_rate ||
|
||||
av_channel_layout_compare(&avci->initial_ch_layout, &frame->ch_layout);
|
||||
break;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
avci->changed_frames_dropped++;
|
||||
av_log(avctx, AV_LOG_INFO, "dropped changed frame #%"PRId64" pts %"PRId64
|
||||
" drop count: %d \n",
|
||||
avctx->frame_num, frame->pts,
|
||||
avci->changed_frames_dropped);
|
||||
ret = AVERROR_INPUT_CHANGED;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
fail:
|
||||
av_frame_unref(frame);
|
||||
@ -2071,11 +2024,6 @@ int ff_decode_preinit(AVCodecContext *avctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if FF_API_DROPCHANGED
|
||||
if (avctx->flags & AV_CODEC_FLAG_DROPCHANGED)
|
||||
av_log(avctx, AV_LOG_WARNING, "The dropchanged flag is deprecated.\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -145,15 +145,6 @@ typedef struct AVCodecInternal {
|
||||
AVFrame *buffer_frame;
|
||||
int draining_done;
|
||||
|
||||
#if FF_API_DROPCHANGED
|
||||
/* used when avctx flag AV_CODEC_FLAG_DROPCHANGED is set */
|
||||
int changed_frames_dropped;
|
||||
int initial_format;
|
||||
int initial_width, initial_height;
|
||||
int initial_sample_rate;
|
||||
AVChannelLayout initial_ch_layout;
|
||||
#endif
|
||||
|
||||
#if CONFIG_LCMS2
|
||||
FFIccContext icc; /* used to read and write embedded ICC profiles */
|
||||
#endif
|
||||
|
@ -74,9 +74,6 @@ static const AVOption avcodec_options[] = {
|
||||
{"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, .unit = "flags"},
|
||||
{"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, .unit = "flags"},
|
||||
{"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, .unit = "flags"},
|
||||
#if FF_API_DROPCHANGED
|
||||
{"drop_changed", "Drop frames whose parameters differ from first decoded frame", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_DROPCHANGED }, INT_MIN, INT_MAX, A|V|D | AV_OPT_FLAG_DEPRECATED, .unit = "flags"},
|
||||
#endif
|
||||
{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D|S, .unit = "flags2"},
|
||||
{"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, .unit = "flags2"},
|
||||
{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, .unit = "flags2"},
|
||||
|
@ -38,7 +38,6 @@
|
||||
*/
|
||||
|
||||
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 62)
|
||||
#define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 62)
|
||||
|
||||
#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62)
|
||||
#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
|
||||
|
Reference in New Issue
Block a user