Parsing caps

Michael Gruner michael.gruner at ridgerun.com
Thu Jan 17 17:17:13 UTC 2019


Hi Iiya

You can try gst_value_get_fraction_range_min <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstValue.html#gst-value-get-fraction-range-min> and gst_value_get_fraction_range_max <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstValue.html#gst-value-get-fraction-range-max>, where the GValue returned is of type GST_TYPE_FRACTION_RANGE.

Michael
RidgeRun

> On Jan 17, 2019, at 10:59 AM, Ilya Aleshkov <ilya.aleshkov at gmail.com> wrote:
> 
> 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
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190117/292d9677/attachment.html>


More information about the gstreamer-devel mailing list