mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	prop: introduce new PA_PROP_DEVICE_INTENDED_ROLES property
This commit is contained in:
		
							parent
							
								
									12d53826f6
								
							
						
					
					
						commit
						f13bbd576f
					
				
					 7 changed files with 28 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -177,6 +177,7 @@ pa_sink* pa_sink_new(
 | 
			
		|||
 | 
			
		||||
    pa_device_init_description(data->proplist);
 | 
			
		||||
    pa_device_init_icon(data->proplist, TRUE);
 | 
			
		||||
    pa_device_init_intended_roles(data->proplist);
 | 
			
		||||
 | 
			
		||||
    if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_SINK_FIXATE], data) < 0) {
 | 
			
		||||
        pa_xfree(s);
 | 
			
		||||
| 
						 | 
				
			
			@ -2287,3 +2288,19 @@ pa_bool_t pa_device_init_description(pa_proplist *p) {
 | 
			
		|||
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pa_bool_t pa_device_init_intended_roles(pa_proplist *p) {
 | 
			
		||||
    const char *s;
 | 
			
		||||
    pa_assert(p);
 | 
			
		||||
 | 
			
		||||
    if (pa_proplist_contains(p, PA_PROP_DEVICE_INTENDED_ROLES))
 | 
			
		||||
        return TRUE;
 | 
			
		||||
 | 
			
		||||
    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR)))
 | 
			
		||||
        if (pa_streq(s, "handset") || pa_streq(s, "hands-free")) {
 | 
			
		||||
            pa_proplist_sets(p, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
 | 
			
		||||
            return TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue