Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QtGstreamer, multiudpsink - how to add clients?
BjornW last edited by BjornW
I have previously setup a gstreamer pipeline using an udpsink. This has worked fine. Now I want to change this pipeline to instead use a multiudpsink and to that sink I want to dynamically add and remove clients as they show up (I have a tcp session setup in parallel with the stream).
My pipeline is setup as follows:
auto spBin = QGst::Bin::fromDescription("autovideosrc ! videoconvert ! capsfilter caps=video/x-raw,width=(int)320,height=(int)240 ! videoconvert ! rtpvrawpay ! multiudpsink name=out_sink"); ... auto spPipeline = QGst::Pipeline::create(); spPipeline->add(spBin); ...
Then I connect some signal notifications:
... spPipeline->bus()->addSignalWatch(); QGlib::connect(spPipeline->bus(), "message", this, &VideoControl::onBusMessage); auto spSink = spPipeline->getElementByName("out_sink"); QGlib::connect(spSink, "client-added", this, &VideoControl::onClientAdded); auto spSinkPad = spSink->getStaticPad("sink"); QGlib::connect(spSinkPad, "notify::caps", this, &VideoControl::onSinkCapsChanged); ...
Finally I start the pipeline:
When doing so I get a callback on VideoControl::onBusMessage telling me that the pipeline is now in StatePlaying. That is good, I guess?
In my previous implemntation (udpsink with single reciever) I got a callback to onSinkCapsChanged as soon as a client showed up, at which point i sent those caps to the client so that it could start playback using the correct format. Now I have not been able to trigger onSinkCapsChanged.
I have tried setting the clients property. That did give me a callback on onClientAdded but onSinkCapsChanged is never called.
I would be grateful for any advice :-)
BjornW last edited by
Well, turns out it was only me being stupid. The caps were there all along, I just failed to pass them on to the client after I changed the interface. That's what happens when you code at 2 am :)
Then please mark the topic as solved. thx
BjornW last edited by
I did mark it it as solved the moment I wrote my comment :(
There seems to be some caching issues. Don't worry it will appear as solved :-)