mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Fix bluetooth.nrec property not updated
PropertyChanged signal of org.BlueZ.MediaTransport is processed in pa_bluetooth_transport_parse_property() which updates t->nrec. This is called by : - First by filter_cb() of bluetooth-util.c - Then by filter_cb() of module-bluetooth-device.c which retrieve value of t->nrec before calling parse function, then it checks if t->nrec has changed before updating bluetooth.nrec property. As t->nrec has alreday been changed during first process, property update is never performed. This patch creates a new hook in pa_bluetooth_transport called PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED. The hook is fired by bluetooth-util.c when the transport's NREC property changes. module-bluetooth-device.c won't listen the PropertyChanged signal of MediaTransport anymore. Instead, it will use the hook in pa_bluetooth_transport to get a notification when the NREC property changes, and update the sink or source proplist accordingly. const qualifier for returned pointer of pa_bluetooth_discovery_get_transport() is removed.
This commit is contained in:
		
							parent
							
								
									a91359956f
								
							
						
					
					
						commit
						017e1c4dda
					
				
					 3 changed files with 47 additions and 26 deletions
				
			
		| 
						 | 
				
			
			@ -63,6 +63,12 @@ enum profile {
 | 
			
		|||
    PROFILE_OFF
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Hook data: pa_bluetooth_transport pointer. */
 | 
			
		||||
typedef enum pa_bluetooth_transport_hook {
 | 
			
		||||
    PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED, /* Call data: NULL. */
 | 
			
		||||
    PA_BLUETOOTH_TRANSPORT_HOOK_MAX
 | 
			
		||||
} pa_bluetooth_transport_hook_t;
 | 
			
		||||
 | 
			
		||||
struct pa_bluetooth_transport {
 | 
			
		||||
    pa_bluetooth_discovery *y;
 | 
			
		||||
    char *path;
 | 
			
		||||
| 
						 | 
				
			
			@ -71,6 +77,8 @@ struct pa_bluetooth_transport {
 | 
			
		|||
    uint8_t *config;
 | 
			
		||||
    int config_size;
 | 
			
		||||
    pa_bool_t nrec;
 | 
			
		||||
 | 
			
		||||
    pa_hook hooks[PA_BLUETOOTH_TRANSPORT_HOOK_MAX];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* This enum is shared among Audio, Headset, AudioSink, and AudioSource, although not all values are acceptable in all profiles */
 | 
			
		||||
| 
						 | 
				
			
			@ -124,7 +132,7 @@ void pa_bluetooth_discovery_sync(pa_bluetooth_discovery *d);
 | 
			
		|||
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path);
 | 
			
		||||
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
 | 
			
		||||
 | 
			
		||||
const pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path);
 | 
			
		||||
pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path);
 | 
			
		||||
const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile);
 | 
			
		||||
 | 
			
		||||
int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue