mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	context: add suport.dbus option
Add a support.dbus option in the context that can be used to disable the dbus feature.
This commit is contained in:
		
							parent
							
								
									2c2ba6eec3
								
							
						
					
					
						commit
						70390a631e
					
				
					 3 changed files with 17 additions and 13 deletions
				
			
		| 
						 | 
					@ -3,7 +3,7 @@ context.properties = {
 | 
				
			||||||
    # Properties to configure the session and some
 | 
					    # Properties to configure the session and some
 | 
				
			||||||
    # modules.
 | 
					    # modules.
 | 
				
			||||||
    #mem.mlock-all           = false
 | 
					    #mem.mlock-all           = false
 | 
				
			||||||
    #dbus                    = true
 | 
					    #support.dbus            = true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
context.spa-libs = {
 | 
					context.spa-libs = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,6 +3,7 @@ context.properties = {
 | 
				
			||||||
    ## Configure properties in the system.
 | 
					    ## Configure properties in the system.
 | 
				
			||||||
    #library.name.system                   = support/libspa-support
 | 
					    #library.name.system                   = support/libspa-support
 | 
				
			||||||
    #context.data-loop.library.name.system = support/libspa-support
 | 
					    #context.data-loop.library.name.system = support/libspa-support
 | 
				
			||||||
 | 
					    #support.dbus                          = true
 | 
				
			||||||
    #link.max-buffers                      = 64
 | 
					    #link.max-buffers                      = 64
 | 
				
			||||||
    link.max-buffers                       = 16                       # version < 3 clients can't handle more
 | 
					    link.max-buffers                       = 16                       # version < 3 clients can't handle more
 | 
				
			||||||
    #mem.warn-mlock                        = false
 | 
					    #mem.warn-mlock                        = false
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -281,20 +281,23 @@ struct pw_context *pw_context_new(struct pw_loop *main_loop,
 | 
				
			||||||
	if ((cpu = spa_support_find(this->support, n_support, SPA_TYPE_INTERFACE_CPU)) != NULL)
 | 
						if ((cpu = spa_support_find(this->support, n_support, SPA_TYPE_INTERFACE_CPU)) != NULL)
 | 
				
			||||||
		pw_properties_setf(properties, PW_KEY_CPU_MAX_ALIGN, "%u", spa_cpu_get_max_align(cpu));
 | 
							pw_properties_setf(properties, PW_KEY_CPU_MAX_ALIGN, "%u", spa_cpu_get_max_align(cpu));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lib = pw_properties_get(properties, PW_KEY_LIBRARY_NAME_DBUS);
 | 
						if ((str = pw_properties_get(properties, "support.dbus")) == NULL ||
 | 
				
			||||||
	if (lib == NULL)
 | 
						    pw_properties_parse_bool(str)) {
 | 
				
			||||||
		lib = "support/libspa-dbus";
 | 
							lib = pw_properties_get(properties, PW_KEY_LIBRARY_NAME_DBUS);
 | 
				
			||||||
 | 
							if (lib == NULL)
 | 
				
			||||||
 | 
								lib = "support/libspa-dbus";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	impl->dbus_handle = pw_load_spa_handle(lib,
 | 
							impl->dbus_handle = pw_load_spa_handle(lib,
 | 
				
			||||||
			SPA_NAME_SUPPORT_DBUS, NULL,
 | 
									SPA_NAME_SUPPORT_DBUS, NULL,
 | 
				
			||||||
			n_support, this->support);
 | 
									n_support, this->support);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (impl->dbus_handle == NULL ||
 | 
							if (impl->dbus_handle == NULL ||
 | 
				
			||||||
	    (res = spa_handle_get_interface(impl->dbus_handle,
 | 
							    (res = spa_handle_get_interface(impl->dbus_handle,
 | 
				
			||||||
						SPA_TYPE_INTERFACE_DBus, &dbus_iface)) < 0) {
 | 
												SPA_TYPE_INTERFACE_DBus, &dbus_iface)) < 0) {
 | 
				
			||||||
			pw_log_warn(NAME" %p: can't load dbus interface: %s", this, spa_strerror(res));
 | 
									pw_log_warn(NAME" %p: can't load dbus interface: %s", this, spa_strerror(res));
 | 
				
			||||||
	} else {
 | 
							} else {
 | 
				
			||||||
		this->support[n_support++] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, dbus_iface);
 | 
								this->support[n_support++] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, dbus_iface);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	this->n_support = n_support;
 | 
						this->n_support = n_support;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue