From patchwork Fri Apr 5 16:11:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47830 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:24a8:b0:1a3:b6bb:3029 with SMTP id m40csp1068937pzd; Fri, 5 Apr 2024 09:13:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVTn3P7fVmUezjCjV2PCmX/VVSoDU3XhfSr43lwhM6ICnxaz045TSH1jS9VBy9mzo3tupw1ikk9Q69dA8HxT9zo3Re3wRqVVcjngw== X-Google-Smtp-Source: AGHT+IFmdsQDcw51CF6HRWjqddYdUP1wJiI0TWhyqSWrVjCWk6vCbQkOpQ6U/B+FxmkY3iQe6gJQ X-Received: by 2002:a17:906:4e93:b0:a51:9d6e:a77b with SMTP id v19-20020a1709064e9300b00a519d6ea77bmr1186825eju.0.1712333609286; Fri, 05 Apr 2024 09:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712333609; cv=none; d=google.com; s=arc-20160816; b=Xx5FyCVUtE5wZtMQzAwDA0ZnA4b/7CpVkpHgJFGVkAhr6y69RAFRiNa9AIIHui+5h0 m7L7u+W5jGiuJEOhDFCyRQGmUAgZ3ulLll0jTfPe4rUjx8Cg+dJbVuBhibSj8dZK9T54 oRIhHdnqGlr5oU6247mm6S1R9GNabry3lxr8ERGXW0bqDYEYdOIcc2ViG3zgRCqihOkJ e4coy0SmY2dlfy6pdfAKlz06Iubt5es6J7psPGpOltTnFNy5HILD9ixP+CbievblDMor bFKX0kfNeDuhA91hlnik+d9mA89J8qwZgzHZYEY2taOXNnWscE7O8K/tyUDb1n23XkfH W6oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=N0iESBcrJYJemGorFK2IH1Vf2Mlp42ani3IEgkHT1Zo=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=VsEiEItspiQX7xMEAn9qnb/koJJEqZXO4gZFhagEbPEq3T7MsYXiXwP5Cem/aBTgiF YhgVUf8sWckiK4r077yAKjyhEjYmiNArStcFHoHZcajJrWRJDLtr8iSRyQfw78sq/VqR tS9ybC8GOM+kk+iQZwkgKP+HPECbwkOTilCEx62AHvhwaggDLYdO+Pn+s/jRWtakZQ9x HP+u+r7mgaBV+pMZ6cNeWjSHlk5WEg8GTllW78VPTHYPVHhjCLWgIhkXe1E+g5lenA0Y wJt17XBkSfh2L+OTHwpqZAaCllZHkm11t5CoTvTabeUYSii2N8lZAViAhzi2yPBTvCys 62QA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=dDl6lncR; 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 ck7-20020a170906c44700b00a4720ded97dsi830621ejb.185.2024.04.05.09.13.28; Fri, 05 Apr 2024 09:13:29 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=dDl6lncR; 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 AE5B868D21C; Fri, 5 Apr 2024 19:13:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FA1A68D13B for ; Fri, 5 Apr 2024 19:13:04 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=dDl6lncR; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 2299C4D82 for ; Fri, 5 Apr 2024 18:13:03 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 6Jn5xOhxd7-K for ; Fri, 5 Apr 2024 18:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712333581; bh=UrFHyr8qZGnTT44anfv00nQz36JzG9zeVTol9PuXHzw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dDl6lncROGeSOZO6HnAUNsx/8AXrVj8Vv78U4vLVip7T3U9ULaSFZzy/4cm0trC5o qCtfszSAsLJWZqOte2Q8i7gyN29FioKo1JQkaIE+cEkp3wlGW7lw+cwhe34zu5HKmk WpA3pVmE7nLuKQ6YgE2rFAdiutwoZapfCuIdECUhSS44LQHypdKDhca4npln9sViU6 sem7tZ1cQP2jgJFw8QlmVlszYk++Qil0N7IfYDxaWV2nHIJaQGNVcJBE8GBvL9VcVG idjhsEr95DTDAgXMSEX34rwkUmMr3YR2tUHzzGOqNLlxMSS37SvDreeQBl2bF69Bct llRzn1OSx/7Fw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id E126025F for ; Fri, 5 Apr 2024 18:13:01 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 802233A059E for ; Fri, 5 Apr 2024 18:12:55 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2024 18:11:43 +0200 Message-ID: <20240405161212.26167-2-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405161212.26167-1-anton@khirnov.net> References: <20240405161212.26167-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/31] lavfi/avfilter: add an "auto" constant to the threads option 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WdeBf0OcIjhR Analogous to the same constant in avfiltergraph and avcodec. Cf. f599ae88c25. --- libavfilter/avfilter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 7f94e71fbc..049e4f62ca 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -652,7 +652,8 @@ static const AVOption avfilter_options[] = { { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = FLAGS, .unit = "thread_type" }, { "enable", "set enable expression", OFFSET(enable_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = TFLAGS }, { "threads", "Allowed number of threads", OFFSET(nb_threads), AV_OPT_TYPE_INT, - { .i64 = 0 }, 0, INT_MAX, FLAGS }, + { .i64 = 0 }, 0, INT_MAX, FLAGS, .unit = "threads" }, + {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags = FLAGS, .unit = "threads"}, { "extra_hw_frames", "Number of extra hardware frames to allocate for the user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS }, { NULL },