Using GstAggregator as sink

Greetings,

I’m developing a plugin to offload multiplexing to an external library. So far, my proof of concept works with a single input using GstBaseSink. I rely on the base class’s event, render, and preroll methods to successfully multiplex my streams.

However, to properly multiplex multiple streams, I need to “aggregate” them. To achieve this, I migrated to GstAggregator, which worked somewhat okay.

The issue is that, for GstAggregator to be usable, I must send a “droppable” buffer to a fake sink; otherwise, the pipeline won’t connect. This approach feels like a hack.

Is there a way to use GstAggregator as a sink or to aggregate multiple inputs for GstBaseSink?

Much appreciated.

Is there a way to use GstAggregator as a sink

No.

or to aggregate multiple inputs for GstBaseSink?

Not easily on multiple pads, no.

There are multiple possible workarounds for this that usually involve having the aggregator element output the combined buffers as a custom GstMeta implementation. The sink element then deals with the combined data in the appropriate fashion.

Not really what I hoped but okay. The workaround you suggested sounds good, I could have the aggregator and sink under a GstBin. In theory that would seem like a single element that can do what I want.

Do you think this workaround or the other ones you had in your mind add any overhead?