mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
allow setting properties for modules, too
This commit is contained in:
parent
fe703013ad
commit
b43a45d184
9 changed files with 61 additions and 9 deletions
|
|
@ -480,13 +480,16 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_module_info i;
|
||||
pa_bool_t auto_unload = FALSE;
|
||||
|
||||
memset(&i, 0, sizeof(i));
|
||||
i.proplist = pa_proplist_new();
|
||||
|
||||
if (pa_tagstruct_getu32(t, &i.index) < 0 ||
|
||||
pa_tagstruct_gets(t, &i.name) < 0 ||
|
||||
pa_tagstruct_gets(t, &i.argument) < 0 ||
|
||||
pa_tagstruct_getu32(t, &i.n_used) < 0 ||
|
||||
pa_tagstruct_get_boolean(t, &auto_unload) < 0) {
|
||||
(o->context->version < 15 && pa_tagstruct_get_boolean(t, &auto_unload) < 0) ||
|
||||
(o->context->version >= 15 && pa_tagstruct_get_proplist(t, i.proplist) < 0)) {
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -497,6 +500,8 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
pa_module_info_cb_t cb = (pa_module_info_cb_t) o->callback;
|
||||
cb(o->context, &i, 0, o->userdata);
|
||||
}
|
||||
|
||||
pa_proplist_free(i.proplist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@ typedef struct pa_module_info {
|
|||
/** \cond fulldocs */
|
||||
int auto_unload; /**< \deprecated Non-zero if this is an autoloaded module */
|
||||
/** \endcond */
|
||||
pa_proplist *proplist; /**< Property list \since 0.9.15 */
|
||||
} pa_module_info;
|
||||
|
||||
/** Callback prototype for pa_context_get_module_info() and firends*/
|
||||
|
|
|
|||
|
|
@ -128,6 +128,10 @@ PA_C_DECL_BEGIN
|
|||
#define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size"
|
||||
#define PA_PROP_DEVICE_PROFILE_NAME "device.profile.name"
|
||||
#define PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description"
|
||||
#define PA_PROP_MODULE_AUTHOR "module.author"
|
||||
#define PA_PROP_MODULE_DESCRIPTION "module.description"
|
||||
#define PA_PROP_MODULE_USAGE "module.usage"
|
||||
#define PA_PROP_MODULE_VERSION "module.version"
|
||||
|
||||
/** A property list object. Basically a dictionary with UTF-8 strings
|
||||
* as keys and arbitrary data as values. \since 0.9.11 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue