From patchwork Fri Dec 29 18:50:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 45388 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6623:b0:194:e134:edd4 with SMTP id n35csp4948638pzh; Fri, 29 Dec 2023 10:51:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfpDM5oiNMghenQ72jzFZLRdLNKoZPPNrWEyJ9wK+O2KMZ8TwAjidbzhwzchSbMKnT+aHi X-Received: by 2002:a17:906:46d8:b0:a23:5eb9:367d with SMTP id k24-20020a17090646d800b00a235eb9367dmr3603458ejs.227.1703875888507; Fri, 29 Dec 2023 10:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703875888; cv=none; d=google.com; s=arc-20160816; b=pGEbMhYqKMMDaWxhJHDddTkhA2Pl0xoVixpKPYQfmE6KCaED2DlNbWdDCvkezPoNKD Z6iJ8GJvt3wZ8d8DpMhjI/dXKk1DMUbrtNQJWOO0RvfS+rqk7iRyoHyJNEU52STPP6QI pMAgnZw1CYSeI7wjkyWnVU1XowlEUuIriQCOVS3SvPj27yBEkmvOCR8WjemqH/l44itJ /3x6Gpz7YBjLGeLQux/idTDHpJGsk7z8OIzdnWiTK5dLl40oMPKeXsuvPuhmHx7Sn2GC 0Hj4KT1mixSa2FemRc0ZymkEI5/6ADJlp0CMcZC7euMVSbJ1gk4HmpmxrhlxRnqXCQhy IbvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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:delivered-to; bh=1f8etfUDkLqjo4s9kUnh22Qg+oxSVxtJHYuO7x4p1NQ=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=z2yIyPco+fIS1ZnA3k8veFEAJmqnI+LE9r13Q/TPCERjoaKhGzU3H6IZBhS6at74Mx DbulcJ8ggvX10EyoCqrcnTJY10UZTDBFsLSqtnsDiXdNBcFJHG1YB9lDJ2SmnCWMCd0Z do7vUKpQtVXOD+I9BfQv1NGMLQgwC1augjr3Uk2Hk7Jdlv6lPi/75xDPdKUdPYsnP6Ir lZRe/8P9xoQeBghEY3OnnAQbvCfCWRpb7x2/glHNj+QeUZrpkMR8h9HQQYJAdGOMAp6S 8vPQ2FlGYCWvo0joHxcHSlzaImKW1nBBh8b/1J/kgIQsrf07IuGcrdtrs9ZvUs48t3bJ y6pQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ew3-20020a170907950300b00a279d3ad57bsi503734ejc.242.2023.12.29.10.51.28; Fri, 29 Dec 2023 10:51:28 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15E8A68CC40; Fri, 29 Dec 2023 20:51:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2C15068CBD1 for ; Fri, 29 Dec 2023 20:51:10 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id F2906E7DBB; Fri, 29 Dec 2023 19:51:09 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QOwEozFyD4qY; Fri, 29 Dec 2023 19:51:08 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6800DE9298; Fri, 29 Dec 2023 19:51:08 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Dec 2023 19:50:58 +0100 Message-Id: <20231229185059.18462-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231229185059.18462-1-cus@passwd.hu> References: <20231229185059.18462-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_filter: honor -reinit_filters 0 even on changed display matrix 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZIQlIebFvddl Not sure about honoring it also in case of a hwaccel change, so left that as is for now. Signed-off-by: Marton Balint --- fftools/ffmpeg_filter.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index c1c3014453..680fffb060 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -2607,13 +2607,6 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt, break; } - if (!ifp->ist->reinit_filters && fgt->graph) - need_reinit = 0; - - if (!!ifp->hw_frames_ctx != !!frame->hw_frames_ctx || - (ifp->hw_frames_ctx && ifp->hw_frames_ctx->data != frame->hw_frames_ctx->data)) - need_reinit = 1; - if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) { if (!ifp->displaymatrix_present || memcmp(sd->data, ifp->displaymatrix, sizeof(ifp->displaymatrix))) @@ -2621,6 +2614,13 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt, } else if (ifp->displaymatrix_present) need_reinit = 1; + if (!ifp->ist->reinit_filters && fgt->graph) + need_reinit = 0; + + if (!!ifp->hw_frames_ctx != !!frame->hw_frames_ctx || + (ifp->hw_frames_ctx && ifp->hw_frames_ctx->data != frame->hw_frames_ctx->data)) + need_reinit = 1; + if (need_reinit) { ret = ifilter_parameters_from_frame(ifilter, frame); if (ret < 0)