diff options
Diffstat (limited to 'src/modules/module-protocol-native/v0')
-rw-r--r-- | src/modules/module-protocol-native/v0/interfaces.h | 534 | ||||
-rw-r--r-- | src/modules/module-protocol-native/v0/protocol-native.c | 1371 | ||||
-rw-r--r-- | src/modules/module-protocol-native/v0/typemap.h | 282 |
3 files changed, 2187 insertions, 0 deletions
diff --git a/src/modules/module-protocol-native/v0/interfaces.h b/src/modules/module-protocol-native/v0/interfaces.h new file mode 100644 index 0000000..dca9672 --- /dev/null +++ b/src/modules/module-protocol-native/v0/interfaces.h @@ -0,0 +1,534 @@ +/* PipeWire + * + * Copyright © 2016 Wim Taymans <wim.taymans@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef PIPEWIRE_INTERFACES_V0_H +#define PIPEWIRE_INTERFACES_V0_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <spa/utils/defs.h> +#include <spa/param/param.h> +#include <spa/node/node.h> + +#include <pipewire/pipewire.h> + +/** Core */ + +#define PW_VERSION_CORE_V0 0 + +#define PW_CORE_V0_METHOD_HELLO 0 +#define PW_CORE_V0_METHOD_UPDATE_TYPES 1 +#define PW_CORE_V0_METHOD_SYNC 2 +#define PW_CORE_V0_METHOD_GET_REGISTRY 3 +#define PW_CORE_V0_METHOD_CLIENT_UPDATE 4 +#define PW_CORE_V0_METHOD_PERMISSIONS 5 +#define PW_CORE_V0_METHOD_CREATE_OBJECT 6 +#define PW_CORE_V0_METHOD_DESTROY 7 +#define PW_CORE_V0_METHOD_NUM 8 + +/** + * Key to update default permissions of globals without specific + * permissions. value is "[r][w][x]" */ +#define PW_CORE_PERMISSIONS_DEFAULT "permissions.default" + +/** + * Key to update specific permissions of a global. If the global + * did not have specific permissions, it will first be assigned + * the default permissions before it is updated. + * Value is "<global-id>:[r][w][x]"*/ +#define PW_CORE_PERMISSIONS_GLOBAL "permissions.global" + +/** + * Key to update specific permissions of all existing globals. + * This is equivalent to using \ref PW_CORE_PERMISSIONS_GLOBAL + * on each global id individually that did not have specific + * permissions. + * Value is "[r][w][x]" */ +#define PW_CORE_PERMISSIONS_EXISTING "permissions.existing" + +#define PW_LINK_OUTPUT_NODE_ID "link.output_node.id" +#define PW_LINK_OUTPUT_PORT_ID "link.output_port.id" +#define PW_LINK_INPUT_NODE_ID "link.input_node.id" +#define PW_LINK_INPUT_PORT_ID "link.input_port.id" + +/** + * \struct pw_core_v0_methods + * \brief Core methods + * + * The core global object. This is a singleton object used for + * creating new objects in the remote PipeWire instance. It is + * also used for internal features. + */ +struct pw_core_v0_methods { +#define PW_VERSION_CORE_V0_METHODS 0 + uint32_t version; + /** + * Start a conversation with the server. This will send + * the core info and server types. + * + * All the existing resources for the client (except the core + * resource) will be destroyed. + */ + void (*hello) (void *object); + /** + * Update the type map + * + * Send a type map update to the PipeWire server. The server uses this + * information to keep a mapping between client types and the server types. + * \param first_id the id of the first type + * \param types the types as a string + * \param n_types the number of types + */ + void (*update_types) (void *object, + uint32_t first_id, + const char **types, + uint32_t n_types); + /** + * Do server roundtrip + * + * Ask the server to emit the 'done' event with \a id. + * Since methods are handled in-order and events are delivered + * in-order, this can be used as a barrier to ensure all previous + * methods and the resulting events have been handled. + * \param seq the sequence number passed to the done event + */ + void (*sync) (void *object, uint32_t seq); + /** + * Get the registry object + * + * Create a registry object that allows the client to list and bind + * the global objects available from the PipeWire server + * \param version the client proxy id + * \param id the client proxy id + */ + void (*get_registry) (void *object, uint32_t version, uint32_t new_id); + /** + * Update the client properties + * \param props the new client properties + */ + void (*client_update) (void *object, const struct spa_dict *props); + /** + * Manage the permissions of the global objects + * + * Update the permissions of the global objects using the + * dictionary with properties. + * + * Globals can use the default permissions or can have specific + * permissions assigned to them. + * + * \param id the global id to change + * \param props dictionary with permission properties + */ + void (*permissions) (void *object, const struct spa_dict *props); + /** + * Create a new object on the PipeWire server from a factory. + * Use a \a factory_name of "client-node" to create a + * \ref pw_client_node. + * + * \param factory_name the factory name to use + * \param type the interface to bind to + * \param version the version of the interface + * \param props extra properties + * \param new_id the client proxy id + */ + void (*create_object) (void *object, + const char *factory_name, + uint32_t type, + uint32_t version, + const struct spa_dict *props, + uint32_t new_id); + + /** + * Destroy an object id + * + * \param id the object id to destroy + */ + void (*destroy) (void *object, uint32_t id); +}; + +#define PW_CORE_V0_EVENT_UPDATE_TYPES 0 +#define PW_CORE_V0_EVENT_DONE 1 +#define PW_CORE_V0_EVENT_ERROR 2 +#define PW_CORE_V0_EVENT_REMOVE_ID 3 +#define PW_CORE_V0_EVENT_INFO 4 +#define PW_CORE_V0_EVENT_NUM 5 + +/** \struct pw_core_v0_events + * \brief Core events + * \ingroup pw_core_interface The pw_core interface + */ +struct pw_core_v0_events { +#define PW_VERSION_CORE_V0_EVENTS 0 + uint32_t version; + /** + * Update the type map + * + * Send a type map update to the client. The client uses this + * information to keep a mapping between server types and the client types. + * \param first_id the id of the first type + * \param types the types as a string + * \param n_types the number of \a types + */ + void (*update_types) (void *data, + uint32_t first_id, + const char **types, + uint32_t n_types); + /** + * Emit a done event + * + * The done event is emitted as a result of a sync method with the + * same sequence number. + * \param seq the sequence number passed to the sync method call + */ + void (*done) (void *data, uint32_t seq); + /** + * Fatal error event + * + * The error event is sent out when a fatal (non-recoverable) + * error has occurred. The id argument is the object where + * the error occurred, most often in response to a request to that + * object. The message is a brief description of the error, + * for (debugging) convenience. + * \param id object where the error occurred + * \param res error code + * \param error error description + */ + void (*error) (void *data, uint32_t id, int res, const char *error, ...); + /** + * Remove an object ID + * + * This event is used internally by the object ID management + * logic. When a client deletes an object, the server will send + * this event to acknowledge that it has seen the delete request. + * When the client receives this event, it will know that it can + * safely reuse the object ID. + * \param id deleted object ID + */ + void (*remove_id) (void *data, uint32_t id); + /** + * Notify new core info + * + * \param info new core info + */ + void (*info) (void *data, struct pw_core_info *info); +}; + +#define pw_core_resource_v0_update_types(r,...) pw_resource_notify(r,struct pw_core_v0_events,update_types,__VA_ARGS__) +#define pw_core_resource_v0_done(r,...) pw_resource_notify(r,struct pw_core_v0_events,done,__VA_ARGS__) +#define pw_core_resource_v0_error(r,...) pw_resource_notify(r,struct pw_core_v0_events,error,__VA_ARGS__) +#define pw_core_resource_v0_remove_id(r,...) pw_resource_notify(r,struct pw_core_v0_events,remove_id,__VA_ARGS__) +#define pw_core_resource_v0_info(r,...) pw_resource_notify(r,struct pw_core_v0_events,info,__VA_ARGS__) + + +#define PW_VERSION_REGISTRY_V0 0 + +/** \page page_registry Registry + * + * \section page_registry_overview Overview + * + * The registry object is a singleton object that keeps track of + * global objects on the PipeWire instance. See also \ref page_global. + * + * Global objects typically represent an actual object in PipeWire + * (for example, a module or node) or they are singleton + * objects such as the core. + * + * When a client creates a registry object, the registry object + * will emit a global event for each global currently in the + * registry. Globals come and go as a result of device hotplugs or + * reconfiguration or other events, and the registry will send out + * global and global_remove events to keep the client up to date + * with the changes. To mark the end of the initial burst of + * events, the client can use the pw_core.sync methosd immediately + * after calling pw_core.get_registry. + * + * A client can bind to a global object by using the bind + * request. This creates a client-side proxy that lets the object + * emit events to the client and lets the client invoke methods on + * the object. See \ref page_proxy + * + * Clients can also change the permissions of the global objects that + * it can see. This is interesting when you want to configure a + * pipewire session before handing it to another application. You + * can, for example, hide certain existing or new objects or limit + * the access permissions on an object. + */ +#define PW_REGISTRY_V0_METHOD_BIND 0 +#define PW_REGISTRY_V0_METHOD_NUM 1 + +/** Registry methods */ +struct pw_registry_v0_methods { +#define PW_VERSION_REGISTRY_V0_METHODS 0 + uint32_t version; + /** + * Bind to a global object + * + * Bind to the global object with \a id and use the client proxy + * with new_id as the proxy. After this call, methods can be + * send to the remote global object and events can be received + * + * \param id the global id to bind to + * \param type the interface type to bind to + * \param version the interface version to use + * \param new_id the client proxy to use + */ + void (*bind) (void *object, uint32_t id, uint32_t type, uint32_t version, uint32_t new_id); +}; + +#define PW_REGISTRY_V0_EVENT_GLOBAL 0 +#define PW_REGISTRY_V0_EVENT_GLOBAL_REMOVE 1 +#define PW_REGISTRY_V0_EVENT_NUM 2 + +/** Registry events */ +struct pw_registry_v0_events { +#define PW_VERSION_REGISTRY_V0_EVENTS 0 + uint32_t version; + /** + * Notify of a new global object + * + * The registry emits this event when a new global object is + * available. + * + * \param id the global object id + * \param parent_id the parent global id + * \param permissions the permissions of the object + * \param type the type of the interface + * \param version the version of the interface + * \param props extra properties of the global + */ + void (*global) (void *data, uint32_t id, uint32_t parent_id, + uint32_t permissions, uint32_t type, uint32_t version, + const struct spa_dict *props); + /** + * Notify of a global object removal + * + * Emitted when a global object was removed from the registry. + * If the client has any bindings to the global, it should destroy + * those. + * + * \param id the id of the global that was removed + */ + void (*global_remove) (void *data, uint32_t id); +}; + +#define pw_registry_resource_v0_global(r,...) pw_resource_notify(r,struct pw_registry_v0_events,global,__VA_ARGS__) +#define pw_registry_resource_v0_global_remove(r,...) pw_resource_notify(r,struct pw_registry_v0_events,global_remove,__VA_ARGS__) + + +#define PW_VERSION_MODULE_V0 0 + +#define PW_MODULE_V0_EVENT_INFO 0 +#define PW_MODULE_V0_EVENT_NUM 1 + +/** Module events */ +struct pw_module_v0_events { +#define PW_VERSION_MODULE_V0_EVENTS 0 + uint32_t version; + /** + * Notify module info + * + * \param info info about the module + */ + void (*info) (void *data, struct pw_module_info *info); +}; + +#define pw_module_resource_v0_info(r,...) pw_resource_notify(r,struct pw_module_v0_events,info,__VA_ARGS__) + +#define PW_VERSION_NODE_V0 0 + +#define PW_NODE_V0_EVENT_INFO 0 +#define PW_NODE_V0_EVENT_PARAM 1 +#define PW_NODE_V0_EVENT_NUM 2 + +/** Node events */ +struct pw_node_v0_events { +#define PW_VERSION_NODE_V0_EVENTS 0 + uint32_t version; + /** + * Notify node info + * + * \param info info about the node + */ + void (*info) (void *data, struct pw_node_info *info); + /** + * Notify a node param + * + * Event emitted as a result of the enum_params method. + * + * \param id the param id + * \param index the param index + * \param next the param index of the next param + * \param param the parameter + */ + void (*param) (void *data, + uint32_t id, uint32_t index, uint32_t next, + const struct spa_pod *param); +}; + +#define pw_node_resource_v0_info(r,...) pw_resource_notify(r,struct pw_node_v0_events,info,__VA_ARGS__) +#define pw_node_resource_v0_param(r,...) pw_resource_notify(r,struct pw_node_v0_events,param,__VA_ARGS__) + +#define PW_NODE_V0_METHOD_ENUM_PARAMS 0 +#define PW_NODE_V0_METHOD_NUM 1 + +/** Node methods */ +struct pw_node_v0_methods { +#define PW_VERSION_NODE_V0_METHODS 0 + uint32_t version; + /** + * Enumerate node parameters + * + * Start enumeration of node parameters. For each param, a + * param event will be emitted. + * + * \param id the parameter id to enum or PW_ID_ANY for all + * \param start the start index or 0 for the first param + * \param num the maximum number of params to retrieve + * \param filter a param filter or NULL + */ + void (*enum_params) (void *object, uint32_t id, uint32_t start, uint32_t num, + const struct spa_pod *filter); +}; + +#define PW_VERSION_PORT_V0 0 + +#define PW_PORT_V0_EVENT_INFO 0 +#define PW_PORT_V0_EVENT_PARAM 1 +#define PW_PORT_V0_EVENT_NUM 2 + +/** Port events */ +struct pw_port_v0_events { +#define PW_VERSION_PORT_V0_EVENTS 0 + uint32_t version; + /** + * Notify port info + * + * \param info info about the port + */ + void (*info) (void *data, struct pw_port_info *info); + /** + * Notify a port param + * + * Event emitted as a result of the enum_params method. + * + * \param id the param id + * \param index the param index + * \param next the param index of the next param + * \param param the parameter + */ + void (*param) (void *data, + uint32_t id, uint32_t index, uint32_t next, + const struct spa_pod *param); +}; + +#define pw_port_resource_v0_info(r,...) pw_resource_notify(r,struct pw_port_v0_events,info,__VA_ARGS__) +#define pw_port_resource_v0_param(r,...) pw_resource_notify(r,struct pw_port_v0_events,param,__VA_ARGS__) + +#define PW_PORT_V0_METHOD_ENUM_PARAMS 0 +#define PW_PORT_V0_METHOD_NUM 1 + +/** Port methods */ +struct pw_port_v0_methods { +#define PW_VERSION_PORT_V0_METHODS 0 + uint32_t version; + /** + * Enumerate port parameters + * + * Start enumeration of port parameters. For each param, a + * param event will be emitted. + * + * \param id the parameter id to enumerate + * \param start the start index or 0 for the first param + * \param num the maximum number of params to retrieve + * \param filter a param filter or NULL + */ + void (*enum_params) (void *object, uint32_t id, uint32_t start, uint32_t num, + const struct spa_pod *filter); +}; + +#define PW_VERSION_FACTORY_V0 0 + +#define PW_FACTORY_V0_EVENT_INFO 0 +#define PW_FACTORY_V0_EVENT_NUM 1 + +/** Factory events */ +struct pw_factory_v0_events { +#define PW_VERSION_FACTORY_V0_EVENTS 0 + uint32_t version; + /** + * Notify factory info + * + * \param info info about the factory + */ + void (*info) (void *data, struct pw_factory_info *info); +}; + +#define pw_factory_resource_v0_info(r,...) pw_resource_notify(r,struct pw_factory_v0_events,info,__VA_ARGS__) + +#define PW_VERSION_CLIENT_V0 0 + +#define PW_CLIENT_V0_EVENT_INFO 0 +#define PW_CLIENT_V0_EVENT_NUM 1 + +/** Client events */ +struct pw_client_v0_events { +#define PW_VERSION_CLIENT_V0_EVENTS 0 + uint32_t version; + /** + * Notify client info + * + * \param info info about the client + */ + void (*info) (void *data, struct pw_client_info *info); +}; + +#define pw_client_resource_v0_info(r,...) pw_resource_notify(r,struct pw_client_v0_events,info,__VA_ARGS__) + + +#define PW_VERSION_LINK_V0 0 + +#define PW_LINK_V0_EVENT_INFO 0 +#define PW_LINK_V0_EVENT_NUM 1 + +/** Link events */ +struct pw_link_v0_events { +#define PW_VERSION_LINK_V0_EVENTS 0 + uint32_t version; + /** + * Notify link info + * + * \param info info about the link + */ + void (*info) (void *data, struct pw_link_info *info); +}; + +#define pw_link_resource_v0_info(r,...) pw_resource_notify(r,struct pw_link_v0_events,info,__VA_ARGS__) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* PIPEWIRE_INTERFACES_V0_H */ diff --git a/src/modules/module-protocol-native/v0/protocol-native.c b/src/modules/module-protocol-native/v0/protocol-native.c new file mode 100644 index 0000000..d6173ac --- /dev/null +++ b/src/modules/module-protocol-native/v0/protocol-native.c @@ -0,0 +1,1371 @@ +/* PipeWire + * + * Copyright © 2017 Wim Taymans <wim.taymans@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <stdio.h> +#include <errno.h> + +#include "spa/pod/parser.h" +#include "spa/pod/builder.h" +#include "spa/debug/types.h" +#include "spa/utils/string.h" + +#include "pipewire/pipewire.h" +#include "pipewire/private.h" +#include "pipewire/protocol.h" +#include "pipewire/resource.h" +#include "pipewire/extensions/protocol-native.h" +#include "pipewire/extensions/metadata.h" +#include "pipewire/extensions/session-manager.h" +#include "pipewire/extensions/client-node.h" + +#include "interfaces.h" +#include "typemap.h" + +#include "../connection.h" + +PW_LOG_TOPIC_EXTERN(mod_topic); +#define PW_LOG_TOPIC_DEFAULT mod_topic + +#define PW_PROTOCOL_NATIVE_FLAG_REMAP (1<<0) + +SPA_EXPORT +uint32_t pw_protocol_native0_find_type(struct pw_impl_client *client, const char *type) +{ + uint32_t i; + for (i = 0; i < SPA_N_ELEMENTS(type_map); i++) { + if (spa_streq(type_map[i].type, type)) + return i; + } + return SPA_ID_INVALID; +} + +static void +update_types_server(struct pw_resource *resource) +{ + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i; + + b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_UPDATE_TYPES, NULL); + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", 0, + "i", SPA_N_ELEMENTS(type_map), NULL); + + for (i = 0; i < SPA_N_ELEMENTS(type_map); i++) { + spa_pod_builder_add(b, "s", type_map[i].type, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + + +static void core_marshal_info(void *data, const struct pw_core_info *info) +{ + struct pw_resource *resource = data; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct protocol_compat_v2 *compat_v2 = client->compat_v2; + struct spa_pod_builder *b; + uint32_t i, n_items; + uint64_t change_mask = 0; + struct spa_pod_frame f; + struct pw_protocol_native_message *msg; + +#define PW_CORE_V0_CHANGE_MASK_USER_NAME (1 << 0) +#define PW_CORE_V0_CHANGE_MASK_HOST_NAME (1 << 1) +#define PW_CORE_V0_CHANGE_MASK_VERSION (1 << 2) +#define PW_CORE_V0_CHANGE_MASK_NAME (1 << 3) +#define PW_CORE_V0_CHANGE_MASK_COOKIE (1 << 4) +#define PW_CORE_V0_CHANGE_MASK_PROPS (1 << 5) + + if (compat_v2->send_types) { + update_types_server(resource); + change_mask |= PW_CORE_V0_CHANGE_MASK_USER_NAME | + PW_CORE_V0_CHANGE_MASK_HOST_NAME | + PW_CORE_V0_CHANGE_MASK_VERSION | + PW_CORE_V0_CHANGE_MASK_NAME | + PW_CORE_V0_CHANGE_MASK_COOKIE; + compat_v2->send_types = false; + } + b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_INFO, &msg); + + n_items = info->props ? info->props->n_items : 0; + + if (info->change_mask & PW_CORE_CHANGE_MASK_PROPS) + change_mask |= PW_CORE_V0_CHANGE_MASK_PROPS; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", change_mask, + "s", info->user_name, + "s", info->host_name, + "s", info->version, + "s", info->name, + "i", info->cookie, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void core_marshal_done(void *data, uint32_t id, int seq) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + + b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_DONE, NULL); + + spa_pod_builder_add_struct(b, "i", seq); + + pw_protocol_native_end_resource(resource, b); +} + +static void core_marshal_error(void *data, uint32_t id, int seq, int res, const char *error) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + + b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_ERROR, NULL); + + spa_pod_builder_add_struct(b, + "i", id, + "i", res, + "s", error); + + pw_protocol_native_end_resource(resource, b); +} + +static void core_marshal_remove_id(void *data, uint32_t id) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + + b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_REMOVE_ID, NULL); + + spa_pod_builder_add_struct(b, "i", id); + + pw_protocol_native_end_resource(resource, b); +} + +static int core_demarshal_client_update(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_dict props; + struct spa_pod_parser prs; + struct spa_pod_frame f; + uint32_t i; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_push_struct(&prs, &f) < 0 || + spa_pod_parser_get(&prs, + "i", &props.n_items, NULL) < 0) + return -EINVAL; + + props.items = alloca(props.n_items * sizeof(struct spa_dict_item)); + for (i = 0; i < props.n_items; i++) { + if (spa_pod_parser_get(&prs, + "s", &props.items[i].key, + "s", &props.items[i].value, + NULL) < 0) + return -EINVAL; + } + pw_impl_client_update_properties(client, &props); + return 0; +} + +static uint32_t parse_perms(const char *str) +{ + uint32_t perms = 0; + + while (*str != '\0') { + switch (*str++) { + case 'r': + perms |= PW_PERM_R; + break; + case 'w': + perms |= PW_PERM_W; + break; + case 'x': + perms |= PW_PERM_X; + break; + } + } + return perms; +} + +static int core_demarshal_permissions(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct spa_dict props; + struct spa_pod_parser prs; + struct spa_pod_frame f; + uint32_t i, n_permissions; + struct pw_permission *permissions, defperm = { 0, }; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_push_struct(&prs, &f) < 0 || + spa_pod_parser_get(&prs, "i", &props.n_items, NULL) < 0) + return -EINVAL; + + props.items = alloca(props.n_items * sizeof(struct spa_dict_item)); + + n_permissions = 0; + permissions = alloca(props.n_items * sizeof(struct pw_permission)); + + for (i = 0; i < props.n_items; i++) { + uint32_t id, perms; + const char *str; + + if (spa_pod_parser_get(&prs, + "s", &props.items[i].key, + "s", &props.items[i].value, + NULL) < 0) + return -EINVAL; + + str = props.items[i].value; + /* first set global permissions */ + if (spa_streq(props.items[i].key, PW_CORE_PERMISSIONS_GLOBAL)) { + size_t len; + + /* <global-id>:[r][w][x] */ + len = strcspn(str, ":"); + if (len == 0) + continue; + id = atoi(str); + perms = parse_perms(str + len); + permissions[n_permissions++] = PW_PERMISSION_INIT(id, perms); + } else if (spa_streq(props.items[i].key, PW_CORE_PERMISSIONS_DEFAULT)) { + perms = parse_perms(str); + defperm = PW_PERMISSION_INIT(PW_ID_ANY, perms); + } + } + /* add default permission if set */ + if (defperm.id == PW_ID_ANY) + permissions[n_permissions++] = defperm; + + for (i = 0; i < n_permissions; i++) { + pw_log_debug("%d: %d: %08x", i, permissions[i].id, permissions[i].permissions); + } + + return pw_impl_client_update_permissions(resource->client, + n_permissions, permissions); +} + +static int core_demarshal_hello(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct spa_pod_parser prs; + void *ptr; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "P", &ptr) < 0) + return -EINVAL; + + return pw_resource_notify(resource, struct pw_core_methods, hello, 0, 2); +} + +static int core_demarshal_sync(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct spa_pod_parser prs; + uint32_t seq; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, "i", &seq) < 0) + return -EINVAL; + + return pw_resource_notify(resource, struct pw_core_methods, sync, 0, 0, seq); +} + +static int core_demarshal_get_registry(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct spa_pod_parser prs; + int32_t version, new_id; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "i", &version, + "i", &new_id) < 0) + return -EINVAL; + + return pw_resource_notify(resource, struct pw_core_methods, get_registry, 0, version, new_id); +} + +SPA_EXPORT +uint32_t pw_protocol_native0_type_from_v2(struct pw_impl_client *client, uint32_t type) +{ + void *t; + uint32_t index; + struct protocol_compat_v2 *compat_v2 = client->compat_v2; + + if ((t = pw_map_lookup(&compat_v2->types, type)) == NULL) + return SPA_ID_INVALID; + + index = PW_MAP_PTR_TO_ID(t); + if (index >= SPA_N_ELEMENTS(type_map)) + return SPA_ID_INVALID; + + return type_map[index].id; +} + +SPA_EXPORT +const char * pw_protocol_native0_name_from_v2(struct pw_impl_client *client, uint32_t type) +{ + void *t; + uint32_t index; + struct protocol_compat_v2 *compat_v2 = client->compat_v2; + + if ((t = pw_map_lookup(&compat_v2->types, type)) == NULL) + return NULL; + + index = PW_MAP_PTR_TO_ID(t); + if (index >= SPA_N_ELEMENTS(type_map)) + return NULL; + + return type_map[index].name; +} + +SPA_EXPORT +uint32_t pw_protocol_native0_name_to_v2(struct pw_impl_client *client, const char *name) +{ + uint32_t i; + /* match name to type table and return index */ + for (i = 0; i < SPA_N_ELEMENTS(type_map); i++) { + if (type_map[i].name != NULL && spa_streq(type_map[i].name, name)) + return i; + } + return SPA_ID_INVALID; +} + +SPA_EXPORT +uint32_t pw_protocol_native0_type_to_v2(struct pw_impl_client *client, + const struct spa_type_info *info, uint32_t type) +{ + const char *name; + + /** find full name of type in type_info */ + if ((name = spa_debug_type_find_name(info, type)) == NULL) + return SPA_ID_INVALID; + + return pw_protocol_native0_name_to_v2(client, name); +} + +struct spa_pod_prop_body0 { + uint32_t key; +#define SPA_POD_PROP0_RANGE_NONE 0 /**< no range */ +#define SPA_POD_PROP0_RANGE_MIN_MAX 1 /**< property has range */ +#define SPA_POD_PROP0_RANGE_STEP 2 /**< property has range with step */ +#define SPA_POD_PROP0_RANGE_ENUM 3 /**< property has enumeration */ +#define SPA_POD_PROP0_RANGE_FLAGS 4 /**< property has flags */ +#define SPA_POD_PROP0_RANGE_MASK 0xf /**< mask to select range type */ +#define SPA_POD_PROP0_FLAG_UNSET (1 << 4) /**< property value is unset */ +#define SPA_POD_PROP0_FLAG_OPTIONAL (1 << 5) /**< property value is optional */ +#define SPA_POD_PROP0_FLAG_READONLY (1 << 6) /**< property is readonly */ +#define SPA_POD_PROP0_FLAG_DEPRECATED (1 << 7) /**< property is deprecated */ +#define SPA_POD_PROP0_FLAG_INFO (1 << 8) /**< property is informational and is not + * used when filtering */ + uint32_t flags; + struct spa_pod value; + /* array with elements of value.size follows, + * first element is value/default, rest are alternatives */ +}; + +/* v2 iterates object as containing spa_pod */ +#define SPA_POD_OBJECT_BODY_FOREACH0(body, size, iter) \ + for ((iter) = SPA_PTROFF((body), sizeof(struct spa_pod_object_body), struct spa_pod); \ + spa_pod_is_inside(body, size, iter); \ + (iter) = spa_pod_next(iter)) + +#define SPA_POD_PROP_ALTERNATIVE_FOREACH0(body, _size, iter) \ + for ((iter) = SPA_PTROFF((body), (body)->value.size + \ + sizeof(struct spa_pod_prop_body0), __typeof__(*iter)); \ + (iter) <= SPA_PTROFF((body), (_size)-(body)->value.size, __typeof__(*iter)); \ + (iter) = SPA_PTROFF((iter), (body)->value.size, __typeof__(*iter))) + +#define SPA0_POD_PROP_N_VALUES(b,size) (((size) - sizeof(struct spa_pod_prop_body0)) / (b)->value.size) + +static int remap_from_v2(uint32_t type, void *body, uint32_t size, struct pw_impl_client *client, + struct spa_pod_builder *builder) +{ + int res; + + switch (type) { + case SPA_TYPE_Id: + spa_pod_builder_id(builder, pw_protocol_native0_type_from_v2(client, *(int32_t*) body)); + break; + + /** choice was props in v2 */ + case SPA_TYPE_Choice: + { + struct spa_pod_prop_body0 *b = body; + struct spa_pod_frame f; + void *alt; + uint32_t key = pw_protocol_native0_type_from_v2(client, b->key); + enum spa_choice_type type; + + spa_pod_builder_prop(builder, key, 0); + + switch (b->flags & SPA_POD_PROP0_RANGE_MASK) { + default: + case SPA_POD_PROP0_RANGE_NONE: + type = SPA_CHOICE_None; + break; + case SPA_POD_PROP0_RANGE_MIN_MAX: + type = SPA_CHOICE_Range; + break; + case SPA_POD_PROP0_RANGE_STEP: + type = SPA_CHOICE_Step; + break; + case SPA_POD_PROP0_RANGE_ENUM: + type = SPA_CHOICE_Enum; + break; + case SPA_POD_PROP0_RANGE_FLAGS: + type = SPA_CHOICE_Flags; + break; + } + if (!SPA_FLAG_IS_SET(b->flags, SPA_POD_PROP0_FLAG_UNSET) && + SPA0_POD_PROP_N_VALUES(b, size) == 1) + type = SPA_CHOICE_None; + + spa_pod_builder_push_choice(builder, &f, type, 0); + + if (b->value.type == SPA_TYPE_Id) { + uint32_t id; + if ((res = spa_pod_get_id(&b->value, &id)) < 0) + return res; + spa_pod_builder_id(builder, pw_protocol_native0_type_from_v2(client, id)); + SPA_POD_PROP_ALTERNATIVE_FOREACH0(b, size, alt) + if ((res = remap_from_v2(b->value.type, alt, b->value.size, client, builder)) < 0) + return res; + } else { + spa_pod_builder_raw(builder, &b->value, size - sizeof(struct spa_pod)); + } + + spa_pod_builder_pop(builder, &f); + + break; + } + case SPA_TYPE_Object: + { + struct spa_pod_object_body *b = body; + struct spa_pod *p; + struct spa_pod_frame f; + uint32_t type, count = 0; + + /* type and id are switched */ + type = pw_protocol_native0_type_from_v2(client, b->id), + spa_pod_builder_push_object(builder, &f, type, + pw_protocol_native0_type_from_v2(client, b->type)); + + /* object contained pods in v2 */ + SPA_POD_OBJECT_BODY_FOREACH0(b, size, p) { + if (type == SPA_TYPE_OBJECT_Format && count < 2) { + uint32_t id; + if (spa_pod_get_id(p, &id) < 0) + continue; + id = pw_protocol_native0_type_from_v2(client, id); + + if (count == 0) { + spa_pod_builder_prop(builder, SPA_FORMAT_mediaType, 0); + spa_pod_builder_id(builder, id); + } + if (count == 1) { + spa_pod_builder_prop(builder, SPA_FORMAT_mediaSubtype, 0); + spa_pod_builder_id(builder, id); + } + count++; + continue; + } + if ((res = remap_from_v2(p->type, + SPA_POD_BODY(p), + p->size, + client, builder)) < 0) + return res; + } + spa_pod_builder_pop(builder, &f); + break; + } + case SPA_TYPE_Struct: + { + struct spa_pod *b = body, *p; + struct spa_pod_frame f; + + spa_pod_builder_push_struct(builder, &f); + SPA_POD_FOREACH(b, size, p) + if ((res = remap_from_v2(p->type, SPA_POD_BODY(p), p->size, client, builder)) < 0) + return res; + spa_pod_builder_pop(builder, &f); + break; + } + default: + break; + } + return 0; +} + +static int remap_to_v2(struct pw_impl_client *client, const struct spa_type_info *info, + uint32_t type, void *body, uint32_t size, + struct spa_pod_builder *builder) +{ + int res; + + switch (type) { + case SPA_TYPE_Id: + spa_pod_builder_id(builder, pw_protocol_native0_type_to_v2(client, info, *(int32_t*) body)); + break; + + case SPA_TYPE_Object: + { + struct spa_pod_object_body *b = body; + struct spa_pod_prop *p; + struct spa_pod_frame f[2]; + uint32_t type; + const struct spa_type_info *ti, *ii; + + ti = spa_debug_type_find(info, b->type); + ii = ti ? spa_debug_type_find(ti->values, 0) : NULL; + + if (b->type == SPA_TYPE_COMMAND_Node || + b->type == SPA_TYPE_EVENT_Node) { + spa_pod_builder_push_object(builder, &f[0], 0, + pw_protocol_native0_type_to_v2(client, ii ? ii->values : NULL, b->id)); + } else { + ii = ii ? spa_debug_type_find(ii->values, b->id) : NULL; + /* type and id are switched */ + type = pw_protocol_native0_type_to_v2(client, info, b->type), + spa_pod_builder_push_object(builder, &f[0], + pw_protocol_native0_type_to_v2(client, ii ? ii->values : NULL, b->id), type); + } + + + info = ti ? ti->values : info; + + SPA_POD_OBJECT_BODY_FOREACH(b, size, p) { + uint32_t key, flags; + uint32_t n_vals, choice; + struct spa_pod *values; + + ii = spa_debug_type_find(info, p->key); + + values = spa_pod_get_values(&p->value, &n_vals, &choice); + + if (b->type == SPA_TYPE_OBJECT_Format && + (p->key == SPA_FORMAT_mediaType || + p->key == SPA_FORMAT_mediaSubtype)) { + uint32_t val; + + if (spa_pod_get_id(values, &val) < 0) + continue; + spa_pod_builder_id(builder, + pw_protocol_native0_type_to_v2(client, ii ? ii->values : NULL, val)); + continue; + } + + flags = 0; + switch(choice) { + case SPA_CHOICE_None: + flags |= SPA_POD_PROP0_RANGE_NONE; + break; + case SPA_CHOICE_Range: + flags |= SPA_POD_PROP0_RANGE_MIN_MAX | SPA_POD_PROP0_FLAG_UNSET; + break; + case SPA_CHOICE_Step: + flags |= SPA_POD_PROP0_RANGE_STEP | SPA_POD_PROP0_FLAG_UNSET; + break; + case SPA_CHOICE_Enum: + flags |= SPA_POD_PROP0_RANGE_ENUM | SPA_POD_PROP0_FLAG_UNSET; + break; + case SPA_CHOICE_Flags: + flags |= SPA_POD_PROP0_RANGE_FLAGS | SPA_POD_PROP0_FLAG_UNSET; + break; + } + + key = pw_protocol_native0_type_to_v2(client, info, p->key); + + spa_pod_builder_push_choice(builder, &f[1], key, flags); + + if (values->type == SPA_TYPE_Id) { + uint32_t i, *id = SPA_POD_BODY(values); + + for (i = 0; i < n_vals; i++) { + spa_pod_builder_id(builder, + pw_protocol_native0_type_to_v2(client, ii ? ii->values : NULL, id[i])); + } + + } else { + spa_pod_builder_raw(builder, values, sizeof(struct spa_pod) + n_vals * values->size); + } + spa_pod_builder_pop(builder, &f[1]); + } + spa_pod_builder_pop(builder, &f[0]); + break; + } + case SPA_TYPE_Struct: + { + struct spa_pod *b = body, *p; + struct spa_pod_frame f; + + spa_pod_builder_push_struct(builder, &f); + SPA_POD_FOREACH(b, size, p) + if ((res = remap_to_v2(client, info, p->type, SPA_POD_BODY(p), p->size, builder)) < 0) + return res; + spa_pod_builder_pop(builder, &f); + break; + } + default: + break; + } + return 0; +} + + + + +SPA_EXPORT +struct spa_pod * pw_protocol_native0_pod_from_v2(struct pw_impl_client *client, const struct spa_pod *pod) +{ + uint8_t buffer[4096]; + struct spa_pod *copy; + struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, 4096); + int res; + + if (pod == NULL) + return NULL; + + if ((res = remap_from_v2(SPA_POD_TYPE(pod), + SPA_POD_BODY(pod), + SPA_POD_BODY_SIZE(pod), + client, &b)) < 0) { + errno = -res; + return NULL; + } + copy = spa_pod_copy(b.data); + return copy; +} + +SPA_EXPORT +int pw_protocol_native0_pod_to_v2(struct pw_impl_client *client, const struct spa_pod *pod, + struct spa_pod_builder *b) +{ + int res; + + if (pod == NULL) { + spa_pod_builder_none(b); + return 0; + } + + if ((res = remap_to_v2(client, pw_type_info(), + SPA_POD_TYPE(pod), + SPA_POD_BODY(pod), + SPA_POD_BODY_SIZE(pod), + b)) < 0) { + return -res; + } + return 0; +} + +static int core_demarshal_create_object(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_parser prs; + struct spa_pod_frame f; + uint32_t version, type, new_id, i; + const char *factory_name, *type_name; + struct spa_dict props; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_push_struct(&prs, &f) < 0 || + spa_pod_parser_get(&prs, + "s", &factory_name, + "I", &type, + "i", &version, + "i", &props.n_items, NULL) < 0) + return -EINVAL; + + props.items = alloca(props.n_items * sizeof(struct spa_dict_item)); + for (i = 0; i < props.n_items; i++) { + if (spa_pod_parser_get(&prs, + "s", &props.items[i].key, + "s", &props.items[i].value, NULL) < 0) + return -EINVAL; + } + if (spa_pod_parser_get(&prs, "i", &new_id, NULL) < 0) + return -EINVAL; + + type_name = pw_protocol_native0_name_from_v2(client, type); + if (type_name == NULL) + return -EINVAL; + + return pw_resource_notify(resource, struct pw_core_methods, create_object, 0, factory_name, + type_name, version, + &props, new_id); +} + +static int core_demarshal_destroy(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object, *r; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_parser prs; + uint32_t id; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "i", &id, NULL) < 0) + return -EINVAL; + + pw_log_debug("client %p: destroy resource %u", client, id); + + if ((r = pw_impl_client_find_resource(client, id)) == NULL) + goto no_resource; + + return pw_resource_notify(resource, struct pw_core_methods, destroy, 0, r); + +no_resource: + pw_log_error("client %p: unknown resource %u op:%u", client, id, msg->opcode); + pw_resource_errorf(resource, -ENOENT, "unknown resource %d op:%u", id, msg->opcode); + return 0; +} + +static int core_demarshal_update_types_server(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct protocol_compat_v2 *compat_v2 = client->compat_v2; + struct spa_pod_parser prs; + uint32_t first_id, n_types; + struct spa_pod_frame f; + const char **types; + uint32_t i; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_push_struct(&prs, &f) < 0 || + spa_pod_parser_get(&prs, + "i", &first_id, + "i", &n_types, + NULL) < 0) + return -EINVAL; + + if (first_id == 0) + compat_v2->send_types = true; + + types = alloca(n_types * sizeof(char *)); + for (i = 0; i < n_types; i++) { + if (spa_pod_parser_get(&prs, "s", &types[i], NULL) < 0) + return -EINVAL; + } + + for (i = 0; i < n_types; i++, first_id++) { + uint32_t type_id = pw_protocol_native0_find_type(client, types[i]); + if (type_id == SPA_ID_INVALID) + continue; + if (pw_map_insert_at(&compat_v2->types, first_id, PW_MAP_ID_TO_PTR(type_id)) < 0) + pw_log_error("can't add type %d->%d for client", first_id, type_id); + } + return 0; +} + +static void registry_marshal_global(void *data, uint32_t id, uint32_t permissions, + const char *type, uint32_t version, const struct spa_dict *props) +{ + struct pw_resource *resource = data; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items, parent_id; + uint32_t type_id; + const char *str; + + type_id = pw_protocol_native0_find_type(client, type); + if (type_id == SPA_ID_INVALID) + return; + + b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_V0_EVENT_GLOBAL, NULL); + + n_items = props ? props->n_items : 0; + + parent_id = 0; + if (props) { + if (spa_streq(type, PW_TYPE_INTERFACE_Port)) { + if ((str = spa_dict_lookup(props, "node.id")) != NULL) + parent_id = atoi(str); + } else if (spa_streq(type, PW_TYPE_INTERFACE_Node)) { + if ((str = spa_dict_lookup(props, "device.id")) != NULL) + parent_id = atoi(str); + } else if (spa_streq(type, PW_TYPE_INTERFACE_Client) || + spa_streq(type, PW_TYPE_INTERFACE_Device) || + spa_streq(type, PW_TYPE_INTERFACE_Factory)) { + if ((str = spa_dict_lookup(props, "module.id")) != NULL) + parent_id = atoi(str); + } + } + + version = 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", id, + "i", parent_id, + "i", permissions, + "I", type_id, + "i", version, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", props->items[i].key, + "s", props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void registry_marshal_global_remove(void *data, uint32_t id) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + + b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_V0_EVENT_GLOBAL_REMOVE, NULL); + + spa_pod_builder_add_struct(b, "i", id); + + pw_protocol_native_end_resource(resource, b); +} + +static int registry_demarshal_bind(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_parser prs; + uint32_t id, version, type, new_id; + const char *type_name; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "i", &id, + "I", &type, + "i", &version, + "i", &new_id) < 0) + return -EINVAL; + + type_name = pw_protocol_native0_name_from_v2(client, type); + if (type_name == NULL) + return -EINVAL; + + return pw_resource_notify(resource, struct pw_registry_methods, bind, 0, id, type_name, version, new_id); +} + +static void module_marshal_info(void *data, const struct pw_module_info *info) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items; + + b = pw_protocol_native_begin_resource(resource, PW_MODULE_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", info->change_mask, + "s", info->name, + "s", info->filename, + "s", info->args, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void factory_marshal_info(void *data, const struct pw_factory_info *info) +{ + struct pw_resource *resource = data; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items, type, version; + + type = pw_protocol_native0_find_type(client, info->type); + if (type == SPA_ID_INVALID) + return; + + b = pw_protocol_native_begin_resource(resource, PW_FACTORY_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + + version = 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", info->change_mask, + "s", info->name, + "I", type, + "i", version, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void node_marshal_info(void *data, const struct pw_node_info *info) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items; + + b = pw_protocol_native_begin_resource(resource, PW_NODE_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", info->change_mask, + "s", "node.name", + "i", info->max_input_ports, + "i", info->n_input_ports, + "i", info->max_output_ports, + "i", info->n_output_ports, + "i", info->state, + "s", info->error, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void node_marshal_param(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, + const struct spa_pod *param) +{ + struct pw_resource *resource = data; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_builder *b; + struct spa_pod_frame f; + + b = pw_protocol_native_begin_resource(resource, PW_NODE_V0_EVENT_PARAM, NULL); + + id = pw_protocol_native0_type_to_v2(client, spa_type_param, id), + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "I", id, + "i", index, + "i", next, + NULL); + pw_protocol_native0_pod_to_v2(client, (struct spa_pod *)param, b); + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static int node_demarshal_enum_params(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_parser prs; + uint32_t id, index, num; + struct spa_pod *filter; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "I", &id, + "i", &index, + "i", &num, + "P", &filter) < 0) + return -EINVAL; + + id = pw_protocol_native0_type_from_v2(client, id); + filter = NULL; + + return pw_resource_notify(resource, struct pw_node_methods, enum_params, 0, + 0, id, index, num, filter); +} + +static void port_marshal_info(void *data, const struct pw_port_info *info) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items; + uint64_t change_mask = 0; + const char *port_name; + + b = pw_protocol_native_begin_resource(resource, PW_PORT_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + +#define PW_PORT_V0_CHANGE_MASK_NAME (1 << 0) +#define PW_PORT_V0_CHANGE_MASK_PROPS (1 << 1) +#define PW_PORT_V0_CHANGE_MASK_ENUM_PARAMS (1 << 2) + + change_mask |= PW_PORT_V0_CHANGE_MASK_NAME; + if (info->change_mask & PW_PORT_CHANGE_MASK_PROPS) + change_mask |= PW_PORT_V0_CHANGE_MASK_PROPS; + if (info->change_mask & PW_PORT_CHANGE_MASK_PARAMS) + change_mask |= PW_PORT_V0_CHANGE_MASK_ENUM_PARAMS; + + port_name = NULL; + if (info->props != NULL) + port_name = spa_dict_lookup(info->props, "port.name"); + if (port_name == NULL) + port_name = "port.name"; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", change_mask, + "s", port_name, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void port_marshal_param(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, + const struct spa_pod *param) +{ + struct pw_resource *resource = data; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_builder *b; + struct spa_pod_frame f; + + b = pw_protocol_native_begin_resource(resource, PW_PORT_V0_EVENT_PARAM, NULL); + + id = pw_protocol_native0_type_to_v2(client, spa_type_param, id), + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "I", id, + "i", index, + "i", next, + NULL); + pw_protocol_native0_pod_to_v2(client, (struct spa_pod *)param, b); + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static int port_demarshal_enum_params(void *object, const struct pw_protocol_native_message *msg) +{ + struct pw_resource *resource = object; + struct pw_impl_client *client = pw_resource_get_client(resource); + struct spa_pod_parser prs; + uint32_t id, index, num; + struct spa_pod *filter; + + spa_pod_parser_init(&prs, msg->data, msg->size); + if (spa_pod_parser_get_struct(&prs, + "I", &id, + "i", &index, + "i", &num, + "P", &filter) < 0) + return -EINVAL; + + id = pw_protocol_native0_type_from_v2(client, id); + filter = NULL; + + return pw_resource_notify(resource, struct pw_port_methods, enum_params, 0, + 0, id, index, num, filter); +} + +static void client_marshal_info(void *data, const struct pw_client_info *info) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items; + + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", info->change_mask, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static void client_marshal_permissions(void *data, uint32_t index, uint32_t n_permissions, + const struct pw_permission *permissions) +{ +} + + +static void link_marshal_info(void *data, const struct pw_link_info *info) +{ + struct pw_resource *resource = data; + struct spa_pod_builder *b; + struct spa_pod_frame f; + uint32_t i, n_items; + + b = pw_protocol_native_begin_resource(resource, PW_LINK_V0_EVENT_INFO, NULL); + + n_items = info->props ? info->props->n_items : 0; + + spa_pod_builder_push_struct(b, &f); + spa_pod_builder_add(b, + "i", info->id, + "l", info->change_mask, + "i", info->output_node_id, + "i", info->output_port_id, + "i", info->input_node_id, + "i", info->input_port_id, + "P", info->format, + "i", n_items, NULL); + + for (i = 0; i < n_items; i++) { + spa_pod_builder_add(b, + "s", info->props->items[i].key, + "s", info->props->items[i].value, NULL); + } + spa_pod_builder_pop(b, &f); + + pw_protocol_native_end_resource(resource, b); +} + +static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_V0_METHOD_NUM] = { + [PW_CORE_V0_METHOD_HELLO] = { &core_demarshal_hello, 0, }, + [PW_CORE_V0_METHOD_UPDATE_TYPES] = { &core_demarshal_update_types_server, 0, }, + [PW_CORE_V0_METHOD_SYNC] = { &core_demarshal_sync, 0, }, + [PW_CORE_V0_METHOD_GET_REGISTRY] = { &core_demarshal_get_registry, 0, }, + [PW_CORE_V0_METHOD_CLIENT_UPDATE] = { &core_demarshal_client_update, 0, }, + [PW_CORE_V0_METHOD_PERMISSIONS] = { &core_demarshal_permissions, 0, }, + [PW_CORE_V0_METHOD_CREATE_OBJECT] = { &core_demarshal_create_object, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, }, + [PW_CORE_V0_METHOD_DESTROY] = { &core_demarshal_destroy, 0, } +}; + +static const struct pw_core_events pw_protocol_native_core_event_marshal = { + PW_VERSION_CORE_EVENTS, + .info = &core_marshal_info, + .done = &core_marshal_done, + .error = &core_marshal_error, + .remove_id = &core_marshal_remove_id, +}; + +static const struct pw_protocol_marshal pw_protocol_native_core_marshal = { + PW_TYPE_INTERFACE_Core, + PW_VERSION_CORE_V0, + PW_CORE_V0_METHOD_NUM, + PW_CORE_EVENT_NUM, + 0, + NULL, + pw_protocol_native_core_method_demarshal, + &pw_protocol_native_core_event_marshal, + NULL +}; + +static const struct pw_protocol_native_demarshal pw_protocol_native_registry_method_demarshal[] = { + [PW_REGISTRY_V0_METHOD_BIND] = { ®istry_demarshal_bind, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, }, +}; + +static const struct pw_registry_events pw_protocol_native_registry_event_marshal = { + PW_VERSION_REGISTRY_EVENTS, + .global = ®istry_marshal_global, + .global_remove = ®istry_marshal_global_remove, +}; + +static const struct pw_protocol_marshal pw_protocol_native_registry_marshal = { + PW_TYPE_INTERFACE_Registry, + PW_VERSION_REGISTRY_V0, + PW_REGISTRY_V0_METHOD_NUM, + PW_REGISTRY_EVENT_NUM, + 0, + NULL, + pw_protocol_native_registry_method_demarshal, + &pw_protocol_native_registry_event_marshal, + NULL +}; + +static const struct pw_module_events pw_protocol_native_module_event_marshal = { + PW_VERSION_MODULE_EVENTS, + .info = &module_marshal_info, +}; + +static const struct pw_protocol_marshal pw_protocol_native_module_marshal = { + PW_TYPE_INTERFACE_Module, + PW_VERSION_MODULE_V0, + 0, + PW_MODULE_EVENT_NUM, + 0, + NULL, NULL, + &pw_protocol_native_module_event_marshal, + NULL +}; + +static const struct pw_factory_events pw_protocol_native_factory_event_marshal = { + PW_VERSION_FACTORY_EVENTS, + .info = &factory_marshal_info, +}; + +static const struct pw_protocol_marshal pw_protocol_native_factory_marshal = { + PW_TYPE_INTERFACE_Factory, + PW_VERSION_FACTORY_V0, + 0, + PW_FACTORY_EVENT_NUM, + 0, + NULL, NULL, + &pw_protocol_native_factory_event_marshal, + NULL, +}; + +static const struct pw_protocol_native_demarshal pw_protocol_native_node_method_demarshal[] = { + [PW_NODE_V0_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, }, +}; + +static const struct pw_node_events pw_protocol_native_node_event_marshal = { + PW_VERSION_NODE_EVENTS, + .info = &node_marshal_info, + .param = &node_marshal_param, +}; + +static const struct pw_protocol_marshal pw_protocol_native_node_marshal = { + PW_TYPE_INTERFACE_Node, + PW_VERSION_NODE_V0, + PW_NODE_V0_METHOD_NUM, + PW_NODE_EVENT_NUM, + 0, + NULL, + pw_protocol_native_node_method_demarshal, + &pw_protocol_native_node_event_marshal, + NULL +}; + + +static const struct pw_protocol_native_demarshal pw_protocol_native_port_method_demarshal[] = { + [PW_PORT_V0_METHOD_ENUM_PARAMS] = { &port_demarshal_enum_params, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, }, +}; + +static const struct pw_port_events pw_protocol_native_port_event_marshal = { + PW_VERSION_PORT_EVENTS, + .info = &port_marshal_info, + .param = &port_marshal_param, +}; + +static const struct pw_protocol_marshal pw_protocol_native_port_marshal = { + PW_TYPE_INTERFACE_Port, + PW_VERSION_PORT_V0, + PW_PORT_V0_METHOD_NUM, + PW_PORT_EVENT_NUM, + 0, + NULL, + pw_protocol_native_port_method_demarshal, + &pw_protocol_native_port_event_marshal, + NULL +}; + +static const struct pw_client_events pw_protocol_native_client_event_marshal = { + PW_VERSION_CLIENT_EVENTS, + .info = &client_marshal_info, + .permissions = &client_marshal_permissions, +}; + +static const struct pw_protocol_marshal pw_protocol_native_client_marshal = { + PW_TYPE_INTERFACE_Client, + PW_VERSION_CLIENT_V0, + 0, + PW_CLIENT_EVENT_NUM, + 0, + NULL, NULL, + &pw_protocol_native_client_event_marshal, + NULL, +}; + +static const struct pw_link_events pw_protocol_native_link_event_marshal = { + PW_VERSION_LINK_EVENTS, + .info = &link_marshal_info, +}; + +static const struct pw_protocol_marshal pw_protocol_native_link_marshal = { + PW_TYPE_INTERFACE_Link, + PW_VERSION_LINK_V0, + 0, + PW_LINK_EVENT_NUM, + 0, + NULL, NULL, + &pw_protocol_native_link_event_marshal, + NULL +}; + +void pw_protocol_native0_init(struct pw_protocol *protocol) +{ + pw_protocol_add_marshal(protocol, &pw_protocol_native_core_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_registry_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_module_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_node_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_port_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_factory_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_client_marshal); + pw_protocol_add_marshal(protocol, &pw_protocol_native_link_marshal); +} diff --git a/src/modules/module-protocol-native/v0/typemap.h b/src/modules/module-protocol-native/v0/typemap.h new file mode 100644 index 0000000..1d80ea2 --- /dev/null +++ b/src/modules/module-protocol-native/v0/typemap.h @@ -0,0 +1,282 @@ +static const struct type_info { + const char *type; + const char *name; + uint32_t id; +} type_map[] = { + { "Spa:Interface:TypeMap", SPA_TYPE_INFO_INTERFACE_BASE, 0, }, + { "Spa:Interface:Log", SPA_TYPE_INTERFACE_Log, 0, }, + { "Spa:Interface:Loop", SPA_TYPE_INTERFACE_Loop, 0, }, + { "Spa:Interface:LoopControl", SPA_TYPE_INTERFACE_LoopControl, 0, }, + { "Spa:Interface:LoopUtils", SPA_TYPE_INTERFACE_LoopUtils, 0, }, + { "PipeWire:Interface:Core", PW_TYPE_INTERFACE_Core, 0, }, + { "PipeWire:Interface:Registry", PW_TYPE_INTERFACE_Registry, 0, }, + { "PipeWire:Interface:Node", PW_TYPE_INTERFACE_Node, 0, }, + { "PipeWire:Interface:Port", PW_TYPE_INTERFACE_Port,0, }, + { "PipeWire:Interface:Factory", PW_TYPE_INTERFACE_Factory, 0, }, + { "PipeWire:Interface:Link", PW_TYPE_INTERFACE_Link, 0, }, + { "PipeWire:Interface:Client", PW_TYPE_INTERFACE_Client, 0, }, + { "PipeWire:Interface:Module", PW_TYPE_INTERFACE_Module, 0, }, + { "PipeWire:Interface:Device", PW_TYPE_INTERFACE_Device, 0, }, + + { "PipeWire:Interface:Metadata", PW_TYPE_INTERFACE_Metadata, 0, }, + { "PipeWire:Interface:Session", PW_TYPE_INTERFACE_Session, 0, }, + { "PipeWire:Interface:Endpoint", PW_TYPE_INTERFACE_Endpoint, 0, }, + { "PipeWire:Interface:EndpointStream", PW_TYPE_INTERFACE_EndpointStream, 0, }, + { "PipeWire:Interface:EndpointLink", PW_TYPE_INTERFACE_EndpointLink, 0, }, + + { "PipeWire:Interface:ClientNode", PW_TYPE_INTERFACE_ClientNode, 0, }, + { "PipeWire:Interface:ClientSession", PW_TYPE_INTERFACE_ClientSession, 0, }, + { "PipeWire:Interface:ClientEndpoint", PW_TYPE_INTERFACE_ClientEndpoint, 0, }, + + { "Spa:Interface:Node", SPA_TYPE_INTERFACE_Node, 0, }, + { "Spa:Interface:Clock", }, + { "Spa:Interface:Monitor", }, + { "Spa:Interface:Device", SPA_TYPE_INTERFACE_Device, 0, }, + { "Spa:POD:Object:Param:Format", SPA_TYPE_INFO_Format, SPA_TYPE_OBJECT_Format, }, + { "Spa:POD:Object:Param:Props", SPA_TYPE_INFO_Props, SPA_TYPE_OBJECT_Props, }, + { "Spa:Pointer:IO:Buffers", }, + { "Spa:Pointer:IO:Control:Range", }, + { "Spa:Pointer:IO:Prop", }, + { "Spa:Enum:ParamId:List", }, + { "Spa:POD:Object:Param:List", }, + { "Spa:POD:Object:Param:List:id", }, + { "Spa:Enum:ParamId:PropInfo", SPA_TYPE_INFO_PARAM_ID_BASE "PropInfo", SPA_PARAM_PropInfo, }, + { "Spa:POD:Object:Param:PropInfo", SPA_TYPE_INFO_PROP_INFO_BASE, SPA_PROP_INFO_START, }, + { "Spa:POD:Object:Param:PropInfo:id", SPA_TYPE_INFO_PROP_INFO_BASE "id", SPA_PROP_INFO_id, }, + { "Spa:POD:Object:Param:PropInfo:name", SPA_TYPE_INFO_PROP_INFO_BASE "name", SPA_PROP_INFO_name, }, + { "Spa:POD:Object:Param:PropInfo:type", SPA_TYPE_INFO_PROP_INFO_BASE "typ", SPA_PROP_INFO_type, }, + { "Spa:POD:Object:Param:PropInfo:labels", SPA_TYPE_INFO_PROP_INFO_BASE "labels", SPA_PROP_INFO_labels, }, + { "Spa:Enum:ParamId:Props", SPA_TYPE_INFO_PARAM_ID_BASE "Props", SPA_PARAM_Props, }, + { "Spa:Enum:ParamId:EnumFormat", SPA_TYPE_INFO_PARAM_ID_BASE "EnumFormat", SPA_PARAM_EnumFormat,}, + { "Spa:Enum:ParamId:Format", SPA_TYPE_INFO_PARAM_ID_BASE "Format", SPA_PARAM_Format, }, + { "Spa:Enum:ParamId:Buffers", SPA_TYPE_INFO_PARAM_ID_BASE "Buffers", SPA_PARAM_Buffers }, + { "Spa:Enum:ParamId:Meta", SPA_TYPE_INFO_PARAM_ID_BASE "Meta", SPA_PARAM_Meta, }, + { "Spa:Pointer:Meta:Header", SPA_TYPE_INFO_META_BASE "Header", SPA_META_Header, }, + { "Spa:Pointer:Meta:VideoCrop", SPA_TYPE_INFO_META_REGION_BASE "VideoCrop", SPA_META_VideoCrop, }, + { "Spa:Pointer:Meta:VideoDamage", SPA_TYPE_INFO_META_ARRAY_REGION_BASE "VideoDamage", SPA_META_VideoDamage, }, + { "Spa:Pointer:Meta:Bitmap", SPA_TYPE_INFO_META_BASE "Bitmap", SPA_META_Bitmap, }, + { "Spa:Pointer:Meta:Cursor", SPA_TYPE_INFO_META_BASE "Cursor", SPA_META_Cursor, }, + { "Spa:Enum:DataType:MemPtr", SPA_TYPE_INFO_DATA_BASE "MemPtr", SPA_DATA_MemPtr, }, + { "Spa:Enum:DataType:Fd:MemFd", SPA_TYPE_INFO_DATA_FD_BASE "MemFd", SPA_DATA_MemFd, }, + { "Spa:Enum:DataType:Fd:DmaBuf", SPA_TYPE_INFO_DATA_FD_BASE "DmaBuf", SPA_DATA_DmaBuf, }, + { "Spa:POD:Object:Event:Node:Error", SPA_TYPE_INFO_NODE_EVENT_BASE "Error", SPA_NODE_EVENT_Error, }, + { "Spa:POD:Object:Event:Node:Buffering", SPA_TYPE_INFO_NODE_EVENT_BASE "Buffering", SPA_NODE_EVENT_Buffering, }, + { "Spa:POD:Object:Event:Node:RequestRefresh", SPA_TYPE_INFO_NODE_EVENT_BASE "RequestRefresh", SPA_NODE_EVENT_RequestRefresh, }, + { "Spa:POD:Object:Event:Node:RequestClockUpdate", SPA_TYPE_INFO_NODE_EVENT_BASE "RequestClockUpdate", SPA_NODE0_EVENT_RequestClockUpdate, }, + { "Spa:POD:Object:Command:Node", SPA_TYPE_INFO_COMMAND_BASE "Node", SPA_TYPE_COMMAND_Node,}, + { "Spa:POD:Object:Command:Node:Suspend", SPA_TYPE_INFO_NODE_COMMAND_BASE "Suspend", SPA_NODE_COMMAND_Suspend,}, + { "Spa:POD:Object:Command:Node:Pause", SPA_TYPE_INFO_NODE_COMMAND_BASE "Pause", SPA_NODE_COMMAND_Pause, }, + { "Spa:POD:Object:Command:Node:Start", SPA_TYPE_INFO_NODE_COMMAND_BASE "Start", SPA_NODE_COMMAND_Start, }, + { "Spa:POD:Object:Command:Node:Enable", SPA_TYPE_INFO_NODE_COMMAND_BASE "Enable", SPA_NODE_COMMAND_Enable, }, + { "Spa:POD:Object:Command:Node:Disable", SPA_TYPE_INFO_NODE_COMMAND_BASE "Disable", SPA_NODE_COMMAND_Disable, }, + { "Spa:POD:Object:Command:Node:Flush", SPA_TYPE_INFO_NODE_COMMAND_BASE "Flush", SPA_NODE_COMMAND_Flush, }, + { "Spa:POD:Object:Command:Node:Drain", SPA_TYPE_INFO_NODE_COMMAND_BASE "Drain", SPA_NODE_COMMAND_Drain, }, + { "Spa:POD:Object:Command:Node:Marker", SPA_TYPE_INFO_NODE_COMMAND_BASE "Marker", SPA_NODE_COMMAND_Marker, }, + { "Spa:POD:Object:Command:Node:ClockUpdate", SPA_TYPE_INFO_NODE_COMMAND_BASE "ClockUpdate", SPA_NODE0_COMMAND_ClockUpdate, }, + { "Spa:POD:Object:Event:Monitor:Added", }, + { "Spa:POD:Object:Event:Monitor:Removed", }, + { "Spa:POD:Object:Event:Monitor:Changed", }, + { "Spa:POD:Object:MonitorItem", }, + { "Spa:POD:Object:MonitorItem:id", }, + { "Spa:POD:Object:MonitorItem:flags", }, + { "Spa:POD:Object:MonitorItem:state", }, + { "Spa:POD:Object:MonitorItem:name", }, + { "Spa:POD:Object:MonitorItem:class", }, + { "Spa:POD:Object:MonitorItem:info", }, + { "Spa:POD:Object:MonitorItem:factory", }, + { "Spa:POD:Object:Param:Buffers", SPA_TYPE_INFO_PARAM_Buffers, SPA_TYPE_OBJECT_ParamBuffers, }, + { "Spa:POD:Object:Param:Buffers:size", SPA_TYPE_INFO_PARAM_BLOCK_INFO_BASE "size", SPA_PARAM_BUFFERS_size, }, + { "Spa:POD:Object:Param:Buffers:stride", SPA_TYPE_INFO_PARAM_BLOCK_INFO_BASE "stride", SPA_PARAM_BUFFERS_stride, }, + { "Spa:POD:Object:Param:Buffers:buffers", SPA_TYPE_INFO_PARAM_BUFFERS_BASE "buffers", SPA_PARAM_BUFFERS_buffers, }, + { "Spa:POD:Object:Param:Buffers:align",SPA_TYPE_INFO_PARAM_BLOCK_INFO_BASE "align", SPA_PARAM_BUFFERS_align, }, + { "Spa:POD:Object:Param:Meta", SPA_TYPE_INFO_PARAM_Meta, SPA_TYPE_OBJECT_ParamMeta, }, + { "Spa:POD:Object:Param:Meta:type", SPA_TYPE_INFO_PARAM_META_BASE "type", SPA_PARAM_META_type, }, + { "Spa:POD:Object:Param:Meta:size", SPA_TYPE_INFO_PARAM_META_BASE "size", SPA_PARAM_META_size, }, + { "Spa:POD:Object:Param:IO:id", }, + { "Spa:POD:Object:Param:IO:size", }, + { "Spa:Enum:ParamId:IO:Buffers", }, + { "Spa:POD:Object:Param:IO:Buffers", }, + { "Spa:Enum:ParamId:IO:Control", }, + { "Spa:POD:Object:Param:IO:Control", }, + { "Spa:Enum:ParamId:IO:Props:In", }, + { "Spa:Enum:ParamId:IO:Props:Out", }, + { "Spa:POD:Object:Param:IO:Prop", }, + { "Spa:Interface:DBus", SPA_TYPE_INFO_INTERFACE_BASE "DBus", 0, }, + { "Spa:Enum:MediaType:audio", SPA_TYPE_INFO_MEDIA_TYPE_BASE "audio", SPA_MEDIA_TYPE_audio, }, + { "Spa:Enum:MediaType:video", SPA_TYPE_INFO_MEDIA_TYPE_BASE "video", SPA_MEDIA_TYPE_video, }, + { "Spa:Enum:MediaType:image", SPA_TYPE_INFO_MEDIA_TYPE_BASE "image", SPA_MEDIA_TYPE_image, }, + { "Spa:Enum:MediaType:binary", SPA_TYPE_INFO_MEDIA_TYPE_BASE "binary", SPA_MEDIA_TYPE_binary, }, + { "Spa:Enum:MediaType:stream", SPA_TYPE_INFO_MEDIA_TYPE_BASE "stream", SPA_MEDIA_TYPE_stream, }, + { "Spa:Enum:MediaType:application", SPA_TYPE_INFO_MEDIA_TYPE_BASE "application", SPA_MEDIA_TYPE_application, }, + { "Spa:Enum:MediaSubtype:raw", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "raw", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:dsp", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "dsp", SPA_MEDIA_SUBTYPE_dsp, }, + { "Spa:Enum:MediaSubtype:control", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "control", SPA_MEDIA_SUBTYPE_control, }, + { "Spa:Enum:MediaSubtype:h264", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "h264", SPA_MEDIA_SUBTYPE_h264, }, + { "Spa:Enum:MediaSubtype:mjpg", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mjpg", SPA_MEDIA_SUBTYPE_mjpg, }, + { "Spa:Enum:MediaSubtype:dv", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "dv", SPA_MEDIA_SUBTYPE_dv, }, + { "Spa:Enum:MediaSubtype:mpegts", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mpegts", SPA_MEDIA_SUBTYPE_mpegts, }, + { "Spa:Enum:MediaSubtype:h263", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "h263", SPA_MEDIA_SUBTYPE_h263, }, + { "Spa:Enum:MediaSubtype:mpeg1", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mpeg1", SPA_MEDIA_SUBTYPE_mpeg1, }, + { "Spa:Enum:MediaSubtype:mpeg2", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mpeg2", SPA_MEDIA_SUBTYPE_mpeg2, }, + { "Spa:Enum:MediaSubtype:mpeg4", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mpeg4", SPA_MEDIA_SUBTYPE_mpeg4, }, + { "Spa:Enum:MediaSubtype:xvid", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "xvid", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:vc1", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "vc1", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:vp8", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "vp8", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:vp9", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "vp9", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:jpeg", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "jpeg", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:bayer", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "bayer", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:mp3", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "mp3", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:aac", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "aac", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:vorbis", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "vorbis", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:wma", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "wma", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:ra", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "ra", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:sbc", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "sbc", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:adpcm", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "adpcm", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:g723", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "g723", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:g726", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "g726", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:g729", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "g729", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:amr", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "amr", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:gsm", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "gsm", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:Enum:MediaSubtype:midi", SPA_TYPE_INFO_MEDIA_SUBTYPE_BASE "midi", SPA_MEDIA_SUBTYPE_raw, }, + { "Spa:POD:Object:Param:Format:Video:format", SPA_TYPE_INFO_FORMAT_VIDEO_BASE "format", SPA_FORMAT_VIDEO_format,}, + { "Spa:POD:Object:Param:Format:Video:size", SPA_TYPE_INFO_FORMAT_VIDEO_BASE "size", SPA_FORMAT_VIDEO_size,}, + { "Spa:POD:Object:Param:Format:Video:framerate", SPA_TYPE_INFO_FORMAT_VIDEO_BASE "framerate", SPA_FORMAT_VIDEO_framerate}, + { "Spa:POD:Object:Param:Format:Video:max-framerate", SPA_TYPE_INFO_FORMAT_VIDEO_BASE "maxFramerate", SPA_FORMAT_VIDEO_maxFramerate}, + { "Spa:POD:Object:Param:Format:Video:views", SPA_TYPE_INFO_FORMAT_VIDEO_BASE "views", SPA_FORMAT_VIDEO_views}, + { "Spa:POD:Object:Param:Format:Video:interlace-mode", }, + { "Spa:POD:Object:Param:Format:Video:pixel-aspect-ratio", }, + { "Spa:POD:Object:Param:Format:Video:multiview-mode", }, + { "Spa:POD:Object:Param:Format:Video:multiview-flags", }, + { "Spa:POD:Object:Param:Format:Video:chroma-site", }, + { "Spa:POD:Object:Param:Format:Video:color-range", }, + { "Spa:POD:Object:Param:Format:Video:color-matrix", }, + { "Spa:POD:Object:Param:Format:Video:transfer-function", }, + { "Spa:POD:Object:Param:Format:Video:color-primaries", }, + { "Spa:POD:Object:Param:Format:Video:profile", }, + { "Spa:POD:Object:Param:Format:Video:level", }, + { "Spa:POD:Object:Param:Format:Video:stream-format", }, + { "Spa:POD:Object:Param:Format:Video:alignment", }, + { "Spa:POD:Object:Param:Format:Audio:format", SPA_TYPE_INFO_FORMAT_AUDIO_BASE "format", SPA_FORMAT_AUDIO_format,}, + { "Spa:POD:Object:Param:Format:Audio:flags", }, + { "Spa:POD:Object:Param:Format:Audio:layout", }, + { "Spa:POD:Object:Param:Format:Audio:rate", }, + { "Spa:POD:Object:Param:Format:Audio:channels", }, + { "Spa:POD:Object:Param:Format:Audio:channel-mask", }, + { "Spa:Enum:VideoFormat:encoded", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "encoded", SPA_VIDEO_FORMAT_ENCODED,}, + { "Spa:Enum:VideoFormat:I420", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I420", SPA_VIDEO_FORMAT_I420,}, + { "Spa:Enum:VideoFormat:YV12", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "YV12", SPA_VIDEO_FORMAT_YV12,}, + { "Spa:Enum:VideoFormat:YUY2", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "YUY2", SPA_VIDEO_FORMAT_YUY2,}, + { "Spa:Enum:VideoFormat:UYVY", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "UYVY", SPA_VIDEO_FORMAT_UYVY,}, + { "Spa:Enum:VideoFormat:AYUV", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "AYUV", SPA_VIDEO_FORMAT_AYUV,}, + { "Spa:Enum:VideoFormat:RGBx", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGBx", SPA_VIDEO_FORMAT_RGBx,}, + { "Spa:Enum:VideoFormat:BGRx", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGRx", SPA_VIDEO_FORMAT_BGRx,}, + { "Spa:Enum:VideoFormat:xRGB", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "xRGB", SPA_VIDEO_FORMAT_xRGB,}, + { "Spa:Enum:VideoFormat:xBGR", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "xBGR", SPA_VIDEO_FORMAT_xBGR,}, + { "Spa:Enum:VideoFormat:RGBA", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGBA", SPA_VIDEO_FORMAT_RGBA,}, + { "Spa:Enum:VideoFormat:BGRA", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGRA", SPA_VIDEO_FORMAT_BGRA,}, + { "Spa:Enum:VideoFormat:ARGB", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "ARGB", SPA_VIDEO_FORMAT_ARGB,}, + { "Spa:Enum:VideoFormat:ABGR", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "ABGR", SPA_VIDEO_FORMAT_ABGR,}, + { "Spa:Enum:VideoFormat:RGB", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGB", SPA_VIDEO_FORMAT_RGB,}, + { "Spa:Enum:VideoFormat:BGR", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGR", SPA_VIDEO_FORMAT_BGR,}, + { "Spa:Enum:VideoFormat:Y41B", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y41B", SPA_VIDEO_FORMAT_Y41B,}, + { "Spa:Enum:VideoFormat:Y42B", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y42B", SPA_VIDEO_FORMAT_Y42B,}, + { "Spa:Enum:VideoFormat:YVYU", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "YVYU", SPA_VIDEO_FORMAT_YVYU,}, + { "Spa:Enum:VideoFormat:Y444", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y444", SPA_VIDEO_FORMAT_Y444,}, + { "Spa:Enum:VideoFormat:v210", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "v210", SPA_VIDEO_FORMAT_v210,}, + { "Spa:Enum:VideoFormat:v216", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "v216", SPA_VIDEO_FORMAT_v216,}, + { "Spa:Enum:VideoFormat:NV12", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV12", SPA_VIDEO_FORMAT_NV12,}, + { "Spa:Enum:VideoFormat:NV21", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV21", SPA_VIDEO_FORMAT_NV21,}, + { "Spa:Enum:VideoFormat:GRAY8", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GRAY8", SPA_VIDEO_FORMAT_GRAY8,}, + { "Spa:Enum:VideoFormat:GRAY16_BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GRAY16_BE", SPA_VIDEO_FORMAT_GRAY16_BE,}, + { "Spa:Enum:VideoFormat:GRAY16_LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GRAY16_LE", SPA_VIDEO_FORMAT_GRAY16_LE,}, + { "Spa:Enum:VideoFormat:v308", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "v308", SPA_VIDEO_FORMAT_v308,}, + { "Spa:Enum:VideoFormat:RGB16", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGB16", SPA_VIDEO_FORMAT_RGB16,}, + { "Spa:Enum:VideoFormat:BGR16", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGR16", SPA_VIDEO_FORMAT_BGR16,}, + { "Spa:Enum:VideoFormat:RGB15", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGB15", SPA_VIDEO_FORMAT_RGB15,}, + { "Spa:Enum:VideoFormat:BGR15", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGR15", SPA_VIDEO_FORMAT_BGR15,}, + { "Spa:Enum:VideoFormat:UYVP", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "UYVP", SPA_VIDEO_FORMAT_UYVP,}, + { "Spa:Enum:VideoFormat:A420", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A420", SPA_VIDEO_FORMAT_A420,}, + { "Spa:Enum:VideoFormat:RGB8P", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGB8P", SPA_VIDEO_FORMAT_RGB8P,}, + { "Spa:Enum:VideoFormat:YUV9", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "YUV9", SPA_VIDEO_FORMAT_YUV9,}, + { "Spa:Enum:VideoFormat:YVU9", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "YVU9", SPA_VIDEO_FORMAT_YVU9,}, + { "Spa:Enum:VideoFormat:IYU1", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "IYU1", SPA_VIDEO_FORMAT_IYU1,}, + { "Spa:Enum:VideoFormat:ARGB64", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "ARGB64", SPA_VIDEO_FORMAT_ARGB64,}, + { "Spa:Enum:VideoFormat:AYUV64", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "AYUV64", SPA_VIDEO_FORMAT_AYUV64,}, + { "Spa:Enum:VideoFormat:r210", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "r210", SPA_VIDEO_FORMAT_r210,}, + { "Spa:Enum:VideoFormat:I420_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I420_10BE", SPA_VIDEO_FORMAT_I420_10BE,}, + { "Spa:Enum:VideoFormat:I420_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I420_10LE", SPA_VIDEO_FORMAT_I420_10LE,}, + { "Spa:Enum:VideoFormat:I422_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I422_10BE", SPA_VIDEO_FORMAT_I422_10BE,}, + { "Spa:Enum:VideoFormat:I422_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I422_10LE", SPA_VIDEO_FORMAT_I422_10LE,}, + { "Spa:Enum:VideoFormat:Y444_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y444_10BE", SPA_VIDEO_FORMAT_Y444_10BE,}, + { "Spa:Enum:VideoFormat:Y444_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y444_10LE", SPA_VIDEO_FORMAT_Y444_10LE,}, + { "Spa:Enum:VideoFormat:GBR", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBR", SPA_VIDEO_FORMAT_GBR,}, + { "Spa:Enum:VideoFormat:GBR_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBR_10BE", SPA_VIDEO_FORMAT_GBR_10BE,}, + { "Spa:Enum:VideoFormat:GBR_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBR_10LE", SPA_VIDEO_FORMAT_GBR_10LE,}, + { "Spa:Enum:VideoFormat:NV16", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV16", SPA_VIDEO_FORMAT_NV16,}, + { "Spa:Enum:VideoFormat:NV24", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV24", SPA_VIDEO_FORMAT_NV24,}, + { "Spa:Enum:VideoFormat:NV12_64Z32", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV12_64Z32", SPA_VIDEO_FORMAT_NV12_64Z32,}, + { "Spa:Enum:VideoFormat:A420_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A420_10BE", SPA_VIDEO_FORMAT_A420_10BE,}, + { "Spa:Enum:VideoFormat:A420_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A420_10LE", SPA_VIDEO_FORMAT_A420_10LE,}, + { "Spa:Enum:VideoFormat:A422_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A422_10BE", SPA_VIDEO_FORMAT_A422_10BE,}, + { "Spa:Enum:VideoFormat:A422_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A422_10LE", SPA_VIDEO_FORMAT_A422_10LE,}, + { "Spa:Enum:VideoFormat:A444_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A444_10BE", SPA_VIDEO_FORMAT_A444_10BE,}, + { "Spa:Enum:VideoFormat:A444_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "A444_10LE", SPA_VIDEO_FORMAT_A444_10LE,}, + { "Spa:Enum:VideoFormat:NV61", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "NV61", SPA_VIDEO_FORMAT_NV61,}, + { "Spa:Enum:VideoFormat:P010_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "P010_10BE", SPA_VIDEO_FORMAT_P010_10BE,}, + { "Spa:Enum:VideoFormat:P010_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "P010_10LE", SPA_VIDEO_FORMAT_P010_10LE,}, + { "Spa:Enum:VideoFormat:IYU2", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "IYU2", SPA_VIDEO_FORMAT_IYU2,}, + { "Spa:Enum:VideoFormat:VYUY", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "VYUY", SPA_VIDEO_FORMAT_VYUY,}, + { "Spa:Enum:VideoFormat:GBRA", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBRA", SPA_VIDEO_FORMAT_GBRA,}, + { "Spa:Enum:VideoFormat:GBRA_10BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBRA_10BE", SPA_VIDEO_FORMAT_GBRA_10BE,}, + { "Spa:Enum:VideoFormat:GBRA_10LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBRA_10LE", SPA_VIDEO_FORMAT_GBRA_10LE,}, + { "Spa:Enum:VideoFormat:GBR_12BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBR_12BE", SPA_VIDEO_FORMAT_GBR_12BE,}, + { "Spa:Enum:VideoFormat:GBR_12LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBR_12LE", SPA_VIDEO_FORMAT_GBR_12LE,}, + { "Spa:Enum:VideoFormat:GBRA_12BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBRA_12BE", SPA_VIDEO_FORMAT_GBRA_12BE,}, + { "Spa:Enum:VideoFormat:GBRA_12LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "GBRA_12LE", SPA_VIDEO_FORMAT_GBRA_12LE,}, + { "Spa:Enum:VideoFormat:I420_12BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I420_12BE", SPA_VIDEO_FORMAT_I420_12BE,}, + { "Spa:Enum:VideoFormat:I420_12LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I420_12LE", SPA_VIDEO_FORMAT_I420_12LE,}, + { "Spa:Enum:VideoFormat:I422_12BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I422_12BE", SPA_VIDEO_FORMAT_I422_12BE,}, + { "Spa:Enum:VideoFormat:I422_12LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "I422_12LE", SPA_VIDEO_FORMAT_I422_12LE,}, + { "Spa:Enum:VideoFormat:Y444_12BE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y444_12BE", SPA_VIDEO_FORMAT_Y444_12BE,}, + { "Spa:Enum:VideoFormat:Y444_12LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "Y444_12LE", SPA_VIDEO_FORMAT_Y444_12LE,}, + { "Spa:Enum:VideoFormat:xRGB_210LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "xRGB_210LE", SPA_VIDEO_FORMAT_xRGB_210LE,}, + { "Spa:Enum:VideoFormat:xBGR_210LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "xBGR_210LE", SPA_VIDEO_FORMAT_xBGR_210LE,}, + { "Spa:Enum:VideoFormat:RGBx_102LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGBx_102LE", SPA_VIDEO_FORMAT_RGBx_102LE,}, + { "Spa:Enum:VideoFormat:BGRx_102LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGRx_102LE", SPA_VIDEO_FORMAT_BGRx_102LE,}, + { "Spa:Enum:VideoFormat:ARGB_210LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "ARGB_210LE", SPA_VIDEO_FORMAT_ARGB_210LE,}, + { "Spa:Enum:VideoFormat:ABGR_210LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "ABGR_210LE", SPA_VIDEO_FORMAT_ABGR_210LE,}, + { "Spa:Enum:VideoFormat:RGBA_102LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "RGBA_102LE", SPA_VIDEO_FORMAT_RGBA_102LE,}, + { "Spa:Enum:VideoFormat:BGRA_102LE", SPA_TYPE_INFO_VIDEO_FORMAT_BASE "BGRA_102LE", SPA_VIDEO_FORMAT_BGRA_102LE,}, + { "Spa:Enum:AudioFormat:ENCODED", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "ENCODED", SPA_AUDIO_FORMAT_ENCODED,}, + { "Spa:Enum:AudioFormat:S8", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S8", SPA_AUDIO_FORMAT_S8, }, + { "Spa:Enum:AudioFormat:U8", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U8", SPA_AUDIO_FORMAT_U8, }, + { "Spa:Enum:AudioFormat:S16LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S16_LE", SPA_AUDIO_FORMAT_S16_LE, }, + { "Spa:Enum:AudioFormat:U16LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U16_LE", SPA_AUDIO_FORMAT_U16_LE, }, + { "Spa:Enum:AudioFormat:S24_32LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S24_32_LE", SPA_AUDIO_FORMAT_S24_32_LE, }, + { "Spa:Enum:AudioFormat:U24_32LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U24_32_LE", SPA_AUDIO_FORMAT_U24_32_LE, }, + { "Spa:Enum:AudioFormat:S32LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S32_LE", SPA_AUDIO_FORMAT_S32_LE, }, + { "Spa:Enum:AudioFormat:U32LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U32_LE", SPA_AUDIO_FORMAT_U32_LE, }, + { "Spa:Enum:AudioFormat:S24LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S24_LE", SPA_AUDIO_FORMAT_S24_LE, }, + { "Spa:Enum:AudioFormat:U24LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U24_LE", SPA_AUDIO_FORMAT_U24_LE, }, + { "Spa:Enum:AudioFormat:S20LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S20_LE", SPA_AUDIO_FORMAT_S20_LE, }, + { "Spa:Enum:AudioFormat:U20LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U20_LE", SPA_AUDIO_FORMAT_U20_LE, }, + { "Spa:Enum:AudioFormat:S18LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S18_LE", SPA_AUDIO_FORMAT_S18_LE, }, + { "Spa:Enum:AudioFormat:U18LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U18_LE", SPA_AUDIO_FORMAT_U18_LE, }, + { "Spa:Enum:AudioFormat:F32LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "F32_LE", SPA_AUDIO_FORMAT_F32_LE, }, + { "Spa:Enum:AudioFormat:F64LE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "F64_LE", SPA_AUDIO_FORMAT_F64_LE, }, + { "Spa:Enum:AudioFormat:S16BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S16_BE", SPA_AUDIO_FORMAT_S16_BE, }, + { "Spa:Enum:AudioFormat:U16BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U16_BE", SPA_AUDIO_FORMAT_U16_BE, }, + { "Spa:Enum:AudioFormat:S24_32BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S24_32_BE", SPA_AUDIO_FORMAT_S24_32_BE, }, + { "Spa:Enum:AudioFormat:U24_32BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U24_32_BE", SPA_AUDIO_FORMAT_U24_32_BE, }, + { "Spa:Enum:AudioFormat:S32BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S32_BE", SPA_AUDIO_FORMAT_S32_BE, }, + { "Spa:Enum:AudioFormat:U32BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U32_BE", SPA_AUDIO_FORMAT_U32_BE, }, + { "Spa:Enum:AudioFormat:S24BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S24_BE", SPA_AUDIO_FORMAT_S24_BE, }, + { "Spa:Enum:AudioFormat:U24BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U24_BE", SPA_AUDIO_FORMAT_U24_BE, }, + { "Spa:Enum:AudioFormat:S20BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S20_BE", SPA_AUDIO_FORMAT_S20_BE, }, + { "Spa:Enum:AudioFormat:U20BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U20_BE", SPA_AUDIO_FORMAT_U20_BE, }, + { "Spa:Enum:AudioFormat:S18BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "S18_BE", SPA_AUDIO_FORMAT_S18_BE, }, + { "Spa:Enum:AudioFormat:U18BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "U18_BE", SPA_AUDIO_FORMAT_U18_BE, }, + { "Spa:Enum:AudioFormat:F32BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "F32_BE", SPA_AUDIO_FORMAT_F32_BE, }, + { "Spa:Enum:AudioFormat:F64BE", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "F64_BE", SPA_AUDIO_FORMAT_F64_BE, }, + { "Spa:Enum:AudioFormat:F32P", SPA_TYPE_INFO_AUDIO_FORMAT_BASE "F32P", SPA_AUDIO_FORMAT_F32P, }, +}; |