osmux: add OSMUX_MAX_CONCURRENT_CALLS which is 8
Instead of harcoding the number all around the code.
This commit is contained in:
parent
72a0aae500
commit
7a01104b88
|
@ -47,10 +47,12 @@ struct osmux_in_handle {
|
||||||
char *data; /* internal data */
|
char *data; /* internal data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define OSMUX_MAX_CONCURRENT_CALLS 8
|
||||||
|
|
||||||
/* one per OSmux circuit_id, ie. one per RTP flow. */
|
/* one per OSmux circuit_id, ie. one per RTP flow. */
|
||||||
struct osmux_out_handle {
|
struct osmux_out_handle {
|
||||||
uint16_t rtp_seq[8];
|
uint16_t rtp_seq[OSMUX_MAX_CONCURRENT_CALLS];
|
||||||
uint32_t rtp_timestamp[8];
|
uint32_t rtp_timestamp[OSMUX_MAX_CONCURRENT_CALLS];
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh)
|
static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh)
|
||||||
|
|
|
@ -385,7 +385,7 @@ void osmux_xfrm_input_init(struct osmux_in_handle *h)
|
||||||
batch->timer.cb = osmux_batch_timer_expired;
|
batch->timer.cb = osmux_batch_timer_expired;
|
||||||
batch->timer.data = h;
|
batch->timer.data = h;
|
||||||
|
|
||||||
for (i=0; i<8; i++)
|
for (i=0; i<OSMUX_MAX_CONCURRENT_CALLS; i++)
|
||||||
batch->ccid[i] = -1;
|
batch->ccid[i] = -1;
|
||||||
|
|
||||||
h->data = (void *)batch;
|
h->data = (void *)batch;
|
||||||
|
@ -475,7 +475,7 @@ void osmux_xfrm_input_register_ccid(struct osmux_in_handle *h, uint32_t ssrc)
|
||||||
struct osmux_batch *batch = (struct osmux_batch *)h->data;;
|
struct osmux_batch *batch = (struct osmux_batch *)h->data;;
|
||||||
int i, found = 0;
|
int i, found = 0;
|
||||||
|
|
||||||
for (i=0; i<8; i++) {
|
for (i=0; i<OSMUX_MAX_CONCURRENT_CALLS; i++) {
|
||||||
if (batch->ccid[i] == ssrc)
|
if (batch->ccid[i] == ssrc)
|
||||||
continue;
|
continue;
|
||||||
if (batch->ccid[i] < 0) {
|
if (batch->ccid[i] < 0) {
|
||||||
|
@ -498,7 +498,7 @@ int osmux_xfrm_input_get_ccid(struct osmux_in_handle *h, uint32_t ssrc)
|
||||||
struct osmux_batch *batch = (struct osmux_batch *)h->data;;
|
struct osmux_batch *batch = (struct osmux_batch *)h->data;;
|
||||||
int i, found = 0;
|
int i, found = 0;
|
||||||
|
|
||||||
for (i=0; i<8; i++) {
|
for (i=0; i<OSMUX_MAX_CONCURRENT_CALLS; i++) {
|
||||||
if (batch->ccid[i] == ssrc) {
|
if (batch->ccid[i] == ssrc) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -512,7 +512,7 @@ void osmux_xfrm_output_init(struct osmux_out_handle *h)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<8; i++) {
|
for (i=0; i<OSMUX_MAX_CONCURRENT_CALLS; i++) {
|
||||||
h->rtp_seq[i] = (uint16_t)random();
|
h->rtp_seq[i] = (uint16_t)random();
|
||||||
h->rtp_timestamp[i] = (uint32_t)random();
|
h->rtp_timestamp[i] = (uint32_t)random();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue