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 2101B4032F for ; Wed, 19 Apr 2023 10:43:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 31A8B68BF2A; Wed, 19 Apr 2023 13:43:17 +0300 (EEST) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B559E68BF20 for ; Wed, 19 Apr 2023 13:43:10 +0300 (EEST) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-50677365fd1so3937408a12.0 for ; Wed, 19 Apr 2023 03:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681900990; x=1684492990; 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=WWJMGVfm8yK05d+OrftVRxX+NzTIMPQgL9xSXAaDILE=; b=B2ree6aUNB8VBMlBLGjW+9+9ncRpgfci9+cXU6KLQhD4kcWffASCa2xKXCfsF/aU1Q NWs/O15fpLgPFy/s/dNn8oprXoPGZvbXIthujX53bukDCrpUSNr5gmjLEcOEqpqBzHnA k5U/Uj05yQQdQIbQiwloUAWkQ1wZoERsh/j78DDFwIdXusAd0dQT231TVtrs2wZm3X20 EtxJ6C+60jYbkPDTClJ4ufFUo7hc0tz5awubqwsKFUiUxZ3QtEizoCEyIKh43TkOmgIE 8NekjNlCSKEY2TNEYCPgV+8v658xJxeMhIR+Me/8ucGm+G8lFwPzuRGJ8cHfsZzBEQoS Yl2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681900990; x=1684492990; 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=WWJMGVfm8yK05d+OrftVRxX+NzTIMPQgL9xSXAaDILE=; b=HuFxxDcOWK4GiwQ0kPVjbNR0fuqag0xej0vKD7+44DVX/SpJ43/zSBaV9wc05LNVL4 AKHr9okok8CmYBQfvj6GH2CYGGLCth4NMF+tQAeItCn18zy+hWs6JldNkaIhqQy8hebG paa//JvGIsNzq7dWHSkUiuRPOFyirmrEqasWYzSqfaQIPnZT58PB9xwTvRy+OIWhCpex +5kKFKCb23fqd1Q+R2RQf9kWPIsuW7gnL/Pkv8+3xkl6vBcXNpUCeqKs8KfXb6AuG1Le 9neMk4YTmDPnkNHmphlQg6/ZCB4lIBJXSK9VlQ4FiBo70rkeLZuc1Sh6ulDQV7SPG73v pgug== X-Gm-Message-State: AAQBX9fJwt4jNmmYkICLJd9RdXY7nT6BwdkspTucN8soGSCVKKNisU49 Kp/scRcefMkNlbp+tnlK7Q12GFZ4fF8= X-Google-Smtp-Source: AKy350YG3SYEb5SrRVI3dcG07dydeTRJ/UoZATn01CjAzPWkwAc6m6pVM61SFAlqd4ru9l9GsywOCQ== X-Received: by 2002:aa7:d691:0:b0:502:7d3f:1f04 with SMTP id d17-20020aa7d691000000b005027d3f1f04mr6116984edr.19.1681900989910; Wed, 19 Apr 2023 03:43:09 -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 m5-20020aa7c2c5000000b00506987c5c71sm4792859edp.70.2023.04.19.03.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 03:43:09 -0700 (PDT) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Apr 2023 12:42:50 +0200 Message-Id: <20230419104250.21354-2-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20230419104250.21354-1-epirat07@gmail.com> References: <20230419104250.21354-1-epirat07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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 initialized when just cloning frames. --- libavfilter/vf_tpad.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c index 88c3c99de4..9a9d06a8b8 100644 --- a/libavfilter/vf_tpad.c +++ b/libavfilter/vf_tpad.c @@ -71,7 +71,13 @@ 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)); + + fprintf(stderr, "ONLY COPY\n"); + return ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_VIDEO)); } static int activate(AVFilterContext *ctx) @@ -190,8 +196,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".