From patchwork Sat Mar 25 19:15: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: 40819 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp225274pzh; Sat, 25 Mar 2023 12:16:13 -0700 (PDT) X-Google-Smtp-Source: AK7set/yhR/N7RdddqkwQWLbdCyI1lKDicFuJ3dmSjBdrNYDN34AFSJua0XwwUDmQhlyFDDNWHTC X-Received: by 2002:a17:907:6d91:b0:8af:2f5e:93e3 with SMTP id sb17-20020a1709076d9100b008af2f5e93e3mr15906194ejc.29.1679771773368; Sat, 25 Mar 2023 12:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679771773; cv=none; d=google.com; s=arc-20160816; b=bZcgKqjpwTrM502V14NlFKI3/qd+SMSj7iMPnYAV+Dte4N/yl1COJfSRLvYUo/bqYT 1hFIYgDrF2w1ZxBqOIjeag44qdtvAfdj3ypx2Sk7kc2OqzlwpIKU+TmXUDGiG62wiRz5 9v8eg47kCJGO2oRSn/Qtxng0RZVaqF3ui7gXOsMxKxjgWI2RXUiHQ3F93pi2+xwIudsI GroeI08SZ3UUDhkuklCNjAZjEQ5GxigiRDPT8xV6e95LHH0Lx8gOVK3sdMLf+/jeGUml xeYYvtAbjVm7VEmpxHCMgs/zgAZXfahvmX4ABirHjs7MvEnaSJuPkT73KRj9h7ckFbZh RfFQ== 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:message-id:date:to:from :delivered-to; bh=iJfHhFzuFQBel8aMlihaM1Nyprdozch3cWxl6mUf7wc=; b=xYpQzaun6JXfy6zoe72y07I2tj2vwbprkLkjsVGWj83P/61KS7xmnxyOhvWpZYlOFT hCPUtnkAk1nFLYSAoa3gYS1tYBIFgOvjU/C2iijuX60HvzAiTTVlXpdRjnalQuZrpoyz u7THNpSXnJOnefhP2uId+aJEpCVylOac4S4SeA0k/5rXmZnRkzqQ4EiOPg/wE6vXGYil ZzUGX4jjDy8FrHGvAbtbAjO1vjnVQyDTgxNVgx83bKKatBcavoxOEPcV6gMwrOp4mHTK EyAbs6If+Csr0sMjaI5rQorsh1bc71pyCNGtrZVLl2tMnNKOEJ/sRANMBMPMDPezxwak VQmQ== 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 bo4-20020a170906d04400b00920fd209aadsi22436380ejb.758.2023.03.25.12.16.12; Sat, 25 Mar 2023 12:16:13 -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 2196268C956; Sat, 25 Mar 2023 21:16:09 +0200 (EET) 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 5487C68C810 for ; Sat, 25 Mar 2023 21:16:02 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8796E240D1D for ; Sat, 25 Mar 2023 20:16:01 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id JpwyWwpavVy0 for ; Sat, 25 Mar 2023 20:16:00 +0100 (CET) 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 D5C0C240178 for ; Sat, 25 Mar 2023 20:16:00 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 583653A00B6 for ; Sat, 25 Mar 2023 20:15:54 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 25 Mar 2023 20:15:07 +0100 Message-Id: <20230325191529.10578-1-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/23] fftools/ffmpeg: drop InputStream.processing_needed 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: oz31aSQSrOub It is equivalent to !InputStream.discard. --- fftools/ffmpeg.c | 4 ++-- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 1 - fftools/ffmpeg_mux_init.c | 3 --- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 438bee8fef..aa9284ecd5 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3648,7 +3648,7 @@ static void decode_flush(InputFile *ifile) InputStream *ist = ifile->streams[i]; int ret; - if (!ist->processing_needed) + if (ist->discard) continue; do { @@ -3793,7 +3793,7 @@ static int process_input(int file_index) for (i = 0; i < ifile->nb_streams; i++) { ist = ifile->streams[i]; - if (ist->processing_needed) { + if (!ist->discard) { ret = process_input_packet(ist, NULL, 0); if (ret>0) return 0; diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 823218e214..791deedc07 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -342,7 +342,6 @@ typedef struct InputStream { int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */ #define DECODING_FOR_OST 1 #define DECODING_FOR_FILTER 2 - int processing_needed; /* non zero if the packets must be processed */ // should attach FrameData as opaque_ref after decoding int want_frame_data; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 4fde120067..314b89b585 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -296,7 +296,6 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in) ist->discard = 0; ist->decoding_needed |= DECODING_FOR_FILTER; - ist->processing_needed = 1; ist->st->discard = AVDISCARD_NONE; ifilter = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 09d24ba8e5..ebc17059f9 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -2283,7 +2283,6 @@ int of_open(const OptionsContext *o, const char *filename) if (ost->enc_ctx && ost->ist) { InputStream *ist = ost->ist; ist->decoding_needed |= DECODING_FOR_OST; - ist->processing_needed = 1; if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { @@ -2294,8 +2293,6 @@ int of_open(const OptionsContext *o, const char *filename) exit_program(1); } } - } else if (ost->ist) { - ost->ist->processing_needed = 1; } /* set the filter output constraints */