constify some function arg pointers

Change-Id: I7a7560fad96719da01f1ee30eea0be0e52c60e99
This commit is contained in:
Pau Espin 2021-07-07 12:41:38 +02:00
parent 4c77e9b748
commit 8358c4ba07
5 changed files with 20 additions and 25 deletions

View File

@ -152,7 +152,7 @@ void mgcp_cleanup_e1_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *con
int mgcp_bind_net_rtp_port(struct mgcp_endpoint *endp, int rtp_port,
struct mgcp_conn_rtp *conn);
void mgcp_free_rtp_port(struct mgcp_rtp_end *end);
void mgcp_patch_and_count(struct mgcp_endpoint *endp,
void mgcp_patch_and_count(const struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr, struct msgb *msg);
@ -172,6 +172,6 @@ void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp,
struct mgcp_conn_rtp *conn);
/* internal RTP Annex A counting */
void mgcp_rtp_annex_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *state,
void mgcp_rtp_annex_count(const struct mgcp_endpoint *endp, struct mgcp_rtp_state *state,
const uint16_t seq, const int32_t transit,
const uint32_t ssrc);

View File

@ -23,5 +23,5 @@ struct mgcp_rtp_end;
void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
struct mgcp_rtp_end *rtp);
uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *rtp);
uint32_t mgcp_rtp_packet_duration(const struct mgcp_endpoint *endp,
const struct mgcp_rtp_end *rtp);

View File

@ -240,7 +240,7 @@ failed:
}
/* Compute timestamp alignment error */
static int32_t ts_alignment_error(struct mgcp_rtp_stream_state *sstate,
static int32_t ts_alignment_error(const struct mgcp_rtp_stream_state *sstate,
int ptime, uint32_t timestamp)
{
int32_t timestamp_delta;
@ -255,11 +255,11 @@ static int32_t ts_alignment_error(struct mgcp_rtp_stream_state *sstate,
}
/* Check timestamp and sequence number for plausibility */
static int check_rtp_timestamp(struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_stream_state *sstate,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr,
static int check_rtp_timestamp(const struct mgcp_endpoint *endp,
const struct mgcp_rtp_state *state,
const struct mgcp_rtp_stream_state *sstate,
const struct mgcp_rtp_end *rtp_end,
const struct osmo_sockaddr *addr,
uint16_t seq, uint32_t timestamp,
const char *text, int32_t * tsdelta_out)
{
@ -344,10 +344,10 @@ static int check_rtp_timestamp(struct mgcp_endpoint *endp,
}
/* Set the timestamp offset according to the packet duration. */
static int adjust_rtp_timestamp_offset(struct mgcp_endpoint *endp,
static int adjust_rtp_timestamp_offset(const struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr,
const struct mgcp_rtp_end *rtp_end,
const struct osmo_sockaddr *addr,
int16_t delta_seq, uint32_t in_timestamp)
{
int32_t tsdelta = state->packet_duration;
@ -394,10 +394,10 @@ static int adjust_rtp_timestamp_offset(struct mgcp_endpoint *endp,
}
/* Set the timestamp offset according to the packet duration. */
static int align_rtp_timestamp_offset(struct mgcp_endpoint *endp,
static int align_rtp_timestamp_offset(const struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr,
const struct mgcp_rtp_end *rtp_end,
const struct osmo_sockaddr *addr,
uint32_t timestamp)
{
char ipbuf[INET6_ADDRSTRLEN];
@ -475,7 +475,7 @@ void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp,
*fmtp_extra = conn->end.fmtp_extra;
}
void mgcp_rtp_annex_count(struct mgcp_endpoint *endp,
void mgcp_rtp_annex_count(const struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state, const uint16_t seq,
const int32_t transit, const uint32_t ssrc)
{
@ -556,7 +556,7 @@ static int mgcp_patch_pt(struct mgcp_conn_rtp *conn_src,
* is only one source.
* There is also no probation period for new sources. Every RTP header
* we receive will be seen as a switch in streams. */
void mgcp_patch_and_count(struct mgcp_endpoint *endp,
void mgcp_patch_and_count(const struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr, struct msgb *msg)

View File

@ -611,8 +611,8 @@ void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
rtp->force_constant_ssrc ? ", force constant ssrc" : "");
}
uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *rtp)
uint32_t mgcp_rtp_packet_duration(const struct mgcp_endpoint *endp,
const struct mgcp_rtp_end *rtp)
{
int f = 0;

View File

@ -1261,11 +1261,6 @@ struct rtp_packet_info test_rtp_packets1[] = {
"\x01\x23\x45\x67\x89\xAB\xCD\xEF"},
};
void mgcp_patch_and_count(struct mgcp_endpoint *endp,
struct mgcp_rtp_state *state,
struct mgcp_rtp_end *rtp_end,
struct osmo_sockaddr *addr, struct msgb *msg);
static void test_packet_error_detection(int patch_ssrc, int patch_ts)
{
int i;