Update multiple properties at the same time

Hello all,

So I am trying to set multiple properties of a GstElement using g_object_set. The number of properties is unknown so this must occur within a loop. I want all the properties to be updated at the same time, so I was trying to use g_object_freeze_notify & g_object_thaw_notify.
I based my solution on this document:
(GObject: GObject Reference Manual)

So basically it looks something like this:

for (...)
    g_object_set(object, ...);

My goal is to update videocrop properties and make sure the output is always at a fixed width & height (so I have to change top & bottom and left & right at the same time).

While I was testing my code, I tried removing the g_object_thaw_notify() call, and surprisingly, the object’s properties did in fact change.
Also, I’ve noticed that every so often the pipeline throws an error due to caps not negotiated. I was able to fix this by using right=-1 and bottom=-1 and just play with the left+top properties, but I want to want know if there’s a general solution to this problem.


For atomic updates of multiple properties you probably want to set them from a buffer pad probe on the sink pad of the element. There you can change them all, and once the buffer is handled by the element it will have the new values for all the properties.

Freezing the notify signal does not have the effect you’re looking for. It only prevents emitting the notify signal for the properties, the values are still set one by one inside the element.

1 Like


Thank you :slight_smile: