mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: add property to force VM
Also add PIPEWIRE_VM to force a VM type.
This commit is contained in:
		
							parent
							
								
									ce828af9e1
								
							
						
					
					
						commit
						f27ad659f8
					
				
					 3 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -140,6 +140,7 @@ struct spa_cpu_methods {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** keys can be given when initializing the cpu handle */
 | 
					/** keys can be given when initializing the cpu handle */
 | 
				
			||||||
#define SPA_KEY_CPU_FORCE		"cpu.force"		/**< force cpu flags */
 | 
					#define SPA_KEY_CPU_FORCE		"cpu.force"		/**< force cpu flags */
 | 
				
			||||||
 | 
					#define SPA_KEY_CPU_VM_TYPE		"cpu.vm.type"		/**< force a VM type */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}  /* extern "C" */
 | 
					}  /* extern "C" */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -259,6 +259,8 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
	if (info) {
 | 
						if (info) {
 | 
				
			||||||
		if ((str = spa_dict_lookup(info, SPA_KEY_CPU_FORCE)) != NULL)
 | 
							if ((str = spa_dict_lookup(info, SPA_KEY_CPU_FORCE)) != NULL)
 | 
				
			||||||
			this->flags = atoi(str);
 | 
								this->flags = atoi(str);
 | 
				
			||||||
 | 
							if ((str = spa_dict_lookup(info, SPA_KEY_CPU_VM_TYPE)) != NULL)
 | 
				
			||||||
 | 
								this->vm_type = atoi(str);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(this->log, NAME " %p: count:%d align:%d flags:%08x",
 | 
						spa_log_debug(this->log, NAME " %p: count:%d align:%d flags:%08x",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -538,6 +538,8 @@ void pw_init(int *argc, char **argv[])
 | 
				
			||||||
	n_items = 0;
 | 
						n_items = 0;
 | 
				
			||||||
	if ((str = getenv("PIPEWIRE_CPU")))
 | 
						if ((str = getenv("PIPEWIRE_CPU")))
 | 
				
			||||||
		items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_CPU_FORCE, str);
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_CPU_FORCE, str);
 | 
				
			||||||
 | 
						if ((str = getenv("PIPEWIRE_VM")))
 | 
				
			||||||
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_CPU_VM_TYPE, str);
 | 
				
			||||||
	info = SPA_DICT_INIT(items, n_items);
 | 
						info = SPA_DICT_INIT(items, n_items);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	add_interface(support, SPA_NAME_SUPPORT_CPU, SPA_TYPE_INTERFACE_CPU, &info);
 | 
						add_interface(support, SPA_NAME_SUPPORT_CPU, SPA_TYPE_INTERFACE_CPU, &info);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue