aboutsummaryrefslogtreecommitdiffstats
path: root/src/trau/osmo_ortp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/trau/osmo_ortp.c')
-rw-r--r--src/trau/osmo_ortp.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index cac25089..be1d1c03 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -23,6 +23,7 @@
*/
#include <stdint.h>
+#include <inttypes.h>
#include <netdb.h>
#include <osmocom/core/logging.h>
@@ -32,6 +33,7 @@
#include <osmocom/trau/osmo_ortp.h>
#include <ortp/ortp.h>
+#include <ortp/rtp.h>
static PayloadType *payload_type_efr;
@@ -248,6 +250,27 @@ void osmo_rtp_init(void *ctx)
create_payload_types();
}
+int osmo_rtp_socket_set_param(struct osmo_rtp_socket *rs,
+ enum osmo_rtp_param param, int val)
+{
+ int rc = 0;
+
+ switch (param) {
+ case OSMO_RTP_P_JITBUF:
+ rtp_session_set_jitter_compensation(rs->sess, val);
+ break;
+#if 0
+ case OSMO_RTP_P_JIT_ADAP:
+ rc = jitter_control_enable_adaptive(rs->sess, val);
+ break;
+#endif
+ default:
+ return -EINVAL;
+ }
+
+ return rc;
+}
+
/*! \brief Create a new RTP socket
* \param[in] talloc_cxt talloc context for this allocation. NULL for
* dafault context
@@ -466,3 +489,22 @@ int osmo_rtp_get_bound_addr(struct osmo_rtp_socket *rs,
return 0;
}
+
+
+void osmo_rtp_socket_log_stats(struct osmo_rtp_socket *rs,
+ int subsys, int level,
+ const char *pfx)
+{
+ const rtp_stats_t *stats;
+
+ stats = rtp_session_get_stats(rs->sess);
+ if (!stats)
+ return;
+
+ LOGP(subsys, level, "%sRTP Tx(%"PRIu64" pkts, %"PRIu64" bytes) "
+ "Rx(%"PRIu64" pkts, %"PRIu64" bytes, %"PRIu64" late, "
+ "%"PRIu64" loss, %"PRIu64" qmax)\n",
+ pfx, stats->packet_sent, stats->sent,
+ stats->packet_recv, stats->hw_recv, stats->outoftime,
+ stats->cum_packet_loss, stats->discarded);
+}