aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/rtp-udp-test-client.c11
-rw-r--r--examples/rtp-udp-test-server.c10
2 files changed, 11 insertions, 10 deletions
diff --git a/examples/rtp-udp-test-client.c b/examples/rtp-udp-test-client.c
index 4163703..97ec6ff 100644
--- a/examples/rtp-udp-test-client.c
+++ b/examples/rtp-udp-test-client.c
@@ -39,7 +39,7 @@ static struct osmo_rtp_handle *rtp;
static int read_cb(struct osmo_dgram_conn *conn)
{
struct msgb *msg;
- int payload_type;
+ struct rtp_hdr *rtph;
LOGP(DLINP, LOGL_DEBUG, "received message\n");
@@ -53,15 +53,16 @@ static int read_cb(struct osmo_dgram_conn *conn)
LOGP(DRTP_TEST, LOGL_ERROR, "cannot receive message\n");
return -1;
}
- payload_type = osmo_rtp_parse(msg);
- if (payload_type < 0) {
+
+ rtph = osmo_rtp_get_hdr(msg);
+ if (rtph == NULL) {
msgb_free(msg);
LOGP(DRTP_TEST, LOGL_ERROR, "cannot parse RTP message\n");
return -1;
}
- LOGP(DLINP, LOGL_DEBUG, "received message with payload type: %d "
- "and size: %d (%s)\n", payload_type, msg->len, msg->data);
+ LOGP(DLINP, LOGL_DEBUG, "received message with payload type: %d\n",
+ rtph->payload_type);
msgb_free(msg);
return 0;
diff --git a/examples/rtp-udp-test-server.c b/examples/rtp-udp-test-server.c
index 5efd920..2f7f291 100644
--- a/examples/rtp-udp-test-server.c
+++ b/examples/rtp-udp-test-server.c
@@ -38,7 +38,7 @@ int read_cb(struct osmo_dgram_conn *conn)
{
struct msgb *msg;
char dummy_data[RTP_PT_GSM_FULL_PAYLOAD_LEN] = "payload test";
- int payload_type;
+ struct rtp_hdr *rtph;
LOGP(DRTP_TEST, LOGL_DEBUG, "received message from datagram\n");
@@ -51,14 +51,14 @@ int read_cb(struct osmo_dgram_conn *conn)
LOGP(DRTP_TEST, LOGL_ERROR, "cannot receive message\n");
return -1;
}
- payload_type = osmo_rtp_parse(msg);
- if (payload_type < 0) {
+ rtph = osmo_rtp_get_hdr(msg);
+ if (rtph == NULL) {
msgb_free(msg);
LOGP(DRTP_TEST, LOGL_ERROR, "cannot parse RTP message\n");
return -1;
}
- LOGP(DLINP, LOGL_DEBUG, "received message with RTP payload type: %d "
- "and size: %d (%s)\n", payload_type, msg->len, msg->data);
+ LOGP(DLINP, LOGL_DEBUG, "received message with RTP payload type: %d\n",
+ rtph->payload_type);
/*
* ... now build gsm_data_frame, set callref and msg_type based