All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] transport: Expose DelayReporting on MediaTransport interface
@ 2024-10-26 19:14 Arkadiusz Bokowy
  2024-10-26 19:14 ` [PATCH BlueZ 2/2] transport: Allow to set A2DP transport delay property Arkadiusz Bokowy
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Arkadiusz Bokowy @ 2024-10-26 19:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Arkadiusz Bokowy

Exposing DelayReporting property on the MediaTransport interface will
allow media application to get the information about the delay reporting
feature during the SetConfiguration call in a similar way the profile
UUID and transport codec are provided. Otherwise, the application would
need to check the associated endpoint which might not be convenient.
---
 doc/org.bluez.MediaTransport.rst | 10 ++++++++--
 profiles/audio/transport.c       | 30 ++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst
index 4838d69d0..5da13b3b5 100644
--- a/doc/org.bluez.MediaTransport.rst
+++ b/doc/org.bluez.MediaTransport.rst
@@ -115,11 +115,17 @@ string State [readonly]
 		created by a broadcast sink
 	:"active": streaming and acquired
 
+boolean DelayReporting [readonly]
+
+	Indicates if the endpoint associated with the transport supports Delay
+	Reporting.
+
 uint16 Delay [readwrite, optional]
 ``````````````````````````````````
 
-	Transport delay in 1/10 of millisecond, this property is only writeable
-	when the transport was acquired by the sender.
+	Transport delay in 1/10 of millisecond.
+	This property is available only if the DelayReporting is true and is
+	writeable only when the transport was acquired by the sender.
 
 uint16 Volume [readwrite, optional]
 ```````````````````````````````````
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 0f7909a94..dd6878427 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -860,6 +860,22 @@ static gboolean get_state(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean get_delay_reporting(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct media_transport *transport = data;
+	struct avdtp_stream *stream;
+
+	stream = media_transport_get_stream(transport);
+	if (stream == NULL)
+		return FALSE;
+
+	gboolean value = avdtp_stream_has_delay_reporting(stream);
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);
+
+	return TRUE;
+}
+
 static gboolean delay_reporting_exists(const GDBusPropertyTable *property,
 							void *data)
 {
@@ -873,7 +889,7 @@ static gboolean delay_reporting_exists(const GDBusPropertyTable *property,
 	return avdtp_stream_has_delay_reporting(stream);
 }
 
-static gboolean get_delay_reporting(const GDBusPropertyTable *property,
+static gboolean get_delay_report(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
 	struct media_transport *transport = data;
@@ -1019,7 +1035,8 @@ static const GDBusPropertyTable transport_a2dp_properties[] = {
 	{ "Codec", "y", get_codec },
 	{ "Configuration", "ay", get_configuration },
 	{ "State", "s", get_state },
-	{ "Delay", "q", get_delay_reporting, NULL, delay_reporting_exists },
+	{ "DelayReporting", "b", get_delay_reporting },
+	{ "Delay", "q", get_delay_report, NULL, delay_reporting_exists },
 	{ "Volume", "q", get_volume, set_volume, volume_exists },
 	{ "Endpoint", "o", get_endpoint, NULL, endpoint_exists,
 				G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
@@ -1359,6 +1376,14 @@ static const GDBusPropertyTable transport_bap_bc_properties[] = {
 	{ }
 };
 
+static gboolean get_asha_delay_reporting(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	gboolean value = TRUE;
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);
+	return TRUE;
+}
+
 static gboolean get_asha_delay(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -1380,6 +1405,7 @@ static const GDBusPropertyTable transport_asha_properties[] = {
 	{ "UUID", "s", get_uuid },
 	{ "Codec", "y", get_codec },
 	{ "State", "s", get_state },
+	{ "DelayReporting", "b", get_asha_delay_reporting },
 	{ "Delay", "q", get_asha_delay },
 	{ "Volume", "q", get_volume, set_volume, volume_exists },
 	{ }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-10-30 13:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 19:14 [PATCH BlueZ 1/2] transport: Expose DelayReporting on MediaTransport interface Arkadiusz Bokowy
2024-10-26 19:14 ` [PATCH BlueZ 2/2] transport: Allow to set A2DP transport delay property Arkadiusz Bokowy
2024-10-28 14:24   ` Luiz Augusto von Dentz
2024-10-28 20:32     ` Arkadiusz Bokowy
2024-10-28 20:52       ` Luiz Augusto von Dentz
2024-10-28 21:05         ` Arkadiusz Bokowy
2024-10-29 19:05           ` [PATCH BlueZ v2] " Arkadiusz Bokowy
2024-10-29 19:38             ` Luiz Augusto von Dentz
2024-10-29 20:41               ` [PATCH BlueZ v3 1/3] gdbus: Add g_dbus_pending_property_get_sender Arkadiusz Bokowy
2024-10-29 20:41                 ` [PATCH BlueZ v3 2/3] transport: Allow to set A2DP transport delay property Arkadiusz Bokowy
2024-10-29 20:41                 ` [PATCH BlueZ v3 3/3] doc/media: Document policy for setting transport delay Arkadiusz Bokowy
2024-10-29 22:24                 ` [BlueZ,v3,1/3] gdbus: Add g_dbus_pending_property_get_sender bluez.test.bot
2024-10-30 13:40                 ` [PATCH BlueZ v3 1/3] " patchwork-bot+bluetooth
2024-10-29 20:27             ` [BlueZ,v2] transport: Allow to set A2DP transport delay property bluez.test.bot
2024-10-26 21:02 ` [BlueZ,1/2] transport: Expose DelayReporting on MediaTransport interface bluez.test.bot
2024-10-28 14:18 ` [PATCH BlueZ 1/2] " Luiz Augusto von Dentz
2024-10-28 16:32   ` Arkadiusz Bokowy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.