[gst-devel] OR'ed capabilities

Jan Schmidt jan at slug.org.au
Sun Feb 1 13:23:00 CET 2004


On Mon, 2004-02-02 at 02:37, Martin Soto wrote:
> Hi!
> 
> The DVD demuxer audio sources, need to be able to handle different types
> of audio, namely, MPEG, AC3, DTS and linear PCM.  Since a single pad may
> have to change dynamically between two or more of these types, I need to
> define the pad template for such a pad as a boolean OR of the caps for
> the four possible types.
> 
> How do I do that?  As far as I can see, static caps aren't able to
> express such a thing.  An example would come really handy.
> 

Hi Martin,

You want chained caps, as used in lots of places to do exactly this. For
example, ffcolorspace has some caps like this (plus more):

      video/x-raw-yuv,
        width=(int)[ 16, 4096 ],
        height=(int)[ 16, 4096 ],
        framerate=(double)[ 0, 1.7976931348623157e+308 ],
        format=(fourcc)I420;
      video/x-raw-yuv,
        width=(int)[ 16, 4096 ]
        height=(int)[ 16, 4096 ]
        framerate=(double)[ 0, 1.7976931348623157e+308 ]
        format=(fourcc)YUY2;
      video/x-raw-rgb, 
        width=(int)[ 16, 4096 ], 
        height=(int)[ 16, 4096 ], 
        framerate=(double)[ 0, 1.7976931348623157e+308 ],
        bpp=(int)24,
        depth=(int)24,
        red_mask=(int)16711680,
        green_mask=(int)65280,
        blue_mask=(int)255,
        endianness=(int)4321

This says that it can produce yuv I420, YUY2 or 24 bit RGB. The ; in a
static caps string starts a chained capability.

J.

-- 
Jan Schmidt                                  thaytan at mad.scientist.com

"Computer games don't affect kids; I mean if Pac-Man affected us as
kids, we'd all be running around in darkened rooms, munching magic pills
and listening to repetitive electronic music." - Unknown




More information about the gstreamer-devel mailing list