[ogg-dev] liboggplay and overlay video
Ralph Giles
giles at xiph.org
Wed Aug 20 09:30:00 PDT 2008
On Wed, Aug 20, 2008 at 2:27 AM, ogg.k.ogg.k at googlemail.com
<ogg.k.ogg.k at googlemail.com> wrote:
> I'd added an RGBA type, but if this is going to also carry video,
> it might be better to merge this with the existing video type, and
> have a 'type' enum,
Right now, OggPlayVideoData is just a struct with three arbitrarily
named pointers; it doesn't even know its own dimensions. I think
having several collections of arbitrary pointer sets which may be null
depending on a type field might be confusing. You could do something
fancy with unions, but since RGB/RGBA is generally chunked and YUV is
generally planar, having two separate types makes more sense. There's
also the 'array of plane pointers' approach, but I find frame->data[2]
hard to read.
Having the alpha channel be a separate plane and optionally NULL in
the YUV and RGB types would work though.
typedef struct {
unsigned char *y;
unsigned char *u;
unsigned char *v;
unsigned char *mask; /* may be NULL */
} OggPlayVideoYUVData;
typedef struct {
unsigned char *data; /* may be RGB or RGBA */
unsigned char *mask; /* may be NULL if RGBA */
} OggPlayVideoRGBData;
That sort of thing.
-r
More information about the ogg-dev
mailing list