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 347E3465BC for ; Mon, 22 May 2023 10:14:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C361D68C054; Mon, 22 May 2023 13:14:50 +0300 (EEST) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 219E268C02A for ; Mon, 22 May 2023 13:14:43 +0300 (EEST) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-510d6b939bfso10043023a12.0 for ; Mon, 22 May 2023 03:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684750482; x=1687342482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DMZYHPW5nok0BKs3QMK1X0vV4RzlUCmb4AhJ/x8gFIw=; b=nlXxTQ0WJo+9CV+pUgXTIn2jl1uwDTyOCN+EFoNlfLKTeaRj2wFZFQNkImuRDHrvoA JG87fOdkTbdR7aCEdOuo/NA8LNbTXpRBT1vejE7oetwv99dQsHx+NHKAhCLFsRsL3a3L BbQb6y4PX47SoosJe7hVyi3QxgCpxA9eAheh16+w7QNVE0nEKD5OgKRE7PE0XIZBXPfd ylN4y9DkAFKpDkeljs1jzjtwa7pjkyltIoJ5wAOcjJw1Bsa8VzNNz/ljpeOsxkxyccE5 5wkS7VUNx+I7t4b3729CiHi676N7FWjP9JWTBCR7O6MyHmAIp3ADQxUtmn01n/O7VzlC z2ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684750482; x=1687342482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DMZYHPW5nok0BKs3QMK1X0vV4RzlUCmb4AhJ/x8gFIw=; b=X4FM4uMFO3YZro5KhxwonKm8Z9QXuapr2ga433S+nKXn4cc2tFqQHlB/u7Ho+dI2ml yrD/8gJcsdzD6ZwnOm9LsaMSHkcQJRrZnae3y+WJy8EnDoefw6+i+RsBy4F5RgFUwoVo VzTHc6VTE1OuqABmLp7BSmqSvq/SXJI3GKpWpgpike69eYZAO+b4IPraegBfED9uxG6W Ivqj6+syyuABQetAgAh+RotCj2iynHvCwxtWJiHcTtJUgGa6jXDiXHxFhxCFktNc0qTN MJZhCwGKLxBE76QP08e7bPdx60SaRmwsi9O4RGaFDNO0sbCdG7ulQgPkRWZ7fM6kjPss m0uQ== X-Gm-Message-State: AC+VfDzf9WWP7bAu1dzHdqOFvAxyz+fVl9yIpDBnq9P7pikidHSD0xr8 wJPp3tlPUfGtg5uuCi6hPeKkDjXJIsA= X-Google-Smtp-Source: ACHHUZ6hER+hRNPOKAgpDBSN8AbE4MJK36mIFGA+2Ckxk5BOTcgTcRiXQStJ2CychL1CRGxCSsk23g== X-Received: by 2002:aa7:c642:0:b0:50b:d76a:7904 with SMTP id z2-20020aa7c642000000b0050bd76a7904mr7416461edr.28.1684750482296; Mon, 22 May 2023 03:14:42 -0700 (PDT) Received: from MBP-von-Marvin.citadel.scalie.me (84-112-104-25.cable.dynamic.surfer.at. [84.112.104.25]) by smtp.gmail.com with ESMTPSA id ba7-20020a0564021ac700b0050daa883545sm2860199edb.64.2023.05.22.03.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 03:14:41 -0700 (PDT) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 May 2023 12:14:33 +0200 Message-Id: <20230522101433.40493-2-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20230522101433.40493-1-epirat07@gmail.com> References: <20230419104250.21354-1-epirat07@gmail.com> <20230522101433.40493-1-epirat07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 2/2] avfilter/vf_tpad: accept hardware frames in clone-only mode 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: Marvin Scholz 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: When no drawing is to be performed, tpad can work fine with hardware frames, so advertise this in the query_formats callback and ensure the drawing context is never initialised when just cloning frames. --- libavfilter/vf_tpad.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c index d0fa7df8be..c2e266cb1a 100644 --- a/libavfilter/vf_tpad.c +++ b/libavfilter/vf_tpad.c @@ -71,7 +71,12 @@ AVFILTER_DEFINE_CLASS(tpad); static int query_formats(AVFilterContext *ctx) { - return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); + TPadContext *s = ctx->priv; + if ((s->stop_mode == MODE_ADD && s->pad_stop != 0) || + (s->start_mode == MODE_ADD && s->pad_start != 0)) + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); + + return ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_VIDEO)); } static int activate(AVFilterContext *ctx) @@ -190,8 +195,11 @@ static int config_input(AVFilterLink *inlink) AVFilterContext *ctx = inlink->dst; TPadContext *s = ctx->priv; - ff_draw_init(&s->draw, inlink->format, 0); - ff_draw_color(&s->draw, &s->color, s->rgba_color); + if ((s->stop_mode == MODE_ADD && s->pad_stop != 0) || + (s->start_mode == MODE_ADD && s->pad_start != 0)) { + ff_draw_init(&s->draw, inlink->format, 0); + ff_draw_color(&s->draw, &s->color, s->rgba_color); + } if (s->start_duration) s->pad_start = av_rescale_q(s->start_duration, inlink->frame_rate, av_inv_q(AV_TIME_BASE_Q)); -- 2.37.0 (Apple Git-136) _______________________________________________ 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".