mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink-input, source-output: Add pa_sink_input/source_output_get_description()
This commit is contained in:
		
							parent
							
								
									94345677dc
								
							
						
					
					
						commit
						c5e1d505cb
					
				
					 4 changed files with 35 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -32,6 +32,7 @@
 | 
			
		|||
#include <pulse/util.h>
 | 
			
		||||
#include <pulse/internal.h>
 | 
			
		||||
 | 
			
		||||
#include <pulsecore/i18n.h>
 | 
			
		||||
#include <pulsecore/mix.h>
 | 
			
		||||
#include <pulsecore/core-subscribe.h>
 | 
			
		||||
#include <pulsecore/log.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -825,6 +826,20 @@ void pa_sink_input_put(pa_sink_input *i) {
 | 
			
		|||
    pa_sink_update_status(i->sink);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from the main thread. */
 | 
			
		||||
const char *pa_sink_input_get_description(pa_sink_input *i) {
 | 
			
		||||
    const char *description;
 | 
			
		||||
 | 
			
		||||
    pa_assert(i);
 | 
			
		||||
 | 
			
		||||
    description = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME);
 | 
			
		||||
 | 
			
		||||
    if (!description)
 | 
			
		||||
        description = _("(unnamed stream)");
 | 
			
		||||
 | 
			
		||||
    return description;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
void pa_sink_input_kill(pa_sink_input*i) {
 | 
			
		||||
    pa_sink_input_assert_ref(i);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -362,6 +362,8 @@ size_t pa_sink_input_get_max_request(pa_sink_input *i);
 | 
			
		|||
 | 
			
		||||
/* Callable by everyone from main thread*/
 | 
			
		||||
 | 
			
		||||
const char *pa_sink_input_get_description(pa_sink_input *i);
 | 
			
		||||
 | 
			
		||||
/* External code may request disconnection with this function */
 | 
			
		||||
void pa_sink_input_kill(pa_sink_input*i);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,6 +32,7 @@
 | 
			
		|||
#include <pulse/util.h>
 | 
			
		||||
#include <pulse/internal.h>
 | 
			
		||||
 | 
			
		||||
#include <pulsecore/i18n.h>
 | 
			
		||||
#include <pulsecore/mix.h>
 | 
			
		||||
#include <pulsecore/core-subscribe.h>
 | 
			
		||||
#include <pulsecore/log.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -692,6 +693,20 @@ void pa_source_output_put(pa_source_output *o) {
 | 
			
		|||
    pa_source_update_status(o->source);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from the main thread. */
 | 
			
		||||
const char *pa_source_output_get_description(pa_source_output *o) {
 | 
			
		||||
    const char *description;
 | 
			
		||||
 | 
			
		||||
    pa_assert(o);
 | 
			
		||||
 | 
			
		||||
    description = pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME);
 | 
			
		||||
 | 
			
		||||
    if (!description)
 | 
			
		||||
        description = _("(unnamed stream)");
 | 
			
		||||
 | 
			
		||||
    return description;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
void pa_source_output_kill(pa_source_output*o) {
 | 
			
		||||
    pa_source_output_assert_ref(o);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -305,7 +305,9 @@ int pa_source_output_update_rate(pa_source_output *o);
 | 
			
		|||
 | 
			
		||||
size_t pa_source_output_get_max_rewind(pa_source_output *o);
 | 
			
		||||
 | 
			
		||||
/* Callable by everyone */
 | 
			
		||||
/* Callable by everyone from the main thread. */
 | 
			
		||||
 | 
			
		||||
const char *pa_source_output_get_description(pa_source_output *o);
 | 
			
		||||
 | 
			
		||||
/* External code may request disconnection with this function */
 | 
			
		||||
void pa_source_output_kill(pa_source_output*o);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue