This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13158 ) Change subject: mgcp_network: use mgcp_rtp_codec in downlink format callback ...................................................................... mgcp_network: use mgcp_rtp_codec in downlink format callback The callback function mgcp_get_format() is used to request the codec parameters for a specific connection. This function returns the parameters as idividual pointers. Since there is a struct that holds all important codec information among the ones which are currently returned by mgcp_get_format, lets just use this codec struct as single return value. Change-Id: I348f9141eb59ed1a986447b96ab4a24ddf326936 Related: OS#3807 --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_sdp.c 4 files changed, 13 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 5886a65..71d6342 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -81,10 +81,11 @@ struct mgcp_conn_rtp *conn_dst, struct mgcp_conn_rtp *conn_src); +struct mgcp_rtp_codec; + typedef void (*mgcp_get_format)(struct mgcp_endpoint *endp, - int *payload_type, - const char**subtype_name, - const char**fmtp_extra, + const struct mgcp_rtp_codec **codec, + const char **fmtp_extra, struct mgcp_conn_rtp *conn); /** diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index a6239c2..35b535a 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -298,9 +298,8 @@ struct mgcp_conn_rtp *conn_src); void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp, - int *payload_type, - const char**audio_name, - const char**fmtp_extra, + const struct mgcp_rtp_codec **codec, + const char **fmtp_extra, struct mgcp_conn_rtp *conn); /* internal RTP Annex A counting */ diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 30ed7fd..e4fd7c0 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -416,8 +416,7 @@ } void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp, - int *payload_type, - const char **audio_name, + const struct mgcp_rtp_codec **codec, const char **fmtp_extra, struct mgcp_conn_rtp *conn) { @@ -425,8 +424,7 @@ "endpoint:0x%x conn:%s using format defaults\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); - *payload_type = conn->end.codec->payload_type; - *audio_name = conn->end.codec->audio_name; + *codec = conn->end.codec; *fmtp_extra = conn->end.fmtp_extra; } diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 9252b98..3287cd1 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -344,6 +344,7 @@ const struct mgcp_conn_rtp *conn, struct msgb *sdp, const char *addr) { + const struct mgcp_rtp_codec *codec; const char *fmtp_extra; const char *audio_name; int payload_type; @@ -357,10 +358,12 @@ /* FIXME: constify endp and conn args in get_net_donwlink_format_cb() */ endp->cfg->get_net_downlink_format_cb((struct mgcp_endpoint *)endp, - &payload_type, &audio_name, - &fmtp_extra, + &codec, &fmtp_extra, (struct mgcp_conn_rtp *)conn); + audio_name = codec->audio_name; + payload_type = codec->payload_type; + rc = msgb_printf(sdp, "v=0\r\n" "o=- %s 23 IN IP4 %s\r\n" -- To view, visit https://gerrit.osmocom.org/13158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I348f9141eb59ed1a986447b96ab4a24ddf326936 Gerrit-Change-Number: 13158 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier at sysmocom.de> Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org> Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190311/89941b2b/attachment.htm>