diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-07 21:12:32 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-07 21:50:47 +0100 |
commit | 2c8dfd8b7ca8546d063cbed7f3881f863f1f0a65 (patch) | |
tree | 646f5e3221f6bf5893034394f7568766adec1a32 /openbsc/tests/mgcp | |
parent | 51273157fa18034349d6ac1395c6d43e80cc07c0 (diff) |
mgcp: Move the transcoding routines into a struct
We will have the NOOP implementation (e.g. used by the NAT), the
SW implementation (using software codecs), a HW assisted one that
will use a DSP to do transcoding and in theory the RTP based one
(but I will remove that code).
Diffstat (limited to 'openbsc/tests/mgcp')
-rw-r--r-- | openbsc/tests/mgcp/mgcp_transcoding_test.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c index c5c0a0bab..72c75ebb6 100644 --- a/openbsc/tests/mgcp/mgcp_transcoding_test.c +++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c @@ -161,6 +161,12 @@ 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, +}; + static int given_configured_endpoint(int in_samples, int out_samples, const char *srcfmt, const char *dstfmt, void **out_ctx, struct mgcp_endpoint **out_endp) @@ -176,10 +182,7 @@ static int given_configured_endpoint(int in_samples, int out_samples, tcfg = talloc_zero(cfg, struct mgcp_trunk_config); endp = talloc_zero(tcfg, struct mgcp_endpoint); - cfg->setup_rtp_processing_cb = mgcp_transcoding_setup; - cfg->rtp_processing_cb = mgcp_transcoding_process_rtp; - cfg->get_net_downlink_format_cb = mgcp_transcoding_net_downlink_format; - + tcfg->transcoder = &test_transcoder; tcfg->endpoints = endp; tcfg->number_endpoints = 1; tcfg->cfg = cfg; |