mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add pa_sink_used_by()/pa_source_used_by()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1226 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b45c39269f
commit
b5207fc9ca
4 changed files with 24 additions and 1 deletions
|
|
@ -556,3 +556,17 @@ void pa_sink_set_description(pa_sink *s, const char *description) {
|
|||
|
||||
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
|
||||
}
|
||||
|
||||
unsigned pa_sink_used_by(pa_sink *s) {
|
||||
unsigned ret;
|
||||
|
||||
assert(s);
|
||||
assert(s->ref >= 1);
|
||||
|
||||
ret = pa_idxset_size(s->inputs);
|
||||
|
||||
if (s->monitor_source)
|
||||
ret += pa_source_used_by(s->monitor_source);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,4 +103,6 @@ int pa_sink_get_mute(pa_sink *sink, pa_mixer_t m);
|
|||
|
||||
void pa_sink_set_description(pa_sink *s, const char *description);
|
||||
|
||||
unsigned pa_sink_used_by(pa_sink *s);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -333,3 +333,10 @@ void pa_source_set_description(pa_source *s, const char *description) {
|
|||
|
||||
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
|
||||
}
|
||||
|
||||
unsigned pa_source_used_by(pa_source *s) {
|
||||
assert(s);
|
||||
assert(s->ref >= 1);
|
||||
|
||||
return pa_idxset_size(s->outputs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,5 +104,5 @@ int pa_source_get_mute(pa_source *source, pa_mixer_t m);
|
|||
|
||||
void pa_source_set_description(pa_source *s, const char *description);
|
||||
|
||||
|
||||
unsigned pa_source_used_by(pa_source *s);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue