[FFmpeg-devel] Google Summer of Code participation

Thilo Borgmann thilo.borgmann
Sat Apr 4 19:37:37 CEST 2009



Stefano Sabatini schrieb:
>> /**
>> * Decodes an audio frame from \p buf into \p samples.
>> * Wrapper function which calls avcodec_decode_audio3.
>> *
>> * @depricated Use avcodec_decode_audio3 instead.
>>     
>          ^
>
> @deprecated
>   
Corrected.
> Also remember to use attribute_deprecated, and put under #if
> LIBAVCODEC_VERSION_MAJOR < NEXT_VERSION the deprecated functions+declarations.
>
>   
I hope I did this right, see below...
>
> "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
>
>   
Done.

This should be (more) correct then:




#if LIBAVCODEC_VERSION_MAJOR < 53
attribute_deprecated
/**
* Decodes an audio frame from \p buf into \p samples.
* Wrapper function which calls avcodec_decode_audio3.
*
* @deprecated Use avcodec_decode_audio3 instead.
* @param avctx the codec context
* @param[out] samples the output buffer
* @param[in,out] frame_size_ptr the output buffer size in bytes
* @param[in] buf the input buffer
* @param[in] buf_size the input buffer size in bytes
* @return On error a negative value is returned, otherwise the number of 
bytes
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
const uint8_t *buf, int buf_size);
#endif

/**
* Decodes an audio frame from \p avpkt->data into \p samples.
* The avcodec_decode_audio3() function decodes an audio frame from the input
...
* start of the buffer to 16.
*
* @param avctx the codec context
* @param[out] samples the output buffer
* @param[in,out] frame_size_ptr the output buffer size in bytes
* @param[in] avpkt the input AVPacket containing the input buffer
* @return On error a negative value is returned, otherwise the number of 
bytes
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
AVPacket *avpkt);

#if LIBAVCODEC_VERSION_MAJOR < 53
attribute_deprecated
/**
* Decodes a video frame from \p buf into \p picture.
* Wrapper function which calls avcodec_decode_video2.
*
* @deprecated Use avcodec_decode_video2 instead.
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will 
be stored.
* @param[in] buf the input buffer
* @param[in] buf_size the size of the input buffer in bytes
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, 
otherwise, it is nonzero.
* @return On error a negative value is returned, otherwise the number of 
bytes
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
const uint8_t *buf, int buf_size);
#endif

/**
* Decodes a video frame from \p avpkt->data into \p picture.
* The avcodec_decode_video2() function decodes a video frame from the input
...
* start of the buffer to 16.
*
* @note Some codecs have a delay between input and output, these need to be
* feeded with avpkt->data=NULL, avpkt->size=0 at the end to return the 
remaining frames.
*
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will 
be stored.
* @param[in] avpkt the input AVpacket containing the input buffer
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, 
otherwise, it is nonzero.
* @return On error a negative value is returned, otherwise the number of 
bytes
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
AVPacket *avpkt);

#if LIBAVCODEC_VERSION_MAJOR < 53
attribute_deprecated
/* Decode a subtitle message. Return -1 if error, otherwise return the
* number of bytes used. If no subtitle could be decompressed,
* got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
const uint8_t *buf, int buf_size);
#endif

/**
* 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
* @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, 
otherwise, it is nonzero.
* @param[in] avpkt the input AVPacket containing the input buffer
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
AVPacket *avpkt);



Thanks!
TB





More information about the ffmpeg-devel mailing list