protocol-native: move compat_v2 to protocol

This commit is contained in:
Wim Taymans 2023-07-11 15:59:09 +02:00
parent 7d6fc0f544
commit 17bc9d520e
4 changed files with 12 additions and 8 deletions

View file

@ -23,6 +23,8 @@
#endif #endif
#include <spa/pod/iter.h> #include <spa/pod/iter.h>
#include <spa/pod/parser.h>
#include <spa/pod/builder.h>
#include <spa/utils/result.h> #include <spa/utils/result.h>
#include <spa/utils/string.h> #include <spa/utils/string.h>
@ -1465,6 +1467,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_impl_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_protocol *this; struct pw_protocol *this;
struct pw_impl_core *core = context->core;
struct protocol_data *d; struct protocol_data *d;
const struct pw_properties *props; const struct pw_properties *props;
int res; int res;
@ -1496,10 +1499,10 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
d->module = module; d->module = module;
props = pw_context_get_properties(context); props = pw_context_get_properties(context);
d->local = create_server(this, context->core, &props->dict); d->local = create_server(this, core, &props->dict);
if (need_server(context, &props->dict)) { if (need_server(context, &props->dict)) {
if (impl_add_server(this, context->core, &props->dict) == NULL) { if (impl_add_server(this, core, &props->dict) == NULL) {
res = -errno; res = -errno;
goto error_cleanup; goto error_cleanup;
} }

View file

@ -27,3 +27,9 @@ static inline void *get_first_pod_from_data(void *data, uint32_t maxsize, uint64
return NULL; return NULL;
return pod; return pod;
} }
struct protocol_compat_v2 {
/* v2 typemap */
struct pw_map types;
unsigned int send_types:1;
};

View file

@ -22,6 +22,7 @@
#include "interfaces.h" #include "interfaces.h"
#include "typemap.h" #include "typemap.h"
#include "../defs.h"
#include "../connection.h" #include "../connection.h"
PW_LOG_TOPIC_EXTERN(mod_topic); PW_LOG_TOPIC_EXTERN(mod_topic);

View file

@ -213,12 +213,6 @@ enum spa_node0_command {
SPA_NODE0_COMMAND_ClockUpdate, SPA_NODE0_COMMAND_ClockUpdate,
}; };
struct protocol_compat_v2 {
/* v2 typemap */
struct pw_map types;
unsigned int send_types:1;
};
#define pw_impl_core_emit(s,m,v,...) spa_hook_list_call(&s->listener_list, struct pw_impl_core_events, m, v, ##__VA_ARGS__) #define pw_impl_core_emit(s,m,v,...) spa_hook_list_call(&s->listener_list, struct pw_impl_core_events, m, v, ##__VA_ARGS__)
#define pw_impl_core_emit_destroy(s) pw_impl_core_emit(s, destroy, 0) #define pw_impl_core_emit_destroy(s) pw_impl_core_emit(s, destroy, 0)