Updates to element flags not signalled through the bin hierarchy
Consider a pipeline P
containing a bin B1
containing another empty bin B2
. At this point neither of these will have for example the GST_ELEMENT_FLAG_SINK
set.
Now when adding a sink element S
to B2
, B2
will have the SINK
flag set. However neither B1
nor P
will know about this.
When now doing for example a LATENCY
query on P
, this would be sent to all direct child elements that have the SINK
flag set. That is, none in this case.
If S
was added to B2
before B2
was added to B1
then both B1
and B2
would have the SINK
flag set and e.g. LATENCY
queries would be forwarded to B1
, B2
and finally the sink S
.
In practice this is a problem with pipelines containing a webrtcbin
inside another bin.
As a potential solution I could imagine a GST_MESSAGE_OBJECT_FLAGS_UPDATED
that is sent whenever an element's flags are changing. That way the whole bin hierarchy can get notified about this and update its own flags/etc accordingly.
The main question here is whether this should also apply to
- flags like
GST_ELEMENT_FLAG_LOCKED_STATE
. I could imagine this leading to deadlocks in existing code ifgst_element_set_locked_state()
would cause a message to be posted. It's probably called with mutexes locked in more than one place. - flags on pads. We already send messages for other things affecting pads (
GST_MESSAGE_STRUCTURE_CHANGE
) to the parent element, so it would seem consistent to also do that here.
Any opinions, suggestions, comments?