summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-07 21:17:59 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-07 21:50:54 +0100
commit4dac5808674a6a0fc36b76012e93f4a0d16c997e (patch)
tree7b5d64a4db33560f740d6e40ae6e0628fe287c42
parent2c8dfd8b7ca8546d063cbed7f3881f863f1f0a65 (diff)
mgcp: Simplify and shorten routine names
Now they are included in a struct we can just call them setup, process and get_net_downlink_format to manage the lifetime.
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h6
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c2
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c16
-rw-r--r--openbsc/src/libmgcp/mgcp_transcode.c10
-rw-r--r--openbsc/tests/mgcp/mgcp_transcoding_test.c6
5 files changed, 20 insertions, 20 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index a62dbb212..8fb8a45ad 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -154,9 +154,9 @@ enum mgcp_type {
* Function pointers for RTP processing/transcoding
*/
struct mgcp_transcoding {
- mgcp_processing processing_cb;
- mgcp_processing_setup setup_processing_cb;
- mgcp_get_format get_net_downlink_format_cb;
+ mgcp_processing process;
+ mgcp_processing_setup setup;
+ mgcp_get_format get_net_downlink_format;
};
extern const struct mgcp_transcoding *mgcp_default_transcoder;
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index e4f5f7d5c..ed90d34f7 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -614,7 +614,7 @@ int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
int nbytes = 0;
int len = rc;
do {
- cont = trans->processing_cb(endp, rtp_end,
+ cont = trans->process(endp, rtp_end,
buf, &len, RTP_BUF_SIZE);
if (cont < 0)
break;
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 8017fe874..18a25bc88 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -67,9 +67,9 @@ static int setup_rtp_processing(struct mgcp_endpoint *endp);
static int mgcp_analyze_header(struct mgcp_parse_data *parse, char *data);
static const struct mgcp_transcoding no_transcoder = {
- .processing_cb = &mgcp_rtp_processing_default,
- .setup_processing_cb = &mgcp_setup_rtp_processing_default,
- .get_net_downlink_format_cb = &mgcp_get_net_downlink_format_default,
+ .process = &mgcp_rtp_processing_default,
+ .setup = &mgcp_setup_rtp_processing_default,
+ .get_net_downlink_format = &mgcp_get_net_downlink_format_default,
};
const struct mgcp_transcoding *mgcp_default_transcoder = &no_transcoder;
@@ -213,7 +213,7 @@ static int write_response_sdp(struct mgcp_endpoint *endp,
int nchars;
trans = endp->tcfg->transcoder;
- trans->get_net_downlink_format_cb(endp, &payload_type,
+ trans->get_net_downlink_format(endp, &payload_type,
&audio_name, &fmtp_extra);
len = snprintf(sdp_record, size,
@@ -1475,14 +1475,14 @@ static int setup_rtp_processing(struct mgcp_endpoint *endp)
return 0;
if (endp->conn_mode & MGCP_CONN_SEND_ONLY)
- rc |= trans->setup_processing_cb(endp, &endp->net_end, &endp->bts_end);
+ rc |= trans->setup(endp, &endp->net_end, &endp->bts_end);
else
- rc |= trans->setup_processing_cb(endp, &endp->net_end, NULL);
+ rc |= trans->setup(endp, &endp->net_end, NULL);
if (endp->conn_mode & MGCP_CONN_RECV_ONLY)
- rc |= trans->setup_processing_cb(endp, &endp->bts_end, &endp->net_end);
+ rc |= trans->setup(endp, &endp->bts_end, &endp->net_end);
else
- rc |= trans->setup_processing_cb(endp, &endp->bts_end, NULL);
+ rc |= trans->setup(endp, &endp->bts_end, NULL);
return rc;
}
diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/openbsc/src/libmgcp/mgcp_transcode.c
index aaa8863fb..6407cfb4a 100644
--- a/openbsc/src/libmgcp/mgcp_transcode.c
+++ b/openbsc/src/libmgcp/mgcp_transcode.c
@@ -33,9 +33,9 @@
#include <osmocom/netif/rtp.h>
const struct mgcp_transcoding mgcp_sw_transcoder = {
- .processing_cb = mgcp_transcoding_process_rtp,
- .setup_processing_cb = mgcp_transcoding_setup,
- .get_net_downlink_format_cb = mgcp_transcoding_net_downlink_format,
+ .process = mgcp_transcoding_process_rtp,
+ .setup = mgcp_transcoding_setup,
+ .get_net_downlink_format = mgcp_transcoding_net_downlink_format,
};
int mgcp_transcoding_get_frame_size(void *state_, int nsamples, int dst)
@@ -480,8 +480,8 @@ struct mgcp_process_rtp_state *check_transcode_state(
struct mgcp_rtp_codec tmp_codec = src_end->alt_codec;
src_end->alt_codec = src_end->codec;
src_end->codec = tmp_codec;
- trans->setup_processing_cb(endp, &endp->net_end, &endp->bts_end);
- trans->setup_processing_cb(endp, &endp->bts_end, &endp->net_end);
+ trans->setup(endp, &endp->net_end, &endp->bts_end);
+ trans->setup(endp, &endp->bts_end, &endp->net_end);
}
done:
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c
index 72c75ebb6..02f2817c0 100644
--- a/openbsc/tests/mgcp/mgcp_transcoding_test.c
+++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c
@@ -162,9 +162,9 @@ static int audio_name_to_type(const char *name)
int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst);
static const struct mgcp_transcoding test_transcoder = {
- .setup_processing_cb = mgcp_transcoding_setup,
- .processing_cb = mgcp_transcoding_process_rtp,
- .get_net_downlink_format_cb = mgcp_transcoding_net_downlink_format,
+ .setup = mgcp_transcoding_setup,
+ .process = mgcp_transcoding_process_rtp,
+ .get_net_downlink_format = mgcp_transcoding_net_downlink_format,
};
static int given_configured_endpoint(int in_samples, int out_samples,