prawdziwy-sok
Posts: 9
Joined: Wed Jul 30, 2014 12:21 am

QT dbus control over omxplayer

Sun Aug 17, 2014 11:57 pm

Hi, I have to admit that I'm completely new to this whole dbus business, so I was hoping that someone would help me.
I'd like to send a simple message via dbus to omxplayer, with my C++ qt application.
I've seen this script: https://github.com/popcornmix/omxplayer ... control.sh , and it works, but I'm unable to replicate its functionality with my code.

This is what I tried:

Code: Select all

   
QDBusConnection bus  = QDBusConnection::sessionBus();
bus.connectToBus("/tmp/omxplayerdbus", "org.mpris.MediaPlayer2.omxplayer");
QDBusMessage m = QDBusMessage::createMethodCall("org.mpris.MediaPlayer2", "/org/mpris/MediaPlayer2", "", "Quit");
bus.send(m); 
and it doesn't work. here I've noticed that something is extracted from the /tmp/omxplayerdbus file, but I don't know what is it and where to put it.
So, how can I send a simple message to omxplayer via dbus?

pinfred
Posts: 1
Joined: Fri Oct 30, 2015 7:08 am

Re: QT dbus control over omxplayer

Fri Oct 30, 2015 7:13 am

Hi,
I have same issue, do you have find how to do ?

I notice that if you add :

Code: Select all

if (bus.isConnected() == false){
    qDebug() << "Error" << QDBusConnection::sessionBus().lastError().message();
}
then it print :
/usr/bin/dbus-launch terminated abnormally with the following error : Autolaunch error: X11 initialization failed
but I'm not under X11 !

Return to “C/C++”