[PATCH 5/6] protocol-native: Add signal receiving capability

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

 



On 02.10.2017 12:20, Tanu Kaskinen wrote:
> On Sat, 2017-08-19 at 17:48 +0200, Georg Chini wrote:
>> This patch extends the client subscription API, so that signals sent from
>> PulseAudio can be processed. Within PulseAudio, a signal can be emitted
>> using pa_signal_post(). The interface can be used to notify the client of
>> events that are not covered by the subscription API (for example a button
>> press event on a bluetooth headset).
>>
>> Setting up signal notification is very similar to using subscriptions.
>> First the client needs to subscribe with pa_context_subscribe_signals()
>> and then sets up a signal handler using pa_context_set_signal_callback().
>>
>> The signal handler will receive three arguments in addition to the usual
>> context and userdata:
>> sender - string that specifies the origin of the signal
>> signal - string that specifies the type of the signal
>> signal_parameters - optional string for additional information
>> ---
>>   PROTOCOL                        |  3 ++
>>   src/map-file                    |  2 ++
>>   src/pulse/def.h                 |  4 +++
>>   src/pulse/internal.h            |  2 ++
>>   src/pulse/subscribe.c           | 66 +++++++++++++++++++++++++++++++++++++----
>>   src/pulse/subscribe.h           |  9 ++++++
>>   src/pulsecore/core-messages.c   | 23 ++++++++++++++
>>   src/pulsecore/core-messages.h   | 11 +++++++
>>   src/pulsecore/core.h            |  1 +
>>   src/pulsecore/native-common.h   |  1 +
>>   src/pulsecore/pdispatch.c       |  1 +
>>   src/pulsecore/protocol-native.c | 57 +++++++++++++++++++++++++++++++++++
>>   12 files changed, 174 insertions(+), 6 deletions(-)
>>
>> diff --git a/PROTOCOL b/PROTOCOL
>> index ccd3cd2c..e9337e27 100644
>> --- a/PROTOCOL
>> +++ b/PROTOCOL
>> @@ -427,6 +427,9 @@ Added new command for communication with objects.
>>   PA_COMMAND_SEND_OBJECT_MESSAGE:
>>   sends a message to an object that registered a named message handler
>>   
>> +Added signal subscription functions. Clients can now subscribe to signals
>> +that PulseAudio sends.
> The PROTOCOL file is supposed to document the protocol changes in
> detail (or at least that's my impression), but this description is a
> very high-level note. Also, talking about "functions" is off-topic
> since the protocol doesn't define any functions.
>
Where does your impression come from? My impression was, that the
PROTOCOL file has only very brief and high level descriptions, so I kept
it that way. I can surely add more details, if you want.


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux