From patchwork Wed Jan 25 16:55:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40109 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3ca3:b0:b9:1511:ac2c with SMTP id b35csp546422pzj; Wed, 25 Jan 2023 08:56:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXuUchhjmctx3mDBCZbMiCeIcSY6Yr+UKk99sIf4L2KZVRs1XCsjkWsyrgZKdq+QzIY/4+/7 X-Received: by 2002:a05:6402:10c4:b0:48e:94ec:b7ac with SMTP id p4-20020a05640210c400b0048e94ecb7acmr31158470edu.7.1674665814195; Wed, 25 Jan 2023 08:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674665814; cv=none; d=google.com; s=arc-20160816; b=RIWZEDc4E6OwxRTesUi1hbaE+1giN+JK+T9X3xh9I40C2mb91S45B8nZls1eJnDkoR A3RMzNFVzXDaxHKFltkBB/XSiHxPQ0QUOzzMsUrtQoBTdyFhXfhLIwL9vYkh6NswG1AF nSvT6a2Srro2p7I8loBMQzym4jbOVgy3zhNL2Wt2eYn38zXTLg8Rc93AoeCxYM/gxati INQnEUpKgCJ93+EFgrWUhnHFLwbOZ9/Um3347dTALEmI7gAU4OAlbxJhsSFYdAKDkqs7 mPRwHWh5lZhr0iCfZSHwhLx+I6urKZuo7x5Ok4Kw1/hLZT1U5m5+/C8qgjvA/7nNvwTG RXwA== 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=F6FQGtVBrcCNhfndonWoi5lDu/I99PUj/9qDcpj1YX4=; b=vvIGXrNv2MTzYh9Lgp3Yx8l1ic7LQHz/QSrX1lHB65shjn0YsZhSbBac1BWpg5iXX6 7M9k86BlNrfMSBd1+KehBj5y4/HG1h9k2Z935u4PP+d9L3TX7UMwBKWvlBSU8Am59d9b B9uCvy3a8kyvBAQ4YBd8RepJDMR3SG2Po21lla6wJVkOr8fCCmJS5uRskPpiAmXUwYrr Gi0PIhVhyFXV5boTIKeGNSpvrhws07/sMsT0gpDKFvZ/QoLZOqIjQ86Cp+IvItP2zksO E6nnwTcGVs2HRUDUkrUXiGN1ZTc1H74LHR9GiuDzhaVIN91grviOyI5JcNQwe6i920sE ykOA== 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 p17-20020aa7cc91000000b0048475139291si6506957edt.590.2023.01.25.08.56.53; Wed, 25 Jan 2023 08:56:54 -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 05B1D68BD7C; Wed, 25 Jan 2023 18:56:24 +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 D927D68BBEB for ; Wed, 25 Jan 2023 18:56:14 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 9E8FF2404F8 for ; Wed, 25 Jan 2023 17:56:14 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 5O0WSnRxMISl for ; Wed, 25 Jan 2023 17:56:12 +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 F3CAB2404F5 for ; Wed, 25 Jan 2023 17:56:04 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 7F4963A02AF for ; Wed, 25 Jan 2023 17:55:58 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Jan 2023 17:55:19 +0100 Message-Id: <20230125165537.5371-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/19] lavc/avcodec: improve enc/dec API 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: PylYXZxSOeRu Change return value descriptions into proper lists. --- libavcodec/avcodec.h | 81 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 0ac581d660..f3ca41f126 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2605,17 +2605,18 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, * still has frames buffered, it will return them after sending * a flush packet. * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_frame() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors + * @return + * - 0: success + * - AVERROR(EAGAIN): input is not accepted in the current state - user must + * read output with avcodec_receive_frame() (once all + * output is read, the packet should be resent, and the + * call will not fail with EAGAIN). + * - AVERROR_EOF: the decoder has been flushed, and no new packets can be + * sent to it (also returned if more than 1 flush packet is + * sent) + * - AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush + * - AVERROR(ENOMEM): failed to add packet to internal queue, or similar + * - other errors: legitimate decoding errors */ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); @@ -2630,17 +2631,17 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); * av_frame_unref(frame) before doing anything else. * * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available in this state - user must try - * to send new input - * AVERROR_EOF: the codec has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder without - * the AV_CODEC_FLAG_RECON_FRAME flag enabled - * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters - * with respect to first decoded frame. Applicable - * when flag AV_CODEC_FLAG_DROPCHANGED is set. - * other negative values: legitimate decoding errors + * - 0: success, a frame was returned + * - AVERROR(EAGAIN): output is not available in this state - user must + * try to send new input + * - AVERROR_EOF: the codec has been fully flushed, and there will be + * no more output frames + * - AVERROR(EINVAL): codec not opened, or it is an encoder without the + * AV_CODEC_FLAG_RECON_FRAME flag enabled + * - AVERROR_INPUT_CHANGED: current decoded frame has changed parameters with + * respect to first decoded frame. Applicable when flag + * AV_CODEC_FLAG_DROPCHANGED is set. + * - other negative values: legitimate decoding errors */ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); @@ -2667,16 +2668,17 @@ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); * If it is not set, frame->nb_samples must be equal to * avctx->frame_size for all frames except the last. * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_packet() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate encoding errors + * @return + * - 0: success + * - AVERROR(EAGAIN): input is not accepted in the current state - user must + * read output with avcodec_receive_packet() (once all + * output is read, the packet should be resent, and the + * call will not fail with EAGAIN). + * - AVERROR_EOF: the encoder has been flushed, and no new frames can + * be sent to it + * - AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush + * - AVERROR(ENOMEM): failed to add packet to internal queue, or similar + * - other errors: legitimate encoding errors */ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); @@ -2687,13 +2689,14 @@ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); * @param avpkt This will be set to a reference-counted packet allocated by the * encoder. Note that the function will always call * av_packet_unref(avpkt) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available in the current state - user - * must try to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is a decoder - * other errors: legitimate encoding errors + * @return + * - 0: success + * - AVERROR(EAGAIN): output is not available in the current state - user must + * try to send input + * - AVERROR_EOF: the encoder has been fully flushed, and there will be no + * more output packets + * - AVERROR(EINVAL): codec not opened, or it is a decoder + * - other errors: legitimate encoding errors */ int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt);