Set gst caps field
Hi! I am having a hard time trying to set a field in a GstCaps of mine. My code below does not seem to update "framerate" during runtime.
GstCaps *capture_format_caps = gst_caps_new_simple("video/x-raw",
"width", G_TYPE_INT, size.width,
"height", G_TYPE_INT, size.height,
"framerate", GST_TYPE_FRACTION, framerate.numerator, framerate.denominator,
nullptr);
assert(capture_format_caps);
if(format != "")
gst_caps_set_simple(capture_format_caps,
"format", G_TYPE_STRING, format.c_str(),
nullptr);
g_object_set(G_OBJECT(capturecapsfilter_), "caps", capture_format_caps, nullptr);
gst_caps_unref(capture_format_caps);
// later on in the code ...
capture_format_caps = gst_caps_copy(capture_format_caps);
gst_caps_set_simple(capture_format_caps,
"framerate", GST_TYPE_FRACTION, framerate.numerator, framerate.denominator,
nullptr);
gst_caps_unref(capture_format_caps);