[FFmpeg-devel] Google Summer of Code participation
Thilo Borgmann
thilo.borgmann
Sat Apr 4 17:41:31 CEST 2009
Michael Niedermayer schrieb:
>> @@ -3018,24 +3017,40 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
>>
>> /**
>> * Decodes an audio frame from \p buf into \p samples.
>> - * The avcodec_decode_audio2() function decodes an audio frame from the input
>> - * buffer \p buf of size \p buf_size. To decode it, it makes use of the
>> + * Wrapper function which calls avcodec_decode_audio3.
>> + *
>> + * @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);
>> +
>>
>
> the old should be marked deprecated
>
>
Ok, Done for decode_audioX and decode_videoX.
> [...]
>
>> @@ -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);
>> +
>> +/* 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_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
>> + int *got_sub_ptr,
>> + AVPacket *avpkt);
>> +
>>
>
> this comment is not doxygen compatible
>
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.
* @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.
* @param[out] sub The decoded subtitle.
* @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);
TB
More information about the ffmpeg-devel
mailing list