Re: [PATCH BlueZ 2/2] media: implement SupportedFeatures property

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

 



Hi Pauli,

On Mon, Apr 21, 2025 at 7:05 AM Pauli Virtanen <pav@xxxxxx> wrote:
>
> Add org.bluez.Media.SupportedFeatures. The value tx-timestamping is
> hardcoded as it is currently always enabled.
> ---
>  profiles/audio/media.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 69c6dc671..df36bc2df 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -3340,8 +3340,28 @@ static gboolean supported_uuids(const GDBusPropertyTable *property,
>         return TRUE;
>  }
>
> +static gboolean supported_features(const GDBusPropertyTable *property,
> +                                       DBusMessageIter *iter, void *data)
> +{
> +       static const char * const features[] = { "tx-timestamping" };
> +       DBusMessageIter entry;
> +       size_t i;
> +
> +       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
> +                               DBUS_TYPE_STRING_AS_STRING, &entry);
> +
> +       for (i = 0; i < ARRAY_SIZE(features); ++i)
> +               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
> +                                                       &features[i]);

That doesn't really handle if the kernel doesn't support it or setting
SO_TIMESTAMPING fails in case the kernel is too old? We might need to
have a MGMT flag indicating that kernel has support for it otherwise,
that said perhaps it would actually be better to have a socket option
since for the likes of SCO sockets we actually need hardware support
as well.

> +       dbus_message_iter_close_container(iter, &entry);
> +
> +       return TRUE;
> +}
> +
>  static const GDBusPropertyTable media_properties[] = {
>         { "SupportedUUIDs", "as", supported_uuids },
> +       { "SupportedFeatures", "as", supported_features },
>         { }
>  };
>
> --
> 2.49.0
>
>


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