diff mbox series

[FFmpeg-devel,3/3] avcodec/codec: add doxy to AVCodec.decode()

Message ID 20210305125419.504-3-jamrial@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/3] avcodec/codec: remove outdated comment about AVCodec.encode2() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer March 5, 2021, 12:54 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/codec.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Andreas Rheinhardt March 7, 2021, 1:34 p.m. UTC | #1
James Almer:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/codec.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/libavcodec/codec.h b/libavcodec/codec.h
> index bcda061da1..c019e7357c 100644
> --- a/libavcodec/codec.h
> +++ b/libavcodec/codec.h
> @@ -281,6 +281,17 @@ typedef struct AVCodec {
>       */
>      int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
>                     const struct AVFrame *frame, int *got_packet_ptr);
> +    /**
> +     * Decode picture or subtitle data.
> +     *
> +     * @param      avctx          codec context

For this to make sense you need to add the variable name in patch 2.

> +     * @param      outdata        codec type dependent output struct

Why didn't you set the "[out]"?

> +     * @param[out] got_packet_ptr decoder sets to 0 or 1 to indicate that a

Should be got_frame_ptr. (I am unsure whether we should retain that
"_ptr". It seems superfluous.)

> +     *                            non-empty frame or subtitle was returned in
> +     *                            outdata.
> +     * @param[in]  avpkt          AVPacket containing the bitstream to be decoded

Maybe use data instead of bitstream. After all, it may also contain
side-data and other information.

> +     * @return amount of bytes read from the packet, negative error code on failure
> +     */
>      int (*decode)(struct AVCodecContext *, void *outdata, int *got_frame_ptr,
>                    struct AVPacket *avpkt);
>      int (*close)(struct AVCodecContext *);
>
James Almer March 7, 2021, 1:49 p.m. UTC | #2
On 3/7/2021 10:34 AM, Andreas Rheinhardt wrote:
> James Almer:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavcodec/codec.h | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/libavcodec/codec.h b/libavcodec/codec.h
>> index bcda061da1..c019e7357c 100644
>> --- a/libavcodec/codec.h
>> +++ b/libavcodec/codec.h
>> @@ -281,6 +281,17 @@ typedef struct AVCodec {
>>        */
>>       int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
>>                      const struct AVFrame *frame, int *got_packet_ptr);
>> +    /**
>> +     * Decode picture or subtitle data.
>> +     *
>> +     * @param      avctx          codec context
> 
> For this to make sense you need to add the variable name in patch 2.

Good catch. Will do that.

> 
>> +     * @param      outdata        codec type dependent output struct
> 
> Why didn't you set the "[out]"?

Because i copied it from the encode2() doxy.

> 
>> +     * @param[out] got_packet_ptr decoder sets to 0 or 1 to indicate that a
> 
> Should be got_frame_ptr. (I am unsure whether we should retain that
> "_ptr". It seems superfluous.)

Fixed.

> 
>> +     *                            non-empty frame or subtitle was returned in
>> +     *                            outdata.
>> +     * @param[in]  avpkt          AVPacket containing the bitstream to be decoded
> 
> Maybe use data instead of bitstream. After all, it may also contain
> side-data and other information.

Ok.

> 
>> +     * @return amount of bytes read from the packet, negative error code on failure
>> +     */
>>       int (*decode)(struct AVCodecContext *, void *outdata, int *got_frame_ptr,
>>                     struct AVPacket *avpkt);
>>       int (*close)(struct AVCodecContext *);
>>
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index bcda061da1..c019e7357c 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -281,6 +281,17 @@  typedef struct AVCodec {
      */
     int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
                    const struct AVFrame *frame, int *got_packet_ptr);
+    /**
+     * Decode picture or subtitle data.
+     *
+     * @param      avctx          codec context
+     * @param      outdata        codec type dependent output struct
+     * @param[out] got_packet_ptr decoder sets to 0 or 1 to indicate that a
+     *                            non-empty frame or subtitle was returned in
+     *                            outdata.
+     * @param[in]  avpkt          AVPacket containing the bitstream to be decoded
+     * @return amount of bytes read from the packet, negative error code on failure
+     */
     int (*decode)(struct AVCodecContext *, void *outdata, int *got_frame_ptr,
                   struct AVPacket *avpkt);
     int (*close)(struct AVCodecContext *);