mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Add support for Media API
Make use of D-Bus to transfer file descriptors.
This commit is contained in:
		
							parent
							
								
									3de129f3ac
								
							
						
					
					
						commit
						8f3ef04b43
					
				
					 4 changed files with 1112 additions and 75 deletions
				
			
		| 
						 | 
				
			
			@ -25,6 +25,7 @@
 | 
			
		|||
#include <dbus/dbus.h>
 | 
			
		||||
 | 
			
		||||
#include <pulsecore/llist.h>
 | 
			
		||||
#include <pulsecore/strlist.h>
 | 
			
		||||
#include <pulsecore/macro.h>
 | 
			
		||||
#include <pulsecore/core-util.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -45,6 +46,7 @@
 | 
			
		|||
typedef struct pa_bluetooth_uuid pa_bluetooth_uuid;
 | 
			
		||||
typedef struct pa_bluetooth_device pa_bluetooth_device;
 | 
			
		||||
typedef struct pa_bluetooth_discovery pa_bluetooth_discovery;
 | 
			
		||||
typedef struct pa_bluetooth_transport pa_bluetooth_transport;
 | 
			
		||||
 | 
			
		||||
struct userdata;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -53,6 +55,23 @@ struct pa_bluetooth_uuid {
 | 
			
		|||
    PA_LLIST_FIELDS(pa_bluetooth_uuid);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum profile {
 | 
			
		||||
    PROFILE_A2DP,
 | 
			
		||||
    PROFILE_A2DP_SOURCE,
 | 
			
		||||
    PROFILE_HSP,
 | 
			
		||||
    PROFILE_HFGW,
 | 
			
		||||
    PROFILE_OFF
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct pa_bluetooth_transport {
 | 
			
		||||
    pa_bluetooth_discovery *y;
 | 
			
		||||
    char *path;
 | 
			
		||||
    enum profile profile;
 | 
			
		||||
    uint8_t codec;
 | 
			
		||||
    uint8_t *config;
 | 
			
		||||
    int config_size;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* This enum is shared among Audio, Headset, AudioSink, and AudioSource, although not all values are acceptable in all profiles */
 | 
			
		||||
typedef enum pa_bt_audio_state {
 | 
			
		||||
    PA_BT_AUDIO_STATE_INVALID = -1,
 | 
			
		||||
| 
						 | 
				
			
			@ -70,6 +89,7 @@ struct pa_bluetooth_device {
 | 
			
		|||
    /* Device information */
 | 
			
		||||
    char *name;
 | 
			
		||||
    char *path;
 | 
			
		||||
    pa_hashmap *transports;
 | 
			
		||||
    int paired;
 | 
			
		||||
    char *alias;
 | 
			
		||||
    int device_connected;
 | 
			
		||||
| 
						 | 
				
			
			@ -103,6 +123,12 @@ 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);
 | 
			
		||||
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);
 | 
			
		||||
void pa_bluetooth_transport_release(const pa_bluetooth_transport *t, const char *accesstype);
 | 
			
		||||
 | 
			
		||||
pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *d);
 | 
			
		||||
 | 
			
		||||
const char* pa_bluetooth_get_form_factor(uint32_t class);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue