Skip to contentSkip to conversation

Remove HFP implementation

PATCH In review Luiz Augusto von Dentz 2 participants 20 messages Nov 13, 2012

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

cover Remove HFP implementation

From: Luiz Augusto von Dentz <[email protected]>

These changes remove HFP implemention from audio plugin and move audio under profiles directory.

HFP can be emulated by test-profile -u hfp, all the telephony backends are gone as well since this is now suppose to be a external profile probably done inside the telephony stack e.g. oFono in use in the platform.

Luiz Augusto von Dentz (13):
audio: Remove HFP and HSP headset role support
audio: Remove HFP option from audio.conf
audio: Remove code using headset
build: Remove telephony-maemo5.c
build: Remove telephony-maemo6.c
build: Remove telephony-ofono.c
build: Remove telephony-dummy.c
build: Remove telephony.h
build: Remove headset.c and headset.h
audio: Remove code HFP and HS gateway role
build: Remove gateway.c and gateway.h
audio: Move to profiles directory
audio: Add support for passing endpoints as custom property

 Makefile.am                             |   48 +-
 audio/gateway.c                         | 1048 ------------
 audio/gateway.h                         |   75 -
 audio/headset.c                         | 2825 -------------------------------
 audio/headset.h                         |  112 --
 audio/manager.c                         | 1387 ---------------
 audio/telephony-dummy.c                 |  444 -----
 audio/telephony-maemo5.c                | 2102 -----------------------
 audio/telephony-maemo6.c                | 2196 ------------------------
 audio/telephony-ofono.c                 | 1636 ------------------
 audio/telephony.h                       |  244 ---
 {audio => profiles/audio}/a2dp-codecs.h |    0
 {audio => profiles/audio}/a2dp.c        |    0
 {audio => profiles/audio}/a2dp.h        |    0
 {audio => profiles/audio}/audio.conf    |    4 -
 {audio => profiles/audio}/avctp.c       |    0
 {audio => profiles/audio}/avctp.h       |    0
 {audio => profiles/audio}/avdtp.c       |    0
 {audio => profiles/audio}/avdtp.h       |    0
 {audio => profiles/audio}/avrcp.c       |    0
 {audio => profiles/audio}/avrcp.h       |    0
 {audio => profiles/audio}/control.c     |    0
 {audio => profiles/audio}/control.h     |    0
 {audio => profiles/audio}/device.c      |  198 +--
 {audio => profiles/audio}/device.h      |    2 -
 {audio => profiles/audio}/main.c        |   98 +-
 profiles/audio/manager.c                |  552 ++++++
 {audio => profiles/audio}/manager.h     |    7 +-
 {audio => profiles/audio}/media.c       |  245 ++-
 {audio => profiles/audio}/media.h       |    0
 {audio => profiles/audio}/player.c      |    0
 {audio => profiles/audio}/player.h      |    0
 {audio => profiles/audio}/rtp.h         |    0
 {audio => profiles/audio}/sink.c        |    0
 {audio => profiles/audio}/sink.h        |    0
 {audio => profiles/audio}/source.c      |    0
 {audio => profiles/audio}/source.h      |    0
 {audio => profiles/audio}/transport.c   |  380 -----
 {audio => profiles/audio}/transport.h   |    0
 39 files changed, 673 insertions(+), 12930 deletions(-)
 delete mode 100644 audio/gateway.c
 delete mode 100644 audio/gateway.h
 delete mode 100644 audio/headset.c
 delete mode 100644 audio/headset.h
 delete mode 100644 audio/manager.c
 delete mode 100644 audio/telephony-dummy.c
 delete mode 100644 audio/telephony-maemo5.c
 delete mode 100644 audio/telephony-maemo6.c
 delete mode 100644 audio/telephony-ofono.c
 delete mode 100644 audio/telephony.h
 rename {audio => profiles/audio}/a2dp-codecs.h (100%)
 rename {audio => profiles/audio}/a2dp.c (100%)
 rename {audio => profiles/audio}/a2dp.h (100%)
 rename {audio => profiles/audio}/audio.conf (93%)
 rename {audio => profiles/audio}/avctp.c (100%)
 rename {audio => profiles/audio}/avctp.h (100%)
 rename {audio => profiles/audio}/avdtp.c (100%)
 rename {audio => profiles/audio}/avdtp.h (100%)
 rename {audio => profiles/audio}/avrcp.c (100%)
 rename {audio => profiles/audio}/avrcp.h (100%)
 rename {audio => profiles/audio}/control.c (100%)
 rename {audio => profiles/audio}/control.h (100%)
 rename {audio => profiles/audio}/device.c (69%)
 rename {audio => profiles/audio}/device.h (96%)
 rename {audio => profiles/audio}/main.c (53%)
 create mode 100644 profiles/audio/manager.c
 rename {audio => profiles/audio}/manager.h (89%)
 rename {audio => profiles/audio}/media.c (91%)
 rename {audio => profiles/audio}/media.h (100%)
 rename {audio => profiles/audio}/player.c (100%)
 rename {audio => profiles/audio}/player.h (100%)
 rename {audio => profiles/audio}/rtp.h (100%)
 rename {audio => profiles/audio}/sink.c (100%)
 rename {audio => profiles/audio}/sink.h (100%)
 rename {audio => profiles/audio}/source.c (100%)
 rename {audio => profiles/audio}/source.h (100%)
 rename {audio => profiles/audio}/transport.c (72%)
 rename {audio => profiles/audio}/transport.h (100%)
Signature · 1 line
1.7.11.7
author maintainer
#1 lore raw

PATCH 1/13 audio: Remove HFP and HSP headset role support

From: Luiz Augusto von Dentz <[email protected]>

The support for these profiles are intended to be external, probably directly integrated in the telephony stack of the platform in use e.g. oFono.

---
 audio/manager.c | 502 --------------------------------------------------------
 1 file changed, 502 deletions(-)
audio/manager.c +0 -502
index 4ea61bf..26dde60 100644
@@ -91,7 +91,6 @@ static GSList *devices = NULL;
 
 static struct enabled_interfaces enabled = {
 	.hfp		= TRUE,
-	.headset	= TRUE,
 	.gateway	= FALSE,
 	.sink		= TRUE,
 	.source		= FALSE,
@@ -111,62 +110,6 @@ static struct audio_adapter *find_adapter(GSList *list,
 	return NULL;
 }
 
-static sdp_record_t *hsp_ag_record(uint8_t ch)
-{
-	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
-	uuid_t root_uuid, svclass_uuid, ga_svclass_uuid;
-	uuid_t l2cap_uuid, rfcomm_uuid;
-	sdp_profile_desc_t profile;
-	sdp_record_t *record;
-	sdp_list_t *aproto, *proto[2];
-	sdp_data_t *channel;
-
-	record = sdp_record_alloc();
-	if (!record)
-		return NULL;
-
-	sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
-	root = sdp_list_append(0, &root_uuid);
-	sdp_set_browse_groups(record, root);
-
-	sdp_uuid16_create(&svclass_uuid, HEADSET_AGW_SVCLASS_ID);
-	svclass_id = sdp_list_append(0, &svclass_uuid);
-	sdp_uuid16_create(&ga_svclass_uuid, GENERIC_AUDIO_SVCLASS_ID);
-	svclass_id = sdp_list_append(svclass_id, &ga_svclass_uuid);
-	sdp_set_service_classes(record, svclass_id);
-
-	sdp_uuid16_create(&profile.uuid, HEADSET_PROFILE_ID);
-	profile.version = 0x0102;
-	pfseq = sdp_list_append(0, &profile);
-	sdp_set_profile_descs(record, pfseq);
-
-	sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
-	proto[0] = sdp_list_append(0, &l2cap_uuid);
-	apseq = sdp_list_append(0, proto[0]);
-
-	sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
-	proto[1] = sdp_list_append(0, &rfcomm_uuid);
-	channel = sdp_data_alloc(SDP_UINT8, &ch);
-	proto[1] = sdp_list_append(proto[1], channel);
-	apseq = sdp_list_append(apseq, proto[1]);
-
-	aproto = sdp_list_append(0, apseq);
-	sdp_set_access_protos(record, aproto);
-
-	sdp_set_info_attr(record, "Headset Audio Gateway", 0, 0);
-
-	sdp_data_free(channel);
-	sdp_list_free(proto[0], 0);
-	sdp_list_free(proto[1], 0);
-	sdp_list_free(apseq, 0);
-	sdp_list_free(pfseq, 0);
-	sdp_list_free(aproto, 0);
-	sdp_list_free(root, 0);
-	sdp_list_free(svclass_id, 0);
-
-	return record;
-}
-
 static sdp_record_t *hfp_hs_record(uint8_t ch)
 {
 	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
@@ -223,206 +166,6 @@ static sdp_record_t *hfp_hs_record(uint8_t ch)
 	return record;
 }
 
-static sdp_record_t *hfp_ag_record(uint8_t ch, uint32_t feat)
-{
-	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
-	uuid_t root_uuid, svclass_uuid, ga_svclass_uuid;
-	uuid_t l2cap_uuid, rfcomm_uuid;
-	sdp_profile_desc_t profile;
-	sdp_list_t *aproto, *proto[2];
-	sdp_record_t *record;
-	sdp_data_t *channel, *features;
-	uint8_t netid = 0x01;
-	uint16_t sdpfeat;
-	sdp_data_t *network;
-
-	record = sdp_record_alloc();
-	if (!record)
-		return NULL;
-
-	network = sdp_data_alloc(SDP_UINT8, &netid);
-	if (!network) {
-		sdp_record_free(record);
-		return NULL;
-	}
-
-	sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
-	root = sdp_list_append(0, &root_uuid);
-	sdp_set_browse_groups(record, root);
-
-	sdp_uuid16_create(&svclass_uuid, HANDSFREE_AGW_SVCLASS_ID);
-	svclass_id = sdp_list_append(0, &svclass_uuid);
-	sdp_uuid16_create(&ga_svclass_uuid, GENERIC_AUDIO_SVCLASS_ID);
-	svclass_id = sdp_list_append(svclass_id, &ga_svclass_uuid);
-	sdp_set_service_classes(record, svclass_id);
-
-	sdp_uuid16_create(&profile.uuid, HANDSFREE_PROFILE_ID);
-	profile.version = 0x0105;
-	pfseq = sdp_list_append(0, &profile);
-	sdp_set_profile_descs(record, pfseq);
-
-	sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
-	proto[0] = sdp_list_append(0, &l2cap_uuid);
-	apseq = sdp_list_append(0, proto[0]);
-
-	sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
-	proto[1] = sdp_list_append(0, &rfcomm_uuid);
-	channel = sdp_data_alloc(SDP_UINT8, &ch);
-	proto[1] = sdp_list_append(proto[1], channel);
-	apseq = sdp_list_append(apseq, proto[1]);
-
-	sdpfeat = (uint16_t) feat & 0xF;
-	features = sdp_data_alloc(SDP_UINT16, &sdpfeat);
-	sdp_attr_add(record, SDP_ATTR_SUPPORTED_FEATURES, features);
-
-	aproto = sdp_list_append(0, apseq);
-	sdp_set_access_protos(record, aproto);
-
-	sdp_set_info_attr(record, "Hands-Free Audio Gateway", 0, 0);
-
-	sdp_attr_add(record, SDP_ATTR_EXTERNAL_NETWORK, network);
-
-	sdp_data_free(channel);
-	sdp_list_free(proto[0], 0);
-	sdp_list_free(proto[1], 0);
-	sdp_list_free(apseq, 0);
-	sdp_list_free(pfseq, 0);
-	sdp_list_free(aproto, 0);
-	sdp_list_free(root, 0);
-	sdp_list_free(svclass_id, 0);
-
-	return record;
-}
-
-static void headset_auth_cb(DBusError *derr, void *user_data)
-{
-	struct audio_device *device = user_data;
-	GError *err = NULL;
-	GIOChannel *io;
-
-	device->hs_auth_id = 0;
-
-	if (device->hs_preauth_id) {
-		g_source_remove(device->hs_preauth_id);
-		device->hs_preauth_id = 0;
-	}
-
-	if (derr && dbus_error_is_set(derr)) {
-		error("Access denied: %s", derr->message);
-		headset_set_state(device, HEADSET_STATE_DISCONNECTED);
-		return;
-	}
-
-	io = headset_get_rfcomm(device);
-
-	if (!bt_io_accept(io, headset_connect_cb, device, NULL, &err)) {
-		error("bt_io_accept: %s", err->message);
-		g_error_free(err);
-		headset_set_state(device, HEADSET_STATE_DISCONNECTED);
-		return;
-	}
-}
-
-static gboolean hs_preauth_cb(GIOChannel *chan, GIOCondition cond,
-							gpointer user_data)
-{
-	struct audio_device *device = user_data;
-
-	DBG("Headset disconnected during authorization");
-
-	btd_cancel_authorization(device->hs_auth_id);
-	device->hs_auth_id = 0;
-
-	headset_set_state(device, HEADSET_STATE_DISCONNECTED);
-
-	device->hs_preauth_id = 0;
-
-	return FALSE;
-}
-
-static void ag_confirm(GIOChannel *chan, gpointer data)
-{
-	const char *server_uuid, *remote_uuid;
-	struct audio_device *device;
-	gboolean hfp_active;
-	bdaddr_t src, dst;
-	GError *err = NULL;
-	uint8_t ch;
-
-	bt_io_get(chan, &err,
-			BT_IO_OPT_SOURCE_BDADDR, &src,
-			BT_IO_OPT_DEST_BDADDR, &dst,
-			BT_IO_OPT_CHANNEL, &ch,
-			BT_IO_OPT_INVALID);
-	if (err) {
-		error("%s", err->message);
-		g_error_free(err);
-		goto drop;
-	}
-
-	if (ch == DEFAULT_HS_AG_CHANNEL) {
-		hfp_active = FALSE;
-		server_uuid = HSP_AG_UUID;
-		remote_uuid = HSP_HS_UUID;
-	} else {
-		hfp_active = TRUE;
-		server_uuid = HFP_AG_UUID;
-		remote_uuid = HFP_HS_UUID;
-	}
-
-	device = manager_get_device(&src, &dst, TRUE);
-	if (!device)
-		goto drop;
-
-	if (!manager_allow_headset_connection(device)) {
-		DBG("Refusing headset: too many existing connections");
-		goto drop;
-	}
-
-	if (!device->headset) {
-		btd_device_add_uuid(device->btd_dev, remote_uuid);
-		if (!device->headset)
-			goto drop;
-	}
-
-	if (headset_get_state(device) > HEADSET_STATE_DISCONNECTED) {
-		DBG("Refusing new connection since one already exists");
-		goto drop;
-	}
-
-	headset_set_hfp_active(device, hfp_active);
-	headset_set_rfcomm_initiator(device, TRUE);
-
-	if (headset_connect_rfcomm(device, chan) < 0) {
-		error("headset_connect_rfcomm failed");
-		goto drop;
-	}
-
-	headset_set_state(device, HEADSET_STATE_CONNECTING);
-
-	device->hs_auth_id = btd_request_authorization(&device->src,
-							&device->dst,
-							server_uuid,
-							headset_auth_cb,
-							device);
-	if (device->hs_auth_id == 0) {
-		DBG("Authorization denied");
-		headset_set_state(device, HEADSET_STATE_DISCONNECTED);
-		return;
-	}
-
-	device->hs_preauth_id = g_io_add_watch(chan,
-					G_IO_NVAL | G_IO_HUP | G_IO_ERR,
-					hs_preauth_cb, device);
-
-	device->auto_connect = auto_connect;
-
-	return;
-
-drop:
-	g_io_channel_shutdown(chan, TRUE, NULL);
-}
-
 static void gateway_auth_cb(DBusError *derr, void *user_data)
 {
 	struct audio_device *device = user_data;
@@ -499,108 +242,6 @@ drop:
 	g_io_channel_shutdown(chan, TRUE, NULL);
 }
 
-static int headset_server_init(struct audio_adapter *adapter)
-{
-	uint8_t chan = DEFAULT_HS_AG_CHANNEL;
-	sdp_record_t *record;
-	gboolean master = TRUE;
-	GError *err = NULL;
-	uint32_t features;
-	GIOChannel *io;
-	const bdaddr_t *src;
-
-	if (config) {
-		gboolean tmp;
-
-		tmp = g_key_file_get_boolean(config, "General", "Master",
-						&err);
-		if (err) {
-			DBG("audio.conf: %s", err->message);
-			g_clear_error(&err);
-		} else
-			master = tmp;
-	}
-
-	src = adapter_get_address(adapter->btd_adapter);
-
-	io =  bt_io_listen(NULL, ag_confirm, adapter, NULL, &err,
-				BT_IO_OPT_SOURCE_BDADDR, src,
-				BT_IO_OPT_CHANNEL, chan,
-				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
-				BT_IO_OPT_MASTER, master,
-				BT_IO_OPT_INVALID);
-	if (!io)
-		goto failed;
-
-	adapter->hsp_ag_server = io;
-
-	record = hsp_ag_record(chan);
-	if (!record) {
-		error("Unable to allocate new service record");
-		goto failed;
-	}
-
-	if (add_record_to_server(src, record) < 0) {
-		error("Unable to register HS AG service record");
-		sdp_record_free(record);
-		goto failed;
-	}
-	adapter->hsp_ag_record_id = record->handle;
-
-	features = headset_config_init(config);
-
-	if (!enabled.hfp)
-		return 0;
-
-	chan = DEFAULT_HF_AG_CHANNEL;
-
-	io = bt_io_listen(NULL, ag_confirm, adapter, NULL, &err,
-				BT_IO_OPT_SOURCE_BDADDR, src,
-				BT_IO_OPT_CHANNEL, chan,
-				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
-				BT_IO_OPT_MASTER, master,
-				BT_IO_OPT_INVALID);
-	if (!io)
-		goto failed;
-
-	adapter->hfp_ag_server = io;
-
-	record = hfp_ag_record(chan, features);
-	if (!record) {
-		error("Unable to allocate new service record");
-		goto failed;
-	}
-
-	if (add_record_to_server(src, record) < 0) {
-		error("Unable to register HF AG service record");
-		sdp_record_free(record);
-		goto failed;
-	}
-	adapter->hfp_ag_record_id = record->handle;
-
-	return 0;
-
-failed:
-	if (err) {
-		error("%s", err->message);
-		g_error_free(err);
-	}
-
-	if (adapter->hsp_ag_server) {
-		g_io_channel_shutdown(adapter->hsp_ag_server, TRUE, NULL);
-		g_io_channel_unref(adapter->hsp_ag_server);
-		adapter->hsp_ag_server = NULL;
-	}
-
-	if (adapter->hfp_ag_server) {
-		g_io_channel_shutdown(adapter->hfp_ag_server, TRUE, NULL);
-		g_io_channel_unref(adapter->hfp_ag_server);
-		adapter->hfp_ag_server = NULL;
-	}
-
-	return -1;
-}
-
 static int gateway_server_init(struct audio_adapter *adapter)
 {
 	uint8_t chan = DEFAULT_HFP_HS_CHANNEL;
@@ -683,26 +324,6 @@ static void audio_remove(struct btd_profile *p, struct btd_device *device)
 	audio_device_unregister(dev);
 }
 
-static int hs_probe(struct btd_profile *p, struct btd_device *device,
-								GSList *uuids)
-{
-	struct audio_device *audio_dev;
-
-	audio_dev = get_audio_dev(device);
-	if (!audio_dev) {
-		DBG("unable to get a device object");
-		return -1;
-	}
-
-	if (audio_dev->headset)
-		headset_update(audio_dev, audio_dev->headset, uuids);
-	else
-		audio_dev->headset = headset_init(audio_dev, uuids,
-								enabled.hfp);
-
-	return 0;
-}
-
 static int ag_probe(struct btd_profile *p, struct btd_device *device,
 								GSList *uuids)
 {
@@ -813,112 +434,6 @@ static struct audio_adapter *audio_adapter_get(struct btd_adapter *adapter)
 	return adp;
 }
 
-static void state_changed(struct btd_adapter *adapter, gboolean powered)
-{
-	struct audio_adapter *adp;
-	static gboolean telephony = FALSE;
-	GSList *l;
-
-	DBG("%s powered %s", adapter_get_path(adapter),
-						powered ? "on" : "off");
-
-	/* ignore powered change, adapter is powering down */
-	if (powered && adapter_powering_down(adapter))
-		return;
-
-	adp = find_adapter(adapters, adapter);
-	if (!adp)
-		return;
-
-	adp->powered = powered;
-
-	if (powered) {
-		/* telephony driver already initialized*/
-		if (telephony == TRUE)
-			return;
-		telephony_init();
-		telephony = TRUE;
-		return;
-	}
-
-	/* telephony not initialized just ignore power down */
-	if (telephony == FALSE)
-		return;
-
-	for (l = adapters; l; l = l->next) {
-		adp = l->data;
-
-		if (adp->powered == TRUE)
-			return;
-	}
-
-	telephony_exit();
-	telephony = FALSE;
-}
-
-static int headset_server_probe(struct btd_profile *p,
-						struct btd_adapter *adapter)
-{
-	struct audio_adapter *adp;
-	const gchar *path = adapter_get_path(adapter);
-	int err;
-
-	DBG("path %s", path);
-
-	adp = audio_adapter_get(adapter);
-	if (!adp)
-		return -EINVAL;
-
-	err = headset_server_init(adp);
-	if (err < 0) {
-		audio_adapter_unref(adp);
-		return err;
-	}
-
-	btd_adapter_register_powered_callback(adapter, state_changed);
-
-	return 0;
-}
-
-static void headset_server_remove(struct btd_profile *p,
-						struct btd_adapter *adapter)
-{
-	struct audio_adapter *adp;
-	const gchar *path = adapter_get_path(adapter);
-
-	DBG("path %s", path);
-
-	btd_adapter_unregister_powered_callback(adapter, state_changed);
-
-	adp = find_adapter(adapters, adapter);
-	if (!adp)
-		return;
-
-	if (adp->hsp_ag_record_id) {
-		remove_record_from_server(adp->hsp_ag_record_id);
-		adp->hsp_ag_record_id = 0;
-	}
-
-	if (adp->hsp_ag_server) {
-		g_io_channel_shutdown(adp->hsp_ag_server, TRUE, NULL);
-		g_io_channel_unref(adp->hsp_ag_server);
-		adp->hsp_ag_server = NULL;
-	}
-
-	if (adp->hfp_ag_record_id) {
-		remove_record_from_server(adp->hfp_ag_record_id);
-		adp->hfp_ag_record_id = 0;
-	}
-
-	if (adp->hfp_ag_server) {
-		g_io_channel_shutdown(adp->hfp_ag_server, TRUE, NULL);
-		g_io_channel_unref(adp->hfp_ag_server);
-		adp->hfp_ag_server = NULL;
-	}
-
-	audio_adapter_unref(adp);
-}
-
 static int gateway_server_probe(struct btd_profile *p,
 						struct btd_adapter *adapter)
 {
@@ -1068,17 +583,6 @@ static void media_server_remove(struct btd_adapter *adapter)
 	audio_adapter_unref(adp);
 }
 
-static struct btd_profile headset_profile = {
-	.name		= "audio-headset",
-
-	.remote_uuids	= BTD_UUIDS(HSP_HS_UUID, HFP_HS_UUID),
-	.device_probe	= hs_probe,
-	.device_remove	= audio_remove,
-
-	.adapter_probe	= headset_server_probe,
-	.adapter_remove = headset_server_remove,
-};
-
 static struct btd_profile gateway_profile = {
 	.name		= "audio-gateway",
 
@@ -1187,9 +691,6 @@ int audio_manager_init(GKeyFile *conf, gboolean *enable_sco)
 		max_connected_headsets = i;
 
 proceed:
-	if (enabled.headset)
-		btd_profile_register(&headset_profile);
-
 	if (enabled.gateway)
 		btd_profile_register(&gateway_profile);
 
@@ -1213,9 +714,6 @@ void audio_manager_exit(void)
 		config = NULL;
 	}
 
-	if (enabled.headset)
-		btd_profile_unregister(&headset_profile);
-
 	if (enabled.gateway)
 		btd_profile_unregister(&gateway_profile);
 
Signature · 1 line
1.7.11.7
author maintainer
#2 lore raw

PATCH 1/3 avctp: Fix dead assignment in control_response

In reply to Luiz Augusto von Dentz

From: Szymon Janc <[email protected]>

Value stored to req is never read before writing it again.

---
 audio/avctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
audio/avctp.c +1 -1
index 6ba25e4..29756f6 100644
@@ -577,7 +577,7 @@ static void control_response(struct avctp_channel *control,
 					size_t operand_count)
 {
 	struct avctp_pending_req *p = control->p;
-	struct avctp_control_req *req = p->data;
+	struct avctp_control_req *req;
 	GSList *l;
 
 	if (p && p->transaction == avctp->transaction) {
Signature · 1 line
1.7.11.7
author maintainer
#3 lore raw

Re: [PATCH BlueZ 1/3] avctp: Fix dead assignment in control_response

Hi,

Quoted 21 lines · Luiz Augusto von Dentz

From: Szymon Janc <[email protected]>

Value stored to req is never read before writing it again.

---
 audio/avctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
audio/avctp.c +1 -2
index 6ba25e4..29756f6 100644
@@ -577,7 +577,7 @@ static void control_response(struct avctp_channel *control,
                                        size_t operand_count)
 {
        struct avctp_pending_req *p = control->p;
-       struct avctp_control_req *req = p->data;
+       struct avctp_control_req *req;
        GSList *l;
 
        if (p && p->transaction == avctp->transaction) {
--
Quoted 1 line

1.7.11.7

Please ignore this set, it was in my outgoing folder as I just applied them but they are not part of HFP patchset.

Signature · 1 line
Luiz Augusto von Dentz
author maintainer
#4 lore raw

PATCH 2/13 audio: Remove HFP option from audio.conf

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

It is not in use anymore

---
 audio/audio.conf | 4 ----
 audio/manager.c  | 8 --------
 audio/manager.h  | 1 -
 3 files changed, 13 deletions(-)
audio/audio.conf +0 -4
index d1c57d3..6bf4482 100644
@@ -25,10 +25,6 @@
 # service interacts with remote headset devices)
 [Headset]
 
-# Set to true to support HFP, false means only HSP is supported
-# Defaults to true
-HFP=true
-
 # Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
 MaxConnected=1
 
audio/manager.c +0 -8
index 26dde60..e949509 100644
@@ -90,7 +90,6 @@ static GSList *adapters = NULL;
 static GSList *devices = NULL;
 
 static struct enabled_interfaces enabled = {
-	.hfp		= TRUE,
 	.gateway	= FALSE,
 	.sink		= TRUE,
 	.source		= FALSE,
@@ -674,13 +673,6 @@ int audio_manager_init(GKeyFile *conf, gboolean *enable_sco)
 	} else
 		auto_connect = b;
 
-	b = g_key_file_get_boolean(config, "Headset", "HFP",
-					&err);
-	if (err)
-		g_clear_error(&err);
-	else
-		enabled.hfp = b;
-
 	err = NULL;
 	i = g_key_file_get_integer(config, "Headset", "MaxConnected",
 					&err);
audio/manager.h +0 -1
index 08d814f..8fb208c 100644
@@ -23,7 +23,6 @@
  */
 
 struct enabled_interfaces {
-	gboolean hfp;
 	gboolean headset;
 	gboolean gateway;
 	gboolean sink;
Signature · 1 line
1.7.11.7
author maintainer
#5 lore raw

PATCH 2/3 avrcp: Fix dead assignments in ct_set_setting

In reply to Luiz Augusto von Dentz

From: Szymon Janc <[email protected]>

Value stored in val is never read before writing it again. After fixing val same applies to attr variable.

---
 audio/avrcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
audio/avrcp.c +2 -2
index e3ce2fb..2517df8 100644
@@ -1944,8 +1944,8 @@ static bool ct_set_setting(struct media_player *mp, const char *key,
 					const char *value, void *user_data)
 {
 	struct avrcp_player *player = user_data;
-	int attr = attr_to_val(key);
-	int val = attrval_to_val(attr, value);
+	int attr;
+	int val;
 	struct avrcp *session;
 
 	session = player->sessions->data;
Signature · 1 line
1.7.11.7
author maintainer
#6 lore raw

PATCH 3/13 audio: Remove code using headset

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This is to be replaced with external profile support.

---
 audio/device.c    | 191 +-----------------------------------------------
 audio/headset.c   |   3 -
 audio/main.c      |  28 +------
 audio/manager.c   |  48 +-----------
 audio/manager.h   |   3 -
 audio/media.c     |  74 +------------------
 audio/transport.c | 215 ------------------------------------------------------
 7 files changed, 9 insertions(+), 553 deletions(-)
audio/device.c +4 -187
index aee4161..aaa666d 100644
@@ -53,7 +53,6 @@
 #include "control.h"
 #include "avctp.h"
 #include "avrcp.h"
-#include "headset.h"
 #include "gateway.h"
 #include "sink.h"
 #include "source.h"
@@ -74,7 +73,6 @@ typedef enum {
 struct dev_priv {
 	audio_state_t state;
 
-	headset_state_t hs_state;
 	sink_state_t sink_state;
 	avctp_state_t avctp_state;
 
@@ -92,7 +90,6 @@ struct dev_priv {
 static unsigned int sink_callback_id = 0;
 static unsigned int avctp_callback_id = 0;
 static unsigned int avdtp_callback_id = 0;
-static unsigned int headset_callback_id = 0;
 
 static void device_free(struct audio_device *dev)
 {
@@ -208,8 +205,6 @@ static void disconnect_cb(struct btd_device *btd_dev, gboolean removal,
 
 	if (dev->sink && priv->sink_state != SINK_STATE_DISCONNECTED)
 		sink_shutdown(dev->sink);
-	else if (priv->hs_state != HEADSET_STATE_DISCONNECTED)
-		headset_shutdown(dev);
 	else
 		priv->disconnecting = FALSE;
 }
@@ -270,84 +265,6 @@ static void device_set_state(struct audio_device *dev, audio_state_t new_state)
 				DBUS_TYPE_STRING, &state_str);
 }
 
-static gboolean avdtp_connect_timeout(gpointer user_data)
-{
-	struct audio_device *dev = user_data;
-
-	dev->priv->avdtp_timer = 0;
-
-	if (dev->sink) {
-		struct avdtp *session = avdtp_get(&dev->src, &dev->dst);
-
-		if (!session)
-			return FALSE;
-
-		sink_setup_stream(dev->sink, session);
-		avdtp_unref(session);
-	}
-
-	return FALSE;
-}
-
-static gboolean device_set_avdtp_timer(struct audio_device *dev)
-{
-	struct dev_priv *priv = dev->priv;
-	guint timeout = AVDTP_CONNECT_TIMEOUT;
-
-	if (!dev->sink)
-		return FALSE;
-
-	if (priv->avdtp_timer)
-		return FALSE;
-
-	/* If the headset is the HSP/HFP RFCOMM initiator, give the headset
-	 * time to initiate AVDTP signalling (and avoid further racing) */
-	if (dev->headset && headset_get_rfcomm_initiator(dev))
-		timeout += AVDTP_CONNECT_TIMEOUT_BOOST;
-
-	priv->avdtp_timer = g_timeout_add_seconds(timeout,
-							avdtp_connect_timeout,
-							dev);
-
-	return TRUE;
-}
-
-static gboolean headset_connect_timeout(gpointer user_data)
-{
-	struct audio_device *dev = user_data;
-	struct dev_priv *priv = dev->priv;
-
-	dev->priv->headset_timer = 0;
-
-	if (dev->headset == NULL)
-		return FALSE;
-
-	if (headset_config_stream(dev, FALSE, NULL, NULL) == 0) {
-		if (priv->state != AUDIO_STATE_CONNECTED &&
-				(priv->sink_state == SINK_STATE_CONNECTED ||
-				priv->sink_state == SINK_STATE_PLAYING))
-			device_set_state(dev, AUDIO_STATE_CONNECTED);
-	}
-
-	return FALSE;
-}
-
-static gboolean device_set_headset_timer(struct audio_device *dev)
-{
-	struct dev_priv *priv = dev->priv;
-
-	if (!dev->headset)
-		return FALSE;
-
-	if (priv->headset_timer)
-		return FALSE;
-
-	priv->headset_timer = g_timeout_add_seconds(HEADSET_CONNECT_TIMEOUT,
-						headset_connect_timeout, dev);
-
-	return TRUE;
-}
-
 static void device_avdtp_cb(struct audio_device *dev, struct avdtp *session,
 				avdtp_session_state_t old_state,
 				avdtp_session_state_t new_state,
@@ -382,44 +299,17 @@ static void device_sink_cb(struct audio_device *dev,
 			device_remove_control_timer(dev);
 			avrcp_disconnect(dev);
 		}
-		if (priv->hs_state != HEADSET_STATE_DISCONNECTED &&
-				(priv->dc_req || priv->disconnecting)) {
-			headset_shutdown(dev);
-			break;
-		}
-		if (priv->hs_state == HEADSET_STATE_DISCONNECTED)
-			device_set_state(dev, AUDIO_STATE_DISCONNECTED);
-		else if (old_state == SINK_STATE_CONNECTING) {
-			switch (priv->hs_state) {
-			case HEADSET_STATE_CONNECTED:
-			case HEADSET_STATE_PLAY_IN_PROGRESS:
-			case HEADSET_STATE_PLAYING:
-				device_set_state(dev, AUDIO_STATE_CONNECTED);
-			default:
-				break;
-			}
-		}
+
+		device_set_state(dev, AUDIO_STATE_DISCONNECTED);
 		break;
 	case SINK_STATE_CONNECTING:
 		device_remove_avdtp_timer(dev);
-		if (priv->hs_state == HEADSET_STATE_DISCONNECTED)
-			device_set_state(dev, AUDIO_STATE_CONNECTING);
+		device_set_state(dev, AUDIO_STATE_CONNECTING);
 		break;
 	case SINK_STATE_CONNECTED:
 		if (old_state == SINK_STATE_PLAYING)
 			break;
-		if (dev->auto_connect) {
-			if (!dev->headset)
-				device_set_state(dev, AUDIO_STATE_CONNECTED);
-			else if (priv->hs_state == HEADSET_STATE_DISCONNECTED)
-				device_set_headset_timer(dev);
-			else if (priv->hs_state == HEADSET_STATE_CONNECTED ||
-					priv->hs_state == HEADSET_STATE_PLAY_IN_PROGRESS ||
-					priv->hs_state == HEADSET_STATE_PLAYING)
-				device_set_state(dev, AUDIO_STATE_CONNECTED);
-		} else if (priv->hs_state == HEADSET_STATE_DISCONNECTED ||
-				priv->hs_state == HEADSET_STATE_CONNECTING)
-			device_set_state(dev, AUDIO_STATE_CONNECTED);
+		device_set_state(dev, AUDIO_STATE_CONNECTED);
 		break;
 	case SINK_STATE_PLAYING:
 		break;
@@ -447,62 +337,6 @@ static void device_avctp_cb(struct audio_device *dev,
 	}
 }
 
-static void device_headset_cb(struct audio_device *dev,
-				headset_state_t old_state,
-				headset_state_t new_state,
-				void *user_data)
-{
-	struct dev_priv *priv = dev->priv;
-
-	if (!dev->headset)
-		return;
-
-	priv->hs_state = new_state;
-
-	switch (new_state) {
-	case HEADSET_STATE_DISCONNECTED:
-		device_remove_avdtp_timer(dev);
-		if (priv->sink_state != SINK_STATE_DISCONNECTED && dev->sink &&
-				(priv->dc_req || priv->disconnecting)) {
-			sink_shutdown(dev->sink);
-			break;
-		}
-		if (priv->sink_state == SINK_STATE_DISCONNECTED)
-			device_set_state(dev, AUDIO_STATE_DISCONNECTED);
-		else if (old_state == HEADSET_STATE_CONNECTING &&
-				(priv->sink_state == SINK_STATE_CONNECTED ||
-				priv->sink_state == SINK_STATE_PLAYING))
-			device_set_state(dev, AUDIO_STATE_CONNECTED);
-		break;
-	case HEADSET_STATE_CONNECTING:
-		device_remove_headset_timer(dev);
-		if (priv->sink_state == SINK_STATE_DISCONNECTED)
-			device_set_state(dev, AUDIO_STATE_CONNECTING);
-		break;
-	case HEADSET_STATE_CONNECTED:
-		if (old_state == HEADSET_STATE_CONNECTED ||
-				old_state == HEADSET_STATE_PLAY_IN_PROGRESS ||
-				old_state == HEADSET_STATE_PLAYING)
-			break;
-		if (dev->auto_connect) {
-			if (!dev->sink)
-				device_set_state(dev, AUDIO_STATE_CONNECTED);
-			else if (priv->sink_state == SINK_STATE_DISCONNECTED)
-				device_set_avdtp_timer(dev);
-			else if (priv->sink_state == SINK_STATE_CONNECTED ||
-					priv->sink_state == SINK_STATE_PLAYING)
-				device_set_state(dev, AUDIO_STATE_CONNECTED);
-		} else if (priv->sink_state == SINK_STATE_DISCONNECTED ||
-				priv->sink_state == SINK_STATE_CONNECTING)
-			device_set_state(dev, AUDIO_STATE_CONNECTED);
-		break;
-	case HEADSET_STATE_PLAY_IN_PROGRESS:
-		break;
-	case HEADSET_STATE_PLAYING:
-		break;
-	}
-}
-
 static DBusMessage *dev_connect(DBusConnection *conn, DBusMessage *msg,
 								void *data)
 {
@@ -516,9 +350,6 @@ static DBusMessage *dev_connect(DBusConnection *conn, DBusMessage *msg,
 
 	dev->auto_connect = TRUE;
 
-	if (dev->headset)
-		headset_config_stream(dev, FALSE, NULL, NULL);
-
 	if (priv->state != AUDIO_STATE_CONNECTING && dev->sink) {
 		struct avdtp *session = avdtp_get(&dev->src, &dev->dst);
 
@@ -561,8 +392,6 @@ static DBusMessage *dev_disconnect(DBusConnection *conn, DBusMessage *msg,
 
 	if (dev->sink && priv->sink_state != SINK_STATE_DISCONNECTED)
 		sink_shutdown(dev->sink);
-	else if (priv->hs_state != HEADSET_STATE_DISCONNECTED)
-		headset_shutdown(dev);
 	else {
 		dbus_message_unref(priv->dc_req);
 		priv->dc_req = NULL;
@@ -652,10 +481,6 @@ struct audio_device *audio_device_register(struct btd_device *device,
 	if (avctp_callback_id == 0)
 		avctp_callback_id = avctp_add_state_cb(device_avctp_cb, NULL);
 
-	if (headset_callback_id == 0)
-		headset_callback_id = headset_add_state_cb(device_headset_cb,
-									NULL);
-
 	return dev;
 }
 
@@ -666,17 +491,12 @@ gboolean audio_device_is_active(struct audio_device *dev,
 		if ((dev->sink || dev->source) &&
 				avdtp_is_connected(&dev->src, &dev->dst))
 			return TRUE;
-		if (dev->headset && headset_is_active(dev))
-			return TRUE;
 	} else if (!strcmp(interface, AUDIO_SINK_INTERFACE) && dev->sink &&
 				avdtp_is_connected(&dev->src, &dev->dst))
 		return TRUE;
 	else if (!strcmp(interface, AUDIO_SOURCE_INTERFACE) && dev->source &&
 				avdtp_is_connected(&dev->src, &dev->dst))
 		return TRUE;
-	else if (!strcmp(interface, AUDIO_HEADSET_INTERFACE) && dev->headset &&
-				headset_is_active(dev))
-		return TRUE;
 	else if (!strcmp(interface, AUDIO_CONTROL_INTERFACE) && dev->control &&
 				control_is_active(dev))
 		return TRUE;
@@ -694,9 +514,6 @@ void audio_device_unregister(struct audio_device *device)
 		device->hs_preauth_id = 0;
 	}
 
-	if (device->headset)
-		headset_unregister(device);
-
 	if (device->gateway)
 		gateway_unregister(device);
 
audio/headset.c +0 -3
index 5e42a61..fb660f5 100644
@@ -1614,9 +1614,6 @@ static int rfcomm_connect(struct audio_device *dev, headset_stream_cb_t cb,
 	char address[18];
 	GError *err = NULL;
 
-	if (!manager_allow_headset_connection(dev))
-		return -ECONNREFUSED;
-
 	if (hs->rfcomm_ch < 0)
 		return get_records(dev, cb, user_data, cb_id);
 
audio/main.c +1 -27
index f7bb32a..a423b79 100644
@@ -42,7 +42,6 @@
 #include "plugin.h"
 #include "log.h"
 #include "device.h"
-#include "headset.h"
 #include "manager.h"
 #include "gateway.h"
 
@@ -89,36 +88,12 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
 		goto drop;
 	}
 
-	device = manager_find_device(NULL, &src, &dst, AUDIO_HEADSET_INTERFACE,
-					FALSE);
-	if (!device)
-		device = manager_find_device(NULL, &src, &dst,
+	device = manager_find_device(NULL, &src, &dst,
 						AUDIO_GATEWAY_INTERFACE,
 						FALSE);
-
 	if (!device)
 		goto drop;
 
-	if (device->headset) {
-		if (headset_get_state(device) < HEADSET_STATE_CONNECTED) {
-			DBG("Refusing SCO from non-connected headset");
-			goto gateway;
-		}
-
-		if (!headset_get_hfp_active(device)) {
-			error("Refusing non-HFP SCO connect attempt from %s",
-									addr);
-			goto drop;
-		}
-
-		if (headset_connect_sco(device, chan) < 0)
-			goto drop;
-
-		headset_set_state(device, HEADSET_STATE_PLAYING);
-		goto connect;
-	}
-
-gateway:
 	if (device->gateway) {
 		if (!gateway_is_connected(device)) {
 			DBG("Refusing SCO from non-connected AG");
@@ -130,7 +105,6 @@ gateway:
 	} else
 		goto drop;
 
-connect:
 	sk = g_io_channel_unix_get_fd(chan);
 	fcntl(sk, F_SETFL, 0);
 
audio/manager.c +3 -45

88 lines not on this page · raw message

audio/manager.h +0 -3
index 8fb208c..d3b5692 100644
@@ -23,7 +23,6 @@
  */
 
 struct enabled_interfaces {
-	gboolean headset;
 	gboolean gateway;
 	gboolean sink;
 	gboolean source;
@@ -50,8 +49,6 @@ struct audio_device *manager_get_device(const bdaddr_t *src,
 					const bdaddr_t *dst,
 					gboolean create);
 
-gboolean manager_allow_headset_connection(struct audio_device *device);
-
 /* TRUE to enable fast connectable and FALSE to disable fast connectable for all
  * audio adapters. */
 void manager_set_fast_connectable(gboolean enable);
audio/media.c +1 -73

110 lines not on this page · raw message

audio/transport.c +0 -215

269 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#7 lore raw

PATCH 3/3 network: Fix dead assignment in connect_cb

In reply to Luiz Augusto von Dentz

From: Szymon Janc <[email protected]>

Value stored to err_msg is never read in case err was not NULL. Simply remove err_msg and pass strerror() directly where it is used.

---
 profiles/network/connection.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
profiles/network/connection.c +1 -4
index abcbee8..1a1fb4d 100644
@@ -371,19 +371,16 @@ static int bnep_connect(struct network_conn *nc)
 static void connect_cb(GIOChannel *chan, GError *err, gpointer data)
 {
 	struct network_conn *nc = data;
-	const char *err_msg;
 	int perr;
 
 	if (err) {
 		error("%s", err->message);
-		err_msg = err->message;
 		goto failed;
 	}
 
 	perr = bnep_connect(nc);
 	if (perr < 0) {
-		err_msg = strerror(-perr);
-		error("bnep connect(): %s (%d)", err_msg, -perr);
+		error("bnep connect(): %s (%d)", strerror(-perr), -perr);
 		goto failed;
 	}
 
Signature · 1 line
1.7.11.7
author maintainer
#8 lore raw

PATCH 4/13 build: Remove telephony-maemo5.c

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am              |    4 +-
 audio/telephony-maemo5.c | 2102 ----------------------------------------------
 2 files changed, 2 insertions(+), 2104 deletions(-)
 delete mode 100644 audio/telephony-maemo5.c
Makefile.am +2 -2
index c398e74..9b24589 100644
@@ -126,7 +126,7 @@ builtin_nodist += audio/telephony.c
 noinst_LIBRARIES += audio/libtelephony.a
 
 audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c \
-				audio/telephony-maemo5.c audio/telephony-ofono.c \
+				audio/telephony-ofono.c \
 				audio/telephony-maemo6.c
 endif
 
@@ -315,7 +315,7 @@ EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf profiles/network/network.conf \
 			profiles/input/input.conf profiles/proximity/proximity.conf \
 			audio/audio.conf audio/telephony-dummy.c \
-			audio/telephony-maemo5.c audio/telephony-ofono.c \
+			audio/telephony-ofono.c \
 			audio/telephony-maemo6.c profiles/sap/sap-dummy.c \
 			profiles/sap/sap-u8500.c
 
audio/telephony-maemo5.c deleted +0 -2102

2,102 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#9 lore raw

PATCH 5/13 build: Remove telephony-maemo6.c

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am              |    6 +-
 audio/telephony-maemo6.c | 2196 ----------------------------------------------
 2 files changed, 2 insertions(+), 2200 deletions(-)
 delete mode 100644 audio/telephony-maemo6.c
Makefile.am +2 -4
index 9b24589..b7e861b 100644
@@ -126,8 +126,7 @@ builtin_nodist += audio/telephony.c
 noinst_LIBRARIES += audio/libtelephony.a
 
 audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c \
-				audio/telephony-ofono.c \
-				audio/telephony-maemo6.c
+				audio/telephony-ofono.c
 endif
 
 if SAPPLUGIN
@@ -316,8 +315,7 @@ EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			profiles/input/input.conf profiles/proximity/proximity.conf \
 			audio/audio.conf audio/telephony-dummy.c \
 			audio/telephony-ofono.c \
-			audio/telephony-maemo6.c profiles/sap/sap-dummy.c \
-			profiles/sap/sap-u8500.c
+			profiles/sap/sap-dummy.c profiles/sap/sap-u8500.c
 
 include Makefile.tools
 
audio/telephony-maemo6.c deleted +0 -2196

2,196 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#10 lore raw

PATCH 6/13 build: Remove telephony-ofono.c

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am             |    4 +-
 audio/telephony-ofono.c | 1636 -----------------------------------------------
 2 files changed, 1 insertion(+), 1639 deletions(-)
 delete mode 100644 audio/telephony-ofono.c
Makefile.am +1 -3
index b7e861b..84566c8 100644
@@ -125,8 +125,7 @@ builtin_nodist += audio/telephony.c
 
 noinst_LIBRARIES += audio/libtelephony.a
 
-audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c \
-				audio/telephony-ofono.c
+audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c
 endif
 
 if SAPPLUGIN
@@ -314,7 +313,6 @@ EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf profiles/network/network.conf \
 			profiles/input/input.conf profiles/proximity/proximity.conf \
 			audio/audio.conf audio/telephony-dummy.c \
-			audio/telephony-ofono.c \
 			profiles/sap/sap-dummy.c profiles/sap/sap-u8500.c
 
 include Makefile.tools
audio/telephony-ofono.c deleted +0 -1636

1,636 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#11 lore raw

PATCH 7/13 build: Remove telephony-dummy.c

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am             |  10 +-
 audio/telephony-dummy.c | 444 ------------------------------------------------
 2 files changed, 1 insertion(+), 453 deletions(-)
 delete mode 100644 audio/telephony-dummy.c
Makefile.am +1 -9
index 84566c8..ad2e27a 100644
@@ -121,11 +121,6 @@ builtin_sources += audio/main.c \
 			audio/transport.h audio/transport.c \
 			audio/player.h audio/player.c \
 			audio/telephony.h audio/a2dp-codecs.h
-builtin_nodist += audio/telephony.c
-
-noinst_LIBRARIES += audio/libtelephony.a
-
-audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c
 endif
 
 if SAPPLUGIN
@@ -312,7 +307,7 @@ endif
 EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf profiles/network/network.conf \
 			profiles/input/input.conf profiles/proximity/proximity.conf \
-			audio/audio.conf audio/telephony-dummy.c \
+			audio/audio.conf \
 			profiles/sap/sap-dummy.c profiles/sap/sap-u8500.c
 
 include Makefile.tools
@@ -398,9 +393,6 @@ MAINTAINERCLEANFILES = Makefile.in \
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
 
-audio/telephony.c: audio/@TELEPHONY_DRIVER@
-	$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
-
 profiles/sap/sap.c: profiles/sap/@SAP_DRIVER@
 	$(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
 
audio/telephony-dummy.c deleted +0 -444

444 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#12 lore raw

PATCH 8/13 build: Remove telephony.h

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am       |   2 +-
 audio/manager.c   |   1 -
 audio/telephony.h | 244 ------------------------------------------------------
 3 files changed, 1 insertion(+), 246 deletions(-)
 delete mode 100644 audio/telephony.h
Makefile.am +1 -1
index ad2e27a..a8660af 100644
@@ -120,7 +120,7 @@ builtin_sources += audio/main.c \
 			audio/media.h audio/media.c \
 			audio/transport.h audio/transport.c \
 			audio/player.h audio/player.c \
-			audio/telephony.h audio/a2dp-codecs.h
+			audio/a2dp-codecs.h
 endif
 
 if SAPPLUGIN
audio/manager.c +0 -1
index d151f16..0960d28 100644
@@ -68,7 +68,6 @@
 #include "control.h"
 #include "manager.h"
 #include "sdpd.h"
-#include "telephony.h"
 
 struct audio_adapter {
 	struct btd_adapter *btd_adapter;
audio/telephony.h deleted +0 -244

244 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#13 lore raw

PATCH 9/13 build: Remove headset.c and headset.h

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am     |    1 -
 audio/device.h  |    1 -
 audio/headset.c | 2822 -------------------------------------------------------
 audio/headset.h |  112 ---
 4 files changed, 2936 deletions(-)
 delete mode 100644 audio/headset.c
 delete mode 100644 audio/headset.h
Makefile.am +0 -1
index a8660af..7f8ff26 100644
@@ -108,7 +108,6 @@ builtin_modules += audio
 builtin_sources += audio/main.c \
 			audio/manager.h audio/manager.c \
 			audio/gateway.h audio/gateway.c \
-			audio/headset.h audio/headset.c \
 			audio/control.h audio/control.c \
 			audio/avctp.h audio/avctp.c \
 			audio/avrcp.h audio/avrcp.c \
audio/device.h +0 -1
index 1e2cac1..89916be 100644
@@ -38,7 +38,6 @@ struct audio_device {
 
 	gboolean auto_connect;
 
-	struct headset *headset;
 	struct gateway *gateway;
 	struct sink *sink;
 	struct source *source;
audio/headset.c deleted +0 -2822

2,822 lines not on this page · raw message

audio/headset.h deleted +0 -112

112 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#14 lore raw

PATCH 10/13 audio: Remove code HFP and HS gateway role

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This is to be replaced with external profile support.

---
 audio/device.c    |   7 --
 audio/main.c      |  72 +-------------
 audio/manager.c   | 288 +-----------------------------------------------------
 audio/manager.h   |   3 +-
 audio/media.c     |  71 +-------------
 audio/transport.c | 165 -------------------------------
 6 files changed, 8 insertions(+), 598 deletions(-)
audio/device.c +0 -7
index aaa666d..df57d81 100644
@@ -53,7 +53,6 @@
 #include "control.h"
 #include "avctp.h"
 #include "avrcp.h"
-#include "gateway.h"
 #include "sink.h"
 #include "source.h"
 
@@ -500,9 +499,6 @@ gboolean audio_device_is_active(struct audio_device *dev,
 	else if (!strcmp(interface, AUDIO_CONTROL_INTERFACE) && dev->control &&
 				control_is_active(dev))
 		return TRUE;
-	else if (!strcmp(interface, AUDIO_GATEWAY_INTERFACE) && dev->gateway &&
-				gateway_is_active(dev))
-		return TRUE;
 
 	return FALSE;
 }
@@ -514,9 +510,6 @@ void audio_device_unregister(struct audio_device *device)
 		device->hs_preauth_id = 0;
 	}
 
-	if (device->gateway)
-		gateway_unregister(device);
-
 	if (device->sink)
 		sink_unregister(device);
 
audio/main.c +3 -69

93 lines not on this page · raw message

audio/manager.c +3 -285

366 lines not on this page · raw message

audio/manager.h +1 -2
index d3b5692..5691063 100644
@@ -23,14 +23,13 @@
  */
 
 struct enabled_interfaces {
-	gboolean gateway;
 	gboolean sink;
 	gboolean source;
 	gboolean control;
 	gboolean media_player;
 };
 
-int audio_manager_init(GKeyFile *config, gboolean *enable_sco);
+int audio_manager_init(GKeyFile *config);
 void audio_manager_exit(void);
 
 struct audio_device *manager_find_device(const char *path,
audio/media.c +1 -70

101 lines not on this page · raw message

audio/transport.c +0 -165

213 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#15 lore raw

PATCH 11/13 build: Remove gateway.c and gateway.h

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am     |    1 -
 audio/device.h  |    1 -
 audio/gateway.c | 1048 -------------------------------------------------------
 audio/gateway.h |   75 ----
 4 files changed, 1125 deletions(-)
 delete mode 100644 audio/gateway.c
 delete mode 100644 audio/gateway.h
Makefile.am +0 -1
index 7f8ff26..84ae237 100644
@@ -107,7 +107,6 @@ if AUDIOPLUGIN
 builtin_modules += audio
 builtin_sources += audio/main.c \
 			audio/manager.h audio/manager.c \
-			audio/gateway.h audio/gateway.c \
 			audio/control.h audio/control.c \
 			audio/avctp.h audio/avctp.c \
 			audio/avrcp.h audio/avrcp.c \
audio/device.h +0 -1
index 89916be..f0d178d 100644
@@ -38,7 +38,6 @@ struct audio_device {
 
 	gboolean auto_connect;
 
-	struct gateway *gateway;
 	struct sink *sink;
 	struct source *source;
 	struct control *control;
audio/gateway.c deleted +0 -1048

1,048 lines not on this page · raw message

audio/gateway.h deleted +0 -75

75 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#16 lore raw

PATCH 12/13 audio: Move to profiles directory

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 Makefile.am                             | 32 ++++++++++++++++----------------
 {audio => profiles/audio}/a2dp-codecs.h |  0
 {audio => profiles/audio}/a2dp.c        |  0
 {audio => profiles/audio}/a2dp.h        |  0
 {audio => profiles/audio}/audio.conf    |  0
 {audio => profiles/audio}/avctp.c       |  0
 {audio => profiles/audio}/avctp.h       |  0
 {audio => profiles/audio}/avdtp.c       |  0
 {audio => profiles/audio}/avdtp.h       |  0
 {audio => profiles/audio}/avrcp.c       |  0
 {audio => profiles/audio}/avrcp.h       |  0
 {audio => profiles/audio}/control.c     |  0
 {audio => profiles/audio}/control.h     |  0
 {audio => profiles/audio}/device.c      |  0
 {audio => profiles/audio}/device.h      |  0
 {audio => profiles/audio}/main.c        |  0
 {audio => profiles/audio}/manager.c     |  0
 {audio => profiles/audio}/manager.h     |  0
 {audio => profiles/audio}/media.c       |  0
 {audio => profiles/audio}/media.h       |  0
 {audio => profiles/audio}/player.c      |  0
 {audio => profiles/audio}/player.h      |  0
 {audio => profiles/audio}/rtp.h         |  0
 {audio => profiles/audio}/sink.c        |  0
 {audio => profiles/audio}/sink.h        |  0
 {audio => profiles/audio}/source.c      |  0
 {audio => profiles/audio}/source.h      |  0
 {audio => profiles/audio}/transport.c   |  0
 {audio => profiles/audio}/transport.h   |  0
 29 files changed, 16 insertions(+), 16 deletions(-)
 rename {audio => profiles/audio}/a2dp-codecs.h (100%)
 rename {audio => profiles/audio}/a2dp.c (100%)
 rename {audio => profiles/audio}/a2dp.h (100%)
 rename {audio => profiles/audio}/audio.conf (100%)
 rename {audio => profiles/audio}/avctp.c (100%)
 rename {audio => profiles/audio}/avctp.h (100%)
 rename {audio => profiles/audio}/avdtp.c (100%)
 rename {audio => profiles/audio}/avdtp.h (100%)
 rename {audio => profiles/audio}/avrcp.c (100%)
 rename {audio => profiles/audio}/avrcp.h (100%)
 rename {audio => profiles/audio}/control.c (100%)
 rename {audio => profiles/audio}/control.h (100%)
 rename {audio => profiles/audio}/device.c (100%)
 rename {audio => profiles/audio}/device.h (100%)
 rename {audio => profiles/audio}/main.c (100%)
 rename {audio => profiles/audio}/manager.c (100%)
 rename {audio => profiles/audio}/manager.h (100%)
 rename {audio => profiles/audio}/media.c (100%)
 rename {audio => profiles/audio}/media.h (100%)
 rename {audio => profiles/audio}/player.c (100%)
 rename {audio => profiles/audio}/player.h (100%)
 rename {audio => profiles/audio}/rtp.h (100%)
 rename {audio => profiles/audio}/sink.c (100%)
 rename {audio => profiles/audio}/sink.h (100%)
 rename {audio => profiles/audio}/source.c (100%)
 rename {audio => profiles/audio}/source.h (100%)
 rename {audio => profiles/audio}/transport.c (100%)
 rename {audio => profiles/audio}/transport.h (100%)
Makefile.am +16 -16
index 84ae237..10c811a 100644
@@ -105,20 +105,20 @@ endif
 
 if AUDIOPLUGIN
 builtin_modules += audio
-builtin_sources += audio/main.c \
-			audio/manager.h audio/manager.c \
-			audio/control.h audio/control.c \
-			audio/avctp.h audio/avctp.c \
-			audio/avrcp.h audio/avrcp.c \
-			audio/device.h audio/device.c \
-			audio/source.h audio/source.c \
-			audio/sink.h audio/sink.c \
-			audio/a2dp.h audio/a2dp.c \
-			audio/avdtp.h audio/avdtp.c \
-			audio/media.h audio/media.c \
-			audio/transport.h audio/transport.c \
-			audio/player.h audio/player.c \
-			audio/a2dp-codecs.h
+builtin_sources += profiles/audio/main.c \
+			profiles/audio/manager.h profiles/audio/manager.c \
+			profiles/audio/control.h profiles/audio/control.c \
+			profiles/audio/avctp.h profiles/audio/avctp.c \
+			profiles/audio/avrcp.h profiles/audio/avrcp.c \
+			profiles/audio/device.h profiles/audio/device.c \
+			profiles/audio/source.h profiles/audio/source.c \
+			profiles/audio/sink.h profiles/audio/sink.c \
+			profiles/audio/a2dp.h profiles/audio/a2dp.c \
+			profiles/audio/avdtp.h profiles/audio/avdtp.c \
+			profiles/audio/media.h profiles/audio/media.c \
+			profiles/audio/transport.h profiles/audio/transport.c \
+			profiles/audio/player.h profiles/audio/player.c \
+			profiles/audio/a2dp-codecs.h
 endif
 
 if SAPPLUGIN
@@ -305,7 +305,7 @@ endif
 EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf profiles/network/network.conf \
 			profiles/input/input.conf profiles/proximity/proximity.conf \
-			audio/audio.conf \
+			profiles/audio/audio.conf \
 			profiles/sap/sap-dummy.c profiles/sap/sap-u8500.c
 
 include Makefile.tools
@@ -347,7 +347,7 @@ EXTRA_DIST += doc/manager-api.txt \
 AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@
 
 AM_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
-			-I$(srcdir)/audio -I$(srcdir)/gdbus \
+			-I$(srcdir)/profiles/audio -I$(srcdir)/gdbus \
 			-I$(srcdir)/attrib -I$(srcdir)/btio -I$(srcdir)/tools \
 			-I$(builddir)/tools -I$(srcdir)/monitor
 
profiles/audio/a2dp-codecs.h renamed from audio/a2dp-codecs.h +0 -0
similarity index 100%
rename from audio/a2dp-codecs.h
rename to profiles/audio/a2dp-codecs.h
profiles/audio/a2dp.c renamed from audio/a2dp.c +0 -0
similarity index 100%
rename from audio/a2dp.c
rename to profiles/audio/a2dp.c
profiles/audio/a2dp.h renamed from audio/a2dp.h +0 -0
similarity index 100%
rename from audio/a2dp.h
rename to profiles/audio/a2dp.h
profiles/audio/audio.conf renamed from audio/audio.conf +0 -0
similarity index 100%
rename from audio/audio.conf
rename to profiles/audio/audio.conf
profiles/audio/avctp.c renamed from audio/avctp.c +0 -0
similarity index 100%
rename from audio/avctp.c
rename to profiles/audio/avctp.c
profiles/audio/avctp.h renamed from audio/avctp.h +0 -0
similarity index 100%
rename from audio/avctp.h
rename to profiles/audio/avctp.h
profiles/audio/avdtp.c renamed from audio/avdtp.c +0 -0
similarity index 100%
rename from audio/avdtp.c
rename to profiles/audio/avdtp.c
profiles/audio/avdtp.h renamed from audio/avdtp.h +0 -0
similarity index 100%
rename from audio/avdtp.h
rename to profiles/audio/avdtp.h
profiles/audio/avrcp.c renamed from audio/avrcp.c +0 -0
similarity index 100%
rename from audio/avrcp.c
rename to profiles/audio/avrcp.c
profiles/audio/avrcp.h renamed from audio/avrcp.h +0 -0
similarity index 100%
rename from audio/avrcp.h
rename to profiles/audio/avrcp.h
profiles/audio/control.c renamed from audio/control.c +0 -0
similarity index 100%
rename from audio/control.c
rename to profiles/audio/control.c
profiles/audio/control.h renamed from audio/control.h +0 -0
similarity index 100%
rename from audio/control.h
rename to profiles/audio/control.h
profiles/audio/device.c renamed from audio/device.c +0 -0
similarity index 100%
rename from audio/device.c
rename to profiles/audio/device.c
profiles/audio/device.h renamed from audio/device.h +0 -0
similarity index 100%
rename from audio/device.h
rename to profiles/audio/device.h
profiles/audio/main.c renamed from audio/main.c +0 -0
similarity index 100%
rename from audio/main.c
rename to profiles/audio/main.c
profiles/audio/manager.c renamed from audio/manager.c +0 -0
similarity index 100%
rename from audio/manager.c
rename to profiles/audio/manager.c
profiles/audio/manager.h renamed from audio/manager.h +0 -0
similarity index 100%
rename from audio/manager.h
rename to profiles/audio/manager.h
profiles/audio/media.c renamed from audio/media.c +0 -0
similarity index 100%
rename from audio/media.c
rename to profiles/audio/media.c
profiles/audio/media.h renamed from audio/media.h +0 -0
similarity index 100%
rename from audio/media.h
rename to profiles/audio/media.h
profiles/audio/player.c renamed from audio/player.c +0 -0
similarity index 100%
rename from audio/player.c
rename to profiles/audio/player.c
profiles/audio/player.h renamed from audio/player.h +0 -0
similarity index 100%
rename from audio/player.h
rename to profiles/audio/player.h
profiles/audio/rtp.h renamed from audio/rtp.h +0 -0
similarity index 100%
rename from audio/rtp.h
rename to profiles/audio/rtp.h
profiles/audio/sink.c renamed from audio/sink.c +0 -0
similarity index 100%
rename from audio/sink.c
rename to profiles/audio/sink.c
profiles/audio/sink.h renamed from audio/sink.h +0 -0
similarity index 100%
rename from audio/sink.h
rename to profiles/audio/sink.h
profiles/audio/source.c renamed from audio/source.c +0 -0
similarity index 100%
rename from audio/source.c
rename to profiles/audio/source.c
profiles/audio/source.h renamed from audio/source.h +0 -0
similarity index 100%
rename from audio/source.h
rename to profiles/audio/source.h
profiles/audio/transport.c renamed from audio/transport.c +0 -0
similarity index 100%
rename from audio/transport.c
rename to profiles/audio/transport.c
profiles/audio/transport.h renamed from audio/transport.h +0 -0
similarity index 100%
rename from audio/transport.h
rename to profiles/audio/transport.h
Signature · 1 line
1.7.11.7
author maintainer
#17 lore raw

PATCH 13/13 audio: Add support for passing endpoints as custom property

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This adds the possibility to pass the registered endpoints to external components implementing the same profile.

---
 profiles/audio/media.c | 140 ++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 114 insertions(+), 26 deletions(-)
profiles/audio/media.c +114 -26
index 65037fe..6d45373 100644
@@ -35,7 +35,9 @@
 #include <gdbus.h>
 
 #include "../src/adapter.h"
+#include "../src/device.h"
 #include "../src/dbus-common.h"
+#include "../src/profile.h"
 
 #include "glib-helper.h"
 #include "log.h"
@@ -574,6 +576,111 @@ static gboolean endpoint_init_a2dp_sink(struct media_endpoint *endpoint,
 	return TRUE;
 }
 
+static struct media_endpoint *media_adapter_find_endpoint(
+						struct media_adapter *adapter,
+						const char *sender,
+						const char *path,
+						const char *uuid)
+{
+	GSList *l;
+
+	for (l = adapter->endpoints; l; l = l->next) {
+		struct media_endpoint *endpoint = l->data;
+
+		if (sender && g_strcmp0(endpoint->sender, sender) != 0)
+			continue;
+
+		if (path && g_strcmp0(endpoint->path, path) != 0)
+			continue;
+
+		if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
+			continue;
+
+		return endpoint;
+	}
+
+	return NULL;
+}
+
+static bool endpoint_properties_exists(const char *uuid,
+						struct btd_device *dev,
+						void *user_data)
+{
+	struct media_adapter *adapter = user_data;
+	struct btd_adapter *btd_adapter = device_get_adapter(dev);
+	const bdaddr_t *src = adapter_get_address(btd_adapter);
+
+	if (bacmp(&adapter->src, src) != 0)
+		return false;
+
+	if (media_adapter_find_endpoint(adapter, NULL, NULL, uuid) == NULL)
+		return false;
+
+	return true;
+}
+
+static void append_endpoint(struct media_endpoint *endpoint,
+						DBusMessageIter *dict)
+{
+	DBusMessageIter entry, var, props;
+
+	dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+							NULL, &entry);
+
+	dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
+						&endpoint->sender);
+
+	dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT, "a{sv}",
+								&var);
+
+	dbus_message_iter_open_container(&var, DBUS_TYPE_ARRAY,
+					DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+					DBUS_TYPE_STRING_AS_STRING
+					DBUS_TYPE_VARIANT_AS_STRING
+					DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
+					&props);
+
+	dict_append_entry(&props, "Path", DBUS_TYPE_OBJECT_PATH,
+							&endpoint->path);
+	dict_append_entry(&props, "Codec", DBUS_TYPE_BYTE, &endpoint->codec);
+	dict_append_array(&props, "Capabilities", DBUS_TYPE_BYTE,
+				&endpoint->capabilities, endpoint->size);
+
+	dbus_message_iter_close_container(&var, &props);
+	dbus_message_iter_close_container(&entry, &var);
+	dbus_message_iter_close_container(dict, &entry);
+}
+
+static bool endpoint_properties_get(const char *uuid,
+						struct btd_device *dev,
+						DBusMessageIter *iter,
+						void *user_data)
+{
+	struct media_adapter *adapter = user_data;
+	DBusMessageIter dict;
+	GSList *l;
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+					DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+					DBUS_TYPE_STRING_AS_STRING
+					DBUS_TYPE_VARIANT_AS_STRING
+					DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
+					&dict);
+
+	for (l = adapter->endpoints; l; l = l->next) {
+		struct media_endpoint *endpoint = l->data;
+
+		if (g_strcmp0(endpoint->uuid, uuid) != 0)
+			continue;
+
+		append_endpoint(endpoint, &dict);
+	}
+
+	dbus_message_iter_close_container(iter, &dict);
+
+	return true;
+}
+
 static struct media_endpoint *media_endpoint_create(struct media_adapter *adapter,
 						const char *sender,
 						const char *path,
@@ -629,6 +736,13 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte
 						sender, media_endpoint_exit,
 						endpoint, NULL);
 
+	if (media_adapter_find_endpoint(adapter, NULL, NULL, uuid) == NULL) {
+		btd_profile_add_custom_prop(uuid, "a{sv}", "Endpoints",
+						endpoint_properties_exists,
+						endpoint_properties_get,
+						adapter);
+	}
+
 	adapter->endpoints = g_slist_append(adapter->endpoints, endpoint);
 	info("Endpoint registered: sender=%s path=%s", sender, path);
 
@@ -637,32 +751,6 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte
 	return endpoint;
 }
 
-static struct media_endpoint *media_adapter_find_endpoint(
-						struct media_adapter *adapter,
-						const char *sender,
-						const char *path,
-						const char *uuid)
-{
-	GSList *l;
-
-	for (l = adapter->endpoints; l; l = l->next) {
-		struct media_endpoint *endpoint = l->data;
-
-		if (sender && g_strcmp0(endpoint->sender, sender) != 0)
-			continue;
-
-		if (path && g_strcmp0(endpoint->path, path) != 0)
-			continue;
-
-		if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
-			continue;
-
-		return endpoint;
-	}
-
-	return NULL;
-}
-
 static int parse_properties(DBusMessageIter *props, const char **uuid,
 				gboolean *delay_reporting, uint8_t *codec,
 				uint8_t **capabilities, int *size)
Signature · 1 line
1.7.11.7
#18 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 93 lines · Luiz Augusto von Dentz

These changes remove HFP implemention from audio plugin and move audio under profiles directory.

HFP can be emulated by test-profile -u hfp, all the telephony backends are gone as well since this is now suppose to be a external profile probably done inside the telephony stack e.g. oFono in use in the platform.

Luiz Augusto von Dentz (13):
audio: Remove HFP and HSP headset role support
audio: Remove HFP option from audio.conf
audio: Remove code using headset
build: Remove telephony-maemo5.c
build: Remove telephony-maemo6.c
build: Remove telephony-ofono.c
build: Remove telephony-dummy.c
build: Remove telephony.h
build: Remove headset.c and headset.h
audio: Remove code HFP and HS gateway role
build: Remove gateway.c and gateway.h
audio: Move to profiles directory
audio: Add support for passing endpoints as custom property

 Makefile.am                             |   48 +-
 audio/gateway.c                         | 1048 ------------
 audio/gateway.h                         |   75 -
 audio/headset.c                         | 2825 -------------------------------
 audio/headset.h                         |  112 --
 audio/manager.c                         | 1387 ---------------
 audio/telephony-dummy.c                 |  444 -----
 audio/telephony-maemo5.c                | 2102 -----------------------
 audio/telephony-maemo6.c                | 2196 ------------------------
 audio/telephony-ofono.c                 | 1636 ------------------
 audio/telephony.h                       |  244 ---
 {audio => profiles/audio}/a2dp-codecs.h |    0
 {audio => profiles/audio}/a2dp.c        |    0
 {audio => profiles/audio}/a2dp.h        |    0
 {audio => profiles/audio}/audio.conf    |    4 -
 {audio => profiles/audio}/avctp.c       |    0
 {audio => profiles/audio}/avctp.h       |    0
 {audio => profiles/audio}/avdtp.c       |    0
 {audio => profiles/audio}/avdtp.h       |    0
 {audio => profiles/audio}/avrcp.c       |    0
 {audio => profiles/audio}/avrcp.h       |    0
 {audio => profiles/audio}/control.c     |    0
 {audio => profiles/audio}/control.h     |    0
 {audio => profiles/audio}/device.c      |  198 +--
 {audio => profiles/audio}/device.h      |    2 -
 {audio => profiles/audio}/main.c        |   98 +-
 profiles/audio/manager.c                |  552 ++++++
 {audio => profiles/audio}/manager.h     |    7 +-
 {audio => profiles/audio}/media.c       |  245 ++-
 {audio => profiles/audio}/media.h       |    0
 {audio => profiles/audio}/player.c      |    0
 {audio => profiles/audio}/player.h      |    0
 {audio => profiles/audio}/rtp.h         |    0
 {audio => profiles/audio}/sink.c        |    0
 {audio => profiles/audio}/sink.h        |    0
 {audio => profiles/audio}/source.c      |    0
 {audio => profiles/audio}/source.h      |    0
 {audio => profiles/audio}/transport.c   |  380 -----
 {audio => profiles/audio}/transport.h   |    0
 39 files changed, 673 insertions(+), 12930 deletions(-)
 delete mode 100644 audio/gateway.c
 delete mode 100644 audio/gateway.h
 delete mode 100644 audio/headset.c
 delete mode 100644 audio/headset.h
 delete mode 100644 audio/manager.c
 delete mode 100644 audio/telephony-dummy.c
 delete mode 100644 audio/telephony-maemo5.c
 delete mode 100644 audio/telephony-maemo6.c
 delete mode 100644 audio/telephony-ofono.c
 delete mode 100644 audio/telephony.h
 rename {audio => profiles/audio}/a2dp-codecs.h (100%)
 rename {audio => profiles/audio}/a2dp.c (100%)
 rename {audio => profiles/audio}/a2dp.h (100%)
 rename {audio => profiles/audio}/audio.conf (93%)
 rename {audio => profiles/audio}/avctp.c (100%)
 rename {audio => profiles/audio}/avctp.h (100%)
 rename {audio => profiles/audio}/avdtp.c (100%)
 rename {audio => profiles/audio}/avdtp.h (100%)
 rename {audio => profiles/audio}/avrcp.c (100%)
 rename {audio => profiles/audio}/avrcp.h (100%)
 rename {audio => profiles/audio}/control.c (100%)
 rename {audio => profiles/audio}/control.h (100%)
 rename {audio => profiles/audio}/device.c (69%)
 rename {audio => profiles/audio}/device.h (96%)
 rename {audio => profiles/audio}/main.c (53%)
 create mode 100644 profiles/audio/manager.c
 rename {audio => profiles/audio}/manager.h (89%)
 rename {audio => profiles/audio}/media.c (91%)
 rename {audio => profiles/audio}/media.h (100%)
 rename {audio => profiles/audio}/player.c (100%)
Quoted 8 lines
 rename {audio => profiles/audio}/player.h (100%)
 rename {audio => profiles/audio}/rtp.h (100%)
 rename {audio => profiles/audio}/sink.c (100%)
 rename {audio => profiles/audio}/sink.h (100%)
 rename {audio => profiles/audio}/source.c (100%)
 rename {audio => profiles/audio}/source.h (100%)
 rename {audio => profiles/audio}/transport.c (72%)
 rename {audio => profiles/audio}/transport.h (100%)

Looks good to me. Feel free to apply.

Johan

author maintainer
#19 lore raw

Hi Johan,

Quoted 105 lines · Johan Hedberg

Hi Luiz,

Quoted 93 lines · Luiz Augusto von Dentz

These changes remove HFP implemention from audio plugin and move audio under profiles directory.

HFP can be emulated by test-profile -u hfp, all the telephony backends are gone as well since this is now suppose to be a external profile probably done inside the telephony stack e.g. oFono in use in the platform.

Luiz Augusto von Dentz (13):
audio: Remove HFP and HSP headset role support
audio: Remove HFP option from audio.conf
audio: Remove code using headset
build: Remove telephony-maemo5.c
build: Remove telephony-maemo6.c
build: Remove telephony-ofono.c
build: Remove telephony-dummy.c
build: Remove telephony.h
build: Remove headset.c and headset.h
audio: Remove code HFP and HS gateway role
build: Remove gateway.c and gateway.h
audio: Move to profiles directory
audio: Add support for passing endpoints as custom property

 Makefile.am                             |   48 +-
 audio/gateway.c                         | 1048 ------------
 audio/gateway.h                         |   75 -
 audio/headset.c                         | 2825 -------------------------------
 audio/headset.h                         |  112 --
 audio/manager.c                         | 1387 ---------------
 audio/telephony-dummy.c                 |  444 -----
 audio/telephony-maemo5.c                | 2102 -----------------------
 audio/telephony-maemo6.c                | 2196 ------------------------
 audio/telephony-ofono.c                 | 1636 ------------------
 audio/telephony.h                       |  244 ---
 {audio => profiles/audio}/a2dp-codecs.h |    0
 {audio => profiles/audio}/a2dp.c        |    0
 {audio => profiles/audio}/a2dp.h        |    0
 {audio => profiles/audio}/audio.conf    |    4 -
 {audio => profiles/audio}/avctp.c       |    0
 {audio => profiles/audio}/avctp.h       |    0
 {audio => profiles/audio}/avdtp.c       |    0
 {audio => profiles/audio}/avdtp.h       |    0
 {audio => profiles/audio}/avrcp.c       |    0
 {audio => profiles/audio}/avrcp.h       |    0
 {audio => profiles/audio}/control.c     |    0
 {audio => profiles/audio}/control.h     |    0
 {audio => profiles/audio}/device.c      |  198 +--
 {audio => profiles/audio}/device.h      |    2 -
 {audio => profiles/audio}/main.c        |   98 +-
 profiles/audio/manager.c                |  552 ++++++
 {audio => profiles/audio}/manager.h     |    7 +-
 {audio => profiles/audio}/media.c       |  245 ++-
 {audio => profiles/audio}/media.h       |    0
 {audio => profiles/audio}/player.c      |    0
 {audio => profiles/audio}/player.h      |    0
 {audio => profiles/audio}/rtp.h         |    0
 {audio => profiles/audio}/sink.c        |    0
 {audio => profiles/audio}/sink.h        |    0
 {audio => profiles/audio}/source.c      |    0
 {audio => profiles/audio}/source.h      |    0
 {audio => profiles/audio}/transport.c   |  380 -----
 {audio => profiles/audio}/transport.h   |    0
 39 files changed, 673 insertions(+), 12930 deletions(-)
 delete mode 100644 audio/gateway.c
 delete mode 100644 audio/gateway.h
 delete mode 100644 audio/headset.c
 delete mode 100644 audio/headset.h
 delete mode 100644 audio/manager.c
 delete mode 100644 audio/telephony-dummy.c
 delete mode 100644 audio/telephony-maemo5.c
 delete mode 100644 audio/telephony-maemo6.c
 delete mode 100644 audio/telephony-ofono.c
 delete mode 100644 audio/telephony.h
 rename {audio => profiles/audio}/a2dp-codecs.h (100%)
 rename {audio => profiles/audio}/a2dp.c (100%)
 rename {audio => profiles/audio}/a2dp.h (100%)
 rename {audio => profiles/audio}/audio.conf (93%)
 rename {audio => profiles/audio}/avctp.c (100%)
 rename {audio => profiles/audio}/avctp.h (100%)
 rename {audio => profiles/audio}/avdtp.c (100%)
 rename {audio => profiles/audio}/avdtp.h (100%)
 rename {audio => profiles/audio}/avrcp.c (100%)
 rename {audio => profiles/audio}/avrcp.h (100%)
 rename {audio => profiles/audio}/control.c (100%)
 rename {audio => profiles/audio}/control.h (100%)
 rename {audio => profiles/audio}/device.c (69%)
 rename {audio => profiles/audio}/device.h (96%)
 rename {audio => profiles/audio}/main.c (53%)
 create mode 100644 profiles/audio/manager.c
 rename {audio => profiles/audio}/manager.h (89%)
 rename {audio => profiles/audio}/media.c (91%)
 rename {audio => profiles/audio}/media.h (100%)
 rename {audio => profiles/audio}/player.c (100%)
Quoted 8 lines
 rename {audio => profiles/audio}/player.h (100%)
 rename {audio => profiles/audio}/rtp.h (100%)
 rename {audio => profiles/audio}/sink.c (100%)
 rename {audio => profiles/audio}/sink.h (100%)
 rename {audio => profiles/audio}/source.c (100%)
 rename {audio => profiles/audio}/source.h (100%)
 rename {audio => profiles/audio}/transport.c (72%)
 rename {audio => profiles/audio}/transport.h (100%)
Quoted 1 line

Looks good to me. Feel free to apply.

Pushed upstream.

Signature · 1 line
Luiz Augusto von Dentz