summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-12 22:43:14 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-12 22:43:14 +0000
commitf9d8837abad3b67b70425157ac854deb892b2b91 (patch)
treea211e513f4b35fc13d4489223c954e8ac251bf42
parentb7e278c688f4c1442f33ad574577c56979670415 (diff)
All local SEP callbacks need a avdtp session parameter
-rw-r--r--audio/a2dp.c38
-rw-r--r--audio/avdtp.c20
-rw-r--r--audio/avdtp.h40
3 files changed, 56 insertions, 42 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 6d9009a8..1f34fc24 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -77,7 +77,7 @@ static gboolean setconf_ind(struct avdtp *session,
return TRUE;
}
-static gboolean getcap_ind(struct avdtp_local_sep *sep,
+static gboolean getcap_ind(struct avdtp *session, struct avdtp_local_sep *sep,
GSList **caps, uint8_t *err)
{
struct avdtp_service_capability *media_transport, *media_codec;
@@ -131,7 +131,7 @@ static gboolean getcap_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void setconf_cfm(struct avdtp_local_sep *sep,
+static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream)
{
if (sep == sink_sep)
@@ -140,7 +140,8 @@ static void setconf_cfm(struct avdtp_local_sep *sep,
debug("SBC Source: Set_Configuration_Cfm");
}
-static gboolean getconf_ind(struct avdtp_local_sep *sep, uint8_t *err)
+static gboolean getconf_ind(struct avdtp *session, struct avdtp_local_sep *sep,
+ uint8_t *err)
{
if (sep == sink_sep)
debug("SBC Sink: Get_Configuration_Ind");
@@ -149,7 +150,7 @@ static gboolean getconf_ind(struct avdtp_local_sep *sep, uint8_t *err)
return TRUE;
}
-static void getconf_cfm(struct avdtp_local_sep *sep,
+static void getconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream)
{
if (sep == sink_sep)
@@ -158,7 +159,7 @@ static void getconf_cfm(struct avdtp_local_sep *sep,
debug("SBC Source: Set_Configuration_Cfm");
}
-static gboolean open_ind(struct avdtp_local_sep *sep,
+static gboolean open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err)
{
if (sep == sink_sep)
@@ -168,7 +169,8 @@ static gboolean open_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void open_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
+static void open_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
+ struct avdtp_stream *stream)
{
if (sep == sink_sep)
debug("SBC Sink: Open_Cfm");
@@ -176,7 +178,7 @@ static void open_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
debug("SBC Source: Open_Cfm");
}
-static gboolean start_ind(struct avdtp_local_sep *sep,
+static gboolean start_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err)
{
if (sep == sink_sep)
@@ -186,7 +188,8 @@ static gboolean start_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void start_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
+static void start_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
+ struct avdtp_stream *stream)
{
if (sep == sink_sep)
debug("SBC Sink: Start_Cfm");
@@ -194,7 +197,7 @@ static void start_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
debug("SBC Source: Start_Cfm");
}
-static gboolean suspend_ind(struct avdtp_local_sep *sep,
+static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err)
{
if (sep == sink_sep)
@@ -204,7 +207,7 @@ static gboolean suspend_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void suspend_cfm(struct avdtp_local_sep *sep,
+static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream)
{
if (sep == sink_sep)
@@ -213,7 +216,7 @@ static void suspend_cfm(struct avdtp_local_sep *sep,
debug("SBC Source: Suspend_Cfm");
}
-static gboolean close_ind(struct avdtp_local_sep *sep,
+static gboolean close_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err)
{
if (sep == sink_sep)
@@ -223,7 +226,8 @@ static gboolean close_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void close_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
+static void close_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
+ struct avdtp_stream *stream)
{
if (sep == sink_sep)
debug("SBC Sink: Close_Cfm");
@@ -231,7 +235,7 @@ static void close_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
debug("SBC Source: Close_Cfm");
}
-static gboolean abort_ind(struct avdtp_local_sep *sep,
+static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err)
{
if (sep == sink_sep)
@@ -241,7 +245,8 @@ static gboolean abort_ind(struct avdtp_local_sep *sep,
return TRUE;
}
-static void abort_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
+static void abort_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
+ struct avdtp_stream *stream)
{
if (sep == sink_sep)
debug("SBC Sink: Abort_Cfm");
@@ -249,7 +254,8 @@ static void abort_cfm(struct avdtp_local_sep *sep, struct avdtp_stream *stream)
debug("SBC Source: Abort_Cfm");
}
-static gboolean reconf_ind(struct avdtp_local_sep *sep, uint8_t *err)
+static gboolean reconf_ind(struct avdtp *session, struct avdtp_local_sep *sep,
+ uint8_t *err)
{
if (sep == sink_sep)
debug("SBC Sink: ReConfigure_Ind");
@@ -258,7 +264,7 @@ static gboolean reconf_ind(struct avdtp_local_sep *sep, uint8_t *err)
return TRUE;
}
-static void reconf_cfm(struct avdtp_local_sep *sep)
+static void reconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep)
{
if (sep == sink_sep)
debug("SBC Sink: ReConfigure_Cfm");
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 58903d3b..3dafc1bc 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -728,7 +728,7 @@ static gboolean avdtp_getcap_cmd(struct avdtp *session,
goto failed;
}
- if (!sep->ind->get_capability(sep, &caps, &err))
+ if (!sep->ind->get_capability(session, sep, &caps, &err))
goto failed;
init_response(&rsp->header, &req->header, TRUE);
@@ -862,7 +862,7 @@ static gboolean avdtp_open_cmd(struct avdtp *session, struct seid_req *req,
stream = sep->stream;
if (sep->ind && sep->ind->open) {
- if (!sep->ind->open(sep, stream, &err))
+ if (!sep->ind->open(session, sep, stream, &err))
goto failed;
}
@@ -920,7 +920,7 @@ static gboolean avdtp_close_cmd(struct avdtp *session, struct seid_req *req,
stream = sep->stream;
if (sep->ind && sep->ind->close) {
- if (!sep->ind->close(sep, stream, &err))
+ if (!sep->ind->close(session, sep, stream, &err))
goto failed;
}
@@ -969,7 +969,7 @@ static gboolean avdtp_abort_cmd(struct avdtp *session, struct seid_req *req,
}
if (sep->ind && sep->ind->abort) {
- if (!sep->ind->abort(sep, sep->stream, &err))
+ if (!sep->ind->abort(session, sep, sep->stream, &err))
goto failed;
}
@@ -1043,7 +1043,7 @@ static gboolean transport_cb(GIOChannel *chan, GIOCondition cond,
struct avdtp_local_sep *sep = stream->lsep;
if (stream->close_int && sep->cfm && sep->cfm->close)
- sep->cfm->close(sep, stream);
+ sep->cfm->close(stream->session, sep, stream);
avdtp_sep_set_state(stream->session, sep, AVDTP_STATE_IDLE);
@@ -1068,7 +1068,7 @@ static void handle_transport_connect(struct avdtp *session, int sock,
stream->mtu = mtu;
if (!stream->open_acp && sep->cfm && sep->cfm->open)
- sep->cfm->open(sep, stream);
+ sep->cfm->open(session, sep, stream);
channel = g_io_channel_unix_new(stream->sock);
@@ -1520,7 +1520,7 @@ static gboolean avdtp_set_configuration_resp(struct avdtp *session,
struct avdtp_local_sep *sep = stream->lsep;
if (sep->cfm && sep->cfm->set_configuration)
- sep->cfm->set_configuration(sep, stream);
+ sep->cfm->set_configuration(session, sep, stream);
avdtp_sep_set_state(session, sep, AVDTP_STATE_CONFIGURED);
@@ -1554,7 +1554,7 @@ static gboolean avdtp_start_resp(struct avdtp *session,
struct avdtp_local_sep *sep = stream->lsep;
if (sep->cfm && sep->cfm->start)
- sep->cfm->start(sep, stream);
+ sep->cfm->start(session, sep, stream);
avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING);
@@ -1583,7 +1583,7 @@ static gboolean avdtp_suspend_resp(struct avdtp *session,
struct avdtp_local_sep *sep = stream->lsep;
if (sep->cfm && sep->cfm->suspend)
- sep->cfm->suspend(sep, stream);
+ sep->cfm->suspend(session, sep, stream);
avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN);
@@ -1597,7 +1597,7 @@ static gboolean avdtp_abort_resp(struct avdtp *session,
struct avdtp_local_sep *sep = stream->lsep;
if (sep->cfm && sep->cfm->suspend)
- sep->cfm->suspend(sep, stream);
+ sep->cfm->suspend(session, sep, stream);
avdtp_sep_set_state(session, sep, AVDTP_STATE_IDLE);
diff --git a/audio/avdtp.h b/audio/avdtp.h
index 9c4f41e9..67fb38df 100644
--- a/audio/avdtp.h
+++ b/audio/avdtp.h
@@ -99,49 +99,57 @@ typedef void (*avdtp_stream_state_cb) (struct avdtp_stream *stream,
/* Callbacks for when a reply is received to a command that we sent */
struct avdtp_sep_cfm {
- void (*set_configuration) (struct avdtp_local_sep *lsep,
+ void (*set_configuration) (struct avdtp *session,
+ struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*get_configuration) (struct avdtp_local_sep *lsep,
+ void (*get_configuration) (struct avdtp *session,
+ struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*open) (struct avdtp_local_sep *lsep,
+ void (*open) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*start) (struct avdtp_local_sep *lsep,
+ void (*start) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*suspend) (struct avdtp_local_sep *lsep,
+ void (*suspend) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*close) (struct avdtp_local_sep *lsep,
+ void (*close) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*abort) (struct avdtp_local_sep *lsep,
+ void (*abort) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream);
- void (*reconfigure) (struct avdtp_local_sep *lsep);
+ void (*reconfigure) (struct avdtp *session,
+ struct avdtp_local_sep *lsep);
};
/* Callbacks for indicating when we received a new command. The return value
* indicates whether the command should be rejected or accepted */
struct avdtp_sep_ind {
- gboolean (*get_capability) (struct avdtp_local_sep *sep,
+ gboolean (*get_capability) (struct avdtp *session,
+ struct avdtp_local_sep *sep,
GSList **caps, uint8_t *err);
gboolean (*set_configuration) (struct avdtp *session,
struct avdtp_local_sep *lsep,
struct avdtp_stream *stream,
GSList *caps, uint8_t *err,
uint8_t *category);
- gboolean (*get_configuration) (struct avdtp_local_sep *lsep,
+ gboolean (*get_configuration) (struct avdtp *session,
+ struct avdtp_local_sep *lsep,
uint8_t *err);
- gboolean (*open) (struct avdtp_local_sep *lsep,
+ gboolean (*open) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream, uint8_t *err);
- gboolean (*start) (struct avdtp_local_sep *lsep,
+ gboolean (*start) (struct avdtp *session, struct avdtp_local_sep *lsep,
struct avdtp_stream *stream,
uint8_t *err);
- gboolean (*suspend) (struct avdtp_local_sep *sep,
+ gboolean (*suspend) (struct avdtp *session,
+ struct avdtp_local_sep *sep,
struct avdtp_stream *stream,
uint8_t *err);
- gboolean (*close) (struct avdtp_local_sep *sep,
+ gboolean (*close) (struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream,
uint8_t *err);
- gboolean (*abort) (struct avdtp_local_sep *sep,
+ gboolean (*abort) (struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err);
- gboolean (*reconfigure) (struct avdtp_local_sep *lsep, uint8_t *err);
+ gboolean (*reconfigure) (struct avdtp *session,
+ struct avdtp_local_sep *lsep,
+ uint8_t *err);
};
typedef void (*avdtp_discover_cb_t) (struct avdtp *session, GSList *seps,