From patchwork Tue Feb 22 06:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 34437 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp4069223nkx; Mon, 21 Feb 2022 22:28:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJypGY0H3ZayLx+rHRqA33U+XfZd8axXpdmjSjtOUwcLNZlUNVTV99esgYvPXsKdB953w+lH X-Received: by 2002:a17:906:be1:b0:6ce:c3c8:b4b6 with SMTP id z1-20020a1709060be100b006cec3c8b4b6mr17722161ejg.617.1645511307786; Mon, 21 Feb 2022 22:28:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645511307; cv=none; d=google.com; s=arc-20160816; b=Xw3ONyTpXibDZOUyqWwGvYTntTDnCn0f4xHIlbyyTGzFc/DiZIfOaabIBW9i5CIN0F 4Px+zTaF9p7YKP17cmYX3QMiLFLW2/UZwDswII89RYsB58aqeMXNS4OYHx6CDzfNy+io YN+c8zGnB1RlGqiBE/1XatQ/tfnfYX4JWXJFdRuZa2DyfSCmotdVQ7hCvQARufg7BNZz XvJHdT7m2LgQ+I+i+F5nYm9HLgN+GhKF1PoI8NIzyzkzcqpvHRzD+Ph7AhC6yMpxzjw4 D2eAIhbRNflfo6wazpNAKFfKSS3PY+YKlAg5Ymo9AWNTinXNkpRcA+8hnwj62ciLgAT/ O9bQ== 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=I8f0Zmr4UrdCFsNbGBQlMKBjWgYpL407AnnumPzaP8I=; b=XCpCleASJ71xMRrFgxNMU0KC57+6nYRH9GGxUSoqCYX07+cMBOKhPVUmJeT11ztTlW GW9H2rslbXN9xfBND74vyJYuK8wmOEu7XpTpOiesPVfQI9OhCPXHsWrEGz7jiyNeS8Ck Rgjt8e3AlTZynuvHWqWvS86Mwd+Z9T0zPVPh5MMj6282LAYoyOArg/9DOVg1TO8TH5tH QjKQJtXU+y/8eTbcGbypmKzK2r/3oO6pVUbo06v4s+fc9F2GYQAza9UZaH0I9dx1QfVZ kDJkN0MvrYT9scTwz0M79gj/qu20pEug/7lFompszr0SzMHarVjgSCtuCLkpzEqM6XHi OjjQ== 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 d5si13034088edm.342.2022.02.21.22.28.27; Mon, 21 Feb 2022 22:28:27 -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; 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 86E6B68A628; Tue, 22 Feb 2022 08:28:13 +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 1673468A2BF for ; Tue, 22 Feb 2022 08:28:06 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 559A524017C for ; Tue, 22 Feb 2022 07:28:05 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id FOjP6G5lCidf for ; Tue, 22 Feb 2022 07:28:03 +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 C74B2240175 for ; Tue, 22 Feb 2022 07:28:03 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id E66AE3A0406; Tue, 22 Feb 2022 07:28:01 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Feb 2022 07:27:56 +0100 Message-Id: <20220222062757.20908-1-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation 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: iq8TeL96aNhQ Also, place the BSF api docs in their own doxygen group. --- libavcodec/bsf.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index 8c5355d186..ba8b48f222 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -30,7 +30,28 @@ #include "packet.h" /** - * @addtogroup lavc_core + * @defgroup lavc_bsf Bitstream filters + * @ingroup libavc + * + * Bitstream filters transform encoded media data without decoding it. This + * allows e.g. manipulating various header values. Bitstream filters operate on + * @ref AVPacket "AVPackets". + * + * The bitstream filtering API is centered around two structures: + * AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter + * in abstract, the latter a specific filtering process. Obtain an + * AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass + * it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable + * AVBSFContext fields, as described in its documentation, then call + * av_bsf_init() to prepare the filter context for use. + * + * Submit packets for filtering using av_bsf_send_packet(), obtain filtered + * results with av_bsf_receive_packet(). When no more input packets will be + * sent, submit a NULL AVPacket to signal the end of the stream to the filter. + * av_bsf_receive_packet() will then return trailing packets, if any are + * produced by the filter. + * + * Finally, free the filter context with av_bsf_free(). * @{ */ From patchwork Tue Feb 22 06:27:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 34438 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp4069285nkx; Mon, 21 Feb 2022 22:28:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGUZUKDbqwEGPXI+hO/HpdQKqIoGzUatjXzpoKEfl7vkZbhfhePPkRobbQxsHGhMISZnZQ X-Received: by 2002:a17:906:6b8d:b0:6cf:ebab:ef81 with SMTP id l13-20020a1709066b8d00b006cfebabef81mr18022170ejr.5.1645511316856; Mon, 21 Feb 2022 22:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645511316; cv=none; d=google.com; s=arc-20160816; b=ZT/blwmVdbTPLNlGxGsLObDv7xcoN0LEke1kPSP5NyzElaEI+Tf7JPVC/BcHG7zlv2 tU6+kN9NsSm/2kiuR7SypGgD1lKOeIDQjggBZS8mg8viavcYZAPbznFYlwg3fBjSZSP0 oIk5e345P4NHnCmQXoJEBbX1uUWtxBvEJBYHCkzQ6vtviV08gUqoDnVIkNqnYwBB1Y9X 9Y6ZwT2kDh28qwIrEoP2fAOwG+SvLAt0XrLcMuchl5svNmGdMuRgNmt10Ycx3Q1ihxnU mblquUZcdpo4SJ5CApnTbm+tnMMCqSxdYA4dJI63OygBnfxGI3ZNhl7zZMsy271CYL6y HVZg== 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=+CJ2nf7vJp1EzGwPhrmXHSGS8n5coHH8+RUD4VvqzZA=; b=lEUVQAmhmtZ8CZ7OJuK5UXJjuHqZu/9W1ox3gqjyGMqtufE5rco7QYTSZjyK3Cif6Q /TNVVkJ7KkdLM0s56Wb1k0aLhWivgFfvvO7HopeEREMQ3NpoBUo0EMJtmoYBLv6FDOoV 9KXWGJru+qETZCj5G9+7MzZlFAsZVFZWmhVqjuXBbDAldfDxM4lIj3tUKBPtLFRJ8I4i gywSIM0PJwsh71yme+9S9TPqiQlpmRRoch+L6AG0dvo/zCnbSLIooe2GPRF/z8OzKLOf QrtkmwVjYBVRs69irvDGtuS/zxExq7qHZ+K0dQihJ9RQ7JSD6D2IX2Dd1JuE/KJFHaj5 DHNA== 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 fz1si13177369ejc.338.2022.02.21.22.28.36; Mon, 21 Feb 2022 22:28:36 -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; 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 071F168AF85; Tue, 22 Feb 2022 08:28:15 +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 E434968A34B for ; Tue, 22 Feb 2022 08:28:06 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 963D5240175 for ; Tue, 22 Feb 2022 07:28:06 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Ft_P9td6UV1k for ; Tue, 22 Feb 2022 07:28:03 +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 D3477240179 for ; Tue, 22 Feb 2022 07:28:03 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id E83203A02AA; Tue, 22 Feb 2022 07:28:01 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Feb 2022 07:27:57 +0100 Message-Id: <20220222062757.20908-2-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220222062757.20908-1-anton@khirnov.net> References: <20220222062757.20908-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavc/bsf: improve doxy 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: pEQeAAoCey+a --- libavcodec/bsf.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index ba8b48f222..611beab885 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -167,9 +167,9 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque); * av_bsf_init() before sending any data to the filter. * * @param filter the filter for which to allocate an instance. - * @param ctx a pointer into which the pointer to the newly-allocated context - * will be written. It must be freed with av_bsf_free() after the - * filtering is done. + * @param[out] ctx a pointer into which the pointer to the newly-allocated context + * will be written. It must be freed with av_bsf_free() after the + * filtering is done. * * @return 0 on success, a negative AVERROR code on failure */ @@ -195,9 +195,11 @@ int av_bsf_init(AVBSFContext *ctx); * sending more empty packets does nothing) and will cause the filter to output * any packets it may have buffered internally. * - * @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from the - * filter (using av_bsf_receive_packet()) before new input can be consumed. Another - * negative AVERROR value if an error occurs. + * @return + * - 0 on success. + * - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using + * av_bsf_receive_packet()) before new input can be consumed. + * - Another negative AVERROR value if an error occurs. */ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); @@ -214,10 +216,12 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); * overwritten by the returned data. On failure, pkt is not * touched. * - * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the - * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there - * will be no further output from the filter. Another negative AVERROR value if - * an error occurs. + * @return + * - 0 on success. + * - AVERROR(EAGAIN) if more packets need to be sent to the filter (using + * av_bsf_send_packet()) to get more output. + * - AVERROR_EOF if there will be no further output from the filter. + * - Another negative AVERROR value if an error occurs. * * @note one input packet may result in several output packets, so after sending * a packet with av_bsf_send_packet(), this function needs to be called