pulse-server: compile extensions separately

Avoid including other C source files. Compile them separately.
This commit is contained in:
Barnabás Pőcze 2021-10-18 15:00:33 +02:00
parent b78371f702
commit 80ae688cc6
6 changed files with 30 additions and 10 deletions

View file

@ -206,6 +206,9 @@ pipewire_module_protocol_pulse_sources = [
'module-protocol-pulse/client.c', 'module-protocol-pulse/client.c',
'module-protocol-pulse/collect.c', 'module-protocol-pulse/collect.c',
'module-protocol-pulse/extension.c', 'module-protocol-pulse/extension.c',
'module-protocol-pulse/extensions/ext-device-manager.c',
'module-protocol-pulse/extensions/ext-device-restore.c',
'module-protocol-pulse/extensions/ext-stream-restore.c',
'module-protocol-pulse/format.c', 'module-protocol-pulse/format.c',
'module-protocol-pulse/manager.c', 'module-protocol-pulse/manager.c',
'module-protocol-pulse/media-roles.c', 'module-protocol-pulse/media-roles.c',

View file

@ -25,15 +25,9 @@
#include <spa/utils/defs.h> #include <spa/utils/defs.h>
#include <spa/utils/string.h> #include <spa/utils/string.h>
#include "defs.h"
#include "extension.h" #include "extension.h"
#include "extensions/registry.h"
static int do_extension_device_manager(struct client *client, uint32_t tag, struct message *m)
{
return -ENOTSUP;
}
#include "extensions/ext-device-restore.c"
#include "extensions/ext-stream-restore.c"
static const struct extension extensions[] = { static const struct extension extensions[] = {
{ "module-stream-restore", 0 | EXTENSION_FLAG, do_extension_stream_restore, }, { "module-stream-restore", 0 | EXTENSION_FLAG, do_extension_stream_restore, },

View file

@ -0,0 +1,8 @@
#include <errno.h>
#include "registry.h"
int do_extension_device_manager(struct client *client, uint32_t tag, struct message *m)
{
return -ENOTSUP;
}

View file

@ -47,6 +47,7 @@
#include "../message.h" #include "../message.h"
#include "../reply.h" #include "../reply.h"
#include "../volume.h" #include "../volume.h"
#include "registry.h"
PW_LOG_TOPIC_EXTERN(pulse_ext_dev_restore); PW_LOG_TOPIC_EXTERN(pulse_ext_dev_restore);
#undef PW_LOG_TOPIC_DEFAULT #undef PW_LOG_TOPIC_DEFAULT
@ -318,7 +319,7 @@ static const struct extension_sub ext_device_restore[] = {
{ "SAVE_FORMATS", 5, do_extension_device_restore_save_formats, }, { "SAVE_FORMATS", 5, do_extension_device_restore_save_formats, },
}; };
static int do_extension_device_restore(struct client *client, uint32_t tag, struct message *m) int do_extension_device_restore(struct client *client, uint32_t tag, struct message *m)
{ {
uint32_t command; uint32_t command;
int res; int res;

View file

@ -46,6 +46,7 @@
#include "../message.h" #include "../message.h"
#include "../reply.h" #include "../reply.h"
#include "../volume.h" #include "../volume.h"
#include "registry.h"
PW_LOG_TOPIC_EXTERN(pulse_ext_stream_restore); PW_LOG_TOPIC_EXTERN(pulse_ext_stream_restore);
#undef PW_LOG_TOPIC_DEFAULT #undef PW_LOG_TOPIC_DEFAULT
@ -304,7 +305,7 @@ static const struct extension_sub ext_stream_restore[] = {
{ "EVENT", 5, }, { "EVENT", 5, },
}; };
static int do_extension_stream_restore(struct client *client, uint32_t tag, struct message *m) int do_extension_stream_restore(struct client *client, uint32_t tag, struct message *m)
{ {
uint32_t command; uint32_t command;
int res; int res;

View file

@ -0,0 +1,13 @@
#ifndef PIPEWIRE_PULSE_EXTENSION_REGISTRY_H
#define PIPEWIRE_PULSE_EXTENSION_REGISTRY_H
#include <stdint.h>
struct client;
struct message;
int do_extension_stream_restore(struct client *client, uint32_t tag, struct message *m);
int do_extension_device_restore(struct client *client, uint32_t tag, struct message *m);
int do_extension_device_manager(struct client *client, uint32_t tag, struct message *m);
#endif /* PIPEWIRE_PULSE_EXTENSION_REGISTRY_H */