From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 09915444B8 for ; Wed, 12 Apr 2023 19:50:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF29468B99F; Wed, 12 Apr 2023 22:50:01 +0300 (EEST) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B128E68B343 for ; Wed, 12 Apr 2023 22:49:54 +0300 (EEST) Received: by mail-oi1-f178.google.com with SMTP id f14so26960730oiw.10 for ; Wed, 12 Apr 2023 12:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681328993; x=1683920993; 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=PmE2LbhWs+oMq9GaU2HQnfqY3QLBsZg9sRhj0YMThd0=; b=SjUx1jMsmw8c1viDx4uB5QdRjx5uJatciQEXg9kRASTfcGIRZAnPpmwK2pRLBuBqdK qIMh/9UwZNJp4VIrktynNRvNH4zCEEleIJp/47wW4OHQ6zUQNN3M5upcza9AZgTKJskb oE/kt+xe3AHpjO8wdDK+Zp044b8CbNRhG8br11x4XNU2TVnyBIFoHpS3/s44EsuiopEe 6IdrQLtdqQaJwJwnzgq2UUBCpe4+JbKuQCjOMx/jzUaUByfgW4UxGJZAeyQVNugpQQlS MR8DTjl53rPCyUlzwRrLycvBUu6HYvqR/972OSgOVaSlgzcjqYPL4Nh6XngyFPC79GRc 5VbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328993; x=1683920993; 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=PmE2LbhWs+oMq9GaU2HQnfqY3QLBsZg9sRhj0YMThd0=; b=D2oUtnhN4X1zChousBm2s+osXxNgaOIj5zixwMbmxI1SmemaapBfLBCKv7OGb4kbm4 HcQ31zi2JdyKRu9R6/e+6MiSk4PBlno0jB5Lz0aVlV40fJJ4AXKi8HVBLPsvpaS8sbAU O2TquUgpHHEQIMe0IEiIzzvz3RF+4OwBLfNGd3dK5NuXevKKjXNtBXeCBoN7E02/cFh3 uw47BqKSH4yri+PIslTME7yYghSv55P2+Rve8n9Qn7kZrqbT8eaHw5slm2sEvEa02SXQ I9Ma/7MBsU8Y8CYC1afDxqNkz2swxV6MqdXt87pHtVxIitThaqXgt3EiKZzDkwRZ6udg wjfg== X-Gm-Message-State: AAQBX9e/RtwVS8yEde6EL0FDqhWYNOQrhFP9HR9fjtOhr0SbAXSwm3e1 i3KQ2oX8lfdnupqSWHoxOiq2hVkeKTc= X-Google-Smtp-Source: AKy350bIMiWrvkJnu1mUGbQ6U9Kz0q/YQ84K4H2pCYo9tYioUIcHy4t5Csahfom0oGPN9amObAIFQw== X-Received: by 2002:aca:2b13:0:b0:389:8a25:1897 with SMTP id i19-20020aca2b13000000b003898a251897mr2986607oik.12.1681328992847; Wed, 12 Apr 2023 12:49:52 -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.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:49:52 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Apr 2023 16:49:35 -0300 Message-Id: <20230412194936.48022-4-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 4/5] fftools: use the new AVFrame interlace flags 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- fftools/ffmpeg.c | 2 +- fftools/ffmpeg_enc.c | 11 +++++++---- fftools/ffprobe.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 750ab76693..3b271e8f59 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1502,7 +1502,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_ return ret; if(ist->top_field_first>=0) - decoded_frame->top_field_first = ist->top_field_first; + decoded_frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; ist->frames_decoded++; diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 2f1803a74c..969aa0d019 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -238,13 +238,16 @@ int enc_open(OutputStream *ost, AVFrame *frame) if (frame) { if (enc_ctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) && ost->top_field_first >= 0) - frame->top_field_first = !!ost->top_field_first; + if (ost->top_field_first) + frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; + else + frame->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST; - if (frame->interlaced_frame) { + if (frame->flags & AV_FRAME_FLAG_INTERLACED) { if (enc->id == AV_CODEC_ID_MJPEG) - enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TT:AV_FIELD_BB; + enc_ctx->field_order = (frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) ? AV_FIELD_TT:AV_FIELD_BB; else - enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + enc_ctx->field_order = (frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) ? AV_FIELD_TB:AV_FIELD_BT; } else enc_ctx->field_order = AV_FIELD_PROGRESSIVE; } diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index d6e5a79c7e..cb765bd95b 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2640,8 +2640,8 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, print_int("display_picture_number", frame->display_picture_number); ) #endif - print_int("interlaced_frame", frame->interlaced_frame); - print_int("top_field_first", frame->top_field_first); + print_int("interlaced_frame", !!(frame->flags & AV_FRAME_FLAG_INTERLACED)); + print_int("top_field_first", !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); print_int("repeat_pict", frame->repeat_pict); print_color_range(w, frame->color_range); -- 2.40.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".