mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: add info key indicating glib mainloop is usable
This commit is contained in:
		
							parent
							
								
									93a473eff6
								
							
						
					
					
						commit
						25f36e4334
					
				
					 3 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
					@ -136,6 +136,10 @@ extern "C" {
 | 
				
			||||||
#define SPA_KEY_API_JACK_SERVER		"api.jack.server"		/**< a jack server name */
 | 
					#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 */
 | 
					#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 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * \}
 | 
					 * \}
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -807,6 +807,12 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_topic_init(this->log, &log_topic);
 | 
						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);
 | 
						spa_hook_list_init(&this->hooks);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this->device.iface = SPA_INTERFACE_INIT(
 | 
						this->device.iface = SPA_INTERFACE_INIT(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1953,6 +1953,12 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_topic_init(this->log, &log_topic);
 | 
						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) {
 | 
						if (this->data_loop == NULL) {
 | 
				
			||||||
		spa_log_error(this->log, "a data loop is needed");
 | 
							spa_log_error(this->log, "a data loop is needed");
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue