mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	rename core_proxy -> core
Rename core_proxy to core and move the introspect and interface contents to core.h In an effort to promote the proxy API.
This commit is contained in:
		
							parent
							
								
									8ea78c2e3f
								
							
						
					
					
						commit
						ecc6b27cd7
					
				
					 54 changed files with 1068 additions and 1059 deletions
				
			
		| 
						 | 
				
			
			@ -35,36 +35,36 @@ extern "C" {
 | 
			
		|||
 | 
			
		||||
#define PW_VERSION_CORE_V0			0
 | 
			
		||||
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_HELLO		0
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_UPDATE_TYPES	1
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_SYNC		2
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_GET_REGISTRY	3
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_CLIENT_UPDATE	4
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_PERMISSIONS	5
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_CREATE_OBJECT	6
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_DESTROY		7
 | 
			
		||||
#define PW_CORE_PROXY_V0_METHOD_NUM		8
 | 
			
		||||
#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
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
/**
 | 
			
		||||
 * Key to update default permissions of globals without specific
 | 
			
		||||
 * permissions. value is "[r][w][x]" */
 | 
			
		||||
#define PW_CORE_PROXY_PERMISSIONS_DEFAULT	"permissions.default"
 | 
			
		||||
#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_PROXY_PERMISSIONS_GLOBAL	"permissions.global"
 | 
			
		||||
#define PW_CORE_PERMISSIONS_GLOBAL	"permissions.global"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Key to update specific permissions of all existing globals.
 | 
			
		||||
 * This is equivalent to using \ref PW_CORE_PROXY_PERMISSIONS_GLOBAL
 | 
			
		||||
 * 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_PROXY_PERMISSIONS_EXISTING	"permissions.existing"
 | 
			
		||||
#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"
 | 
			
		||||
| 
						 | 
				
			
			@ -73,15 +73,15 @@ extern "C" {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \struct pw_core_proxy_v0_methods
 | 
			
		||||
 * \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 intance. It is
 | 
			
		||||
 * also used for internal features.
 | 
			
		||||
 */
 | 
			
		||||
struct pw_core_proxy_v0_methods {
 | 
			
		||||
#define PW_VERSION_CORE_PROXY_V0_METHODS	0
 | 
			
		||||
struct pw_core_v0_methods {
 | 
			
		||||
#define PW_VERSION_CORE_V0_METHODS	0
 | 
			
		||||
	uint32_t version;
 | 
			
		||||
	/**
 | 
			
		||||
	 * Start a conversation with the server. This will send
 | 
			
		||||
| 
						 | 
				
			
			@ -167,19 +167,19 @@ struct pw_core_proxy_v0_methods {
 | 
			
		|||
	void (*destroy) (void *object, uint32_t id);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_UPDATE_TYPES 0
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_DONE         1
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_ERROR        2
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_REMOVE_ID    3
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_INFO         4
 | 
			
		||||
#define PW_CORE_PROXY_V0_EVENT_NUM          5
 | 
			
		||||
#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_proxy_v0_events
 | 
			
		||||
/** \struct pw_core_v0_events
 | 
			
		||||
 *  \brief Core events
 | 
			
		||||
 *  \ingroup pw_core_interface The pw_core interface
 | 
			
		||||
 */
 | 
			
		||||
struct pw_core_proxy_v0_events {
 | 
			
		||||
#define PW_VERSION_CORE_PROXY_V0_EVENTS		0
 | 
			
		||||
struct pw_core_v0_events {
 | 
			
		||||
#define PW_VERSION_CORE_V0_EVENTS		0
 | 
			
		||||
	uint32_t version;
 | 
			
		||||
	/**
 | 
			
		||||
	 * Update the type map
 | 
			
		||||
| 
						 | 
				
			
			@ -234,11 +234,11 @@ struct pw_core_proxy_v0_events {
 | 
			
		|||
	void (*info) (void *object, struct pw_core_info *info);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define pw_core_resource_v0_update_types(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,update_types,__VA_ARGS__)
 | 
			
		||||
#define pw_core_resource_v0_done(r,...)         pw_resource_notify(r,struct pw_core_proxy_v0_events,done,__VA_ARGS__)
 | 
			
		||||
#define pw_core_resource_v0_error(r,...)        pw_resource_notify(r,struct pw_core_proxy_v0_events,error,__VA_ARGS__)
 | 
			
		||||
#define pw_core_resource_v0_remove_id(r,...)    pw_resource_notify(r,struct pw_core_proxy_v0_events,remove_id,__VA_ARGS__)
 | 
			
		||||
#define pw_core_resource_v0_info(r,...)         pw_resource_notify(r,struct pw_core_proxy_v0_events,info,__VA_ARGS__)
 | 
			
		||||
#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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ update_types_server(struct pw_resource *resource)
 | 
			
		|||
	struct spa_pod_frame f;
 | 
			
		||||
	uint32_t i;
 | 
			
		||||
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_UPDATE_TYPES, NULL);
 | 
			
		||||
	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,
 | 
			
		||||
| 
						 | 
				
			
			@ -78,11 +78,11 @@ static void core_marshal_info(void *object, const struct pw_core_info *info)
 | 
			
		|||
        struct spa_pod_frame f;
 | 
			
		||||
	struct pw_protocol_native_message *msg;
 | 
			
		||||
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_INFO, &msg);
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_INFO, &msg);
 | 
			
		||||
 | 
			
		||||
	if (msg->seq == 0) {
 | 
			
		||||
		update_types_server(resource);
 | 
			
		||||
		b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_INFO, &msg);
 | 
			
		||||
		b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_INFO, &msg);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	n_items = info->props ? info->props->n_items : 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -113,7 +113,7 @@ static void core_marshal_done(void *object, uint32_t id, int seq)
 | 
			
		|||
	struct pw_resource *resource = object;
 | 
			
		||||
	struct spa_pod_builder *b;
 | 
			
		||||
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_DONE, NULL);
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_DONE, NULL);
 | 
			
		||||
 | 
			
		||||
	spa_pod_builder_add_struct(b, "i", seq);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -125,7 +125,7 @@ static void core_marshal_error(void *object, uint32_t id, int seq, int res, cons
 | 
			
		|||
	struct pw_resource *resource = object;
 | 
			
		||||
	struct spa_pod_builder *b;
 | 
			
		||||
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_ERROR, NULL);
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_ERROR, NULL);
 | 
			
		||||
 | 
			
		||||
	spa_pod_builder_add_struct(b,
 | 
			
		||||
			       "i", id,
 | 
			
		||||
| 
						 | 
				
			
			@ -140,7 +140,7 @@ static void core_marshal_remove_id(void *object, uint32_t id)
 | 
			
		|||
	struct pw_resource *resource = object;
 | 
			
		||||
	struct spa_pod_builder *b;
 | 
			
		||||
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_REMOVE_ID, NULL);
 | 
			
		||||
	b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_REMOVE_ID, NULL);
 | 
			
		||||
 | 
			
		||||
	spa_pod_builder_add_struct(b, "i", id);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -211,7 +211,7 @@ static int core_demarshal_hello(void *object, const struct pw_protocol_native_me
 | 
			
		|||
				"P", &ptr) < 0)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
        return pw_resource_notify(resource, struct pw_core_proxy_methods, hello, 0, 2);
 | 
			
		||||
        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)
 | 
			
		||||
| 
						 | 
				
			
			@ -224,7 +224,7 @@ static int core_demarshal_sync(void *object, const struct pw_protocol_native_mes
 | 
			
		|||
	if (spa_pod_parser_get_struct(&prs, "i", &seq) < 0)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
        return pw_resource_notify(resource, struct pw_core_proxy_methods, sync, 0, 0, seq);
 | 
			
		||||
        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)
 | 
			
		||||
| 
						 | 
				
			
			@ -239,7 +239,7 @@ static int core_demarshal_get_registry(void *object, const struct pw_protocol_na
 | 
			
		|||
				"i", &new_id) < 0)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
        return pw_resource_notify(resource, struct pw_core_proxy_methods, get_registry, 0, version, new_id);
 | 
			
		||||
        return pw_resource_notify(resource, struct pw_core_methods, get_registry, 0, version, new_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SPA_EXPORT
 | 
			
		||||
| 
						 | 
				
			
			@ -622,7 +622,7 @@ static int core_demarshal_create_object(void *object, const struct pw_protocol_n
 | 
			
		|||
 | 
			
		||||
	type = pw_protocol_native0_type_from_v2(client, type);
 | 
			
		||||
 | 
			
		||||
	return pw_resource_notify(resource, struct pw_core_proxy_methods, create_object, 0, factory_name,
 | 
			
		||||
	return pw_resource_notify(resource, struct pw_core_methods, create_object, 0, factory_name,
 | 
			
		||||
                                                                      type, version,
 | 
			
		||||
                                                                      &props, new_id);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -644,7 +644,7 @@ static int core_demarshal_destroy(void *object, const struct pw_protocol_native_
 | 
			
		|||
	if ((r = pw_client_find_resource(client, id)) == NULL)
 | 
			
		||||
		goto no_resource;
 | 
			
		||||
 | 
			
		||||
	return pw_resource_notify(resource, struct pw_core_proxy_methods, destroy, 0, r);
 | 
			
		||||
	return pw_resource_notify(resource, struct pw_core_methods, destroy, 0, r);
 | 
			
		||||
 | 
			
		||||
no_resource:
 | 
			
		||||
	pw_log_error("client %p: unknown resouce %u op:%u", client, id, msg->opcode);
 | 
			
		||||
| 
						 | 
				
			
			@ -1018,19 +1018,19 @@ static void link_marshal_info(void *object, const struct pw_link_info *info)
 | 
			
		|||
	pw_protocol_native_end_resource(resource, b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_PROXY_V0_METHOD_NUM] = {
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_HELLO] = { &core_demarshal_hello, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_UPDATE_TYPES] = { &core_demarshal_update_types_server, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_SYNC] = { &core_demarshal_sync, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_GET_REGISTRY] = { &core_demarshal_get_registry, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_CLIENT_UPDATE] = { &core_demarshal_client_update, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_PERMISSIONS] = { &core_demarshal_permissions, 0, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_CREATE_OBJECT] = { &core_demarshal_create_object, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
 | 
			
		||||
	[PW_CORE_PROXY_V0_METHOD_DESTROY] = { &core_demarshal_destroy, 0, }
 | 
			
		||||
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_proxy_events pw_protocol_native_core_event_marshal = {
 | 
			
		||||
	PW_VERSION_CORE_PROXY_EVENTS,
 | 
			
		||||
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,
 | 
			
		||||
| 
						 | 
				
			
			@ -1040,8 +1040,8 @@ static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal =
 | 
			
		|||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
 | 
			
		||||
	PW_TYPE_INTERFACE_Core,
 | 
			
		||||
	PW_VERSION_CORE_V0,
 | 
			
		||||
	PW_CORE_PROXY_V0_METHOD_NUM,
 | 
			
		||||
	PW_CORE_PROXY_EVENT_NUM,
 | 
			
		||||
	PW_CORE_V0_METHOD_NUM,
 | 
			
		||||
	PW_CORE_EVENT_NUM,
 | 
			
		||||
	0,
 | 
			
		||||
	NULL,
 | 
			
		||||
	pw_protocol_native_core_method_demarshal,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue