[PATCH BlueZ V2 1/3] audio: Remove unused local A2DP endpoints reference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chan-yeol Park <chanyeol.park@xxxxxxxxxxx>

---
 audio/a2dp.c |   74 +++-------------------------------------------------------
 audio/a2dp.h |    2 --
 2 files changed, 3 insertions(+), 73 deletions(-)

diff --git a/audio/a2dp.c b/audio/a2dp.c
index db4bb13..4567ce0 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1562,7 +1562,6 @@ struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
 	GSList **l;
 	uint32_t *record_id;
 	sdp_record_t *record;
-	struct avdtp_sep_ind *ind;
 
 	server = find_server(servers, src);
 	if (server == NULL) {
@@ -1585,17 +1584,11 @@ struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
 
 	sep = g_new0(struct a2dp_sep, 1);
 
-	if (endpoint) {
-		ind = &endpoint_ind;
-		goto proceed;
-	}
-
-	ind = (codec == A2DP_CODEC_MPEG12) ? &mpeg_ind : &sbc_ind;
-
-proceed:
 	sep->lsep = avdtp_register_sep(&server->src, type,
 					AVDTP_MEDIA_TYPE_AUDIO, codec,
-					delay_reporting, ind, &cfm, sep);
+					delay_reporting, &endpoint_ind,
+					&cfm, sep);
+
 	if (sep->lsep == NULL) {
 		g_free(sep);
 		if (err)
@@ -1679,44 +1672,6 @@ void a2dp_remove_sep(struct a2dp_sep *sep)
 	a2dp_unregister_sep(sep);
 }
 
-struct a2dp_sep *a2dp_get(struct avdtp *session,
-				struct avdtp_remote_sep *rsep)
-{
-	GSList *l;
-	struct a2dp_server *server;
-	struct avdtp_service_capability *cap;
-	struct avdtp_media_codec_capability *codec_cap = NULL;
-	bdaddr_t src;
-
-	avdtp_get_peers(session, &src, NULL);
-	server = find_server(servers, &src);
-	if (!server)
-		return NULL;
-
-	cap = avdtp_get_codec(rsep);
-	codec_cap = (void *) cap->data;
-
-	if (avdtp_get_type(rsep) == AVDTP_SEP_TYPE_SINK)
-		l = server->sources;
-	else
-		l = server->sinks;
-
-	for (; l != NULL; l = l->next) {
-		struct a2dp_sep *sep = l->data;
-
-		if (sep->locked)
-			continue;
-
-		if (sep->codec != codec_cap->media_codec_type)
-			continue;
-
-		if (!sep->stream || avdtp_has_stream(session, sep->stream))
-			return sep;
-	}
-
-	return NULL;
-}
-
 static uint8_t default_bitpool(uint8_t freq, uint8_t mode)
 {
 	switch (freq) {
@@ -1889,15 +1844,6 @@ done:
 	finalize_select(setup);
 }
 
-static gboolean auto_select(gpointer data)
-{
-	struct a2dp_setup *setup = data;
-
-	finalize_select(setup);
-
-	return FALSE;
-}
-
 static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list,
 					const char *sender)
 {
@@ -1982,20 +1928,6 @@ unsigned int a2dp_select_capabilities(struct avdtp *session,
 		goto fail;
 	}
 
-	/* FIXME: Remove auto select when it is not longer possible to register
-	endpoint in the configuration file */
-	if (sep->endpoint == NULL) {
-		if (!select_capabilities(session, setup->rsep,
-					&setup->caps)) {
-			error("Unable to auto select remote SEP capabilities");
-			goto fail;
-		}
-
-		g_idle_add(auto_select, setup);
-
-		return cb_data->id;
-	}
-
 	service = avdtp_get_codec(setup->rsep);
 	codec = (struct avdtp_media_codec_capability *) service->data;
 
diff --git a/audio/a2dp.h b/audio/a2dp.h
index 887c5ac..3a677aa 100644
--- a/audio/a2dp.h
+++ b/audio/a2dp.h
@@ -171,8 +171,6 @@ struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
 				int *err);
 void a2dp_remove_sep(struct a2dp_sep *sep);
 
-struct a2dp_sep *a2dp_get(struct avdtp *session, struct avdtp_remote_sep *sep);
-
 unsigned int a2dp_select_capabilities(struct avdtp *session,
 					uint8_t type, const char *sender,
 					a2dp_select_cb_t cb,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux