Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. DBus connection to omxplayer
Forum Updated to NodeBB v4.3 + New Features

DBus connection to omxplayer

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 513 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.
  • Q Offline
    Q Offline
    qt_help
    wrote on last edited by qt_help
    #1

    Re: DBus connection to omxplayer won't work

    Looking for working example to play, get status omxplayer using dbus from qt application. Tried but no success. Connection is successful but not able to get status or pause/stop from application. Also looking for method to play files using dbus

    QProcess proc;
    proc.start("omxplayer video.mp4");
    
    proc.waitForStarted();
    

    Files play correctly, I'm not sure there is direct way to play using dbus

    QDBusConnection *_dbus;
    
    _dbus = new QDBusConnection(QDBusConnection::sessionBus());
    
    _dbus->connectToBus("/tmp/omxplayerdbus", "org.mpris.MediaPlayer2.omxplayer");
    
    if( !_dbus->isConnected() ) {
    
        qDebug() << "not connected";
    
    }
    

    Test result: This get connected with no error

    QString dest = "org.mpris.MediaPlayer2.omxplayer";
    
    QString path = "/org/mpris/MediaPlayer2";
    
    QString interface = "org.mpris.MediaPlayer2.Player";
    QString name = "pause";//stop
    QDBusMessage msg = QDBusMessage::createMethodCall(dest, path, interface, name);
    if( !_dbus->send(msg) )
    {
    
        qWarning() << "error: " << _dbus->lastError().message();
    
    }
    

    No error, but video continue to play

    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