There is still a small problem ...
I want to be able to disable a sink, on demand. In this example, we
have 2 audio sinks.
Is there a way to disable a chosen queue/sink? Or maybe there is
another element (on/off?),
which should be added in between ?
PS.
I had the idea to do it like this - first add all elements to the bin,
and then link only chosen queues to tee:
bin.add(tee);
Element element1 = ElementFactory.make("alsasink", "a1");
Element queue1 = ElementFactory.make("queue", "q1");
bin.add(element1);
bin.add(queue1);
Element element2 = ElementFactory.make("alsasink", "a2");
Element queue2 = ElementFactory.make("queue", "q2");
bin.add(element2);
bin.add(queue2);
tee.link(queue1);
queue1.link(element1);
playbin.setState(State.PLAYING);
But this solution does not work - playbin does not start at all
(when all queues/elements are linked - it works of course) :(