mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	core: Added new hooks: PA_CORE_HOOK_SOURCE_PORT_CHANGED and PA_CORE_HOOK_SINK_PORT_CHANGED
This allows modules to know when certain ports are changed. This will allow e.g. a filter module (or LADSAP) to only load when a certain port is used on the device (e.g. to only filter headphones and not normal speakers). (Comment from Colin Guthrie: This may also have use in UCM)
This commit is contained in:
		
							parent
							
								
									6bd32ee2d9
								
							
						
					
					
						commit
						9379d4015c
					
				
					 3 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -74,6 +74,7 @@ typedef enum pa_core_hook {
 | 
				
			||||||
    PA_CORE_HOOK_SINK_UNLINK_POST,
 | 
					    PA_CORE_HOOK_SINK_UNLINK_POST,
 | 
				
			||||||
    PA_CORE_HOOK_SINK_STATE_CHANGED,
 | 
					    PA_CORE_HOOK_SINK_STATE_CHANGED,
 | 
				
			||||||
    PA_CORE_HOOK_SINK_PROPLIST_CHANGED,
 | 
					    PA_CORE_HOOK_SINK_PROPLIST_CHANGED,
 | 
				
			||||||
 | 
					    PA_CORE_HOOK_SINK_PORT_CHANGED,
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_NEW,
 | 
					    PA_CORE_HOOK_SOURCE_NEW,
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_FIXATE,
 | 
					    PA_CORE_HOOK_SOURCE_FIXATE,
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_PUT,
 | 
					    PA_CORE_HOOK_SOURCE_PUT,
 | 
				
			||||||
| 
						 | 
					@ -81,6 +82,7 @@ typedef enum pa_core_hook {
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_UNLINK_POST,
 | 
					    PA_CORE_HOOK_SOURCE_UNLINK_POST,
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_STATE_CHANGED,
 | 
					    PA_CORE_HOOK_SOURCE_STATE_CHANGED,
 | 
				
			||||||
    PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED,
 | 
					    PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED,
 | 
				
			||||||
 | 
					    PA_CORE_HOOK_SOURCE_PORT_CHANGED,
 | 
				
			||||||
    PA_CORE_HOOK_SINK_INPUT_NEW,
 | 
					    PA_CORE_HOOK_SINK_INPUT_NEW,
 | 
				
			||||||
    PA_CORE_HOOK_SINK_INPUT_FIXATE,
 | 
					    PA_CORE_HOOK_SINK_INPUT_FIXATE,
 | 
				
			||||||
    PA_CORE_HOOK_SINK_INPUT_PUT,
 | 
					    PA_CORE_HOOK_SINK_INPUT_PUT,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2700,6 +2700,8 @@ int pa_sink_set_port(pa_sink *s, const char *name, pa_bool_t save) {
 | 
				
			||||||
    s->active_port = port;
 | 
					    s->active_port = port;
 | 
				
			||||||
    s->save_port = save;
 | 
					    s->save_port = save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_PORT_CHANGED], s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1571,5 +1571,7 @@ int pa_source_set_port(pa_source *s, const char *name, pa_bool_t save) {
 | 
				
			||||||
    s->active_port = port;
 | 
					    s->active_port = port;
 | 
				
			||||||
    s->save_port = save;
 | 
					    s->save_port = save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PORT_CHANGED], s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue