Channing dimensions of source element

Maurice Ackel maurice.ackel at students.uni-mannheim.de
Tue Aug 3 18:31:51 UTC 2021


Hi Anton,

Thanks for your quick reply!

> I suggest, that after you've done with gst_base_src_set_caps, you should send 'reconfigure' event down the pipe to notify all downstream elements that caps were changed. 

This suggestion hinted me towards the right way, although it was not directly the solution to my problem. What I ended up having to do is to call the „negotiate“ function of the BaseSrc class. Simply sending „reconfigure" was not triggering an allocation query as it seems..

So my working code looks something like this:

if (src->cur_width != width || src->cur_height != height)
{
    src->cur_width = width;
    src->cur_height = height;

    GstCaps *caps = gst_caps_make_writable(src->caps);
    gst_caps_set_simple(caps, "width", G_TYPE_INT, src->cur_width, "height", G_TYPE_INT, src->cur_height, NULL);
    gst_base_src_set_caps(GST_BASE_SRC(src), caps);
    gst_base_src_negotiate(GST_BASE_SRC(src));
}

Best,
Maurice


More information about the gstreamer-devel mailing list