mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw_core -> pw_context
The proxy API is the one that we would like to expose for applications and the other API is used internally when implementing modules or factories. The current pw_core object is really a context for all objects so name it that way. It also makes it possible to rename pw_core_proxy to pw_proxy later.
This commit is contained in:
		
							parent
							
								
									42103a8218
								
							
						
					
					
						commit
						8ea78c2e3f
					
				
					 113 changed files with 905 additions and 906 deletions
				
			
		| 
						 | 
				
			
			@ -78,7 +78,7 @@ static int client_endpoint_stream_update(void *object,
 | 
			
		|||
	struct pw_properties *props = NULL;
 | 
			
		||||
 | 
			
		||||
	if (!stream) {
 | 
			
		||||
		struct pw_core *core = pw_global_get_core(endpoint->global);
 | 
			
		||||
		struct pw_context *context = pw_global_get_context(endpoint->global);
 | 
			
		||||
		const char *keys[] = {
 | 
			
		||||
			PW_KEY_FACTORY_ID,
 | 
			
		||||
			PW_KEY_CLIENT_ID,
 | 
			
		||||
| 
						 | 
				
			
			@ -103,7 +103,7 @@ static int client_endpoint_stream_update(void *object,
 | 
			
		|||
			pw_properties_update_keys(props, info->props, keys);
 | 
			
		||||
 | 
			
		||||
		if (endpoint_stream_init(stream, stream_id, endpoint->info.id,
 | 
			
		||||
					this, core, props) < 0)
 | 
			
		||||
					this, context, props) < 0)
 | 
			
		||||
			goto no_mem;
 | 
			
		||||
 | 
			
		||||
		spa_list_append(&this->streams, &stream->link);
 | 
			
		||||
| 
						 | 
				
			
			@ -169,7 +169,7 @@ static void *create_object(void *data,
 | 
			
		|||
	struct pw_factory *factory = d->factory;
 | 
			
		||||
	struct client_endpoint *this;
 | 
			
		||||
	struct pw_client *owner = pw_resource_get_client(owner_resource);
 | 
			
		||||
	struct pw_core *core = pw_client_get_core(owner);
 | 
			
		||||
	struct pw_context *context = pw_client_get_context(owner);
 | 
			
		||||
 | 
			
		||||
	this = calloc(1, sizeof(struct client_endpoint));
 | 
			
		||||
	if (this == NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -191,7 +191,7 @@ static void *create_object(void *data,
 | 
			
		|||
	if (this->resource == NULL)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	if (endpoint_init(&this->endpoint, this, core, properties) < 0)
 | 
			
		||||
	if (endpoint_init(&this->endpoint, this, context, properties) < 0)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	pw_resource_add_listener(this->resource, &this->resource_listener,
 | 
			
		||||
| 
						 | 
				
			
			@ -252,11 +252,11 @@ static const struct pw_module_events module_events = {
 | 
			
		|||
 | 
			
		||||
int client_endpoint_factory_init(struct pw_module *module)
 | 
			
		||||
{
 | 
			
		||||
	struct pw_core *core = pw_module_get_core(module);
 | 
			
		||||
	struct pw_context *context = pw_module_get_context(module);
 | 
			
		||||
	struct pw_factory *factory;
 | 
			
		||||
	struct factory_data *data;
 | 
			
		||||
 | 
			
		||||
	factory = pw_factory_new(core,
 | 
			
		||||
	factory = pw_factory_new(context,
 | 
			
		||||
				 "client-endpoint",
 | 
			
		||||
				 PW_TYPE_INTERFACE_ClientEndpoint,
 | 
			
		||||
				 PW_VERSION_CLIENT_ENDPOINT_PROXY,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ static int client_session_link_update(void *object,
 | 
			
		|||
	struct pw_properties *props = NULL;
 | 
			
		||||
 | 
			
		||||
	if (!link) {
 | 
			
		||||
		struct pw_core *core = pw_global_get_core(session->global);
 | 
			
		||||
		struct pw_context *context = pw_global_get_context(session->global);
 | 
			
		||||
		const char *keys[] = {
 | 
			
		||||
			PW_KEY_FACTORY_ID,
 | 
			
		||||
			PW_KEY_CLIENT_ID,
 | 
			
		||||
| 
						 | 
				
			
			@ -102,7 +102,7 @@ static int client_session_link_update(void *object,
 | 
			
		|||
			pw_properties_update_keys(props, info->props, keys);
 | 
			
		||||
 | 
			
		||||
		if (endpoint_link_init(link, link_id, session->info.id,
 | 
			
		||||
					this, core, props) < 0)
 | 
			
		||||
					this, context, props) < 0)
 | 
			
		||||
			goto no_mem;
 | 
			
		||||
 | 
			
		||||
		spa_list_append(&this->links, &link->link);
 | 
			
		||||
| 
						 | 
				
			
			@ -168,7 +168,7 @@ static void *create_object(void *data,
 | 
			
		|||
	struct pw_factory *factory = d->factory;
 | 
			
		||||
	struct client_session *this;
 | 
			
		||||
	struct pw_client *owner = pw_resource_get_client(owner_resource);
 | 
			
		||||
	struct pw_core *core = pw_client_get_core(owner);
 | 
			
		||||
	struct pw_context *context = pw_client_get_context(owner);
 | 
			
		||||
 | 
			
		||||
	this = calloc(1, sizeof(struct client_session));
 | 
			
		||||
	if (this == NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -190,7 +190,7 @@ static void *create_object(void *data,
 | 
			
		|||
	if (this->resource == NULL)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	if (session_init(&this->session, this, core, properties) < 0)
 | 
			
		||||
	if (session_init(&this->session, this, context, properties) < 0)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	pw_resource_add_listener(this->resource, &this->resource_listener,
 | 
			
		||||
| 
						 | 
				
			
			@ -251,11 +251,11 @@ static const struct pw_module_events module_events = {
 | 
			
		|||
 | 
			
		||||
int client_session_factory_init(struct pw_module *module)
 | 
			
		||||
{
 | 
			
		||||
	struct pw_core *core = pw_module_get_core(module);
 | 
			
		||||
	struct pw_context *context = pw_module_get_context(module);
 | 
			
		||||
	struct pw_factory *factory;
 | 
			
		||||
	struct factory_data *data;
 | 
			
		||||
 | 
			
		||||
	factory = pw_factory_new(core,
 | 
			
		||||
	factory = pw_factory_new(context,
 | 
			
		||||
				 "client-session",
 | 
			
		||||
				 PW_TYPE_INTERFACE_ClientSession,
 | 
			
		||||
				 PW_VERSION_CLIENT_SESSION_PROXY,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -294,7 +294,7 @@ static int endpoint_link_bind(void *_data, struct pw_client *client,
 | 
			
		|||
int endpoint_link_init(struct endpoint_link *this,
 | 
			
		||||
		uint32_t id, uint32_t session_id,
 | 
			
		||||
		struct client_session *client_sess,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties)
 | 
			
		||||
{
 | 
			
		||||
	pw_log_debug(NAME" %p: new", this);
 | 
			
		||||
| 
						 | 
				
			
			@ -309,7 +309,7 @@ int endpoint_link_init(struct endpoint_link *this,
 | 
			
		|||
	if (!properties)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	this->global = pw_global_new (core,
 | 
			
		||||
	this->global = pw_global_new(context,
 | 
			
		||||
			PW_TYPE_INTERFACE_EndpointLink,
 | 
			
		||||
			PW_VERSION_ENDPOINT_LINK_PROXY,
 | 
			
		||||
			properties, endpoint_link_bind, this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ struct endpoint_link {
 | 
			
		|||
int endpoint_link_init(struct endpoint_link *this,
 | 
			
		||||
		uint32_t id, uint32_t session_id,
 | 
			
		||||
		struct client_session *client_sess,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties);
 | 
			
		||||
 | 
			
		||||
void endpoint_link_clear(struct endpoint_link *this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -276,7 +276,7 @@ static int endpoint_stream_bind(void *_data, struct pw_client *client,
 | 
			
		|||
int endpoint_stream_init(struct endpoint_stream *this,
 | 
			
		||||
		uint32_t id, uint32_t endpoint_id,
 | 
			
		||||
		struct client_endpoint *client_ep,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties)
 | 
			
		||||
{
 | 
			
		||||
	pw_log_debug(NAME" %p: new", this);
 | 
			
		||||
| 
						 | 
				
			
			@ -291,7 +291,7 @@ int endpoint_stream_init(struct endpoint_stream *this,
 | 
			
		|||
	if (!properties)
 | 
			
		||||
		goto no_mem;
 | 
			
		||||
 | 
			
		||||
	this->global = pw_global_new (core,
 | 
			
		||||
	this->global = pw_global_new (context,
 | 
			
		||||
			PW_TYPE_INTERFACE_EndpointStream,
 | 
			
		||||
			PW_VERSION_ENDPOINT_STREAM_PROXY,
 | 
			
		||||
			properties, endpoint_stream_bind, this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ struct endpoint_stream {
 | 
			
		|||
int endpoint_stream_init(struct endpoint_stream *this,
 | 
			
		||||
		uint32_t id, uint32_t endpoint_id,
 | 
			
		||||
		struct client_endpoint *client_ep,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties);
 | 
			
		||||
 | 
			
		||||
void endpoint_stream_clear(struct endpoint_stream *this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -297,7 +297,7 @@ static int endpoint_bind(void *_data, struct pw_client *client,
 | 
			
		|||
 | 
			
		||||
int endpoint_init(struct endpoint *this,
 | 
			
		||||
		struct client_endpoint *client_ep,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties)
 | 
			
		||||
{
 | 
			
		||||
	const char *keys[] = {
 | 
			
		||||
| 
						 | 
				
			
			@ -326,7 +326,7 @@ int endpoint_init(struct endpoint *this,
 | 
			
		|||
 | 
			
		||||
	pw_properties_update_keys(properties, &this->props->dict, keys);
 | 
			
		||||
 | 
			
		||||
	this->global = pw_global_new (core,
 | 
			
		||||
	this->global = pw_global_new (context,
 | 
			
		||||
			PW_TYPE_INTERFACE_Endpoint,
 | 
			
		||||
			PW_VERSION_ENDPOINT_PROXY,
 | 
			
		||||
			properties, endpoint_bind, this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ struct endpoint {
 | 
			
		|||
 | 
			
		||||
int endpoint_init(struct endpoint *this,
 | 
			
		||||
		struct client_endpoint *client_ep,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties);
 | 
			
		||||
 | 
			
		||||
void endpoint_clear(struct endpoint *this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2001,11 +2001,11 @@ static const struct pw_protocol_marshal pw_protocol_native_session_marshal = {
 | 
			
		|||
	&pw_protocol_native_session_event_demarshal,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_core *core)
 | 
			
		||||
struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_context *context)
 | 
			
		||||
{
 | 
			
		||||
	struct pw_protocol *protocol;
 | 
			
		||||
 | 
			
		||||
	protocol = pw_core_find_protocol(core, PW_TYPE_INFO_PROTOCOL_Native);
 | 
			
		||||
	protocol = pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native);
 | 
			
		||||
 | 
			
		||||
	if (protocol == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -267,7 +267,7 @@ static int session_bind(void *_data, struct pw_client *client,
 | 
			
		|||
 | 
			
		||||
int session_init(struct session *this,
 | 
			
		||||
		struct client_session *client_sess,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties)
 | 
			
		||||
{
 | 
			
		||||
	const char *keys[] = {
 | 
			
		||||
| 
						 | 
				
			
			@ -287,7 +287,7 @@ int session_init(struct session *this,
 | 
			
		|||
 | 
			
		||||
	pw_properties_update_keys(properties, &this->props->dict, keys);
 | 
			
		||||
 | 
			
		||||
	this->global = pw_global_new (core,
 | 
			
		||||
	this->global = pw_global_new (context,
 | 
			
		||||
			PW_TYPE_INTERFACE_Session,
 | 
			
		||||
			PW_VERSION_SESSION_PROXY,
 | 
			
		||||
			properties, session_bind, this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ struct session {
 | 
			
		|||
 | 
			
		||||
int session_init(struct session *this,
 | 
			
		||||
		struct client_session *client_sess,
 | 
			
		||||
		struct pw_core *core,
 | 
			
		||||
		struct pw_context *context,
 | 
			
		||||
		struct pw_properties *properties);
 | 
			
		||||
 | 
			
		||||
void session_clear(struct session *this);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue