[pulseaudio-discuss] [PATCH 1/8] core: add simple message interface

Tanu Kaskinen tanuk at iki.fi
Wed Jul 4 12:36:17 UTC 2018


On Mon, 2018-04-09 at 19:35 +0200, Georg Chini wrote:
> This patch adds a new feature to the core which allows to send messages
> to objects. An object can register/unregister a message handler with
> pa_message_handler_{register, unregister}() while a message can be sent
> to the handler using the pa_message_handler_send_message() function.
> A message has 4 arguments (apart from passing the core):
> 
> object_path: The path identifying the object that will receive the message
> message: message command
> message_parameters: A string containing additional parameters
> response: Pointer to a response string that will be filled by the
>           message handler. The caller is responsible to free the string.
> 
> The patch is a precondition for the following patches that allow clients
> to send messages to pulseaudio objects.
> 
> There is no restriction on object names, except that an object path
> always starts with a "/". The intention is to use a path-like syntax,
> for example /core/sink_1 for a sink or /name/instances/index for modules.
> The exact naming convention still needs to be agreed.
> ---
>  src/Makefile.am                 |   1 +
>  src/pulsecore/core.c            |   4 ++
>  src/pulsecore/core.h            |   2 +-
>  src/pulsecore/message-handler.c | 104 ++++++++++++++++++++++++++++++++++++++++
>  src/pulsecore/message-handler.h |  50 +++++++++++++++++++
>  5 files changed, 160 insertions(+), 1 deletion(-)
>  create mode 100644 src/pulsecore/message-handler.c
>  create mode 100644 src/pulsecore/message-handler.h

Looks good to me.

-- 
Tanu

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


More information about the pulseaudio-discuss mailing list