[FFmpeg-devel] [PATCH] h264.c: add HW acceleration hooks
Michael Niedermayer
michaelni
Thu Feb 26 12:36:05 CET 2009
On Thu, Feb 26, 2009 at 10:11:58AM +0100, Gwenole Beauchesne wrote:
> 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.
yes but you are returning it from the middle, this has to be reviewed for
memleaks and such stuff and tested
i suspect you didnt test it ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090226/f4ab482f/attachment.pgp>
More information about the ffmpeg-devel
mailing list