[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-265-gbae221c
Lennart Poettering
gitmailer-noreply at 0pointer.de
Thu Jan 15 11:49:16 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 47a2b17d01cc0dceb964df07d17e406726d50d45 (commit)
- Log -----------------------------------------------------------------
bae221c... rework module usage counter stuff to be pull based
edf88a5... don't show autoload flag anymore since it is obsolete
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-alsa-sink.c | 9 +++++++++
src/modules/module-alsa-source.c | 9 +++++++++
src/modules/module-defs.h.m4 | 2 ++
src/modules/module-esound-sink.c | 9 +++++++++
src/modules/module-jack-sink.c | 9 +++++++++
src/modules/module-jack-source.c | 9 +++++++++
src/modules/module-ladspa-sink.c | 9 +++++++++
src/modules/module-null-sink.c | 9 +++++++++
src/modules/module-pipe-sink.c | 9 +++++++++
src/modules/module-pipe-source.c | 9 +++++++++
src/modules/module-raop-sink.c | 9 +++++++++
src/modules/module-remap-sink.c | 9 +++++++++
src/modules/module-sine-source.c | 9 +++++++++
src/pulsecore/cli-text.c | 2 +-
src/pulsecore/module.c | 19 +++++++++----------
src/pulsecore/module.h | 5 ++---
src/pulsecore/protocol-native.c | 4 ++--
src/utils/pactl.c | 6 ++----
18 files changed, 126 insertions(+), 20 deletions(-)
-----------------------------------------------------------------------
commit edf88a515035e0544abc328c7b93053bfe475622
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Jan 15 20:48:29 2009 +0100
don't show autoload flag anymore since it is obsolete
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 65342bb..2fc1733 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -281,13 +281,11 @@ static void get_module_info_callback(pa_context *c, const pa_module_info *i, int
printf(_("*** Module #%u ***\n"
"Name: %s\n"
"Argument: %s\n"
- "Usage counter: %s\n"
- "Auto unload: %s\n"),
+ "Usage counter: %s\n"),
i->index,
i->name,
i->argument ? i->argument : "",
- i->n_used != PA_INVALID_INDEX ? t : _("n/a"),
- pa_yes_no(i->auto_unload));
+ i->n_used != PA_INVALID_INDEX ? t : _("n/a"));
}
static void get_client_info_callback(pa_context *c, const pa_client_info *i, int is_last, void *userdata) {
commit bae221cca97816e0ae0395ac1e561aa208cb0346
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Jan 15 20:49:12 2009 +0100
rework module usage counter stuff to be pull based
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 3fa0b5d..a3e818d 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -1610,6 +1610,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index 22e9ebf..901db01 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -1431,6 +1431,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_source_linked_by(u->source);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-defs.h.m4 b/src/modules/module-defs.h.m4
index 64ce192..f9924cf 100644
--- a/src/modules/module-defs.h.m4
+++ b/src/modules/module-defs.h.m4
@@ -18,9 +18,11 @@ gen_symbol(pa__get_description)
gen_symbol(pa__get_usage)
gen_symbol(pa__get_version)
gen_symbol(pa__load_once)
+gen_symbol(pa__get_n_used)
int pa__init(pa_module*m);
void pa__done(pa_module*m);
+int pa__get_n_used(pa_module*m);
const char* pa__get_author(void);
const char* pa__get_description(void);
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 14f1810..7c7f828 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -621,6 +621,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
pa_assert(m);
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c
index 555cb82..b448e84 100644
--- a/src/modules/module-jack-sink.c
+++ b/src/modules/module-jack-sink.c
@@ -430,6 +430,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c
index 9eccbbf..0c7ee53 100644
--- a/src/modules/module-jack-source.c
+++ b/src/modules/module-jack-source.c
@@ -398,6 +398,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_source_linked_by(u->source);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
pa_assert(m);
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 496e9ea..e746f34 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -770,6 +770,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
unsigned c;
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index daf9767..570f8be 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -324,6 +324,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 2b55c82..03e2717 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -315,6 +315,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 77310ca..975090c 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -302,6 +302,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_source_linked_by(u->source);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c
index 62f0a73..c324437 100644
--- a/src/modules/module-raop-sink.c
+++ b/src/modules/module-raop-sink.c
@@ -627,6 +627,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
pa_assert(m);
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index aa91406..e17fef0 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -415,6 +415,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_sink_linked_by(u->sink);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index 79d3b13..5626c2a 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -286,6 +286,15 @@ fail:
return -1;
}
+int pa__get_n_used(pa_module *m) {
+ struct userdata *u;
+
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
+
+ return pa_source_linked_by(u->source);
+}
+
void pa__done(pa_module*m) {
struct userdata *u;
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index 27db56e..0f4a273 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -62,7 +62,7 @@ char *pa_module_list_to_string(pa_core *c) {
m->index,
m->name,
pa_strempty(m->argument),
- m->n_used,
+ pa_module_get_n_used(m),
pa_yes_no(m->load_once));
}
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index b197ba0..c4dcb47 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -45,8 +45,7 @@
#define PA_SYMBOL_INIT "pa__init"
#define PA_SYMBOL_DONE "pa__done"
#define PA_SYMBOL_LOAD_ONCE "pa__load_once"
-
-#define UNLOAD_POLL_TIME 2
+#define PA_SYMBOL_GET_N_USED "pa__get_n_used"
pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
pa_module *m = NULL;
@@ -92,9 +91,9 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
}
m->done = (void (*)(pa_module*_m)) pa_load_sym(m->dl, name, PA_SYMBOL_DONE);
+ m->get_n_used = (int (*)(pa_module*_m)) pa_load_sym(m->dl, name, PA_SYMBOL_GET_N_USED);
m->userdata = NULL;
m->core = c;
- m->n_used = -1;
m->unload_requested = FALSE;
if (m->init(m) < 0) {
@@ -235,17 +234,17 @@ void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, pa_bool_t force
pa_module_unload_request(m, force);
}
-void pa_module_set_used(pa_module*m, int used) {
+pa_modinfo *pa_module_get_info(pa_module *m) {
pa_assert(m);
- if (m->n_used != used)
- pa_subscription_post(m->core, PA_SUBSCRIPTION_EVENT_MODULE|PA_SUBSCRIPTION_EVENT_CHANGE, m->index);
-
- m->n_used = used;
+ return pa_modinfo_get_by_handle(m->dl, m->name);
}
-pa_modinfo *pa_module_get_info(pa_module *m) {
+int pa_module_get_n_used(pa_module*m) {
pa_assert(m);
- return pa_modinfo_get_by_handle(m->dl, m->name);
+ if (!m->get_n_used)
+ return -1;
+
+ return m->get_n_used(m);
}
diff --git a/src/pulsecore/module.h b/src/pulsecore/module.h
index c54169b..986f0d2 100644
--- a/src/pulsecore/module.h
+++ b/src/pulsecore/module.h
@@ -39,11 +39,10 @@ struct pa_module {
int (*init)(pa_module*m);
void (*done)(pa_module*m);
+ int (*get_n_used)(pa_module *m);
void *userdata;
- int n_used;
-
pa_bool_t load_once:1;
pa_bool_t unload_requested:1;
};
@@ -58,7 +57,7 @@ void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, pa_bool_t force
void pa_module_unload_all(pa_core *c);
-void pa_module_set_used(pa_module*m, int used);
+int pa_module_get_n_used(pa_module*m);
#define PA_MODULE_AUTHOR(s) \
const char *pa__get_author(void) { return s; } \
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 0a070f4..af013da 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2731,8 +2731,8 @@ static void module_fill_tagstruct(pa_tagstruct *t, pa_module *module) {
pa_tagstruct_putu32(t, module->index);
pa_tagstruct_puts(t, module->name);
pa_tagstruct_puts(t, module->argument);
- pa_tagstruct_putu32(t, (uint32_t) module->n_used);
- pa_tagstruct_put_boolean(t, FALSE);
+ pa_tagstruct_putu32(t, (uint32_t) pa_module_get_n_used(module));
+ pa_tagstruct_put_boolean(t, FALSE); /* autoload is obsolete */
}
static void sink_input_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sink_input *s) {
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list