Gst.Caps
Caps (capabilities) are lightweight refcounted objects describing media types. They are composed of an array of Gst.Structure.
Caps are exposed on Gst.PadTemplate to describe all possible types a given pad can handle. They are also stored in the Gst.Registry along with a description of the Gst.Element.
Caps are exposed on the element pads using the Gst.query_caps pad function. This function describes the possible types that the pad can handle or produce at runtime.
A Gst.Caps can be constructed with the following code fragment:
<example> <title>Creating caps</title> <programlisting> GstCaps *caps; caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "I420", "framerate", GST_TYPE_FRACTION, 25, 1, "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, "width", G_TYPE_INT, 320, "height", G_TYPE_INT, 240, NULL); </programlisting> </example>
A Gst.Caps is fixed when it has no properties with ranges or lists. Use Gst.is_fixed to test for fixed caps. Fixed caps can be used in a caps event to notify downstream elements of the current media type.
Various methods exist to work with the media types such as subtracting or intersecting.
Last reviewed on 2011-03-28 (0.11.3)