Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. MediaPlayer plugin with multimedia packages from VCPKG
Forum Updated to NodeBB v4.3 + New Features

MediaPlayer plugin with multimedia packages from VCPKG

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
6 Posts 2 Posters 730 Views 2 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.
  • R Offline
    R Offline
    rujma
    wrote on last edited by
    #1

    Hello there,
    I am currently developing a QT 5.15 application with CMake. I want to use the Multimedia package, more specificaly the QMediaPlayer object. I use VCPKG to install the necessary dependencies and my CMakeLists.txt file contains the following QT5 definitions:

    cmake_minimum_required(VERSION 3.5.1)
    ..
    set(CMAKE_AUTOMOC ON)
    ...
    find_package(Qt5 REQUIRED COMPONENTS Core Widgets Multimedia MultimediaWidgets Quick)
    find_package(Qt5Bluetooth CONFIG REQUIRED)
    ...
    target_include_directories(XXX PRIVATE 
                        ${CMAKE_CURRENT_BINARY_DIR}
                        ${Qt5Core_INCLUDE_DIRS}
                        ${Qt5Multimedia_INCLUDE_DIRS}
                        ${Qt5MultimediaWidgets_INCLUDE_DIRS}
                        ${Qt5Quick_INCLUDE_DIRS}
                        ${Qt5Bluetooth_INCLUDE_DIRS}
    ...			
    link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    
    target_link_libraries(XXXX PRIVATE Qt5::Core Qt5::Quick Qt5::Widgets Qt5::Gui Qt5::Multimedia Qt5::MultimediaWidgets Qt5::Bluetooth)
    ...
    

    The program compiles and runs but the QMediaPlayer object does not work properly. During boot, I get the following error:

    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.qt.mediaserviceproviderfactory/5.0" since plugins are disabled in static builds
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    

    Upon inspection of the plugins folder on /vcpkg_installed/x64-linux/plugins/mediaservice/, I only see the "libqtmedia_audioengine.a" and "libqtmedia_audioengine.prl". I assume that the "libgstmediaplayer" library is missing.

    Can anyone help me with this?

    Kind regards,
    Rui Almeida

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You seem to be using a static build of Qt thus you have to explicitly link to the plugins you are going to use.

      As for the gst plugin, there's no reason for it to be there since it's the Linux backend. If you want it on Windows, you will have to build it yourself.

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

      R 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        You seem to be using a static build of Qt thus you have to explicitly link to the plugins you are going to use.

        As for the gst plugin, there's no reason for it to be there since it's the Linux backend. If you want it on Windows, you will have to build it yourself.

        R Offline
        R Offline
        rujma
        wrote on last edited by
        #3

        @SGaist Hello, can you direct me into an example/wiki that shows how to do that?

        SGaistS 1 Reply Last reply
        0
        • R rujma

          @SGaist Hello, can you direct me into an example/wiki that shows how to do that?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #4

          @rujma do what ? Link the static plugins or build the GST plugin on Windows ?

          For the former, check the Qt plugins how-to.

          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
          • R Offline
            R Offline
            rujma
            wrote on last edited by rujma
            #5

            Linking the plugins did not work. I have changed my CMakeLists.txt file and added:

            qt_import_plugins(XXXX INCLUDE Qt::QLibInputPlugin)
            qt_import_plugins(XXXX INCLUDE Qt::MediaPlayer)
            

            I still have the same error.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I would rather expect to see qt_import_plugins(XXXX INCLUDE_BY_TYPE multimedia).

              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
              0

              • Login

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