core: add some core properties to the global

This commit is contained in:
Wim Taymans 2018-01-19 16:10:32 +01:00
parent 4384097227
commit 8da8dbe025
2 changed files with 10 additions and 1 deletions

View file

@ -393,7 +393,12 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro
this->global = pw_global_new(this, this->global = pw_global_new(this,
this->type.core, this->type.core,
PW_VERSION_CORE, PW_VERSION_CORE,
NULL, pw_properties_new(
PW_CORE_PROP_USER_NAME, this->info.user_name,
PW_CORE_PROP_HOST_NAME, this->info.host_name,
PW_CORE_PROP_NAME, this->info.name,
PW_CORE_PROP_VERSION, this->info.version,
NULL),
core_bind_func, core_bind_func,
this); this);
if (this->global != NULL) { if (this->global != NULL) {

View file

@ -105,6 +105,10 @@ struct pw_core_events {
void (*global_removed) (void *data, struct pw_global *global); void (*global_removed) (void *data, struct pw_global *global);
}; };
/** The user name that started the core */
#define PW_CORE_PROP_USER_NAME "pipewire.core.user-name"
/** The host name of the machine */
#define PW_CORE_PROP_HOST_NAME "pipewire.core.host-name"
/** The name of the core. Default is pipewire-<user-name>-<pid> */ /** The name of the core. Default is pipewire-<user-name>-<pid> */
#define PW_CORE_PROP_NAME "pipewire.core.name" #define PW_CORE_PROP_NAME "pipewire.core.name"
/** The version of the core. */ /** The version of the core. */