protocol: add flags to protocol marshal

Allows us to to select marshallers for implementation and binding.
This commit is contained in:
Wim Taymans 2019-11-03 10:21:57 +01:00
parent d1e331e268
commit 8ddf579cc0
11 changed files with 150 additions and 92 deletions

View file

@ -1914,12 +1914,13 @@ pw_protocol_native_core_event_demarshal[PW_CORE_PROXY_EVENT_NUM] =
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
PW_TYPE_INTERFACE_Core,
PW_VERSION_CORE_PROXY,
0,
PW_CORE_PROXY_METHOD_NUM,
PW_CORE_PROXY_EVENT_NUM,
&pw_protocol_native_core_method_marshal,
pw_protocol_native_core_method_demarshal,
&pw_protocol_native_core_event_marshal,
pw_protocol_native_core_event_demarshal,
.client_marshal = &pw_protocol_native_core_method_marshal,
.server_demarshal = pw_protocol_native_core_method_demarshal,
.server_marshal = &pw_protocol_native_core_event_marshal,
.client_demarshal = pw_protocol_native_core_event_demarshal,
};
static const struct pw_registry_proxy_methods pw_protocol_native_registry_method_marshal = {
@ -1953,12 +1954,13 @@ pw_protocol_native_registry_event_demarshal[PW_REGISTRY_PROXY_EVENT_NUM] =
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_TYPE_INTERFACE_Registry,
PW_VERSION_REGISTRY_PROXY,
0,
PW_REGISTRY_PROXY_METHOD_NUM,
PW_REGISTRY_PROXY_EVENT_NUM,
&pw_protocol_native_registry_method_marshal,
pw_protocol_native_registry_method_demarshal,
&pw_protocol_native_registry_event_marshal,
pw_protocol_native_registry_event_demarshal,
.client_marshal = &pw_protocol_native_registry_method_marshal,
.server_demarshal = pw_protocol_native_registry_method_demarshal,
.server_marshal = &pw_protocol_native_registry_event_marshal,
.client_demarshal = pw_protocol_native_registry_event_demarshal,
};
static const struct pw_module_proxy_events pw_protocol_native_module_event_marshal = {
@ -1987,12 +1989,13 @@ pw_protocol_native_module_method_demarshal[PW_MODULE_PROXY_METHOD_NUM] =
const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
PW_TYPE_INTERFACE_Module,
PW_VERSION_MODULE_PROXY,
0,
PW_MODULE_PROXY_METHOD_NUM,
PW_MODULE_PROXY_EVENT_NUM,
&pw_protocol_native_module_method_marshal,
pw_protocol_native_module_method_demarshal,
&pw_protocol_native_module_event_marshal,
pw_protocol_native_module_event_demarshal,
.client_marshal = &pw_protocol_native_module_method_marshal,
.server_demarshal = pw_protocol_native_module_method_demarshal,
.server_marshal = &pw_protocol_native_module_event_marshal,
.client_demarshal = pw_protocol_native_module_event_demarshal,
};
static const struct pw_factory_proxy_events pw_protocol_native_factory_event_marshal = {
@ -2020,12 +2023,13 @@ pw_protocol_native_factory_method_demarshal[PW_FACTORY_PROXY_METHOD_NUM] =
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
PW_TYPE_INTERFACE_Factory,
PW_VERSION_FACTORY_PROXY,
0,
PW_FACTORY_PROXY_METHOD_NUM,
PW_FACTORY_PROXY_EVENT_NUM,
&pw_protocol_native_factory_method_marshal,
pw_protocol_native_factory_method_demarshal,
&pw_protocol_native_factory_event_marshal,
pw_protocol_native_factory_event_demarshal,
.client_marshal = &pw_protocol_native_factory_method_marshal,
.server_demarshal = pw_protocol_native_factory_method_demarshal,
.server_marshal = &pw_protocol_native_factory_event_marshal,
.client_demarshal = pw_protocol_native_factory_event_demarshal,
};
static const struct pw_device_proxy_methods pw_protocol_native_device_method_marshal = {
@ -2057,12 +2061,13 @@ pw_protocol_native_device_event_demarshal[PW_DEVICE_PROXY_EVENT_NUM] = {
static const struct pw_protocol_marshal pw_protocol_native_device_marshal = {
PW_TYPE_INTERFACE_Device,
PW_VERSION_DEVICE_PROXY,
0,
PW_DEVICE_PROXY_METHOD_NUM,
PW_DEVICE_PROXY_EVENT_NUM,
&pw_protocol_native_device_method_marshal,
pw_protocol_native_device_method_demarshal,
&pw_protocol_native_device_event_marshal,
pw_protocol_native_device_event_demarshal,
.client_marshal = &pw_protocol_native_device_method_marshal,
.server_demarshal = pw_protocol_native_device_method_demarshal,
.server_marshal = &pw_protocol_native_device_event_marshal,
.client_demarshal = pw_protocol_native_device_event_demarshal,
};
static const struct pw_node_proxy_methods pw_protocol_native_node_method_marshal = {
@ -2099,12 +2104,13 @@ pw_protocol_native_node_event_demarshal[PW_NODE_PROXY_EVENT_NUM] = {
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY,
0,
PW_NODE_PROXY_METHOD_NUM,
PW_NODE_PROXY_EVENT_NUM,
&pw_protocol_native_node_method_marshal,
pw_protocol_native_node_method_demarshal,
&pw_protocol_native_node_event_marshal,
pw_protocol_native_node_event_demarshal,
.client_marshal = &pw_protocol_native_node_method_marshal,
.server_demarshal = pw_protocol_native_node_method_demarshal,
.server_marshal = &pw_protocol_native_node_event_marshal,
.client_demarshal = pw_protocol_native_node_event_demarshal,
};
@ -2139,12 +2145,13 @@ pw_protocol_native_port_event_demarshal[PW_PORT_PROXY_EVENT_NUM] =
static const struct pw_protocol_marshal pw_protocol_native_port_marshal = {
PW_TYPE_INTERFACE_Port,
PW_VERSION_PORT_PROXY,
0,
PW_PORT_PROXY_METHOD_NUM,
PW_PORT_PROXY_EVENT_NUM,
&pw_protocol_native_port_method_marshal,
pw_protocol_native_port_method_demarshal,
&pw_protocol_native_port_event_marshal,
pw_protocol_native_port_event_demarshal,
.client_marshal = &pw_protocol_native_port_method_marshal,
.server_demarshal = pw_protocol_native_port_method_demarshal,
.server_marshal = &pw_protocol_native_port_event_marshal,
.client_demarshal = pw_protocol_native_port_event_demarshal,
};
static const struct pw_client_proxy_methods pw_protocol_native_client_method_marshal = {
@ -2182,12 +2189,13 @@ pw_protocol_native_client_event_demarshal[PW_CLIENT_PROXY_EVENT_NUM] =
static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
PW_TYPE_INTERFACE_Client,
PW_VERSION_CLIENT_PROXY,
0,
PW_CLIENT_PROXY_METHOD_NUM,
PW_CLIENT_PROXY_EVENT_NUM,
&pw_protocol_native_client_method_marshal,
pw_protocol_native_client_method_demarshal,
&pw_protocol_native_client_event_marshal,
pw_protocol_native_client_event_demarshal,
.client_marshal = &pw_protocol_native_client_method_marshal,
.server_demarshal = pw_protocol_native_client_method_demarshal,
.server_marshal = &pw_protocol_native_client_event_marshal,
.client_demarshal = pw_protocol_native_client_event_demarshal,
};
@ -2216,12 +2224,13 @@ pw_protocol_native_link_event_demarshal[PW_LINK_PROXY_EVENT_NUM] =
static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
0,
PW_LINK_PROXY_METHOD_NUM,
PW_LINK_PROXY_EVENT_NUM,
&pw_protocol_native_link_method_marshal,
pw_protocol_native_link_method_demarshal,
&pw_protocol_native_link_event_marshal,
pw_protocol_native_link_event_demarshal,
.client_marshal = &pw_protocol_native_link_method_marshal,
.server_demarshal = pw_protocol_native_link_method_demarshal,
.server_marshal = &pw_protocol_native_link_event_marshal,
.client_demarshal = pw_protocol_native_link_event_demarshal,
};
void pw_protocol_native_init(struct pw_protocol *protocol)

View file

@ -1042,6 +1042,7 @@ static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
PW_VERSION_CORE_V0,
PW_CORE_PROXY_V0_METHOD_NUM,
PW_CORE_PROXY_EVENT_NUM,
0,
NULL,
pw_protocol_native_core_method_demarshal,
&pw_protocol_native_core_event_marshal,
@ -1063,6 +1064,7 @@ static const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_VERSION_REGISTRY_V0,
PW_REGISTRY_PROXY_V0_METHOD_NUM,
PW_REGISTRY_PROXY_EVENT_NUM,
0,
NULL,
pw_protocol_native_registry_method_demarshal,
&pw_protocol_native_registry_event_marshal,
@ -1079,6 +1081,7 @@ static const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
PW_VERSION_MODULE_V0,
0,
PW_MODULE_PROXY_EVENT_NUM,
0,
NULL, NULL,
&pw_protocol_native_module_event_marshal,
NULL
@ -1094,6 +1097,7 @@ static const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
PW_VERSION_FACTORY_V0,
0,
PW_FACTORY_PROXY_EVENT_NUM,
0,
NULL, NULL,
&pw_protocol_native_factory_event_marshal,
NULL,
@ -1114,6 +1118,7 @@ static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
PW_VERSION_NODE_V0,
PW_NODE_PROXY_V0_METHOD_NUM,
PW_NODE_PROXY_EVENT_NUM,
0,
NULL,
pw_protocol_native_node_method_demarshal,
&pw_protocol_native_node_event_marshal,
@ -1136,6 +1141,7 @@ static const struct pw_protocol_marshal pw_protocol_native_port_marshal = {
PW_VERSION_PORT_V0,
PW_PORT_PROXY_V0_METHOD_NUM,
PW_PORT_PROXY_EVENT_NUM,
0,
NULL,
pw_protocol_native_port_method_demarshal,
&pw_protocol_native_port_event_marshal,
@ -1153,6 +1159,7 @@ static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
PW_VERSION_CLIENT_V0,
0,
PW_CLIENT_PROXY_EVENT_NUM,
0,
NULL, NULL,
&pw_protocol_native_client_event_marshal,
NULL,
@ -1168,6 +1175,7 @@ static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
PW_VERSION_LINK_V0,
0,
PW_LINK_PROXY_EVENT_NUM,
0,
NULL, NULL,
&pw_protocol_native_link_event_marshal,
NULL