mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink,source: Add a helper function to check whether this is a filter
This commit is contained in:
		
							parent
							
								
									5adb126259
								
							
						
					
					
						commit
						81f7589a3f
					
				
					 5 changed files with 22 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -356,7 +356,7 @@ static void find_filters_for_module(struct userdata *u, pa_module *m, const char
 | 
			
		|||
 | 
			
		||||
    PA_IDXSET_FOREACH(sink, u->core->sinks, idx) {
 | 
			
		||||
        if (sink->module == m) {
 | 
			
		||||
            pa_assert(sink->input_to_master != NULL);
 | 
			
		||||
            pa_assert(pa_sink_is_filter(sink));
 | 
			
		||||
 | 
			
		||||
            fltr = filter_new(name, sink->input_to_master->sink, NULL);
 | 
			
		||||
            fltr->module_index = m->index;
 | 
			
		||||
| 
						 | 
				
			
			@ -368,7 +368,7 @@ static void find_filters_for_module(struct userdata *u, pa_module *m, const char
 | 
			
		|||
 | 
			
		||||
    PA_IDXSET_FOREACH(source, u->core->sources, idx) {
 | 
			
		||||
        if (source->module == m && !source->monitor_of) {
 | 
			
		||||
            pa_assert(source->output_from_master != NULL);
 | 
			
		||||
            pa_assert(pa_source_is_filter(source));
 | 
			
		||||
 | 
			
		||||
            if (!fltr) {
 | 
			
		||||
                fltr = filter_new(name, NULL, source->output_from_master->source);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -580,7 +580,7 @@ void pa_sink_put(pa_sink* s) {
 | 
			
		|||
    pa_assert_ctl_context();
 | 
			
		||||
 | 
			
		||||
    pa_assert(s->state == PA_SINK_INIT);
 | 
			
		||||
    pa_assert(!(s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER) || s->input_to_master);
 | 
			
		||||
    pa_assert(!(s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER) || pa_sink_is_filter(s));
 | 
			
		||||
 | 
			
		||||
    /* The following fields must be initialized properly when calling _put() */
 | 
			
		||||
    pa_assert(s->asyncmsgq);
 | 
			
		||||
| 
						 | 
				
			
			@ -1557,6 +1557,13 @@ pa_sink *pa_sink_get_master(pa_sink *s) {
 | 
			
		|||
    return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
bool pa_sink_is_filter(pa_sink *s) {
 | 
			
		||||
    pa_sink_assert_ref(s);
 | 
			
		||||
 | 
			
		||||
    return (s->input_to_master != NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
bool pa_sink_is_passthrough(pa_sink *s) {
 | 
			
		||||
    pa_sink_input *alt_i;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -440,6 +440,8 @@ bool pa_sink_flat_volume_enabled(pa_sink *s);
 | 
			
		|||
/* Get the master sink when sharing volumes */
 | 
			
		||||
pa_sink *pa_sink_get_master(pa_sink *s);
 | 
			
		||||
 | 
			
		||||
bool pa_sink_is_filter(pa_sink *s);
 | 
			
		||||
 | 
			
		||||
/* Is the sink in passthrough mode? (that is, is there a passthrough sink input
 | 
			
		||||
 * connected to this sink? */
 | 
			
		||||
bool pa_sink_is_passthrough(pa_sink *s);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -531,7 +531,7 @@ void pa_source_put(pa_source *s) {
 | 
			
		|||
    pa_assert_ctl_context();
 | 
			
		||||
 | 
			
		||||
    pa_assert(s->state == PA_SOURCE_INIT);
 | 
			
		||||
    pa_assert(!(s->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER) || s->output_from_master);
 | 
			
		||||
    pa_assert(!(s->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER) || pa_source_is_filter(s));
 | 
			
		||||
 | 
			
		||||
    /* The following fields must be initialized properly when calling _put() */
 | 
			
		||||
    pa_assert(s->asyncmsgq);
 | 
			
		||||
| 
						 | 
				
			
			@ -1172,6 +1172,13 @@ pa_source *pa_source_get_master(pa_source *s) {
 | 
			
		|||
    return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
bool pa_source_is_filter(pa_source *s) {
 | 
			
		||||
    pa_source_assert_ref(s);
 | 
			
		||||
 | 
			
		||||
    return (s->output_from_master != NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
bool pa_source_is_passthrough(pa_source *s) {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -371,6 +371,8 @@ bool pa_source_flat_volume_enabled(pa_source *s);
 | 
			
		|||
/* Get the master source when sharing volumes */
 | 
			
		||||
pa_source *pa_source_get_master(pa_source *s);
 | 
			
		||||
 | 
			
		||||
bool pa_source_is_filter(pa_source *s);
 | 
			
		||||
 | 
			
		||||
/* Is the source in passthrough mode? (that is, is this a monitor source for a sink
 | 
			
		||||
 * that has a passthrough sink input connected to it. */
 | 
			
		||||
bool pa_source_is_passthrough(pa_source *s);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue