[FFmpeg-cvslog] avutil/frame: deprecate interlaced_frame and top_field_first

James Almer git at videolan.org
Fri May 5 02:50:47 EEST 2023


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Apr 12 14:18:50 2023 -0300| [599abc0f3a0c6a1d9746a3098cd444a45471a160] | committer: James Almer

avutil/frame: deprecate interlaced_frame and top_field_first

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=599abc0f3a0c6a1d9746a3098cd444a45471a160
---

 libavcodec/decode.c                |  4 ++++
 libavcodec/encode.c                |  4 ++++
 libavfilter/buffersrc.c            |  4 ++++
 libavfilter/vf_coreimage.m         |  2 ++
 libavfilter/vf_deinterlace_vaapi.c |  4 ++++
 libavfilter/vf_estdif.c            |  4 ++++
 libavfilter/vf_field.c             |  4 ++++
 libavfilter/vf_fieldhint.c         |  8 ++++++++
 libavfilter/vf_fieldmatch.c        |  8 ++++++++
 libavfilter/vf_fieldorder.c        |  4 ++++
 libavfilter/vf_idet.c              | 24 ++++++++++++++++++++++++
 libavfilter/vf_kerndeint.c         |  4 ++++
 libavfilter/vf_nnedi.c             |  4 ++++
 libavfilter/vf_separatefields.c    |  4 ++++
 libavfilter/vf_setparams.c         |  8 ++++++++
 libavfilter/vf_telecine.c          | 12 ++++++++++++
 libavfilter/vf_tinterlace.c        | 16 ++++++++++++++++
 libavfilter/vf_w3fdif.c            |  4 ++++
 libavfilter/vf_weave.c             |  4 ++++
 libavfilter/vsrc_gradients.c       |  4 ++++
 libavfilter/vsrc_testsrc.c         |  4 ++++
 libavfilter/yadif_common.c         |  8 ++++++++
 libavutil/frame.c                  |  4 ++++
 libavutil/frame.h                  |  8 ++++++++
 libavutil/version.h                |  1 +
 25 files changed, 155 insertions(+)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 73bba99750..64a448b54c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -570,8 +570,12 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
     }
 
     if (!ret) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->interlaced_frame = !!(frame->flags & AV_FRAME_FLAG_INTERLACED);
         frame->top_field_first =  !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         frame->best_effort_timestamp = guess_correct_pts(avctx,
                                                          frame->pts,
                                                          frame->pkt_dts);
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index dfcdce6a3c..0c4b2b0f99 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -192,10 +192,14 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame)
 
     av_frame_move_ref(frame, avci->buffer_frame);
 
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     if (frame->interlaced_frame)
         frame->flags |= AV_FRAME_FLAG_INTERLACED;
     if (frame->top_field_first)
         frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 927b16ea06..1d2f357bbc 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -247,10 +247,14 @@ FF_DISABLE_DEPRECATION_WARNINGS
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     if (copy->interlaced_frame)
         copy->flags |= AV_FRAME_FLAG_INTERLACED;
     if (copy->top_field_first)
         copy->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     ret = ff_filter_frame(ctx->outputs[0], copy);
     if (ret < 0)
diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m
index a5bfdaef6d..a2e3dbea46 100644
--- a/libavfilter/vf_coreimage.m
+++ b/libavfilter/vf_coreimage.m
@@ -302,7 +302,9 @@ static int request_frame(AVFilterLink *link)
     frame->pts                 = ctx->pts;
     frame->duration            = 1;
     frame->key_frame           = 1;
+#if FF_API_INTERLACED_FRAME
     frame->interlaced_frame    = 0;
+#endif
     frame->flags              &= ~AV_FRAME_FLAG_INTERLACED;
     frame->pict_type           = AV_PICTURE_TYPE_I;
     frame->sample_aspect_ratio = ctx->sar;
diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
index d4246eb4fc..cb4f7b32d7 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -303,7 +303,11 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
                 output_frame->pts = input_frame->pts +
                     ctx->frame_queue[current_frame_index + 1]->pts;
         }
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         output_frame->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         output_frame->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
         av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c
index d71d39e268..2bb1680f43 100644
--- a/libavfilter/vf_estdif.c
+++ b/libavfilter/vf_estdif.c
@@ -443,7 +443,11 @@ static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts, int64_t durati
     if (!out)
         return AVERROR(ENOMEM);
     av_frame_copy_props(out, in);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     out->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     out->flags &= ~AV_FRAME_FLAG_INTERLACED;
     out->pts = pts;
     out->duration = duration;
diff --git a/libavfilter/vf_field.c b/libavfilter/vf_field.c
index 66b646c72d..5c4ff0881c 100644
--- a/libavfilter/vf_field.c
+++ b/libavfilter/vf_field.c
@@ -73,7 +73,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
     int i;
 
     inpicref->height = outlink->h;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     inpicref->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     inpicref->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
     for (i = 0; i < field->nb_planes; i++) {
diff --git a/libavfilter/vf_fieldhint.c b/libavfilter/vf_fieldhint.c
index df6fb0b8df..ff940a50e6 100644
--- a/libavfilter/vf_fieldhint.c
+++ b/libavfilter/vf_fieldhint.c
@@ -217,11 +217,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
     switch (hint) {
     case '+':
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags |= AV_FRAME_FLAG_INTERLACED;
         break;
     case '-':
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags &= ~AV_FRAME_FLAG_INTERLACED;
         break;
     case '=':
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index a177cb3fd8..71bef7b30f 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -820,12 +820,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
     /* mark the frame we are unable to match properly as interlaced so a proper
      * de-interlacer can take the relay */
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     dst->interlaced_frame = interlaced_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     if (interlaced_frame) {
         dst->flags |= AV_FRAME_FLAG_INTERLACED;
         av_log(ctx, AV_LOG_WARNING, "Frame #%"PRId64" at %s is still interlaced\n",
                outlink->frame_count_in, av_ts2timestr(in->pts, &inlink->time_base));
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         dst->top_field_first = field;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         if (field)
             dst->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
         else
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c
index e4d0eda1a4..cf6efa6e54 100644
--- a/libavfilter/vf_fieldorder.c
+++ b/libavfilter/vf_fieldorder.c
@@ -140,7 +140,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
             }
         }
     }
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     out->top_field_first = s->dst_tff;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     if (s->dst_tff)
         out->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
     else
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 0f150a273d..abd375230a 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -183,16 +183,28 @@ static void filter(AVFilterContext *ctx)
     }
 
     if      (idet->last_type == TFF){
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         idet->cur->top_field_first = 1;
         idet->cur->interlaced_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         idet->cur->flags |= (AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST);
     }else if(idet->last_type == BFF){
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         idet->cur->top_field_first = 0;
         idet->cur->interlaced_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         idet->cur->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
         idet->cur->flags |= AV_FRAME_FLAG_INTERLACED;
     }else if(idet->last_type == PROGRESSIVE){
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         idet->cur->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED;
     }
 
@@ -248,7 +260,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
     }
     if (idet->analyze_interlaced_flag_done) {
         if ((picref->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
             picref->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
             picref->flags &= ~AV_FRAME_FLAG_INTERLACED;
         }
         return ff_filter_frame(ctx->outputs[0], picref);
@@ -289,7 +305,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
 
     if (idet->analyze_interlaced_flag) {
         if (idet->cur->flags & AV_FRAME_FLAG_INTERLACED) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
             idet->cur->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
             idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED;
             filter(ctx);
             if (idet->last_type == PROGRESSIVE) {
@@ -303,7 +323,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
                 ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));
 
                 if ((idet->next->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
                     idet->next->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
                     idet->next->flags &= ~AV_FRAME_FLAG_INTERLACED;
                 }
                 idet->analyze_interlaced_flag_done = 1;
diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
index e8ec1f474a..8aec5afe98 100644
--- a/libavfilter/vf_kerndeint.c
+++ b/libavfilter/vf_kerndeint.c
@@ -141,7 +141,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
         return AVERROR(ENOMEM);
     }
     av_frame_copy_props(outpic, inpic);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     outpic->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     outpic->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
     for (plane = 0; plane < 4 && inpic->data[plane] && inpic->linesize[plane]; plane++) {
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index 39cb4f5a85..1bb8c21e10 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -665,7 +665,11 @@ static int get_frame(AVFilterContext *ctx, int is_second)
     if (!dst)
         return AVERROR(ENOMEM);
     av_frame_copy_props(dst, s->prev);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     dst->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     dst->flags &= ~AV_FRAME_FLAG_INTERLACED;
     dst->pts = s->pts;
 
diff --git a/libavfilter/vf_separatefields.c b/libavfilter/vf_separatefields.c
index 814ea52e21..723974afaa 100644
--- a/libavfilter/vf_separatefields.c
+++ b/libavfilter/vf_separatefields.c
@@ -70,7 +70,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
     int ret;
 
     inpicref->height = outlink->h;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     inpicref->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     inpicref->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
     if (!s->second) {
diff --git a/libavfilter/vf_setparams.c b/libavfilter/vf_setparams.c
index 0165a5aaa6..321a64a14e 100644
--- a/libavfilter/vf_setparams.c
+++ b/libavfilter/vf_setparams.c
@@ -127,11 +127,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 
     /* set field */
     if (s->field_mode == MODE_PROG) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         frame->flags &= ~AV_FRAME_FLAG_INTERLACED;
     } else if (s->field_mode != MODE_AUTO) {
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->interlaced_frame = 1;
         frame->top_field_first = s->field_mode;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         frame->flags |= AV_FRAME_FLAG_INTERLACED;
         if (s->field_mode)
             frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index d8daa25939..8343b11466 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -204,8 +204,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
                                 s->stride[i],
                                 (s->planeheight[i] - !s->first_field + 1) / 2);
         }
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         s->frame[nout]->interlaced_frame = 1;
         s->frame[nout]->top_field_first  = !s->first_field;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         s->frame[nout]->flags |= AV_FRAME_FLAG_INTERLACED;
         if (s->first_field)
             s->frame[nout]->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
@@ -228,8 +232,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
                                 inpicref->data[i], inpicref->linesize[i],
                                 s->stride[i],
                                 s->planeheight[i]);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         s->frame[nout]->interlaced_frame = inpicref->interlaced_frame;
         s->frame[nout]->top_field_first  = inpicref->top_field_first;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         s->frame[nout]->flags |= (inpicref->flags & (AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST));
         nout++;
         len -= 2;
@@ -256,8 +264,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
         }
 
         av_frame_copy_props(frame, inpicref);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->interlaced_frame = interlaced;
         frame->top_field_first  = tff;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         if (interlaced)
             frame->flags |= AV_FRAME_FLAG_INTERLACED;
         else
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 742d4e195a..8b0cbbcf95 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -391,8 +391,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
             return AVERROR(ENOMEM);
         av_frame_copy_props(out, cur);
         out->height = outlink->h;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 1;
         out->top_field_first = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags |= AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST;
         out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1));
 
@@ -460,8 +464,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         if (!out)
             return AVERROR(ENOMEM);
         av_frame_copy_props(out, cur);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 1;
         out->top_field_first = tff;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags |= AV_FRAME_FLAG_INTERLACED;
         if (tff)
             out->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
@@ -487,7 +495,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         out = av_frame_clone(cur);
         if (!out)
             return AVERROR(ENOMEM);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags |= AV_FRAME_FLAG_INTERLACED;
         if (cur->pts != AV_NOPTS_VALUE)
             out->pts = cur->pts*2;
@@ -502,8 +514,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         if (!out)
             return AVERROR(ENOMEM);
         av_frame_copy_props(out, next);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         out->interlaced_frame = 1;
         out->top_field_first = !tff;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         out->flags |= AV_FRAME_FLAG_INTERLACED;
         if (tff)
             out->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index 7c3ffbc5f0..f10cf06a49 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -486,7 +486,11 @@ static int filter(AVFilterContext *ctx, int is_second)
     if (!out)
         return AVERROR(ENOMEM);
     av_frame_copy_props(out, s->cur);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     out->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     out->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
     if (!is_second) {
diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
index e738c9ba17..2e64d81f27 100644
--- a/libavfilter/vf_weave.c
+++ b/libavfilter/vf_weave.c
@@ -148,8 +148,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
                       FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
 
     out->pts = s->double_weave ? s->prev->pts : in->pts / 2;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     out->interlaced_frame = 1;
     out->top_field_first = !s->first_field;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     out->flags |= AV_FRAME_FLAG_INTERLACED;
     if (s->first_field)
         out->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
diff --git a/libavfilter/vsrc_gradients.c b/libavfilter/vsrc_gradients.c
index 2811dd8bb6..f50b4d3cc7 100644
--- a/libavfilter/vsrc_gradients.c
+++ b/libavfilter/vsrc_gradients.c
@@ -398,7 +398,11 @@ static int activate(AVFilterContext *ctx)
             return AVERROR(ENOMEM);
 
         frame->key_frame           = 1;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->interlaced_frame    = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         frame->flags              &= ~AV_FRAME_FLAG_INTERLACED;
         frame->pict_type           = AV_PICTURE_TYPE_I;
         frame->sample_aspect_ratio = (AVRational) {1, 1};
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index cef3a9be36..c358f9ada2 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -185,7 +185,11 @@ static int activate(AVFilterContext *ctx)
     frame->pts                 = test->pts;
     frame->duration            = 1;
     frame->key_frame           = 1;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     frame->interlaced_frame    = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     frame->flags              &= ~AV_FRAME_FLAG_INTERLACED;
     frame->pict_type           = AV_PICTURE_TYPE_I;
     frame->sample_aspect_ratio = test->sar;
diff --git a/libavfilter/yadif_common.c b/libavfilter/yadif_common.c
index 5b29d2e6d8..2bd6111140 100644
--- a/libavfilter/yadif_common.c
+++ b/libavfilter/yadif_common.c
@@ -43,7 +43,11 @@ static int return_frame(AVFilterContext *ctx, int is_second)
             return AVERROR(ENOMEM);
 
         av_frame_copy_props(yadif->out, yadif->cur);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
         yadif->out->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         yadif->out->flags &= ~AV_FRAME_FLAG_INTERLACED;
         if (yadif->current_field == YADIF_FIELD_BACK_END)
             yadif->current_field = YADIF_FIELD_END;
@@ -149,7 +153,11 @@ int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
         return AVERROR(ENOMEM);
 
     av_frame_copy_props(yadif->out, yadif->cur);
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     yadif->out->interlaced_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     yadif->out->flags &= ~AV_FRAME_FLAG_INTERLACED;
 
     if (yadif->out->pts != AV_NOPTS_VALUE)
diff --git a/libavutil/frame.c b/libavutil/frame.c
index f420a6e187..e544b690fe 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -275,8 +275,12 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
     dst->pts                    = src->pts;
     dst->duration               = src->duration;
     dst->repeat_pict            = src->repeat_pict;
+#if FF_API_INTERLACED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     dst->interlaced_frame       = src->interlaced_frame;
     dst->top_field_first        = src->top_field_first;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     dst->palette_has_changed    = src->palette_has_changed;
     dst->sample_rate            = src->sample_rate;
     dst->opaque                 = src->opaque;
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 125ba3aa35..095fc39c3f 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -491,15 +491,23 @@ typedef struct AVFrame {
      */
     int repeat_pict;
 
+#if FF_API_INTERLACED_FRAME
     /**
      * The content of the picture is interlaced.
+     *
+     * @deprecated Use AV_FRAME_FLAG_INTERLACED instead
      */
+    attribute_deprecated
     int interlaced_frame;
 
     /**
      * If the content is interlaced, is top field displayed first.
+     *
+     * @deprecated Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead
      */
+    attribute_deprecated
     int top_field_first;
+#endif
 
     /**
      * Tell user application that palette has changed from previous frame.
diff --git a/libavutil/version.h b/libavutil/version.h
index 40f92af055..6a5e2c4881 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -115,6 +115,7 @@
 #define FF_API_FRAME_PICTURE_NUMBER     (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_HDR_VIVID_THREE_SPLINE   (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_FRAME_PKT                (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_INTERLACED_FRAME         (LIBAVUTIL_VERSION_MAJOR < 59)
 
 /**
  * @}



More information about the ffmpeg-cvslog mailing list