Re: No way to advertise an interface?
Anders Feder <[email protected]>
| Newsgroups | gmane.comp.freedesktop.dbus |
|---|---|
| Message-ID | <CAFqna2VeMwwjE9PCS9WrsjpZtD2Z84BsGaVb6RJ2kUVt29niNA@mail.gmail.com> |
"the other bus" was a typo, I just meant "the bus". ons. 29. sep. 2021 09.57 skrev Anders Feder <[email protected]>: > No, that is the rub. In the example with two applications both deciding to > take the bus name “org.mpris.MediaPlayer2.musicplayer”, you do in fact need > both to available on the bus at the same time. Because otherwise one of > them precludes the other from being controlled by clients. > > It is currently possible to have for instance VLC and Spotify both running > and both controllable via MPRIS at the same time. But this is only possible > because they happen to have different names and their programmers therefore > have chosen to take different bus names. > > If they had chosen to take same bus name because they were not aware of > each other, then one would either replace the other on the other bus or > have to wait in queue as you say, thus preventing one of them from being > controlled this way. > > The way MPRIS is designed, the programmer must choose a bus name and can > then only pray that no other media player will try to use the same name. In > my view, this is not a good design. I would be interested to understand if > a better design could be made or if D-Bus could be extended to support this > scenario or if not why not. > > Regards, > Anders Feder > > ons. 29. sep. 2021 09.27 skrev Lawrence D'Oliveiro < > ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>: > >> On Wed, 29 Sep 2021 08:03:20 +0200, Anders Feder wrote: >> >> > If a person A creates an application named "Music Player" and have it >> > take the bus name "org.mpris.MediaPlayer2.musicplayer", there is no >> > procedure preventing a person B without knowledge of person A's >> > application from creating another application named "Music Player" >> > also taking the bus name "org.mpris.MediaPlayer2.musicplayer". >> >> It is true that D-Bus has no concept of “group” or “multicast” names; >> each name can belong to only one bus peer. But remember that, if you do >> not specify DBUS_NAME_FLAG_DO_NOT_QUEUE when trying to register a name >> and it is already taken, then you will be placed in a queue to get it >> when the existing owner relinquishes it. >> >> That way, anybody looking for “org.mpris.MediaPlayer2.musicplayer” only >> sees one. Quit that one, and the other should appear. After all, you >> only need one at a time, don’t you? >> >