context: add object store

Add method to set and get typed objects from the context. This can
be used to pass around context objects between modules without having
to register them.
This commit is contained in:
Wim Taymans 2019-12-16 10:28:18 +01:00
parent 6cf6af6620
commit 1bca1b15ea
5 changed files with 62 additions and 0 deletions

View file

@ -1639,6 +1639,8 @@ int main(int argc, char *argv[])
pw_context_add_spa_lib(impl.this.context, "api.alsa.*", "alsa/libspa-alsa");
pw_context_add_spa_lib(impl.this.context, "api.v4l2.*", "v4l2/libspa-v4l2");
pw_context_set_object(impl.this.context, SM_TYPE_MEDIA_SESSION, &impl);
pw_map_init(&impl.globals, 64, 64);
spa_list_init(&impl.global_list);
pw_map_init(&impl.endpoint_links, 64, 64);