popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.02k stars 334 forks source link

is there a way to observe properties using D-Bus? #681

Open lherman-cs opened 5 years ago

lherman-cs commented 5 years ago

I'd like to have a bidirectional communication using D-Bus so that I can have a hook/callback to listen to changes that happened.

I found that this feature is quite useful in mpv. MPV uses unix socket, https://github.com/mpv-player/mpv/blob/master/DOCS/man/ipc.rst#commands.

Is this actually possible? If it's not, is this a good feature to add? How can I contribute? Thanks

danielrodriguezac commented 5 years ago

Yep, coming from mpv i miss simple UNIX socket communication as well. AFAIK there are no subscribable properties in the player, and the interface is DBus so there is something to consider...

I would say it would be great to add this feature. Having glanced at the code more than once this does not sound like a super-complicated thing to do. Would be willing to help in the implementation should this be deemed appropriate for the player. Maybe implement the subscription through DBus to avoid having more than one interface?

popcornmix commented 5 years ago

A helper app that queries through dbus and sends results to a socket sounds possible. It doesn't require changes to omxplayer itself.

danielrodriguezac commented 5 years ago

Yeah that's what most people end up doing, including me. It would be nice to be able to register callbacks (more like "messagebacks" or notifications) so that we can quickly react to player status changes without having to query the DBus interface, this however is probably something too big for the few use cases where it would prove useful.