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. How to build Qt mediaservice plugin for radio
QtWS25 Last Chance

How to build Qt mediaservice plugin for radio

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 1.8k Views
  • 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.
  • S Offline
    S Offline
    slevp
    wrote on last edited by
    #1

    I want to build radio mediaservice plugin for Qt5.3.2, I coded the plugin and built with Qt creator, then I got a libradio.so, and I put it into plugins/mediaservice folder, but the radio app of Qt example print an error: not service found for 'org.qt-project.qt.audio', Was the way I deployed the libradio.so wrong?

    Thanks a lot.

    @SGaist SGaist Thanks for your reply:

    This is the pro file:

    TEMPLATE = lib
    TARGET = $$qtLibraryTarget(hsradio)
    CONFIG += plugin
    Q_MOC_OUTPUT_REVISION = 5.3.2
    QT += multimedia-private
    QT -= gui
    PLUGIN_TYPE = mediaservice
    PLUGIN_CLASS_NAME = HsRadioServicePlugin
    INCLUDEPATH += $$PWD
    #DEFINES += RADIO_LIBRARY
    DESTDIR = ../output
    SOURCES += hsradioserviceplugin.cpp
    hsradiocontrol.cpp
    hsradioservice.cpp
    HEADERS += hsradioserviceplugin.h
    hsradiocontrol.h
    hsradioservice.h
    OTHER_FILES +=
    radio.json

    The plugin header file:

    class HsRadioServicePlugin :
    public QMediaServiceProviderPlugin,
    public QMediaServiceSupportedDevicesInterface
    {
    Q_OBJECT
    Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
    Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "radio.json")
    public:
    QMediaService* create(QString const& key);
    void release(QMediaService *service);

    QList<QByteArray> devices(const QByteArray &service) const;
    QString deviceDescription(const QByteArray &service, const QByteArray &device);
    

    };

    The json file:
    {
    "Keys": ["hsradio"],
    "Services": ["org.qt-project.qt.radio"]
    }

    And I created service and control class referring the v4l mediaservice plugin, It seems that v4l was not built into Qt/plugins/mediaservice/ path, so I built my plugin with Qt creator, and I put 'radio.so' file into Qt/plugins/mediaservice/, but the error still appears.

    My Qt version is 5.3.2, Qt creator is 3.2.1.

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

      Hi and welcome to devnet,

      How did you wrote the plugin ? What base did you use ?

      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