1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-05 18:01:59 +02:00

lavc/avcodec: improve enc/dec API doxy

Change return value descriptions into lists of @retval
This commit is contained in:
Anton Khirnov 2023-01-10 15:12:48 +01:00
parent 935964bd41
commit 1f9828bb8c

View File

@ -2605,17 +2605,17 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
* still has frames buffered, it will return them after sending * still has frames buffered, it will return them after sending
* a flush packet. * a flush packet.
* *
* @return 0 on success, otherwise negative error code: * @retval 0 success
* AVERROR(EAGAIN): input is not accepted in the current state - user * @retval AVERROR(EAGAIN) input is not accepted in the current state - user
* must read output with avcodec_receive_frame() (once * must read output with avcodec_receive_frame() (once
* all output is read, the packet should be resent, and * all output is read, the packet should be resent,
* the call will not fail with EAGAIN). * and the call will not fail with EAGAIN).
* AVERROR_EOF: the decoder has been flushed, and no new packets can * @retval AVERROR_EOF the decoder has been flushed, and no new packets can be
* be sent to it (also returned if more than 1 flush * sent to it (also returned if more than 1 flush
* packet is sent) * packet is sent)
* AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush * @retval AVERROR(EINVAL) codec not opened, it is an encoder, or requires flush
* AVERROR(ENOMEM): failed to add packet to internal queue, or similar * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar
* other errors: legitimate decoding errors * @retval "another negative error code" legitimate decoding errors
*/ */
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);
@ -2629,18 +2629,17 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);
* codec. Note that the function will always call * codec. Note that the function will always call
* av_frame_unref(frame) before doing anything else. * av_frame_unref(frame) before doing anything else.
* *
* @return * @retval 0 success, a frame was returned
* 0: success, a frame was returned * @retval AVERROR(EAGAIN) output is not available in this state - user must
* AVERROR(EAGAIN): output is not available in this state - user must try * try to send new input
* to send new input * @retval AVERROR_EOF the codec has been fully flushed, and there will be
* AVERROR_EOF: the codec has been fully flushed, and there will be * no more output frames
* no more output frames * @retval AVERROR(EINVAL) codec not opened, or it is an encoder without the
* AVERROR(EINVAL): codec not opened, or it is an encoder without * AV_CODEC_FLAG_RECON_FRAME flag enabled
* the AV_CODEC_FLAG_RECON_FRAME flag enabled * @retval AVERROR_INPUT_CHANGED current decoded frame has changed parameters with
* AVERROR_INPUT_CHANGED: current decoded frame has changed parameters * respect to first decoded frame. Applicable when flag
* with respect to first decoded frame. Applicable * AV_CODEC_FLAG_DROPCHANGED is set.
* when flag AV_CODEC_FLAG_DROPCHANGED is set. * @retval "other negative error code" legitimate decoding errors
* other negative values: legitimate decoding errors
*/ */
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame);
@ -2667,16 +2666,16 @@ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame);
* If it is not set, frame->nb_samples must be equal to * If it is not set, frame->nb_samples must be equal to
* avctx->frame_size for all frames except the last. * avctx->frame_size for all frames except the last.
* The final frame may be smaller than avctx->frame_size. * The final frame may be smaller than avctx->frame_size.
* @return 0 on success, otherwise negative error code: * @retval 0 success
* AVERROR(EAGAIN): input is not accepted in the current state - user * @retval AVERROR(EAGAIN) input is not accepted in the current state - user must
* must read output with avcodec_receive_packet() (once * read output with avcodec_receive_packet() (once all
* all output is read, the packet should be resent, and * output is read, the packet should be resent, and the
* the call will not fail with EAGAIN). * call will not fail with EAGAIN).
* AVERROR_EOF: the encoder has been flushed, and no new frames can * @retval AVERROR_EOF the encoder has been flushed, and no new frames can
* be sent to it * be sent to it
* AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush * @retval AVERROR(EINVAL) codec not opened, it is a decoder, or requires flush
* AVERROR(ENOMEM): failed to add packet to internal queue, or similar * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar
* other errors: legitimate encoding errors * @retval "another negative error code" legitimate encoding errors
*/ */
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);
@ -2687,13 +2686,13 @@ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);
* @param avpkt This will be set to a reference-counted packet allocated by the * @param avpkt This will be set to a reference-counted packet allocated by the
* encoder. Note that the function will always call * encoder. Note that the function will always call
* av_packet_unref(avpkt) before doing anything else. * av_packet_unref(avpkt) before doing anything else.
* @return 0 on success, otherwise negative error code: * @retval 0 success
* AVERROR(EAGAIN): output is not available in the current state - user * @retval AVERROR(EAGAIN) output is not available in the current state - user must
* must try to send input * try to send input
* AVERROR_EOF: the encoder has been fully flushed, and there will be * @retval AVERROR_EOF the encoder has been fully flushed, and there will be no
* no more output packets * more output packets
* AVERROR(EINVAL): codec not opened, or it is a decoder * @retval AVERROR(EINVAL) codec not opened, or it is a decoder
* other errors: legitimate encoding errors * @retval "another negative error code" legitimate encoding errors
*/ */
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt);