lavc: Document BSF in/out codecparam alloc and init process

Message ID 20161004155953.9890-1-vittorio.giovara@gmail.com
State Superseded
Headers show

Commit Message

Vittorio Giovara Oct. 4, 2016, 3:59 p.m.
---
 libavcodec/avcodec.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Diego Biurrun Oct. 4, 2016, 4:11 p.m. | #1
On Tue, Oct 04, 2016 at 11:59:53AM -0400, Vittorio Giovara wrote:
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -5017,12 +5017,15 @@ typedef struct AVBSFContext {
>  
>      /**
> -     * Parameters of the input stream. Set by the caller before av_bsf_init().
> +     * Parameters of the input stream. This field is allocated in
> +     * av_bsf_alloc(),needs to be initialized by the caller before
> +     * av_bsf_init().
>       */
>      AVCodecParameters *par_in;

Space after ',' and please give the subclause a subject.

Diego
Anton Khirnov Oct. 10, 2016, 5:38 p.m. | #2
Quoting Vittorio Giovara (2016-10-04 17:59:53)
> ---
>  libavcodec/avcodec.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 167525d..02f391c 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -5017,12 +5017,15 @@ typedef struct AVBSFContext {
>      void *priv_data;
>  
>      /**
> -     * Parameters of the input stream. Set by the caller before av_bsf_init().
> +     * Parameters of the input stream. This field is allocated in
> +     * av_bsf_alloc(),needs to be initialized by the caller before

nit: I would use "filled" instead of initialized, since the fields are
guaranteed to be initialized to proper "invalid/unset" values, the
callers just fills those that are known/relevant.
Vittorio Giovara Oct. 12, 2016, 3:09 p.m. | #3
On Mon, Oct 10, 2016 at 1:38 PM, Anton Khirnov <anton@khirnov.net> wrote:
> Quoting Vittorio Giovara (2016-10-04 17:59:53)
>> ---
>>  libavcodec/avcodec.h | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 167525d..02f391c 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -5017,12 +5017,15 @@ typedef struct AVBSFContext {
>>      void *priv_data;
>>
>>      /**
>> -     * Parameters of the input stream. Set by the caller before av_bsf_init().
>> +     * Parameters of the input stream. This field is allocated in
>> +     * av_bsf_alloc(),needs to be initialized by the caller before
>
> nit: I would use "filled" instead of initialized, since the fields are
> guaranteed to be initialized to proper "invalid/unset" values, the
> callers just fills those that are known/relevant.

ok, I'll also slightly modify the title to the usual formatting

lavc: bsf: Document input/output codecparam alloc/init process

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 167525d..02f391c 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -5017,12 +5017,15 @@  typedef struct AVBSFContext {
     void *priv_data;
 
     /**
-     * Parameters of the input stream. Set by the caller before av_bsf_init().
+     * Parameters of the input stream. This field is allocated in
+     * av_bsf_alloc(),needs to be initialized by the caller before
+     * av_bsf_init().
      */
     AVCodecParameters *par_in;
 
     /**
-     * Parameters of the output stream. Set by the filter in av_bsf_init().
+     * Parameters of the output stream. This field is allocated in
+     * av_bsf_alloc(), it is set by the filter in av_bsf_init().
      */
     AVCodecParameters *par_out;