[FFmpeg-devel] [PATCH] Try to make new VDPAU usable by adding context to callback.

Nicolas George nicolas.george at normalesup.org
Thu Aug 8 10:22:34 CEST 2013


Le decadi 20 thermidor, an CCXXI, Michael Niedermayer a écrit :
> see MAKE_ACCESSORS()

A side note on that: this macro builds a pair of functions:

type get_foo(struct *s) { return s->foo; }
void set_foo(struct *s, type v) { s->foo = v; }

If the goal is only to preserve binary compatibility when fields move (and
not abstract the changes and possibly translate to something else), then I
believe now that this would be a better API:

type *get_foo_p(struct *s) { return &s->foo; }

That way, the set variant is written:

	*get_foo_p(s) = 42;

This is especially important when the field is a pointer to a dictionary,
because the dictionary API uses pointers to the pointer, but it is valid for
all fields.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130808/9267989f/attachment.asc>


More information about the ffmpeg-devel mailing list