MediaPlayer plugin with multimedia packages from VCPKG
-
Hello there,
I am currently developing a QT 5.15 application with CMake. I want to use the Multimedia package, more specificaly theQMediaPlayer
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 -
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.
-
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.
-
@rujma do what ? Link the static plugins or build the GST plugin on Windows ?
For the former, check the Qt plugins how-to.
-
I would rather expect to see
qt_import_plugins(XXXX INCLUDE_BY_TYPE multimedia)
.