Compare commits
2 Commits
0f89975760
...
40075d1a99
Author | SHA1 | Date |
---|---|---|
Andreas Eversberg | 40075d1a99 | |
Andreas Eversberg | 68db24cf60 |
|
@ -1 +1 @@
|
|||
1.0.0
|
||||
2.0.0
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
void osmo_cc_set_rtp_ports(osmo_cc_session_config_t *conf, uint16_t from, uint16_t to);
|
||||
int osmo_cc_rtp_open(osmo_cc_session_media_t *media);
|
||||
int osmo_cc_rtp_connect(osmo_cc_session_media_t *media);
|
||||
void osmo_cc_rtp_send(osmo_cc_session_codec_t *codec, uint8_t *data, int len, uint8_t marker, int inc_sequence,
|
||||
int inc_timestamp, void *priv);
|
||||
void osmo_cc_rtp_send_ts(osmo_cc_session_codec_t *codec, uint8_t *data, int len, uint8_t marker, uint16_t tx_sequence,
|
||||
uint32_t tx_timestamp, void *priv);
|
||||
void osmo_cc_rtp_send(osmo_cc_session_codec_t *codec, uint8_t *payload, int payload_len, uint8_t marker, int inc_sequence,
|
||||
int inc_timestamp);
|
||||
void osmo_cc_rtp_send_ts(osmo_cc_session_codec_t *codec, uint8_t *payload, int payload_len, uint8_t marker,
|
||||
uint16_t tx_sequence, uint32_t tx_timestamp);
|
||||
void osmo_cc_rtp_close(osmo_cc_session_media_t *media);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This is _NOT_ the library release version, it's an API version.
|
||||
# Please read Chapter 6 "Library interface versions" of the libtool
|
||||
# documentation before making any modification
|
||||
LIBVERSION=0:0:0
|
||||
LIBVERSION=2:0:0
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
$(all_includes) \
|
||||
|
|
48
src/rtp.c
48
src/rtp.c
|
@ -354,56 +354,30 @@ pton_error:
|
|||
}
|
||||
|
||||
/* send rtp data with given codec */
|
||||
void osmo_cc_rtp_send(osmo_cc_session_codec_t *codec, uint8_t *data, int len, uint8_t marker, int inc_sequence,
|
||||
int inc_timestamp, void *priv)
|
||||
void osmo_cc_rtp_send(osmo_cc_session_codec_t *codec, uint8_t *payload, int payload_len, uint8_t marker, int inc_sequence,
|
||||
int inc_timestamp)
|
||||
{
|
||||
uint8_t *payload = NULL;
|
||||
int payload_len = 0;
|
||||
|
||||
if (!codec || !codec->media->rtp_ofd.fd)
|
||||
return;
|
||||
|
||||
if (codec->encoder)
|
||||
codec->encoder(data, len, &payload, &payload_len, priv);
|
||||
else {
|
||||
payload = data;
|
||||
payload_len = len;
|
||||
}
|
||||
|
||||
rtp_send(&codec->media->rtp_sa, codec->media->rtp_slen, codec->media->rtp_ofd.fd, payload, payload_len, marker,
|
||||
codec->payload_type_remote, codec->media->tx_sequence, codec->media->tx_timestamp,
|
||||
codec->media->tx_ssrc);
|
||||
codec->media->tx_sequence += inc_sequence;
|
||||
codec->media->tx_timestamp += inc_timestamp;
|
||||
|
||||
if (codec->encoder)
|
||||
free(payload);
|
||||
}
|
||||
|
||||
/* dito, but with absolute sequence and timestamp */
|
||||
void osmo_cc_rtp_send_ts(osmo_cc_session_codec_t *codec, uint8_t *data, int len, uint8_t marker, uint16_t tx_sequence,
|
||||
uint32_t tx_timestamp, void *priv)
|
||||
void osmo_cc_rtp_send_ts(osmo_cc_session_codec_t *codec, uint8_t *payload, int payload_len, uint8_t marker,
|
||||
uint16_t tx_sequence, uint32_t tx_timestamp)
|
||||
{
|
||||
uint8_t *payload = NULL;
|
||||
int payload_len = 0;
|
||||
|
||||
if (!codec || !codec->media->rtp_ofd.fd)
|
||||
return;
|
||||
|
||||
if (codec->encoder)
|
||||
codec->encoder(data, len, &payload, &payload_len, priv);
|
||||
else {
|
||||
payload = data;
|
||||
payload_len = len;
|
||||
}
|
||||
|
||||
rtp_send(&codec->media->rtp_sa, codec->media->rtp_slen, codec->media->rtp_ofd.fd, payload, payload_len, marker,
|
||||
codec->payload_type_remote, tx_sequence, tx_timestamp, codec->media->tx_ssrc);
|
||||
codec->media->tx_sequence = tx_sequence;
|
||||
codec->media->tx_timestamp = tx_timestamp;
|
||||
|
||||
if (codec->encoder)
|
||||
free(payload);
|
||||
}
|
||||
|
||||
static void check_port_translation(struct sockaddr_storage *sa, struct sockaddr_storage *media_sa, const char *what)
|
||||
|
@ -454,8 +428,6 @@ static int rtp_listen_cb(struct osmo_fd *ofd, unsigned int when)
|
|||
uint8_t marker;
|
||||
uint8_t payload_type;
|
||||
osmo_cc_session_codec_t *codec;
|
||||
uint8_t *data;
|
||||
int len;
|
||||
struct sockaddr_storage sa;
|
||||
socklen_t slen = sizeof(sa); // must be initialized and will be overwritten
|
||||
|
||||
|
@ -477,19 +449,9 @@ static int rtp_listen_cb(struct osmo_fd *ofd, unsigned int when)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (codec->decoder)
|
||||
codec->decoder(payload, payload_len, &data, &len, media->session->priv);
|
||||
else {
|
||||
data = payload;
|
||||
len = payload_len;
|
||||
}
|
||||
|
||||
if (codec->media->receive)
|
||||
codec->media->receiver(codec, marker, media->rx_sequence, media->rx_timestamp, media->rx_ssrc,
|
||||
data, len);
|
||||
|
||||
if (codec->decoder)
|
||||
free(data);
|
||||
payload, payload_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue