From patchwork Wed Apr 12 19:49:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 41122 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp728267pzb; Wed, 12 Apr 2023 12:50:43 -0700 (PDT) X-Google-Smtp-Source: AKy350Z1YErofIV015qwBUmg8uXjhx3lDrr5pTHy9/HDbnNLwkww/szmLZq5MlqLmPvlYrOMKh4c X-Received: by 2002:a17:906:4a13:b0:947:d3d0:ae1c with SMTP id w19-20020a1709064a1300b00947d3d0ae1cmr150387eju.0.1681329042943; Wed, 12 Apr 2023 12:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681329042; cv=none; d=google.com; s=arc-20160816; b=FgZUXLJ1Z7QCfPecnMQZwLbfHLn88Eu0X3CgpMlcDA1rD8zmaIkZKgaL6syaDgyDq+ DQQ9rwcN+I/Zr1hOz6DUSFwclU6uQrB6tQYXdaK5pV5rbamvd9TkFefahmIgRwqyc1R1 a8MKW16I27/vobwyCMfQIH+xyQYDyvweIg+GnANUm05/uxZku0YWsg3vN4cuzdKo47Ap VUE3a0MxaUtO/+c7Cw9QfV5uQnA2uv/scMqn3DxYVJN2m7Z5aRk2PgoU+yPiJdkNNLAU j5DxN4bzJ0IPQ7WZx9+GGW7k3Ri4FxCugA4YKpD6FoOPlCb90dPPgOCg1aoYDuTphQ+/ YNFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=3q/IfBO/XrVLYGPRAOwH7gRo27lR3PPgWRbj5FWvdOA=; b=U9XyGbGHuN+t4tPgzE9/Sx68hj/8oqVxnueVmOOCem3AKTiJtATdvg8ld/LVuN7W4L Pr8kWsulD8TZ/8woKAy4Pp2oatg92P3o9tA9xds3Kgjw0aMJXWAETzPB2N8L/ygdkcJM ChsB2OMt+QpxnGd6LHnuHuLvNcrtqOAoVMC0eSWQo1bZ7enFmtB0fNX+Ae5veggcdLug 159nxIOTSULeH87DBmTTAkMNSoZZmhwOFg+ln+oDAbQLqbnVPc7QEXAfuZlMXW9M1sc+ sVi59Z4/IPJrOCowe8M1Igp/gV0Xm8E3vUtrkqijvWhYeM9SXuDpidyhthGasFo1lPil KXJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=pO5ong2U; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qf39-20020a1709077f2700b0094df894f6e6si6629509ejc.1.2023.04.12.12.50.42; Wed, 12 Apr 2023 12:50:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=pO5ong2U; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33DE668BAA5; Wed, 12 Apr 2023 22:50:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 570E068B79A for ; Wed, 12 Apr 2023 22:49:56 +0300 (EEST) Received: by mail-oi1-f182.google.com with SMTP id e9so8502774oig.7 for ; Wed, 12 Apr 2023 12:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681328994; x=1683920994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lRZ+Qpw0+3Ib0XRr+Rx9ynxPnx/g0auEdZ2SmQFEPpA=; b=pO5ong2UlQqyMPkJDOfYDkGPhEFe9vR+b+S6dJmWGFnWZH+dTrRgKpUy5UOF0CtQQ9 roGCQ3dPXZFi91AP65398oyRFE/Q4lgyMtFHyU3gTIN5R7giUFkUfVKaIAiGYSmGJ6k3 4TM33zqjrkn4C7Sytr6aUDoEuHmvVv9Nr3Qq5bUW4NlmuK6GUjKTJuLrxc9Y4PjtPAdo M0xRX+T7kvlAfM5kxkmznMv+cie9QdxvHznM9wjlmCh5L+b36cf8RB42hOygPR/f4tQK Uva7pa9Mz30Ia3JWWnoUGsNkwnt66dGCaA1tS02E5f1oKQjV2RuxVyuflgOE86VrRvK5 NNuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328994; x=1683920994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lRZ+Qpw0+3Ib0XRr+Rx9ynxPnx/g0auEdZ2SmQFEPpA=; b=H6eVFMdXNEMjTtTU8/ZO/9HgQYhqqYiZ8CDUAh3uyFWcO1cbzAZ6QkCwVLNr19nJD5 O7PFQK0CzOEZx0hvHFRh0TvgxgeFdggb2YRSBJR+kW7wrM7srS7KEPyYmk18La38EYwg 6jvz/HxPZw7F8az5NivakAstd6pr0AOrRD4vmOzFBw13NHIBxN8ml3HwXLg5k2OrrqE8 /FSm3miYS0fi440uqk6HnmPdgdNamdE/C8lr8V/UQX2p4AnF6VCq4AFVGZx7lh7JWTP7 3EV5k1OutraXsJATXbs9CiqFTrNBvdr53x1STmkqRWJ3yL2rPb08WRt73pC9lNfITaFZ n9UQ== X-Gm-Message-State: AAQBX9cf7gkmiFh2PMmPsNPoi3tfpvswiZI+P45eNb4+t1C/T6YQdpWf 29rajj2YOGCd3CWK7aNBYquqsFqfbVo= X-Received: by 2002:aca:d7d5:0:b0:389:4bc5:8094 with SMTP id o204-20020acad7d5000000b003894bc58094mr1979163oig.3.1681328994358; Wed, 12 Apr 2023 12:49:54 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id j5-20020aca3c05000000b0038694b7dc09sm7097502oia.55.2023.04.12.12.49.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:49:53 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Apr 2023 16:49:36 -0300 Message-Id: <20230412194936.48022-5-jamrial@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230412194936.48022-1-jamrial@gmail.com> References: <20230412194936.48022-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avutil/frame: deprecate interlaced_frame and top_field_first X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: TQdJMGNlnr/R Signed-off-by: James Almer --- 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 37cf6d0820..20082ad7f1 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 0af23d3a86..17654d1394 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 14800ef6bd..02e8524884 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 73684baf6a..f44840d686 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; out->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !s->first_field; 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 3086027a4a..378c3bf4cd 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 c905e8d611..a23520c929 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 87e0a51226..f60ad6fbec 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) /** * @}