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 0FA5946043 for ; Mon, 1 May 2023 12:18:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA1EE68C086; Mon, 1 May 2023 15:18:56 +0300 (EEST) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01CFA68BC18 for ; Mon, 1 May 2023 15:18:50 +0300 (EEST) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-94f7a7a3351so491382666b.2 for ; Mon, 01 May 2023 05:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682943530; x=1685535530; 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=J6QQdN71o+F0rkerjavMhdV8Yom5lKhXzraxPltnA8E=; b=VVhL2ZacfGjMs7LpfhpBWfeebvW3oDQgqWOhiq4ydVy0Xga21OueABQatnNi7URRsx l+1tFKOmvLmGWGNyj1dKqiyWzrnPoLtGx3E4EVuJNCWnzTf4VhibiGxHeqNNhlRAXop5 NHwrgvqL7q5IHLg+4yG8bxUJZ5pcjTE4rVVkUpB00N5kQcL7R3IxcFZfh2UPUIbNZbxK qJEE5RXbZnCVv0CFNz+cwSpSOlqHUWuISIlUmXws2DyVsTGRgDq9Rg1+IEuxd/ifpwjE GkF+E3NOKznABdUS/9tZXIb6Gl+84EQPvr/ikMhp9X//tkjDLIDPpZ0CvwgSL2ZRSDfw yJzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682943530; x=1685535530; 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=J6QQdN71o+F0rkerjavMhdV8Yom5lKhXzraxPltnA8E=; b=OFh6GLvSeNiwSffKrYj9UjoJdr0gWz5kyQVb1MDh1t2UQjUJsSZ5yxAxKux7jRU/21 yWjI/m8Zk66QR8IXPkJ/4h3U/VXN+8Ro6cdWPR6hJpOkewXRSYHC1Nzz8OnfRAfP3sce hvXCa4+u+1A88qNGo1pENjEPS2/dHeXVFAyXBx43eSJEl1AizDLb0kl6bceeptMvc9ky zWzi6wylZY/m1YMIyoMN7KRB4frxUATT5Mi2AabtlTluxrv382rMCn2oDj7x7CjnH9J8 XBCutd5GAPu9Lr1fIEiT0OwcWFkHp9SgSfELlqSkpNmwn3DKjZ9jtg8u4SYMJb7e2yfg 9kWQ== X-Gm-Message-State: AC+VfDygTf4eKFKBjdGY8vjv3U5FHdxFU+fAQZks0iEkIFmM1SoDiDMv Fo/UA1SkKOjxO8TnPHWN3PxWJI0l6doHrA== X-Google-Smtp-Source: ACHHUZ6IJkjOhzq8Jy028NZ4o4gsriOauKzs/t4FWVGkEz8vTX16pZafvg4Zev1wwoqRN8fZHd+CYQ== X-Received: by 2002:a17:906:7308:b0:94e:7bde:3108 with SMTP id di8-20020a170906730800b0094e7bde3108mr13027946ejc.27.1682943530169; Mon, 01 May 2023 05:18:50 -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 s21-20020a170906779500b0094eef800850sm14778730ejm.204.2023.05.01.05.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 05:18:49 -0700 (PDT) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Mon, 1 May 2023 14:18:42 +0200 Message-Id: <20230501121842.18868-2-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20230501121842.18868-1-epirat07@gmail.com> References: <20230419104250.21354-1-epirat07@gmail.com> <20230501121842.18868-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 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 88c3c99de4..cabfe33685 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".