[FFmpeg-devel] Google Summer of Code participation

Stefano Sabatini stefano.sabatini-lala
Sat Apr 4 19:07:03 CEST 2009


On date Saturday 2009-04-04 17:41:31 +0200, Thilo Borgmann encoded:
[...]
> Stefano Sabatini schrieb:
>> [...]    
>>>  /* Decode a subtitle message. Return -1 if error, otherwise return the
>>>   * number of bytes used. If no subtitle could be decompressed,
>>> @@ -3100,6 +3129,14 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
>>>  int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
>>>                              int *got_sub_ptr,
>>>                              const uint8_t *buf, int buf_size);
>>>     
>>
>> I'd prefer here:
>>
>> "Wrapper function which calls avcodec_decode_subtitles2()."
>> This in order to avoid duplication in documentation.
>>   
> The original comment is not to be changed, as this would be a "cosmetic"  
> operation again?
> Added a more or less equal version of it in doxygen style to the new  
> decode_subtitle2.
>
>
>> [...]
>>   
>>> diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
>>> index 14da1a0..92672bf 100644
>>> --- a/libavcodec/fraps.c
>>> +++ b/libavcodec/fraps.c
>>> @@ -130,8 +130,10 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
>>>   */
>>>  static int decode_frame(AVCodecContext *avctx,
>>>                          void *data, int *data_size,
>>> -                        const uint8_t *buf, int buf_size)
>>> +                        AVPacket *avpkt)
>>>  {
>>> +    const uint8_t *buf = avpkt->data;
>>> +    int buf_size = avpkt->size;
>>>      FrapsContext * const s = avctx->priv_data;
>>>      AVFrame *frame = data;
>>>      AVFrame * const f = (AVFrame*)&s->frame;
>>>     
>>
>>   
>>> @@ -345,7 +347,6 @@ static int decode_frame(AVCodecContext *avctx,
>>>      return buf_size;
>>>  }
>>>  -
>>>  /**
>>>   * closes decoder
>>>   * @param avctx codec context
>>>     
>>
>> cosmetic, are you actually looking at what you submit?
>>
>>   
>>
> I do and as there are quite a few files, naturally some of theese are  
> getting through...
>
> Here are the new comments I've written, please have a look before I  
> finalize them in another revision while I'm going to hunt down these  
> "cosmetics":

> /**
> * Decodes an audio frame from \p buf into \p samples.
> * Wrapper function which calls avcodec_decode_audio3.
> *
> * @depricated Use avcodec_decode_audio3 instead.
         ^

@deprecated

Also remember to use attribute_deprecated, and put under #if
LIBAVCODEC_VERSION_MAJOR < NEXT_VERSION the deprecated functions+declarations.

> * @param avctx the codec context
> * @param[out] samples the output buffer
> ...
> */
>
> /**
> * Decodes a video frame from \p buf into \p picture.
> * Wrapper function which calls avcodec_decode_video2.
> *
> * @depricated Use avcodec_decode_video2 instead.
> * @param avctx the codec context
> * @param[out] picture The AVFrame in which the decoded video frame will  
> be stored.
> ...
> */
>
> /**
> * Decodes a subtitle message.
> * Returns -1 if error, otherwise returns the number of bytes used.
> * If no subtitle could be decompressed, \p got_sub_ptr is zero.
> * Otherwise, the subtitle is stored in \p *sub.
> *
> * @param avctx The codec context.

"the codec context" with no capitalization and without the final
point, some for the other params.

We have some rather complex rule for which if a comment is not a
complete sentence then it doesn't need capitalization/ending period.

> * @param[out] sub The decoded subtitle.

For consistency with avcodec_decode_video() I'd prefer:
@param[out] sub the AVSubtitle in which the decoded subtitle will be stored

> * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed.
> * @param[in] avpkt The input packet containing the input buffer.
> */
> int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
>                            int *got_sub_ptr,
>                            AVPacket *avpkt);
[...]

Regards.  
-- 
FFmpeg = Foolish & Frenzy Mournful Philosofic Exciting Ghost



More information about the ffmpeg-devel mailing list