[FFmpeg-devel] Google Summer of Code participation

Thilo Borgmann thilo.borgmann
Fri Apr 3 01:19:27 CEST 2009



Michael Niedermayer schrieb:
>> diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
>> index 5c96baa..26c7cce 100644
>> --- a/libavcodec/4xm.c
>> +++ b/libavcodec/4xm.c
>> @@ -784,6 +784,15 @@ static int decode_frame(AVCodecContext *avctx,
>>      return buf_size;
>>  }
>>  
>> +static int decode_frame2(AVCodecContext *avctx,
>> +                        void *data, int *data_size,
>> +                        AVPacket *avpkt)
>> +{
>> +    return decode_frame(avctx, data, data_size, avpkt->data, avpkt->size);
>> +}
>> +
>> +
>> +
>>  
>>     
>
> decode_frame() should be changed not a new one added.
>
>
>   
Oh, I deducted this from the avcodec_decode_video2 creation... but ok 
will do.
> [...]
>   
>> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
>> index 4113382..eb732d2 100644
>> --- a/libavcodec/utils.c
>> +++ b/libavcodec/utils.c
>> @@ -530,12 +530,39 @@ int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *pic
>>  {
>>      int ret;
>>  
>> +    AVPacket avpkt;
>> +    avpkt.data = buf;
>> +    avpkt.size = buf_size;
>> +
>>      *got_picture_ptr= 0;
>>      if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
>>          return -1;
>>      if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
>> -        ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
>> -                                buf, buf_size);
>>     
>
>   
>> +            ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
>> +                                &avpkt);
>> +
>> +        emms_c(); //needed to avoid an emms_c() call before every return;
>>     
>
> indention if totally off
>
>   
Sorry don't get that. The inserted line is one click too far to the 
right... right?
Going to change that too, this is what you've mentioned?

>   
>> +
>> +        if (*got_picture_ptr)
>> +            avctx->frame_number++;
>> +    }else
>> +        ret= 0;
>> +
>> +    return ret;
>> +}
>> +
>> +int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
>> +                         int *got_picture_ptr,
>> +                         AVPacket *avpkt)
>> +{
>> +    int ret;
>> +
>> +    *got_picture_ptr= 0;
>> +    if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
>> +        return -1;
>> +    if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
>> +            ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
>> +                                avpkt);
>>  
>>          emms_c(); //needed to avoid an emms_c() call before every return;
>>  
>>     
>
> avcodec_decode_video() should call avcodec_decode_video2()
>
>   
Aaah yes of course... shame on me...

Thanks for the quick review!
TB



More information about the ffmpeg-devel mailing list