mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: handle missing dbus support
This commit is contained in:
		
							parent
							
								
									04354215b6
								
							
						
					
					
						commit
						2c2ba6eec3
					
				
					 2 changed files with 17 additions and 5 deletions
				
			
		| 
						 | 
					@ -346,6 +346,15 @@ static void do_permission_store_check(struct client *client)
 | 
				
			||||||
					client);
 | 
										client);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (impl->bus == NULL) {
 | 
				
			||||||
 | 
							pw_log_debug("Ignoring portal check for client %p: dbus disabled",
 | 
				
			||||||
 | 
								     client);
 | 
				
			||||||
 | 
							client->allowed_media_roles = MEDIA_ROLE_ALL;
 | 
				
			||||||
 | 
							sm_media_session_for_each_object(impl->session,
 | 
				
			||||||
 | 
										set_global_permissions,
 | 
				
			||||||
 | 
										client);
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	client->allowed_media_roles = MEDIA_ROLE_NONE;
 | 
						client->allowed_media_roles = MEDIA_ROLE_NONE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -553,6 +562,9 @@ static int init_dbus_connection(struct impl *impl)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	DBusError error;
 | 
						DBusError error;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (impl->bus == NULL)
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dbus_error_init(&error);
 | 
						dbus_error_init(&error);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dbus_bus_add_match(impl->bus,
 | 
						dbus_bus_add_match(impl->bus,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2172,15 +2172,15 @@ int main(int argc, char *argv[])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	support = pw_context_get_support(impl.this.context, &n_support);
 | 
						support = pw_context_get_support(impl.this.context, &n_support);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((str = pw_properties_get(impl.this.props, "dbus")) == NULL ||
 | 
						impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
 | 
				
			||||||
	    pw_properties_parse_bool(str)) {
 | 
						if (impl.dbus) {
 | 
				
			||||||
		impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
 | 
							impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, SPA_DBUS_TYPE_SESSION);
 | 
				
			||||||
		if (impl.dbus)
 | 
					 | 
				
			||||||
			impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, SPA_DBUS_TYPE_SESSION);
 | 
					 | 
				
			||||||
		if (impl.this.dbus_connection == NULL)
 | 
							if (impl.this.dbus_connection == NULL)
 | 
				
			||||||
			pw_log_warn("no dbus connection");
 | 
								pw_log_warn("no dbus connection");
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			pw_log_debug("got dbus connection %p", impl.this.dbus_connection);
 | 
								pw_log_debug("got dbus connection %p", impl.this.dbus_connection);
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							pw_log_info("dbus diabled");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((res = start_session(&impl)) < 0)
 | 
						if ((res = start_session(&impl)) < 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue