mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-server: message: use union to store event data
Store subscription event data in a union instead of just an array for better readability.
This commit is contained in:
parent
d467f6fdc6
commit
46e4a33f27
3 changed files with 21 additions and 9 deletions
|
|
@ -13,15 +13,27 @@
|
|||
|
||||
struct impl;
|
||||
|
||||
enum message_type {
|
||||
MESSAGE_TYPE_UNSPECIFIED,
|
||||
MESSAGE_TYPE_SUBSCRIPTION_EVENT,
|
||||
};
|
||||
|
||||
struct message {
|
||||
struct spa_list link;
|
||||
struct impl *impl;
|
||||
uint32_t extra[4];
|
||||
uint32_t channel;
|
||||
uint32_t allocated;
|
||||
uint32_t length;
|
||||
uint32_t offset;
|
||||
uint8_t *data;
|
||||
|
||||
enum message_type type;
|
||||
union {
|
||||
struct {
|
||||
uint32_t event;
|
||||
uint32_t index;
|
||||
} subscription_event;
|
||||
} u;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue