gst_caps_get_structure question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_caps_get_structure question

wanting2learn
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?

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??
Reply | Threaded
Open this post in threaded view
|

Re: gst_caps_get_structure question

Stefan Sauer
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??
>


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel