* [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation
@ 2022-02-22 6:27 Anton Khirnov
2022-02-22 6:27 ` [FFmpeg-devel] [PATCH 2/2] lavc/bsf: improve doxy Anton Khirnov
2022-02-22 17:09 ` [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation James Almer
0 siblings, 2 replies; 5+ messages in thread
From: Anton Khirnov @ 2022-02-22 6:27 UTC (permalink / raw)
To: ffmpeg-devel
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().
* @{
*/
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] lavc/bsf: improve doxy
2022-02-22 6:27 [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation Anton Khirnov
@ 2022-02-22 6:27 ` Anton Khirnov
2022-02-22 17:09 ` [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation James Almer
1 sibling, 0 replies; 5+ messages in thread
From: Anton Khirnov @ 2022-02-22 6:27 UTC (permalink / raw)
To: ffmpeg-devel
---
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
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation
2022-02-22 6:27 [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation Anton Khirnov
2022-02-22 6:27 ` [FFmpeg-devel] [PATCH 2/2] lavc/bsf: improve doxy Anton Khirnov
@ 2022-02-22 17:09 ` James Almer
2022-03-16 11:36 ` Anton Khirnov
1 sibling, 1 reply; 5+ messages in thread
From: James Almer @ 2022-02-22 17:09 UTC (permalink / raw)
To: ffmpeg-devel
On 2/22/2022 3:27 AM, Anton Khirnov wrote:
> 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
Could use @ref here and below, too.
> + * 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.
The doxy for av_bsf_send_packet() states the packet must be "empty",
meaning either "NULL, or pkt->data is NULL and pkt->side_data_elems
zero", so probably mention the same here so it's consistent.
> + * 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().
> * @{
> */
LGTM otherwise.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation
2022-02-22 17:09 ` [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation James Almer
@ 2022-03-16 11:36 ` Anton Khirnov
2022-03-16 11:51 ` James Almer
0 siblings, 1 reply; 5+ messages in thread
From: Anton Khirnov @ 2022-03-16 11:36 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting James Almer (2022-02-22 18:09:59)
>
>
> On 2/22/2022 3:27 AM, Anton Khirnov wrote:
> > 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
>
> Could use @ref here and below, too.
That happens automatically when you write a struct name.
>
> > + * 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.
>
> The doxy for av_bsf_send_packet() states the packet must be "empty",
> meaning either "NULL, or pkt->data is NULL and pkt->side_data_elems
> zero", so probably mention the same here so it's consistent.
The idea here is to provide a quick overview of the API rather than be
exhaustive. In retrospect I regard allowing both NULL and "empty packet"
(for some quite nontrivial definition of empty, given side-data-only
packets) as a mistake, allowing only NULL would be cleaner and less
confusing.
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation
2022-03-16 11:36 ` Anton Khirnov
@ 2022-03-16 11:51 ` James Almer
0 siblings, 0 replies; 5+ messages in thread
From: James Almer @ 2022-03-16 11:51 UTC (permalink / raw)
To: ffmpeg-devel
On 3/16/2022 8:36 AM, Anton Khirnov wrote:
> Quoting James Almer (2022-02-22 18:09:59)
>>
>>
>> On 2/22/2022 3:27 AM, Anton Khirnov wrote:
>>> 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
>>
>> Could use @ref here and below, too.
>
> That happens automatically when you write a struct name.
>
>>
>>> + * 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.
>>
>> The doxy for av_bsf_send_packet() states the packet must be "empty",
>> meaning either "NULL, or pkt->data is NULL and pkt->side_data_elems
>> zero", so probably mention the same here so it's consistent.
>
> The idea here is to provide a quick overview of the API rather than be
> exhaustive. In retrospect I regard allowing both NULL and "empty packet"
> (for some quite nontrivial definition of empty, given side-data-only
> packets) as a mistake, allowing only NULL would be cleaner and less
> confusing.
Ok, LGTM then.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-16 11:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 6:27 [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation Anton Khirnov
2022-02-22 6:27 ` [FFmpeg-devel] [PATCH 2/2] lavc/bsf: improve doxy Anton Khirnov
2022-02-22 17:09 ` [FFmpeg-devel] [PATCH 1/2] lavc/bsf: add general documentation James Almer
2022-03-16 11:36 ` Anton Khirnov
2022-03-16 11:51 ` James Almer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git