summaryrefslogtreecommitdiff
path: root/doc/media-api.txt
blob: 3746ccd5540caeeb6fa32fcb3b5d58986a7a43bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
BlueZ D-Bus Media API description
*********************************


Media hierarchy
===============

Service		org.bluez
Interface	org.bluez.Media1
Object path	[variable prefix]/{hci0,hci1,...}

Methods		void RegisterEndpoint(object endpoint, dict properties)

			Register a local end point to sender, the sender can
			register as many end points as it likes.

			Note: If the sender disconnects the end points are
			automatically unregistered.

			possible properties:

				string UUID:

					UUID of the profile which the endpoint
					is for.

					UUID must be in the list of
					SupportedUUIDS.

				byte Codec:

					Assigned number of codec that the
					endpoint implements. The values should
					match the profile specification which
					is indicated by the UUID.

				uint32_t Vendor [Optional]:

					Vendor-specific Company ID, Codec ID
					tuple that the endpoint implements.

					It shall be set to appropriate value
					when Vendor Specific Codec (0xff)
					is used.

				array{byte} Capabilities:

					Capabilities blob, it is used as it is
					so the size and byte order must match.

				array{byte} Metadata [Optional]:

					Metadata blob, it is used as it is
					so the size and byte order must match.

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported - emitted
					 when interface for the end-point is
					 disabled.

		void UnregisterEndpoint(object endpoint)

			Unregister sender end point.

		void RegisterPlayer(object player, dict properties)

			Register a media player object to sender, the sender
			can register as many objects as it likes.

			Object must implement at least
			org.mpris.MediaPlayer2.Player as defined in MPRIS 2.2
			spec:

			http://specifications.freedesktop.org/mpris-spec/latest/

			Note: If the sender disconnects its objects are
			automatically unregistered.

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported

		void UnregisterPlayer(object player)

			Unregister sender media player.

		void RegisterApplication(object root, dict options)

			Register endpoints an player objects within root
			object which must implement ObjectManager.

			The application object path together with the D-Bus
			system bus connection ID define the identification of
			the application.

			Possible errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.AlreadyExists

		void UnregisterApplication(object application)

			This unregisters the services that has been
			previously registered. The object path parameter
			must match the same value that has been used
			on registration.

			Possible errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.DoesNotExist

Properties	array{string} SupportedUUIDs [readonly]:

			List of 128-bit UUIDs that represents the supported
			Endpoint registration.

Media Control hierarchy
=======================

Service		org.bluez
Interface	org.bluez.MediaControl1
Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods		void Play() [Deprecated]

			Resume playback.

		void Pause() [Deprecated]

			Pause playback.

		void Stop() [Deprecated]

			Stop playback.

		void Next() [Deprecated]

			Next item.

		void Previous() [Deprecated]

			Previous item.

		void VolumeUp() [Deprecated]

			Adjust remote volume one step up

		void VolumeDown() [Deprecated]

			Adjust remote volume one step down

		void FastForward() [Deprecated]

			Fast forward playback, this action is only stopped
			when another method in this interface is called.

		void Rewind() [Deprecated]

			Rewind playback, this action is only stopped
			when another method in this interface is called.

Properties

		boolean Connected [readonly]

		object Player [readonly, optional]

			Addressed Player object path.


MediaPlayer1 hierarchy
======================

Service		org.bluez (Controller role)
Interface	org.bluez.MediaPlayer1
Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX

Methods		void Play()

			Resume playback.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Pause()

			Pause playback.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Stop()

			Stop playback.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Next()

			Next item.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Previous()

			Previous item.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void FastForward()

			Fast forward playback, this action is only stopped
			when another method in this interface is called.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Rewind()

			Rewind playback, this action is only stopped
			when another method in this interface is called.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Press(byte avc_key)

			Press a specific key to send as passthrough command.
			The key will be released automatically. Use Hold()
			instead if the intention is to hold down the key.

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Hold(byte avc_key)

			Press and hold a specific key to send as passthrough
			command. It is your responsibility to make sure that
			Release() is called after calling this method. The held
			key will also be released when any other method in this
			interface is called.

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void Release()

			Release the previously held key invoked using Hold().

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

Properties	string Equalizer [readwrite]

			Possible values: "off" or "on"

		string Repeat [readwrite]

			Possible values: "off", "singletrack", "alltracks" or
					"group"

		string Shuffle [readwrite]

			Possible values: "off", "alltracks" or "group"

		string Scan [readwrite]

			Possible values: "off", "alltracks" or "group"

		string Status [readonly]

			Possible status: "playing", "stopped", "paused",
					"forward-seek", "reverse-seek"
					or "error"

		uint32 Position [readonly]

			Playback position in milliseconds. Changing the
			position may generate additional events that will be
			sent to the remote device. When position is 0 it means
			the track is starting and when it's greater than or
			equal to track's duration the track has ended. Note
			that even if duration is not available in metadata it's
			possible to signal its end by setting position to the
			maximum uint32 value.

		dict Track [readonly]

			Track metadata.

			Possible values:

				string Title:

					Track title name

				string Artist:

					Track artist name

				string Album:

					Track album name

				string Genre:

					Track genre name

				uint32 NumberOfTracks:

					Number of tracks in total

				uint32 TrackNumber:

					Track number

				uint32 Duration:

					Track duration in milliseconds

		object Device [readonly]

			Device object path.

		string Name [readonly]

			Player name

		string Type [readonly]

			Player type

			Possible values:

				"Audio"
				"Video"
				"Audio Broadcasting"
				"Video Broadcasting"

		string Subtype [readonly]

			Player subtype

			Possible values:

				"Audio Book"
				"Podcast"

		boolean Browsable [readonly]

			If present indicates the player can be browsed using
			MediaFolder interface.

			Possible values:

				True: Supported and active
				False: Supported but inactive

			Note: If supported but inactive clients can enable it
			by using MediaFolder interface but it might interfere
			in the playback of other players.


		boolean Searchable [readonly]

			If present indicates the player can be searched using
			MediaFolder interface.

			Possible values:

				True: Supported and active
				False: Supported but inactive

			Note: If supported but inactive clients can enable it
			by using MediaFolder interface but it might interfere
			in the playback of other players.

		object Playlist

			Playlist object path.

MediaFolder1 hierarchy
======================

Service		unique name (Target role)
		org.bluez (Controller role)
Interface	org.bluez.MediaFolder1
Object path	freely definable (Target role)
		[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
		(Controller role)

Methods		object Search(string value, dict filter)

			Return a folder object containing the search result.

			To list the items found use the folder object returned
			and pass to ChangeFolder.

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		array{objects, properties} ListItems(dict filter)

			Return a list of items found

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void ChangeFolder(object folder)

			Change current folder.

			Note: By changing folder the items of previous folder
			might be destroyed and have to be listed again, the
			exception is NowPlaying folder which should be always
			present while the player is active.

			Possible Errors: org.bluez.Error.InvalidArguments
					 org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

Properties	uint32 NumberOfItems [readonly]

			Number of items in the folder

		string Name [readonly]

			Folder name:

			Possible values:
				"/Filesystem/...": Filesystem scope
				"/NowPlaying/...": NowPlaying scope

			Note: /NowPlaying folder might not be listed if player
			is stopped, folders created by Search are virtual so
			once another Search is perform or the folder is
			changed using ChangeFolder it will no longer be listed.

Filters		uint32 Start:

			Offset of the first item.

			Default value: 0

		uint32 End:

			Offset of the last item.

			Default value: NumbeOfItems

		array{string} Attributes

			Item properties that should be included in the list.

			Possible Values:

				"title", "artist", "album", "genre",
				"number-of-tracks", "number", "duration"

			Default Value: All

MediaItem1 hierarchy
====================

Service		unique name (Target role)
		org.bluez (Controller role)
Interface	org.bluez.MediaItem1
Object path	freely definable (Target role)
		[variable
		prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX/itemX
		(Controller role)

Methods		void Play()

			Play item

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

		void AddtoNowPlaying()

			Add item to now playing list

			Possible Errors: org.bluez.Error.NotSupported
					 org.bluez.Error.Failed

Properties	object Player [readonly]

			Player object path the item belongs to

		string Name [readonly]

			Item displayable name

		string Type [readonly]

			Item type

			Possible values: "video", "audio", "folder"

		string FolderType [readonly, optional]

			Folder type.

			Possible values: "mixed", "titles", "albums", "artists"

			Available if property Type is "Folder"

		boolean Playable [readonly, optional]

			Indicates if the item can be played

			Available if property Type is "folder"

		dict Metadata [readonly]

			Item metadata.

			Possible values:

				string Title

					Item title name

					Available if property Type is "audio"
					or "video"

				string Artist

					Item artist name

					Available if property Type is "audio"
					or "video"

				string Album

					Item album name

					Available if property Type is "audio"
					or "video"

				string Genre

					Item genre name

					Available if property Type is "audio"
					or "video"

				uint32 NumberOfTracks

					Item album number of tracks in total

					Available if property Type is "audio"
					or "video"

				uint32 Number

					Item album number

					Available if property Type is "audio"
					or "video"

				uint32 Duration

					Item duration in milliseconds

					Available if property Type is "audio"
					or "video"

MediaEndpoint1 hierarchy
========================

Service		unique name (Server role)
		org.bluez (Client role)
Interface	org.bluez.MediaEndpoint1
Object path	freely definable (Server role)
		[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/sepX
		(Client role)

Methods		void SetConfiguration(object transport, dict properties)

			Set configuration for the transport.

			For client role transport must be set with a server
			endpoint oject which will be configured and the
			properties must contain the following properties:

				array{byte} Capabilities [Mandatory]
				array{byte} Metadata [ISO only]
				byte CIG [ISO only]
				byte CIS [ISO only]
				uint32 Interval [ISO only]
				bool Framing [ISO only]
				string PHY [ISO only]
				uint16 SDU [ISO only]
				byte Retransmissions [ISO only]
				uint16 Latency [ISO only]
				uint32 Delay [ISO only]
				uint8 TargetLatency [ISO Latency]

		array{byte} SelectConfiguration(array{byte} capabilities)

			Select preferable configuration from the supported
			capabilities.

			Returns a configuration which can be used to setup
			a transport.

			Note: There is no need to cache the selected
			configuration since on success the configuration is
			send back as parameter of SetConfiguration.

		dict SelectProperties(dict properties)

			Select preferable properties from the supported
			properties:
				object Endpoint [ISO only]
				Refer to SetConfiguration for the list of
					other possible properties.

			Returns propeties which can be used to setup
			a transport.

			Note: There is no need to cache the selected
			properties since on success the configuration is
			send back as parameter of SetConfiguration.

		void ClearConfiguration(object transport)

			Clear transport configuration.

		void Release()

			This method gets called when the service daemon
			unregisters the endpoint. An endpoint can use it to do
			cleanup tasks. There is no need to unregister the
			endpoint, because when this method gets called it has
			already been unregistered.

Properties	string UUID [readonly, optional]:

			UUID of the profile which the endpoint is for.

		byte Codec [readonly, optional]:

			Assigned number of codec that the endpoint implements.
			The values should match the profile specification which
			is indicated by the UUID.

		uint32_t Vendor [readonly, Optional]:

			Vendor-specific Company ID, Codec ID tuple that the
			endpoint implements.

			It shall be set to appropriate value when Vendor
			Specific Codec (0xff) is used.

		array{byte} Capabilities [readonly, optional]:

			Capabilities blob, it is used as it is so the size and
			byte order must match.

		array{byte} Metadata [readonly, Optional]:

			Metadata blob, it is used as it is so the size and
			byte order must match.

		object Device [readonly, optional]:

			Device object which the endpoint is belongs to.

		bool DelayReporting [readonly, optional]:

			Indicates if endpoint supports Delay Reporting.

		byte Framing [ISO only]

			Indicates endpoint support framing.

		byte PHY [ISO only]

			Indicates endpoint supported PHY.

		uint16_t MaximumLatency [ISO only]

			Indicates endpoint maximum latency.

		uint32_t MinimumDelay [ISO only]

			Indicates endpoint minimum presentation delay.

		uint32_t MaximumDelay [ISO only]

			Indicates endpoint maximum presentation delay.

		uint32_t PreferredMinimumDelay [ISO only]

			Indicates endpoint preferred minimum presentation delay.

		uint32_t PreferredMinimumDelay [ISO only]

			Indicates endpoint preferred minimum presentation delay.

		uint32 Location [ISO only]

			Indicates endpoint supported locations.

		uint16 SupportedContext [ISO only]

			Indicates endpoint supported audio context.

		uint16 Context [ISO only]

			Indicates endpoint available audio context.

MediaTransport1 hierarchy
=========================

Service		org.bluez
Interface	org.bluez.MediaTransport1
Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/fdX

Methods		fd, uint16, uint16 Acquire()

			Acquire transport file descriptor and the MTU for read
			and write respectively.

			Possible Errors: org.bluez.Error.NotAuthorized
					 org.bluez.Error.Failed

		fd, uint16, uint16 TryAcquire()

			Acquire transport file descriptor only if the transport
			is in "pending" state at the time the message is
			received by BlueZ. Otherwise no request will be sent
			to the remote device and the function will just fail
			with org.bluez.Error.NotAvailable.

			Possible Errors: org.bluez.Error.NotAuthorized
					 org.bluez.Error.Failed
					 org.bluez.Error.NotAvailable

		void Release()

			Releases file descriptor.

Properties	object Device [readonly]

			Device object which the transport is connected to.

		string UUID [readonly]

			UUID of the profile which the transport is for.

		byte Codec [readonly]

			Assigned number of codec that the transport support.
			The values should match the profile specification which
			is indicated by the UUID.

		array{byte} Configuration [readonly]

			Configuration blob, it is used as it is so the size and
			byte order must match.

		string State [readonly]

			Indicates the state of the transport. Possible
			values are:
				"idle": not streaming
				"pending": streaming but not acquired
				"active": streaming and acquired

		uint16 Delay [readwrite]

			Optional. Transport delay in 1/10 of millisecond, this
			property is only writeable when the transport was
			acquired by the sender.

		uint16 Volume [readwrite]

			Optional. Indicates volume level of the transport,
			this property is only writeable when the transport was
			acquired by the sender.

			Possible Values: 0-127

		object Endpoint [readonly, optional, experimental]

			Endpoint object which the transport is associated
			with.

		uint32 Location [readonly, ISO only, experimental]

			Indicates transport Audio Location.

		array{byte} Metadata [ISO Only, experimental]

			Indicates transport Metadata.

		array{object} Links [readonly, optional, ISO only, experimental]

			Linked transport objects which the transport is
			associated with.

		byte CIG [ISO only, optional, experimental]

			Indicates configured QoS CIG.
			Only present when QoS is configured.

		byte CIS [ISO only, optional, experimental]

			Indicates configured QoS CIS.
			Only present when QoS is configured.

		uint32 Interval [ISO only, optional, experimental]

			Indicates configured QoS interval.
			Only present when QoS is configured.

		boolean Framing [ISO only, optional, experimental]

			Indicates configured QoS framing.
			Only present when QoS is configured.

		byte PHY [ISO only, optional, experimental]

			Indicates configured QoS PHY.
			Only present when QoS is configured.

		uint16 SDU [ISO only, optional, experimental]

			Indicates configured QoS SDU.
			Only present when QoS is configured.

		byte Retransmissions [ISO only, optional, experimental]

			Indicates configured QoS retransmissions.
			Only present when QoS is configured.

		uint16 Latency [ISO only, optional, experimental]

			Indicates configured QoS latency.
			Only present when QoS is configured.