[FFmpeg-devel] [PATCH] h264.c: add HW acceleration hooks

Gwenole Beauchesne gbeauchesne
Thu Feb 26 10:11:58 CET 2009


On Wed, 25 Feb 2009, Michael Niedermayer wrote:

>>>> @@ -7706,6 +7718,11 @@ static int decode_frame(AVCodecContext *avctx,
>>>>         h->prev_frame_num_offset= h->frame_num_offset;
>>>>         h->prev_frame_num= h->frame_num;
>>>>
>>>> +        if (avctx->hwaccel) {
>>>> +            if (avctx->hwaccel->end_frame(avctx) < 0)
>>>> +                return -1;
>>>> +        }
>>>> +
>>>>         if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec-
>>>>> capabilities&CODEC_CAP_HWACCEL_VDPAU)
>>>>             ff_vdpau_h264_picture_complete(s);
>>>>
>>>
>>> this seems the only code that does a return -1 there ...
>>> what is the intent of that? besides what is the meaning of
>>> end_frame() failing?
>>
>> Generally, actually all cases, AVHWAccel::end_frame() is sending the
>> control blocks to the accelerator, and does the actual decoding. We
>> could ignore errors as the original VDPAU code though.
>
> iam not asking to ignore them but rather asking what exactly
> the return -1 at that point is supposed to achive?

You are right, it's probably just more useful to return the usual 
get_consumed_bytes(). OK to replace the return -1; with an 
av_log(ERROR,..)?

On the other hand, decode_frame() usually returns -1 on errors and let the 
callee manage whatever it wants.




More information about the ffmpeg-devel mailing list