osmux: cleanup misleading code calling rtp_bridge_cb

Documentation of rtp_bridge_cb was outdated, and caused confusion when
adding initial osmux support. Let's clear all the mess.

Change-Id: I42d1f2e2919eae3b1555ca4929e571855960792e
This commit is contained in:
Pau Espin 2022-10-03 16:08:58 +02:00
parent cb25a0aa48
commit de805b6772
3 changed files with 12 additions and 19 deletions

View File

@ -40,8 +40,13 @@ LOGP(cat, level, "endpoint:%s " fmt, \
endp ? endp->name : "none", \ endp ? endp->name : "none", \
## args) ## args)
enum rtp_proto {
MGCP_PROTO_RTP,
MGCP_PROTO_RTCP,
};
struct osmo_rtp_msg_ctx { struct osmo_rtp_msg_ctx {
int proto; enum rtp_proto proto;
struct mgcp_conn_rtp *conn_src; struct mgcp_conn_rtp *conn_src;
struct osmo_sockaddr *from_addr; struct osmo_sockaddr *from_addr;
}; };

View File

@ -54,11 +54,6 @@
#define RTP_MAX_DROPOUT 3000 #define RTP_MAX_DROPOUT 3000
#define RTP_MAX_MISORDER 100 #define RTP_MAX_MISORDER 100
enum rtp_proto {
MGCP_PROTO_RTP,
MGCP_PROTO_RTCP,
};
void rtpconn_rate_ctr_add(struct mgcp_conn_rtp *conn_rtp, struct mgcp_endpoint *endp, void rtpconn_rate_ctr_add(struct mgcp_conn_rtp *conn_rtp, struct mgcp_endpoint *endp,
int id, int inc) int id, int inc)
{ {
@ -1278,13 +1273,12 @@ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct osmo_sockaddr *addr
return 0; return 0;
} }
/*! dispatch incoming RTP packet to opposite RTP connection. /*! Dispatch incoming RTP packet to opposite RTP connection.
* \param[in] proto protocol (MGCP_CONN_TYPE_RTP or MGCP_CONN_TYPE_RTCP). * \param[in] msg Message buffer to bridge, coming from source connection.
* \param[in] addr socket address where the RTP packet has been received from. * msg shall contain "struct osmo_rtp_msg_ctx *" attached in
* \param[in] buf buffer that hold the RTP payload. * "OSMO_RTP_MSG_CTX(msg)".
* \param[in] buf_size size data length of buf. * \returns 0 on success, -1 on ERROR.
* \param[in] conn originating connection. */
* \returns 0 on success, -1 on ERROR. */
int mgcp_dispatch_rtp_bridge_cb(struct msgb *msg) int mgcp_dispatch_rtp_bridge_cb(struct msgb *msg)
{ {
struct osmo_rtp_msg_ctx *mc = OSMO_RTP_MSG_CTX(msg); struct osmo_rtp_msg_ctx *mc = OSMO_RTP_MSG_CTX(msg);

View File

@ -279,12 +279,6 @@ osmux_conn_lookup(struct mgcp_trunk *trunk, uint8_t local_cid, const struct osmo
return NULL; return NULL;
} }
/* FIXME: this is declared and used in mgcp_network.c, but documentation of mgcp_dispatch_rtp_bridge_cb() states another enum is to be used */
enum {
MGCP_PROTO_RTP,
MGCP_PROTO_RTCP,
};
static void scheduled_from_osmux_tx_rtp_cb(struct msgb *msg, void *data) static void scheduled_from_osmux_tx_rtp_cb(struct msgb *msg, void *data)
{ {
struct mgcp_conn_rtp *conn = data; struct mgcp_conn_rtp *conn = data;