bluez5: add info key indicating glib mainloop is usable

This commit is contained in:
Pauli Virtanen 2022-11-19 12:59:34 +02:00 committed by Wim Taymans
parent 93a473eff6
commit 25f36e4334
3 changed files with 16 additions and 0 deletions

View file

@ -136,6 +136,10 @@ extern "C" {
#define SPA_KEY_API_JACK_SERVER "api.jack.server" /**< a jack server name */
#define SPA_KEY_API_JACK_CLIENT "api.jack.client" /**< an internal jack client */
/** keys for glib api */
#define SPA_KEY_API_GLIB_MAINLOOP "api.glib.mainloop" /**< whether glib mainloop runs
* in same thread as PW loop */
/**
* \}
*/

View file

@ -807,6 +807,12 @@ impl_init(const struct spa_handle_factory *factory,
spa_log_topic_init(this->log, &log_topic);
if (!(info && spa_atob(spa_dict_lookup(info, SPA_KEY_API_GLIB_MAINLOOP)))) {
spa_log_error(this->log, "Glib mainloop is not usable: %s not set",
SPA_KEY_API_GLIB_MAINLOOP);
return -EINVAL;
}
spa_hook_list_init(&this->hooks);
this->device.iface = SPA_INTERFACE_INIT(

View file

@ -1953,6 +1953,12 @@ impl_init(const struct spa_handle_factory *factory,
spa_log_topic_init(this->log, &log_topic);
if (!(info && spa_atob(spa_dict_lookup(info, SPA_KEY_API_GLIB_MAINLOOP)))) {
spa_log_error(this->log, "Glib mainloop is not usable: %s not set",
SPA_KEY_API_GLIB_MAINLOOP);
return -EINVAL;
}
if (this->data_loop == NULL) {
spa_log_error(this->log, "a data loop is needed");
return -EINVAL;