audio/AVDTP: Remove unused code
Luiz Augusto von Dentz
maintainerPATCH 1/5 audio/AVDTP: Remove unused code
From: Luiz Augusto von Dentz <[email protected]>
--- profiles/audio/avdtp.c | 20 -------------------- profiles/audio/avdtp.h | 8 -------- 2 files changed, 28 deletions(-)
profiles/audio/avdtp.c +0 -20
@@ -3283,31 +3283,11 @@ struct avdtp_remote_sep *avdtp_get_remote_sep(struct avdtp *session,return NULL ; } -uint8_t avdtp_get_seid (struct avdtp_remote_sep *sep) -{ -return sep->seid; -} - -uint8_t avdtp_get_type (struct avdtp_remote_sep *sep) -{ -return sep->type; -} -struct avdtp_service_capability *avdtp_get_codec (struct avdtp_remote_sep *sep) {return sep->codec; } -gboolean avdtp_get_delay_reporting (struct avdtp_remote_sep *sep) -{ -return sep->delay_reporting; -} - -struct avdtp_stream *avdtp_get_stream (struct avdtp_remote_sep *sep) -{ -return sep->stream; -} -struct avdtp_service_capability *avdtp_service_cap_new (uint8_t category,void *data,int length) {
profiles/audio/avdtp.h +0 -8
@@ -224,16 +224,8 @@ struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category,struct avdtp_remote_sep *avdtp_get_remote_sep (struct avdtp *session,uint8_t seid); -uint8_t avdtp_get_seid (struct avdtp_remote_sep *sep); - -uint8_t avdtp_get_type (struct avdtp_remote_sep *sep); -struct avdtp_service_capability *avdtp_get_codec (struct avdtp_remote_sep *sep); -gboolean avdtp_get_delay_reporting (struct avdtp_remote_sep *sep); - -struct avdtp_stream *avdtp_get_stream (struct avdtp_remote_sep *sep); -int avdtp_discover (struct avdtp *session,avdtp_discover_cb_t cb,void *user_data);
Signature · 1 line
1.8.3.1
Luiz Augusto von Dentz
maintainerPATCH 2/5 audio/AVDTP: Remove public function that are only used locally
From: Luiz Augusto von Dentz <[email protected]>
--- profiles/audio/avdtp.c | 30 ++++++++++++------------------ profiles/audio/avdtp.h | 5 ----- 2 files changed, 12 insertions(+), 23 deletions(-)
profiles/audio/avdtp.c +12 -18
@@ -3183,8 +3183,8 @@ struct avdtp_service_capability *avdtp_stream_get_codec(return NULL ; } -gboolean avdtp_stream_has_capability (struct avdtp_stream *stream, -struct avdtp_service_capability *cap) +static gboolean avdtp_stream_has_capability (struct avdtp_stream *stream, +struct avdtp_service_capability *cap) {GSList *l;struct avdtp_service_capability *stream_cap;
@@ -3219,7 +3219,16 @@ gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream,struct avdtp_remote_sep *avdtp_stream_get_remote_sep (struct avdtp_stream *stream) { -return avdtp_get_remote_sep (stream->session, stream->rseid); +GSList *l; + +for (l = stream->session->seps; l; l = l->next) { +struct avdtp_remote_sep *sep = l->data; + +if (sep->seid == stream->rseid) +return sep; + } + +return NULL ; } gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock,
@@ -3268,21 +3277,6 @@ static int process_queue(struct avdtp *session)return send_req (session, FALSE, req); } -struct avdtp_remote_sep *avdtp_get_remote_sep (struct avdtp *session, -uint8_t seid) -{ -GSList *l; - -for (l = session->seps; l; l = l->next) { -struct avdtp_remote_sep *sep = l->data; - -if (sep->seid == seid) -return sep; - } - -return NULL ; -} -struct avdtp_service_capability *avdtp_get_codec (struct avdtp_remote_sep *sep) {return sep->codec;
profiles/audio/avdtp.h +0 -5
@@ -221,9 +221,6 @@ struct avdtp *avdtp_ref(struct avdtp *session);struct avdtp_service_capability *avdtp_service_cap_new (uint8_t category,void *data,int size); -struct avdtp_remote_sep *avdtp_get_remote_sep (struct avdtp *session, -uint8_t seid); -struct avdtp_service_capability *avdtp_get_codec (struct avdtp_remote_sep *sep); int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
@@ -243,8 +240,6 @@ gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock, GSList **caps);struct avdtp_service_capability *avdtp_stream_get_codec (struct avdtp_stream *stream); -gboolean avdtp_stream_has_capability (struct avdtp_stream *stream, -struct avdtp_service_capability *cap);gboolean avdtp_stream_has_capabilities (struct avdtp_stream *stream,GSList *caps); struct avdtp_remote_sep *avdtp_stream_get_remote_sep(
Signature · 1 line
1.8.3.1
Luiz Augusto von Dentz
maintainerPATCH 3/5 audio/source: Remove shutdown parameter from source_disconnect
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This parameter is always false so it never do anything.
--- profiles/audio/a2dp.c | 2 +- profiles/audio/source.c | 5 +---- profiles/audio/source.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)
profiles/audio/a2dp.c +1 -1
@@ -1887,7 +1887,7 @@ static int a2dp_source_disconnect(struct btd_service *service)DBG ("path %s" , path); -return source_disconnect (service, FALSE); +return source_disconnect (service); }static int a2dp_sink_connect (struct btd_service *service)
profiles/audio/source.c +1 -4
@@ -380,16 +380,13 @@ gboolean source_new_stream(struct btd_service *service, struct avdtp *session,return TRUE; } -int source_disconnect (struct btd_service *service,gboolean shutdown) +int source_disconnect (struct btd_service *service) {struct source *source =btd_service_get_user_data (service);if (!source->session)return -ENOTCONN ; -if (shutdown) -avdtp_set_device_disconnect (source->session, TRUE); -/* cancel pending connect */ if (source->connect_id >0 ) {a2dp_cancel (source->connect_id);
profiles/audio/source.h +1 -1
@@ -48,4 +48,4 @@ gboolean source_new_stream(struct btd_service *service, struct avdtp *session, struct avdtp_stream *stream);gboolean source_setup_stream (struct btd_service *service,struct avdtp *session); -int source_disconnect (struct btd_service *service,gboolean shutdown); +int source_disconnect (struct btd_service *service);
Signature · 1 line
1.8.3.1
Luiz Augusto von Dentz
maintainerPATCH 4/5 audio/sink: Remove shutdown parameter from sink_disconnect
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This parameter is always false so it never do anything.
--- profiles/audio/a2dp.c | 2 +- profiles/audio/sink.c | 5 +---- profiles/audio/sink.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)
profiles/audio/a2dp.c +1 -1
@@ -1919,7 +1919,7 @@ static int a2dp_sink_disconnect(struct btd_service *service)DBG ("path %s" , path); -return sink_disconnect (service, FALSE); +return sink_disconnect (service); } static int a2dp_source_server_probe(struct btd_profile *p,
profiles/audio/sink.c +1 -4
@@ -388,16 +388,13 @@ gboolean sink_new_stream(struct btd_service *service, struct avdtp *session,return TRUE; } -int sink_disconnect (struct btd_service *service,gboolean shutdown) +int sink_disconnect (struct btd_service *service) {struct sink *sink =btd_service_get_user_data (service);if (!sink->session)return -ENOTCONN ; -if (shutdown) -avdtp_set_device_disconnect (sink->session, TRUE); -/* cancel pending connect */ if (sink->connect_id >0 ) {a2dp_cancel (sink->connect_id);
profiles/audio/sink.h +1 -1
@@ -47,4 +47,4 @@ int sink_connect(struct btd_service *service);gboolean sink_new_stream (struct btd_service *service,struct avdtp *session,struct avdtp_stream *stream);gboolean sink_setup_stream (struct btd_service *service,struct avdtp *session); -int sink_disconnect (struct btd_service *service,gboolean shutdown); +int sink_disconnect (struct btd_service *service);
Signature · 1 line
1.8.3.1
Luiz Augusto von Dentz
maintainerPATCH 5/5 audio/AVDTP: Remove unused avdtp_set_device_disconnect
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- profiles/audio/avdtp.c | 13 ------------- profiles/audio/avdtp.h | 2 -- 2 files changed, 15 deletions(-)
profiles/audio/avdtp.c +0 -13
@@ -394,9 +394,6 @@ struct avdtp {avdtp_session_state_t state; -/* True if the entire device is being disconnected */ -gboolean device_disconnect; -guint auth_id;GIOChannel *io;
@@ -1200,11 +1197,6 @@ static void set_disconnect_timer(struct avdtp *session)if (session->dc_timer)remove_disconnect_timer (session); -if (session->device_disconnect) { - session->dc_timer =g_idle_add (disconnect_timeout, session); -return ; - } - session->dc_timer =g_timeout_add_seconds (DISCONNECT_TIMEOUT , disconnect_timeout, session);
@@ -3841,11 +3833,6 @@ gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream)return g_slist_find (session->streams, stream) ? TRUE : FALSE; } -void avdtp_set_device_disconnect (struct avdtp *session,gboolean dev_dc) -{ - session->device_disconnect = dev_dc; -} -unsigned int avdtp_add_state_cb (struct btd_device *dev,avdtp_session_state_cb cb,void *user_data) {
profiles/audio/avdtp.h +0 -2
@@ -293,5 +293,3 @@ int avdtp_error_posix_errno(struct avdtp_error *err);struct btd_adapter *avdtp_get_adapter (struct avdtp *session);struct btd_device *avdtp_get_device (struct avdtp *session); - -void avdtp_set_device_disconnect (struct avdtp *session,gboolean dev_dc);
Signature · 1 line
1.8.3.1
Hi Luiz,
Quoted 4 lines · Luiz Augusto von Dentz
--- profiles/audio/avdtp.c | 20 -------------------- profiles/audio/avdtp.h | 8 -------- 2 files changed, 28 deletions(-)
All five patches have been applied. Thanks.
Johan