Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QMediaPlayer network dependency



  • I notice that QMediaPlayer adds a libQt5Network dependency, which i'm sure makes sense for a full-featured mediaplayer. However i just want to play some local mp3's. Is there an alternative way that doesn't use network libraries?


  • Lifetime Qt Champion

    Hi,

    You will have to rebuild Qt with network support disabled. Or rather start with only qtbase and then qtmultimedia and the other modules you might need.



  • Hey, @SGaist

    Well perhaps i will experiment with Qt builds again.

    However, is there another option by using different classes?
    What do you think of: https://doc.qt.io/qt-5/qaudiodecoder.html#details



  • I looked at building without network but there's no -skip network option right. So that's why you suggest building in steps? Well let me see if i can figure this out...


  • Lifetime Qt Champion

    The skip option is for modules outside qtbase. Networking is a feature that you have to disable at the qtbase level.



  • @SGaist Would this involve passing a very long list of -no-feature arguments to configure?


  • Lifetime Qt Champion

    From the top of my head, something like -no-feature-network.



  • Excellent. I just tried that and it says:
    Qt Network ............................. no
    under Qt modules and options
    in config.summary.

    I will have to check out if it really works at a later time.

    I wonder though how i would have found that on my own... since it's not in the features list and in the summary it gives the impression that it's either a module or option.



  • I wonder though how i would have found that on my own... since it's not in the features list and in the summary it gives the impression that it's either a module or option.

    And this is probably because of the existence of the Qt Configuration Tool available for commercial users only...


  • Lifetime Qt Champion

    @Tink said in QMediaPlayer network dependency:

    I wonder though how i would have found that on my own... since it's not in the features list and in the summary it gives the impression that it's either a module or option.

    And this is probably because of the existence of the Qt Configuration Tool available for commercial users only...

    Not really no, that tool has been created only very recently with the change of the features handling.

    As for finding about the features part, the documentation of the configure options talks about them.



  • @SGaist that supports my point, the tool has been made because it's kind of hard to make sense of it all on the command line if you are not an expert.

    "The Qt Configuration Tool that is part of Qt for Device Creation allows the tweaking of features and dependencies through a convenient user interface."

    Also on that page it talks about the -list-features command which i already did before but there is no plain "network" listed there. So how does one that is not an expert and does not have a gui tool do all this?

    I tried multiple times to make/make install, but each time i get errors... so some help would be appreciated.


  • Lifetime Qt Champion

    Well, the features handling as changed over time. Back in the days, I went through the documentation and Qt's code to see how I could customize the build to match the constraints I had.

    Becoming an experts requires a lot fiddling and spelunking.

    What errors do you get ?

    Note that the features system might have issues with certain combinations. All the possible combinations cannot be tested as it would require a lot more of processing power and time than currently available.



  • @SGaist

    So after more tinkering with configure options (last i did that seemed to help was -skip qttools -skip qtdoc) i got a good make/install. But now qmake notices i have an unknown module: multimedia.
    When i run make module-qtmultimedia it fails with this message:
    echo "Some of the required modules (qtHaveModule(network)) are not available."
    echo "Skipped."

    So that is a real bummer.
    Any ideas?

    As for spelunking, i suspect that many, including me, might find a watery grave deep underground...


  • Lifetime Qt Champion

    From the looks of it, QtMultimedia has a hard requirement on the network module that I completely forgot about.

    That means that if you want to disable the network part completely you would need to modify QtMultimedia directly.



  • Even if i could figure that out i must conclude that it takes much longer than it's worth for me right now. Thanks for the help anyway.


Log in to reply