mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: a2dp-sink: support duplex codec
Allow running a2dp-sink using the duplex codec, when the local endpoint is the A2DP sink.
This commit is contained in:
		
							parent
							
								
									1a5ec4452f
								
							
						
					
					
						commit
						f593a44069
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
					@ -137,6 +137,8 @@ struct impl {
 | 
				
			||||||
	unsigned int started:1;
 | 
						unsigned int started:1;
 | 
				
			||||||
	unsigned int following:1;
 | 
						unsigned int following:1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						unsigned int is_duplex:1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct spa_source source;
 | 
						struct spa_source source;
 | 
				
			||||||
	int timerfd;
 | 
						int timerfd;
 | 
				
			||||||
	struct spa_source flush_source;
 | 
						struct spa_source flush_source;
 | 
				
			||||||
| 
						 | 
					@ -1697,6 +1699,9 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_list_init(&port->ready);
 | 
						spa_list_init(&port->ready);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (info && (str = spa_dict_lookup(info, "api.bluez5.a2dp-duplex")) != NULL)
 | 
				
			||||||
 | 
							this->is_duplex = spa_atob(str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (info && (str = spa_dict_lookup(info, SPA_KEY_API_BLUEZ5_TRANSPORT)))
 | 
						if (info && (str = spa_dict_lookup(info, SPA_KEY_API_BLUEZ5_TRANSPORT)))
 | 
				
			||||||
		sscanf(str, "pointer:%p", &this->transport);
 | 
							sscanf(str, "pointer:%p", &this->transport);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1708,7 +1713,17 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
		spa_log_error(this->log, "a transport codec is needed");
 | 
							spa_log_error(this->log, "a transport codec is needed");
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this->codec = this->transport->a2dp_codec;
 | 
						this->codec = this->transport->a2dp_codec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (this->is_duplex) {
 | 
				
			||||||
 | 
							if (!this->codec->duplex_codec) {
 | 
				
			||||||
 | 
								spa_log_error(this->log, "transport codec doesn't support duplex");
 | 
				
			||||||
 | 
								return -EINVAL;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							this->codec = this->codec->duplex_codec;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (this->codec->init_props != NULL)
 | 
						if (this->codec->init_props != NULL)
 | 
				
			||||||
		this->codec_props = this->codec->init_props(this->codec,
 | 
							this->codec_props = this->codec->init_props(this->codec,
 | 
				
			||||||
					this->transport->device->settings);
 | 
										this->transport->device->settings);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue