[pulseaudio-discuss] [PATCH v4 2/7] protocol-native: add message sending capability

Tanu Kaskinen tanuk at iki.fi
Wed Feb 21 12:07:05 UTC 2018


On Sun, 2018-01-28 at 18:40 +0100, Georg Chini wrote:
> This patch adds the PA_COMMAND_SEND_OBJECT_MESSAGE command to protocol-native
> so that clients can use the messaging feature introduced in the previous patch.
> 
> Sending messages can in effect replace the extension system for modules. The
> approach is more flexible than the extension interface because a generic string
> format is used to exchange information. Furthermore the messaging system can be
> used for any object, not only for modules, and is easier to implement than
> extensions.
> ---
>  PROTOCOL                        | 14 +++++++++
>  configure.ac                    |  2 +-
>  src/map-file                    |  1 +
>  src/pulse/introspect.c          | 64 +++++++++++++++++++++++++++++++++++++++++
>  src/pulse/introspect.h          | 16 +++++++++++
>  src/pulsecore/native-common.h   |  3 ++
>  src/pulsecore/pdispatch.c       |  3 ++
>  src/pulsecore/protocol-native.c | 52 +++++++++++++++++++++++++++++++++
>  8 files changed, 154 insertions(+), 1 deletion(-)
> 
> diff --git a/PROTOCOL b/PROTOCOL
> index 546998b7..480291bb 100644
> --- a/PROTOCOL
> +++ b/PROTOCOL
> @@ -420,6 +420,20 @@ memfd support only to 10.0+ clients.
>  
>  Check commit 451d1d676237c81 for further details.
>  
> +## v33, implemented by >= 12.0

Time flies, and the version number is now out of date.

> diff --git a/src/pulsecore/native-common.h b/src/pulsecore/native-common.h
> index 70338b9f..5c3cf521 100644
> --- a/src/pulsecore/native-common.h
> +++ b/src/pulsecore/native-common.h
> @@ -187,6 +187,9 @@ enum {
>       * BOTH DIRECTIONS */
>      PA_COMMAND_REGISTER_MEMFD_SHMID,
>  
> +    /* Supported since protocol v33 (12.0) */

Version update needed here too.

> +    PA_COMMAND_SEND_OBJECT_MESSAGE,
> +
>      PA_COMMAND_MAX
>  };
>  
> diff --git a/src/pulsecore/pdispatch.c b/src/pulsecore/pdispatch.c
> index ab632a5a..d317a15e 100644
> --- a/src/pulsecore/pdispatch.c
> +++ b/src/pulsecore/pdispatch.c
> @@ -199,6 +199,9 @@ static const char *command_names[PA_COMMAND_MAX] = {
>      /* Supported since protocol v31 (9.0) */
>      /* BOTH DIRECTIONS */
>      [PA_COMMAND_REGISTER_MEMFD_SHMID] = "REGISTER_MEMFD_SHMID",
> +
> +    /* Supported since protocol v33 (12.0) */
> +    [PA_COMMAND_SEND_OBJECT_MESSAGE] = "SEND_OBJECT_MESSAGE",

...and here.

-- 
Tanu

https://liberapay.com/tanuk
https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list