Change in libosmo-abis[master]: trau: Introduce osmo_rtp_socket_set_priority()

laforge gerrit-no-reply at lists.osmocom.org
Thu Apr 29 19:44:54 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/23986 )


Change subject: trau: Introduce osmo_rtp_socket_set_priority()
......................................................................

trau: Introduce osmo_rtp_socket_set_priority()

For consistency reasons with osmo_rtp_socket_set_dscp(), let's also
introduce a osmo_rtp_socket_set_priority() function to wrap the two
calls to osmo_sock_set_priority().

Change-Id: I52c08f4b2a46981d002ef0c21e6549445d845a6e
---
M include/osmocom/trau/osmo_ortp.h
M src/trau/osmo_ortp.c
2 files changed, 18 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/86/23986/1

diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h
index 1e0720c..4cf2321 100644
--- a/include/osmocom/trau/osmo_ortp.h
+++ b/include/osmocom/trau/osmo_ortp.h
@@ -77,6 +77,7 @@
 int osmo_rtp_socket_autoconnect(struct osmo_rtp_socket *rs);
 int osmo_rtp_socket_set_pt(struct osmo_rtp_socket *rs, int payload_type);
 int osmo_rtp_socket_set_dscp(struct osmo_rtp_socket *rs, int dscp);
+int osmo_rtp_socket_set_priority(struct osmo_rtp_socket *rs, uint8_t prio);
 int osmo_rtp_socket_free(struct osmo_rtp_socket *rs);
 int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration);
 int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload,
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index d105ca8..b72f681 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -1,4 +1,4 @@
-/* (C) 2011 by Harald Welte <laforge at gnumonks.org>
+/* (C) 2011-2021 by Harald Welte <laforge at gnumonks.org>
  * (C) 2011 by On-Waves e.h.f
  * All Rights Reserved
  *
@@ -33,6 +33,7 @@
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/select.h>
+#include <osmocom/core/socket.h>
 #include <osmocom/trau/osmo_ortp.h>
 
 #include <ortp/ortp.h>
@@ -592,6 +593,21 @@
 	return rtp_session_set_dscp(rs->sess, dscp);
 }
 
+/*! \brief Set the socket priority for outgoing RTP packets
+ *  \param[in] rs OsmoRTP socket
+ *  \param[in] prio socket priority
+ *  \returns 0 on success, < 0 otherwise
+ */
+int osmo_rtp_socket_set_priority(struct osmo_rtp_socket *rs, uint8_t prio)
+{
+	int rc;
+
+	rc = osmo_sock_set_priority(rs->rtp_bfd.fd, prio);
+	if (rc < 0)
+		return rc;
+	return osmo_sock_set_priority(rs->rtcp_bfd.fd, prio);
+}
+
 /*! \brief completely close the RTP socket and release all resources
  *  \param[in] rs OsmoRTP socket to be released
  *  \returns 0 on success

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/23986
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I52c08f4b2a46981d002ef0c21e6549445d845a6e
Gerrit-Change-Number: 23986
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210429/7a54c11e/attachment.htm>


More information about the gerrit-log mailing list