[gst-devel] gst_caps_get_structure question

Stefan Kost ensonic at hora-obscura.de
Thu Dec 3 23:17:53 CET 2009


Am 01.12.2009 18:09, schrieb LearnerMan:
> 
> Hi,
> 
> The gst_buffer_get_caps function returns a GstCaps varialbe.  I read in the
> documentation that GstCaps are represented as an array of one or more
> GstStructures, and each GstStructure is an array of fields where each field
> consists of a field name string (e.g. "width") and a typed value.
> 
> I understand this so far and I can use the following to get width and height
> info etc:
> GstStructure *str = gst_caps_get_structure( caps, 0 );
> 
> My question is: in the above function the index used is '0'.  What
> determines what index is used here?

The caps you show below only have one structure. If you would have caps like:
video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)10/1;
video/x-raw-rgb, width=(int)640, height=(int)480, framerate=(fraction)10/1

then index 0 would be the yuv-format and index 1 the rgb one. btw. a framerate
of 1000/1 sounds wrong - that is 1000 frames per second.

Stefan

> 
> In my program if I print out the str returned I get the following output:
> video/x-raw-yuv, width=(int)640, height=(int)480,
> framerate=(fraction)1000/1, format=(fourcc)I420, interlaced=(boolean)false,
> pixel-aspect-ratio=(fraction)1/1;().
> 
> How do I find out other information about such as bit-rate etc??
> 





More information about the gstreamer-devel mailing list