[VDPAU] [PATCH] Fix incorrect VdpDecoderRender signature.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Feb 18 13:39:37 PST 2014
On Tue, Feb 18, 2014 at 08:42:09AM -0800, Stephen Warren wrote:
> Reimar Döffinger wrote at Sunday, February 16, 2014 12:14 PM:
> > VdpPictureInfo is already a pointer to e.g. a VdpPictureInfoH264,
> > and that is what the function expects, it does not expect
> > a pointer to a pointer as the signature claims.
> > This also requires a new typedef to keep the const attribute.
>
> Good catch, but ...
>
> > diff --git a/include/vdpau/vdpau.h b/include/vdpau/vdpau.h
>
> > typedef void * VdpPictureInfo;
> > +typedef const void * ConstVdpPictureInfo;
>
> I think this would be better served by the following:
>
> - typedef void * VdpPictureInfo;
> + typedef struct VdpPictureInfo VdpPictureInfo;
There is no "struct VdpPictureInfo" I can see anywhere? (and that is
almost certainly intentional since adding a new, larger
VdpPictureInfoSomething would break API/ABI if there was such a generic
type)
It would mean you could no longer pass in a VdpPictureInfoMPEG1Or2 *
without needing a cast.
There is also the problem that this would change API more
significantly.
If someone placed a VdpPictureInfo field into a struct for example
this change will break their code, since it refuses to compile.
> > @@ -3017,7 +3018,7 @@ typedef VdpPictureInfoMPEG4Part2 VdpPictureInfoDivX5;
> > typedef VdpStatus VdpDecoderRender(
> > VdpDecoder decoder,
> > VdpVideoSurface target,
> > - VdpPictureInfo const * picture_info,
> > + ConstVdpPictureInfo picture_info,
>
> ... and dropping that change.
>
> That way, all of VdpPictureInfo (the generic version) and VdpPictureInfo*
> (the various concrete structures) are all structs, rather than the generic
> version being a pointer instead.
I agree this would be nicer, but I can't see how it would be possible.
More information about the VDPAU
mailing list