media-api.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. BlueZ D-Bus Media API description
  2. *********************************
  3. Media hierarchy
  4. ===============
  5. Service org.bluez
  6. Interface org.bluez.Media1
  7. Object path [variable prefix]/{hci0,hci1,...}
  8. Methods void RegisterEndpoint(object endpoint, dict properties)
  9. Register a local end point to sender, the sender can
  10. register as many end points as it likes.
  11. Note: If the sender disconnects the end points are
  12. automatically unregistered.
  13. possible properties:
  14. string UUID:
  15. UUID of the profile which the endpoint
  16. is for.
  17. byte Codec:
  18. Assigned number of codec that the
  19. endpoint implements. The values should
  20. match the profile specification which
  21. is indicated by the UUID.
  22. array{byte} Capabilities:
  23. Capabilities blob, it is used as it is
  24. so the size and byte order must match.
  25. Possible Errors: org.bluez.Error.InvalidArguments
  26. org.bluez.Error.NotSupported - emitted
  27. when interface for the end-point is
  28. disabled.
  29. void UnregisterEndpoint(object endpoint)
  30. Unregister sender end point.
  31. void RegisterPlayer(object player, dict properties)
  32. Register a media player object to sender, the sender
  33. can register as many objects as it likes.
  34. Object must implement at least
  35. org.mpris.MediaPlayer2.Player as defined in MPRIS 2.2
  36. spec:
  37. http://specifications.freedesktop.org/mpris-spec/latest/
  38. Note: If the sender disconnects its objects are
  39. automatically unregistered.
  40. Possible Errors: org.bluez.Error.InvalidArguments
  41. org.bluez.Error.NotSupported
  42. void UnregisterPlayer(object player)
  43. Unregister sender media player.
  44. void RegisterApplication(object root, dict options)
  45. Register endpoints an player objects within root
  46. object which must implement ObjectManager.
  47. The application object path together with the D-Bus
  48. system bus connection ID define the identification of
  49. the application.
  50. Possible errors: org.bluez.Error.InvalidArguments
  51. org.bluez.Error.AlreadyExists
  52. void UnregisterApplication(object application)
  53. This unregisters the services that has been
  54. previously registered. The object path parameter
  55. must match the same value that has been used
  56. on registration.
  57. Possible errors: org.bluez.Error.InvalidArguments
  58. org.bluez.Error.DoesNotExist
  59. Media Control hierarchy
  60. =======================
  61. Service org.bluez
  62. Interface org.bluez.MediaControl1
  63. Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
  64. Methods void Play() [Deprecated]
  65. Resume playback.
  66. void Pause() [Deprecated]
  67. Pause playback.
  68. void Stop() [Deprecated]
  69. Stop playback.
  70. void Next() [Deprecated]
  71. Next item.
  72. void Previous() [Deprecated]
  73. Previous item.
  74. void VolumeUp() [Deprecated]
  75. Adjust remote volume one step up
  76. void VolumeDown() [Deprecated]
  77. Adjust remote volume one step down
  78. void FastForward() [Deprecated]
  79. Fast forward playback, this action is only stopped
  80. when another method in this interface is called.
  81. void Rewind() [Deprecated]
  82. Rewind playback, this action is only stopped
  83. when another method in this interface is called.
  84. Properties
  85. boolean Connected [readonly]
  86. object Player [readonly, optional]
  87. Addressed Player object path.
  88. MediaPlayer1 hierarchy
  89. ======================
  90. Service org.bluez (Controller role)
  91. Interface org.bluez.MediaPlayer1
  92. Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
  93. Methods void Play()
  94. Resume playback.
  95. Possible Errors: org.bluez.Error.NotSupported
  96. org.bluez.Error.Failed
  97. void Pause()
  98. Pause playback.
  99. Possible Errors: org.bluez.Error.NotSupported
  100. org.bluez.Error.Failed
  101. void Stop()
  102. Stop playback.
  103. Possible Errors: org.bluez.Error.NotSupported
  104. org.bluez.Error.Failed
  105. void Next()
  106. Next item.
  107. Possible Errors: org.bluez.Error.NotSupported
  108. org.bluez.Error.Failed
  109. void Previous()
  110. Previous item.
  111. Possible Errors: org.bluez.Error.NotSupported
  112. org.bluez.Error.Failed
  113. void FastForward()
  114. Fast forward playback, this action is only stopped
  115. when another method in this interface is called.
  116. Possible Errors: org.bluez.Error.NotSupported
  117. org.bluez.Error.Failed
  118. void Rewind()
  119. Rewind playback, this action is only stopped
  120. when another method in this interface is called.
  121. Possible Errors: org.bluez.Error.NotSupported
  122. org.bluez.Error.Failed
  123. void Press(byte avc_key)
  124. Press a specific key to send as passthrough command.
  125. The key will be released automatically. Use Hold()
  126. instead if the intention is to hold down the key.
  127. Possible Errors: org.bluez.Error.InvalidArguments
  128. org.bluez.Error.NotSupported
  129. org.bluez.Error.Failed
  130. void Hold(byte avc_key)
  131. Press and hold a specific key to send as passthrough
  132. command. It is your responsibility to make sure that
  133. Release() is called after calling this method. The held
  134. key will also be released when any other method in this
  135. interface is called.
  136. Possible Errors: org.bluez.Error.InvalidArguments
  137. org.bluez.Error.NotSupported
  138. org.bluez.Error.Failed
  139. void Release()
  140. Release the previously held key invoked using Hold().
  141. Possible Errors: org.bluez.Error.NotSupported
  142. org.bluez.Error.Failed
  143. Properties string Equalizer [readwrite]
  144. Possible values: "off" or "on"
  145. string Repeat [readwrite]
  146. Possible values: "off", "singletrack", "alltracks" or
  147. "group"
  148. string Shuffle [readwrite]
  149. Possible values: "off", "alltracks" or "group"
  150. string Scan [readwrite]
  151. Possible values: "off", "alltracks" or "group"
  152. string Status [readonly]
  153. Possible status: "playing", "stopped", "paused",
  154. "forward-seek", "reverse-seek"
  155. or "error"
  156. uint32 Position [readonly]
  157. Playback position in milliseconds. Changing the
  158. position may generate additional events that will be
  159. sent to the remote device. When position is 0 it means
  160. the track is starting and when it's greater than or
  161. equal to track's duration the track has ended. Note
  162. that even if duration is not available in metadata it's
  163. possible to signal its end by setting position to the
  164. maximum uint32 value.
  165. dict Track [readonly]
  166. Track metadata.
  167. Possible values:
  168. string Title:
  169. Track title name
  170. string Artist:
  171. Track artist name
  172. string Album:
  173. Track album name
  174. string Genre:
  175. Track genre name
  176. uint32 NumberOfTracks:
  177. Number of tracks in total
  178. uint32 TrackNumber:
  179. Track number
  180. uint32 Duration:
  181. Track duration in milliseconds
  182. object Device [readonly]
  183. Device object path.
  184. string Name [readonly]
  185. Player name
  186. string Type [readonly]
  187. Player type
  188. Possible values:
  189. "Audio"
  190. "Video"
  191. "Audio Broadcasting"
  192. "Video Broadcasting"
  193. string Subtype [readonly]
  194. Player subtype
  195. Possible values:
  196. "Audio Book"
  197. "Podcast"
  198. boolean Browsable [readonly]
  199. If present indicates the player can be browsed using
  200. MediaFolder interface.
  201. Possible values:
  202. True: Supported and active
  203. False: Supported but inactive
  204. Note: If supported but inactive clients can enable it
  205. by using MediaFolder interface but it might interfere
  206. in the playback of other players.
  207. boolean Searchable [readonly]
  208. If present indicates the player can be searched using
  209. MediaFolder interface.
  210. Possible values:
  211. True: Supported and active
  212. False: Supported but inactive
  213. Note: If supported but inactive clients can enable it
  214. by using MediaFolder interface but it might interfere
  215. in the playback of other players.
  216. object Playlist
  217. Playlist object path.
  218. MediaFolder1 hierarchy
  219. ======================
  220. Service unique name (Target role)
  221. org.bluez (Controller role)
  222. Interface org.bluez.MediaFolder1
  223. Object path freely definable (Target role)
  224. [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
  225. (Controller role)
  226. Methods object Search(string value, dict filter)
  227. Return a folder object containing the search result.
  228. To list the items found use the folder object returned
  229. and pass to ChangeFolder.
  230. Possible Errors: org.bluez.Error.NotSupported
  231. org.bluez.Error.Failed
  232. array{objects, properties} ListItems(dict filter)
  233. Return a list of items found
  234. Possible Errors: org.bluez.Error.InvalidArguments
  235. org.bluez.Error.NotSupported
  236. org.bluez.Error.Failed
  237. void ChangeFolder(object folder)
  238. Change current folder.
  239. Note: By changing folder the items of previous folder
  240. might be destroyed and have to be listed again, the
  241. exception is NowPlaying folder which should be always
  242. present while the player is active.
  243. Possible Errors: org.bluez.Error.InvalidArguments
  244. org.bluez.Error.NotSupported
  245. org.bluez.Error.Failed
  246. Properties uint32 NumberOfItems [readonly]
  247. Number of items in the folder
  248. string Name [readonly]
  249. Folder name:
  250. Possible values:
  251. "/Filesystem/...": Filesystem scope
  252. "/NowPlaying/...": NowPlaying scope
  253. Note: /NowPlaying folder might not be listed if player
  254. is stopped, folders created by Search are virtual so
  255. once another Search is perform or the folder is
  256. changed using ChangeFolder it will no longer be listed.
  257. Filters uint32 Start:
  258. Offset of the first item.
  259. Default value: 0
  260. uint32 End:
  261. Offset of the last item.
  262. Default value: NumbeOfItems
  263. array{string} Attributes
  264. Item properties that should be included in the list.
  265. Possible Values:
  266. "title", "artist", "album", "genre",
  267. "number-of-tracks", "number", "duration"
  268. Default Value: All
  269. MediaItem1 hierarchy
  270. ====================
  271. Service unique name (Target role)
  272. org.bluez (Controller role)
  273. Interface org.bluez.MediaItem1
  274. Object path freely definable (Target role)
  275. [variable
  276. prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX/itemX
  277. (Controller role)
  278. Methods void Play()
  279. Play item
  280. Possible Errors: org.bluez.Error.NotSupported
  281. org.bluez.Error.Failed
  282. void AddtoNowPlaying()
  283. Add item to now playing list
  284. Possible Errors: org.bluez.Error.NotSupported
  285. org.bluez.Error.Failed
  286. Properties object Player [readonly]
  287. Player object path the item belongs to
  288. string Name [readonly]
  289. Item displayable name
  290. string Type [readonly]
  291. Item type
  292. Possible values: "video", "audio", "folder"
  293. string FolderType [readonly, optional]
  294. Folder type.
  295. Possible values: "mixed", "titles", "albums", "artists"
  296. Available if property Type is "Folder"
  297. boolean Playable [readonly, optional]
  298. Indicates if the item can be played
  299. Available if property Type is "folder"
  300. dict Metadata [readonly]
  301. Item metadata.
  302. Possible values:
  303. string Title
  304. Item title name
  305. Available if property Type is "audio"
  306. or "video"
  307. string Artist
  308. Item artist name
  309. Available if property Type is "audio"
  310. or "video"
  311. string Album
  312. Item album name
  313. Available if property Type is "audio"
  314. or "video"
  315. string Genre
  316. Item genre name
  317. Available if property Type is "audio"
  318. or "video"
  319. uint32 NumberOfTracks
  320. Item album number of tracks in total
  321. Available if property Type is "audio"
  322. or "video"
  323. uint32 Number
  324. Item album number
  325. Available if property Type is "audio"
  326. or "video"
  327. uint32 Duration
  328. Item duration in milliseconds
  329. Available if property Type is "audio"
  330. or "video"
  331. MediaEndpoint1 hierarchy
  332. ========================
  333. Service unique name (Server role)
  334. org.bluez (Client role)
  335. Interface org.bluez.MediaEndpoint1
  336. Object path freely definable (Server role)
  337. [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/sepX
  338. (Client role)
  339. Methods void SetConfiguration(object transport, dict properties)
  340. Set configuration for the transport.
  341. For client role transport must be set with a server
  342. endpoint oject which will be configured and the
  343. properties must contain the following properties:
  344. array{byte} Capabilities
  345. array{byte} SelectConfiguration(array{byte} capabilities)
  346. Select preferable configuration from the supported
  347. capabilities.
  348. Returns a configuration which can be used to setup
  349. a transport.
  350. Note: There is no need to cache the selected
  351. configuration since on success the configuration is
  352. send back as parameter of SetConfiguration.
  353. void ClearConfiguration(object transport)
  354. Clear transport configuration.
  355. void Release()
  356. This method gets called when the service daemon
  357. unregisters the endpoint. An endpoint can use it to do
  358. cleanup tasks. There is no need to unregister the
  359. endpoint, because when this method gets called it has
  360. already been unregistered.
  361. Properties string UUID [readonly, optional]:
  362. UUID of the profile which the endpoint is for.
  363. byte Codec [readonly, optional]:
  364. Assigned number of codec that the endpoint implements.
  365. The values should match the profile specification which
  366. is indicated by the UUID.
  367. array{byte} Capabilities [readonly, optional]:
  368. Capabilities blob, it is used as it is so the size and
  369. byte order must match.
  370. object Device [readonly, optional]:
  371. Device object which the endpoint is belongs to.
  372. bool DelayReporting [readonly, optional]:
  373. Indicates if endpoint supports Delay Reporting.
  374. MediaTransport1 hierarchy
  375. =========================
  376. Service org.bluez
  377. Interface org.bluez.MediaTransport1
  378. Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/fdX
  379. Methods fd, uint16, uint16 Acquire()
  380. Acquire transport file descriptor and the MTU for read
  381. and write respectively.
  382. Possible Errors: org.bluez.Error.NotAuthorized
  383. org.bluez.Error.Failed
  384. fd, uint16, uint16 TryAcquire()
  385. Acquire transport file descriptor only if the transport
  386. is in "pending" state at the time the message is
  387. received by BlueZ. Otherwise no request will be sent
  388. to the remote device and the function will just fail
  389. with org.bluez.Error.NotAvailable.
  390. Possible Errors: org.bluez.Error.NotAuthorized
  391. org.bluez.Error.Failed
  392. org.bluez.Error.NotAvailable
  393. void Release()
  394. Releases file descriptor.
  395. Properties object Device [readonly]
  396. Device object which the transport is connected to.
  397. string UUID [readonly]
  398. UUID of the profile which the transport is for.
  399. byte Codec [readonly]
  400. Assigned number of codec that the transport support.
  401. The values should match the profile specification which
  402. is indicated by the UUID.
  403. array{byte} Configuration [readonly]
  404. Configuration blob, it is used as it is so the size and
  405. byte order must match.
  406. string State [readonly]
  407. Indicates the state of the transport. Possible
  408. values are:
  409. "idle": not streaming
  410. "pending": streaming but not acquired
  411. "active": streaming and acquired
  412. uint16 Delay [readwrite]
  413. Optional. Transport delay in 1/10 of millisecond, this
  414. property is only writeable when the transport was
  415. acquired by the sender.
  416. uint16 Volume [readwrite]
  417. Optional. Indicates volume level of the transport,
  418. this property is only writeable when the transport was
  419. acquired by the sender.
  420. Possible Values: 0-127
  421. object Endpoint [readonly, optional, experimental]
  422. Endpoint object which the transport is associated
  423. with.