Parsing caps

Ilya Aleshkov ilya.aleshkov at gmail.com
Thu Jan 17 16:59:16 UTC 2019


Hi,

I'd like to parse GstCaps. It's pretty trivial:

GstDevice *device = ... // Get "Video/Source" devices from GstDeviceMonitor

GstCaps *devCaps = gst_device_get_caps(device);
uint size = gst_caps_get_size(devCaps);

for (uint i = 0; i < size; ++i) {
    GstStructure *s = gst_caps_get_structure(devCaps, i);
    GType framerate = gst_structure_get_field_type(s, "framerate");
    qDebug() << g_type_name(framerate);
      ...
}

Output: GstFraction or GstFractionRange

I can easily get a fraction with:

gst_structure_get_fraction(s, "framerate", &numerator, &denominator)

But there is no such method for a fraction range.

I can get a GValue for a fraction range:

GValue *fractionRange = gst_structure_get_value(s, "framerate");

But I don't know how to extract a range from it.

What did I miss?

Thanks,
Ilya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190117/40d6fed9/attachment.html>


More information about the gstreamer-devel mailing list