Class Caps

java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.Caps
All Implemented Interfaces:
Proxy

@Generated("io.github.jwharm.JavaGI") public class Caps extends ProxyInstance
Caps (capabilities) are lightweight refcounted objects describing media types. They are composed of an array of GstStructure.

Caps are exposed on GstPadTemplate to describe all possible types a given pad can handle. They are also stored in the GstRegistry along with a description of the GstElement.

Caps are exposed on the element pads using the gst_pad_query_caps() pad function. This function describes the possible types that the pad can handle or produce at runtime.

A GstCaps can be constructed with the following code fragment:

  GstCaps *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);
 

A GstCaps is fixed when it has no fields with ranges or lists. Use gst_caps_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.

Be aware that until 1.20 the GstCaps / GstStructure serialization into string had limited support for nested GstCaps / GstStructure fields. It could only support one level of nesting. Using more levels would lead to unexpected behavior when using serialization features, such as gst_caps_to_string() or gst_value_serialize() and their counterparts.