Re: [PATCH BlueZ 1/2] transport: Expose DelayReporting on MediaTransport interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Arkadiusz,

On Sat, Oct 26, 2024 at 3:15 PM Arkadiusz Bokowy
<arkadiusz.bokowy@xxxxxxxxx> wrote:
>
> 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.

The presence of Delay indicates delay reporting is supported, so no
need to add another property for it.

>  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.

Again no need to add another property just to indicate its support
since its presence shall already indicate that.

>  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
>
>


-- 
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux