mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Use transport array instead of hashmap for devices
Devices will have zero or one transports per profile, and besides the typical lookup is also profile-based. Therefore, replace the old hashmap (which used the transport path as key) with a simple array which holds a transport pointer per profile.
This commit is contained in:
		
							parent
							
								
									51d28e6331
								
							
						
					
					
						commit
						faaf8cd39e
					
				
					 2 changed files with 20 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -63,6 +63,8 @@ enum profile {
 | 
			
		|||
    PROFILE_OFF
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define PA_BLUETOOTH_PROFILE_COUNT PROFILE_OFF
 | 
			
		||||
 | 
			
		||||
/* Hook data: pa_bluetooth_transport pointer. */
 | 
			
		||||
typedef enum pa_bluetooth_transport_hook {
 | 
			
		||||
    PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED, /* Call data: NULL. */
 | 
			
		||||
| 
						 | 
				
			
			@ -108,7 +110,7 @@ struct pa_bluetooth_device {
 | 
			
		|||
    /* Device information */
 | 
			
		||||
    char *name;
 | 
			
		||||
    char *path;
 | 
			
		||||
    pa_hashmap *transports;
 | 
			
		||||
    pa_bluetooth_transport *transports[PA_BLUETOOTH_PROFILE_COUNT];
 | 
			
		||||
    int paired;
 | 
			
		||||
    char *alias;
 | 
			
		||||
    PA_LLIST_HEAD(pa_bluetooth_uuid, uuids);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue