From patchwork Wed May 17 10:20:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41680 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1079650pzb; Wed, 17 May 2023 03:24:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dZAyINWetb+u5rpIN6frwIXZyEVF3Y/48a2wwdCLdY58rmYQ+dFKGDEns/3jSjHc3V8Ea X-Received: by 2002:a17:907:94c5:b0:96a:7196:6e2b with SMTP id dn5-20020a17090794c500b0096a71966e2bmr19099862ejc.14.1684319074706; Wed, 17 May 2023 03:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684319074; cv=none; d=google.com; s=arc-20160816; b=o68Z6+qFxqNppDnmCtd99aGklZ8N1juh/VRrlbAfqOgNbwrHnNB0TGryCz8hHNFQrr ZXmR5fBRsfWB0vrYo8cx/NBe72WiHTsM4nA8djnZ30RstpBMK53CTW3N+CzAz9Ej/SrO DbzUI/vF+ocK8uwJsL4ZKmNyv3zHu4Nwdqz8okticl3X7VX7bzaS77l3NyRTfTv53pSX U1JwkXepheJFNOB8JINU67gKBH08wCCcVWtHuTfD2cDnFpJY0O5WFfpuJ2/IkavOVDR6 9iPYhbStDCznR7LFCZB6Fw6Q37HIMG6pzJbkITRZsNNnEo94KlvaNiuUOFpcIAtNe5Jk xyWw== 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:delivered-to; bh=oK8Wm98xKxK9ar1y7lIo3juYzstHnSS5g0+lylq0qeQ=; b=vnrhgZO/nYfciUNMxmvrlNEpAkKg6eetrSe28w8czg343Jh+xzoXsOsCIH6yBMCIZI ygpCfDdQdWxM3Yy17WTSqydSahhLOkOLb3aI7DoRMVumOAG+zTel/GRetZJ3q92i1paj wo9KmbncHnm6WpT5RAewXBnRXKBHGn7kuZJNXPGJhpIqV2ESe3KzvkbtFB/9zOMoiMi4 lq9wICZo1Z2APryTiA6dgx4umhc5FD21q6xuDotUVRHqdpMJQKuAZo109HJAK7lvaYtB 7KoJLqpxCXqS9pAprJKRxeZHxY61EerGhKCTwn3H85yXu3bDW6V1EtQZWbLVxDJ/J6qB ASPQ== 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 i10-20020a1709064eca00b009659fdd26adsi11336773ejv.105.2023.05.17.03.24.34; Wed, 17 May 2023 03:24:34 -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; 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 681FA68C1C8; Wed, 17 May 2023 13:21:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A96968C149 for ; Wed, 17 May 2023 13:20:58 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 48329240177 for ; Wed, 17 May 2023 12:20:58 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id wp6SQq5XtOXc for ; Wed, 17 May 2023 12:20:57 +0200 (CEST) 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 mail0.khirnov.net (Postfix) with ESMTPS id 63A3E240D25 for ; Wed, 17 May 2023 12:20:46 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 035C83A16DB for ; Wed, 17 May 2023 12:20:40 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 May 2023 12:20:07 +0200 Message-Id: <20230517102029.541-14-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517102029.541-1-anton@khirnov.net> References: <20230517102029.541-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/36] fftools/ffmpeg: move ifilter_has_all_input_formats() to ffmpeg_filter 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: g9Y6YITuMJQo That is a more appropriate place for that function. --- fftools/ffmpeg.c | 12 ------------ fftools/ffmpeg_filter.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e368f5a148..9d554e2fb0 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -787,18 +787,6 @@ static void check_decode_result(InputStream *ist, int *got_output, int ret) } } -// Filters can be configured only if the formats of all inputs are known. -int ifilter_has_all_input_formats(FilterGraph *fg) -{ - int i; - for (i = 0; i < fg->nb_inputs; i++) { - if (fg->inputs[i]->format < 0 && (fg->inputs[i]->type == AVMEDIA_TYPE_AUDIO || - fg->inputs[i]->type == AVMEDIA_TYPE_VIDEO)) - return 0; - } - return 1; -} - // This does not quite work like avcodec_decode_audio4/avcodec_decode_video2. // There is the following difference: if you got a frame, you must call // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0 diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 6323278d15..d85d9e2c67 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1445,6 +1445,18 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr return 0; } +// Filters can be configured only if the formats of all inputs are known. +int ifilter_has_all_input_formats(FilterGraph *fg) +{ + int i; + for (i = 0; i < fg->nb_inputs; i++) { + if (fg->inputs[i]->format < 0 && (fg->inputs[i]->type == AVMEDIA_TYPE_AUDIO || + fg->inputs[i]->type == AVMEDIA_TYPE_VIDEO)) + return 0; + } + return 1; +} + int filtergraph_is_simple(FilterGraph *fg) { FilterGraphPriv *fgp = fgp_from_fg(fg);