Commit graph

7350 commits

Author SHA1 Message Date
Arun Raghavan
0a5f3bfaf0 hashmap: Add a key+value iterator 2013-09-29 19:15:39 +03:00
João Paulo Rechi Vita
8753b8c147 bluetooth: Revive module-bluetooth-discover
Create a wrapper module called module-bluetooth-discover to avoid
breaking backward-compatibility of default.pa. This wrapper may
eventually be dropped altoghether with BlueZ 4 support.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
1ea8a2bdae cli-command: Use pa_module_exists() in .ifexists 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
48d23d4863 module: Create pa_module_exists()
This new function checks if a certain module name is available in the
system.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
dc4be17e07 bluetooth: Fail to load driver if discovery module is not loaded
For quite some time now the device driver module doesn't work well
without the discovery module, so for the BlueZ 5 support we'll prevent
the device driver module to be loaded if the discovery module is not
loaded.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
774c73309d bluetooth: Implement get_n_used() for module-bluez5-device 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
ef24f7f3aa bluetooth: Handle changes to BlueZ 5 transports state 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
8d303f0bd1 bluetooth: Process source messages for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
05366fdc22 bluetooth: Process sink messages for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
eb9813c833 bluetooth: Create I/O thread function for BlueZ 5 cards
Create the thread function, the render and push functions for A2DP, the
process message function for communication between the I/O thread and
the main thread, and other helper functions related to them.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
44462904df bluetooth: Set card profile for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
d243fdd07b bluetooth: Start / stop I/O thread for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
8d1decffd7 bluetooth: Create source for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
0274032141 bluetooth: Create sink for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
7e80678cc5 bluetooth: Initialize profiles for BlueZ 5 cards
Initialized the currently active profile, configure and acquire the
transport.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
a0ed6d7970 bluetooth: Create BlueZ 5 card profile for each audio UUID 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
5a9007338b bluetooth: Create BlueZ 5 card ports 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
501f5e2898 bluetooth: Create BlueZ 5 card 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
6ba1610b6f bluetooth: Unload module-bluez5-device on device's disconnection 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
da61957602 bluetooth: Get BlueZ 5 device object
Get the remote device information stored in pa_bluetooth_discovery. This
also creates the mandatory parameter 'path' for module-bluez5-device,
which is used to inform the object path of the remote device in BlueZ on
the module load.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
384f4751eb bluetooth: Create module-bluez5-device 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
a5fdf965ed bluetooth: Track devices in module-bluez5-discover 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
e352da60a7 bluetooth: Handle PropertiesChanged for org.bluez.MediaTransport1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
f65cafe64d bluetooth: Handle PropertiesChanged for org.bluez.Device1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
82fd8cc845 bluetooth: Protect from a misbehaving bluetoothd
bluetoothd always send the GetManagedObjects() reply messages with the
objects array argument following an in-depth order starting from the
root. That means parents will always be known at the time their children
objects are parsed, if clients parse the objects in the same order they
appear in the array, as we do in PulseAudio.

This commit tries to protect PulseAudio in the case bluetoothd changes
that behavior for some reason. It hasn't been tested, since this
situation never occurs.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
89e97215c7 bluetooth: Parse BlueZ 5 device properties
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
877f0a7d54 bluetooth: Handle PropertiesChanged for org.bluez.Adapter1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
a59177e666 bluetooth: Register endpoints with BlueZ 5 adapter 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
42dccb6b37 bluetooth: Parse BlueZ 5 adapter properties 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
f1d8958fb6 bluetooth: Parse BlueZ 5 D-Bus interfaces
Parse the arguments of the InterfacesAdded signal and the
GetManagedObjects() reply.

This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
878eccb680 bluetooth: Handle InterfacesAdded and InterfacesRemoved
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
1e58120a5c bluetooth: Create a function to remove only one adapter object 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
b8edddddd3 bluetooth: Get managed objects
Get objects from the BlueZ 5 object manager. This code is based on
previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
d186d0f105 bluetooth: Add utility function to send D-Bus messages with reply 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
63108c5cc8 bluetooth: Implement org.bluez.MediaEndpoint1.ClearConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
2594909338 bluetooth: Implement org.bluez.MediaEndpoint1.SelectConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
449d6cb1e2 bluetooth: Implement org.bluez.MediaEndpoint1.SetConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
aff6fa79ba bluetooth: Register MediaEndpoint1 objects with D-Bus 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
e78e7e698c bluetooth: Create pa_bluetooth_transport for BlueZ 5 support
Create the pa_bluetooth_transport structure to store information about
the bluetooth transport and utility functions to manipulate this
structure. The acquire() and release() operations are function pointers
in the pa_bluetooth_transport structure to make possible for different
transport backends to provide different implementations of these
operations. Thre is also a userdata field for the transport backend
provide data for the acquire/release functions.

This commit also creates a new function
pa_bluetooth_device_any_transport_connected() to check if there is any
audio connection between the host and a remote device.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
c3efb24aa7 bluetooth: Remove all devices and adapters when org.bluez goes away 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
9be71b5838 bluetooth: Create pa_bluetooth_device for BlueZ 5 support
Create a structure pa_bluetooth_device to store information about the
bluetooth device and utility functions to manipulate this structure.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
546da17cbe bluetooth: Create pa_bluetooth_adapter for BlueZ 5 support 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
19a23cef10 bluetooth: Create infrastrucure for bluetooth hooks
Create a pa_bluetooth_hook enum type and API to get pa_hooks from the
opaque pa_bluetooth_discovery struct.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
dcc28a23f9 bluetooth: Track org.bluez for BlueZ 5 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
0103cd1379 bluetooth: Create pa_bluetooth_discovery for BlueZ 5
pa_bluetooth_discovery is the struct that holds information about known
Bluetooth audio devices and other information about the Bluetooth stack.

This commit also creates bluez5-util.[ch], which will hold a lot of
utility functions to help with the BlueZ 5 support.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
c706792df7 bluetooth: Create stub for module-bluez5-discover 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
795e488f25 build: Add support for enabling/disabling BlueZ 5 support 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
d7d3a1e2b2 build: Make the build of bluetooth modules BlueZ 4 specific 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
4f972aa993 bluetooth: Remove module-bluetooth-proximity
module-bluetooth-proximity has not worked for quite a while, since it
uses pre-BlueZ4 APIs. Nobody complained since then, which is a good
indication that it doesn't have much users. Even the original commit
message refers to it more as a toy than as something of great use: "add
new fun module that automatically mutes your audio devices when you
leave with your bluetooth phone, and unmutes when you come back"

Removing it we completely remove the dependency on libbluetooth.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
e647e74f32 bluetooth: Prefix BlueZ 4 card profiles enum with PA_BLUEZ4_
Also typedef the enum as pa_bluez4_profile_t.
2013-09-29 16:54:36 +03:00