From patchwork Mon Feb 14 22:41:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 34289 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:14aa:0:0:0:0 with SMTP id bz10csp5923727nkb; Mon, 14 Feb 2022 14:42:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwm+9pMyvesAo6aawJzssfmDKmTdAZRZ8ic5UuAHh58xoyq39cTdL+cS0VzLWq+aiLqAz2L X-Received: by 2002:aa7:d941:: with SMTP id l1mr1122244eds.200.1644878558511; Mon, 14 Feb 2022 14:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644878558; cv=none; d=google.com; s=arc-20160816; b=ooy2iNAkuDfjXy2WKWs0G0oVI4eBRrrggtAGW8DIJPQ2ZE1GFz2yK9wXQbX3Mp2Ai9 NqOlnV+HqyRkyZJkwV0hCraaWThD8bw5ezpCqxQsdVK5DvM801ScBtlMBZ5WDK0Z/okM LEIFW5LsLL3+s+3Ubt4ljoM/8GcvwMPkR2D990ECiwp5xcNdcXdyt+HWIX5p9JJ0LKe2 RaiP8I3+tbggTpmwh+D+dk84bz+myA5n6G3hgm84Ff5aU73JuA5w1eXKIIZzzfglzomu oP5qY+v0rGDcweHMH38DQhFnIRL7k1FF52oh890QTJCqAPL6boPhqta4xvLzwqRuTd+q 0GIw== 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=ih0sf/24QdrB01i1GZr/LzIkqnUqN9goDTuHy5rhg8g=; b=oX4Aw4Nn24smRr+c2cUZ52ZlVwYoP+t7dItHXEEBWaCmOjIJYMhBXsnK8a/2qlr9ZE QkonPrGhnQkf8hCF0ALGq41O8H2hy7Sp6flM+yXY9blyd9GlNatN1GJnS8oxXtuynlb6 yMkzomV/bk2HnjXuQDwerFjpTMgDlr14oTKXR8wKBKmVHwmMST6KUiSJGbWbZwZEVKz9 Qh4lCcWogmGRHF0gt3eeef8lbBegBwMt0ameoSB1AmGrccO/U6zYI2/mhnZzSeMQ1lrV IdT0wEAcZH/p8fWPtubP7Ny9jx9TT5W37xVpHp7m7UpZ8n3En/gcEnPvQJ2OF3+lkUan JIRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=pSTn9lMk; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hc13si14681305ejc.901.2022.02.14.14.42.33; Mon, 14 Feb 2022 14:42:38 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=pSTn9lMk; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6F0368B149; Tue, 15 Feb 2022 00:42:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0575268AEE9 for ; Tue, 15 Feb 2022 00:42:17 +0200 (EET) Received: by mail-oo1-f45.google.com with SMTP id i10-20020a4aab0a000000b002fccf890d5fso21100187oon.5 for ; Mon, 14 Feb 2022 14:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=UsTbFbKZ7mKxywbpMUgBPTkEOe1Z15VrmcO9PyQtsxg=; b=pSTn9lMkfxjKUlqLWNdcEkaCTgQg57961UJNr8e6fRaimFe9ZYZa2urbcL656WpNNi kUYWdPHrbYlZo6qjdBfngQ0KAWnZYaatkSsGfCkoeHq6ej1Y0mV3VkRRsYTZKmzxDpYy D2La+8VnOFHehxFppF/IsBdYFYEedsfKQwHqxse6IqT2SmMTm//LUjzy6LfRR5xQmDTY iKaMs3zpOsKcSfA/7pcnsHBotwNOK3IH8marsA+XNJUBc1TVN6do1W5U17uQ3zuky2zf yG5nYTOU62gp85TGpH/nnsnlmb6JHS8hgjeK3lLIafZpj3FBbtttLYiZEDoPy8JlkU29 u+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UsTbFbKZ7mKxywbpMUgBPTkEOe1Z15VrmcO9PyQtsxg=; b=kPpUv4gQ1pkUjjG0oVexmmlWfhKCewl51h9nZ/ZZf9rT+OVx8tVoz7RrJHNf4x1lW0 UBTgplgPMr490S+f7m1M0S4GVW+dZI4NWkqxwXKEfpslh1VG4hdIkRDa6tw9tuSebSha 6PTaJYcx9+ylDFsgUJzZ1AlI63+7sogMFnxUv2JOC7If7c7p/+dFGhPXYFMd6cGbA9Pd /r5Lfcl+obupd9UZ19s9xp9RfM6PpN3Qj9/KsGr+GQfx2//+bo9P4fRlSNhkHAQwXk/J DLCwIHPeatw9O1D1TwQiC5SgYVczGAXpAl+bFMV/XObjU0SauVwdDP8fAYvJLZwTvj70 W9Ew== X-Gm-Message-State: AOAM530xjn5tY+g9oPfrzFP2x3eMG31NrjbFwwTXTiJAIPCIqIZBWFtH m6REGFznfBAzNavRjZD13r+AhKhslYcdmQ== X-Received: by 2002:a05:6870:e308:: with SMTP id z8mr387527oad.132.1644878535835; Mon, 14 Feb 2022 14:42:15 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id a8sm13199885otj.47.2022.02.14.14.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 14:42:15 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Feb 2022 19:41:52 -0300 Message-Id: <20220214224156.39862-2-jamrial@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214224156.39862-1-jamrial@gmail.com> References: <20220214224156.39862-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/bsf: add a capabilities field to AVBitStreamFilter 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: 0pA5GL8CP13B And a first flag to signal that the bsf buffers packets and needs to be drained Signed-off-by: James Almer --- Missing APIChanges entry and version bump. libavcodec/bsf.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index 8c5355d186..798c6470ee 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -87,6 +87,12 @@ typedef struct AVBSFContext { AVRational time_base_out; } AVBSFContext; +/** + * The bitstream filter requires flushing with NULL input at the end in order + * to drain all buffered packets and give the complete and correct output. + */ +#define AV_BSF_CAP_DELAY (1 << 0) + typedef struct AVBitStreamFilter { const char *name; @@ -108,6 +114,12 @@ typedef struct AVBitStreamFilter { */ const AVClass *priv_class; + /** + * Filter capabilities. + * see AV_BSF_CAP_* + */ + int capabilities; + /***************************************************************** * No fields below this line are part of the public API. They * may not be used outside of libavcodec and can be changed and