pulse-server: add event to the implementation

Add events when a server is started and stopped
This commit is contained in:
Wim Taymans 2022-11-17 18:31:23 +01:00
parent ab5fe8957b
commit a11612bdad
3 changed files with 30 additions and 1 deletions

View file

@ -36,6 +36,7 @@
#include <pipewire/private.h>
#include "format.h"
#include "server.h"
struct pw_loop;
struct pw_context;
@ -72,6 +73,7 @@ struct impl {
struct ratelimit rate_limit;
struct spa_hook_list hooks;
struct spa_list servers;
struct pw_work_queue *work_queue;
@ -85,6 +87,19 @@ struct impl {
struct stats stat;
};
struct impl_events {
#define VERSION_IMPL_EVENTS 0
uint32_t version;
void (*server_started) (void *data, struct server *server);
void (*server_stopped) (void *data, struct server *server);
};
void impl_add_listener(struct impl *impl,
struct spa_hook *listener,
const struct impl_events *events, void *data);
extern bool debug_messages;
void broadcast_subscribe_event(struct impl *impl, uint32_t mask, uint32_t event, uint32_t id);