Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtGstreamer, multiudpsink - how to add clients?
Forum Updated to NodeBB v4.3 + New Features

QtGstreamer, multiudpsink - how to add clients?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 884 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BjornW
    wrote on 4 Oct 2019, 23:35 last edited by BjornW 10 Apr 2019, 23:36
    #1

    Hi!

    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:

    m_spPipeline->setState(QGst::StatePlaying);
    

    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.

    The gstreamer docs mention some add and remove signals. How do I call them? I'm struggling to find good documentation / examples of QtGstreamer.

    I would be grateful for any advice :-)

    //Björn

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BjornW
      wrote on 5 Oct 2019, 11:31 last edited by
      #2

      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 :)

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 5 Oct 2019, 12:25 last edited by
        #3

        Then please mark the topic as solved. thx

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BjornW
          wrote on 5 Oct 2019, 15:02 last edited by
          #4

          I did mark it it as solved the moment I wrote my comment :(

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 5 Oct 2019, 15:47 last edited by
            #5

            There seems to be some caching issues. Don't worry it will appear as solved :-)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            2/5

            5 Oct 2019, 11:31

            • Login

            • Login or register to search.
            2 out of 5
            • First post
              2/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved