Important: Please read the Qt Code of Conduct -

Can I use QtMultimedia Private API ?

  • Hi all,

    I am experimenting with the new QtMultimedia module on Linux (Kubuntu 21.04). I would like to create a custom GStreamer pipeline by using some helper classes from the QtMultimedia/GStreamer backend. I have added multimedia-private to my QT.

    My problem is that I get undefined references for some private classes.

    For example, when I build this snippet:

    #include "widget.h"
    #include <QtMultimedia/private/qgstpipeline_p.h>
    Widget::Widget(QWidget *parent)
        : QWidget(parent)
        QGstPipeline pipeline("my-pipeline");
        QGstElement element("videotestsrc");

    I get:

    undefined reference to `QGstPipeline::QGstPipeline(char const*)'
    undefined reference to `QGstPipeline::~QGstPipeline()'

    So QGstPipeline is undefined, but QGstElement is all good. Could anybody help me understand ?

    I also tried with a CMake project by adding a project dependency to Qt6::MultimediaPrivate, same result 😕


  • Lifetime Qt Champion


    From the looks of it, the class was not exported. I don't think it's intentional though.

  • Bummer.

    Can you point me to the files / docs I should look at to get the missing symbols exported. I am building Qt from source anyway and would be happy to contribute to QtMultimedia.

    Dropping the plugin architecture in Qt6 is making everything so much simpler and interesting. I have a few apps which I want to migrate to Qt6 just to throw away custom Qt5/Multimedia code 😄

  • Lifetime Qt Champion

    From the looks of it, it's in gstpipeline_p.h. The other private classes seem to be exported.

  • Amazing!

    So I simply added Q_MULTIMEDIA_EXPORT to the QGstPipeline class declaration and it did the trick.

    I'll try to get this contributed.

    PS: Tu passes à la foire vendredi ?

Log in to reply