[PATCH 05/25] rtp: Allow transport parameters to be ovewritten

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Blanchard <tinram@xxxxxx>

In some special cases, tuning transport parameters is required (default:
"RTP/AVP/TCP;unicast;interleaved=0-1;mode=record") ! The RAOP client for
example needs to overwrite them.
---
 src/modules/raop/raop_client.c | 2 +-
 src/modules/rtp/rtsp_client.c  | 7 +++++--
 src/modules/rtp/rtsp_client.h  | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index 45bdfd9..f6dcd25 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -286,7 +286,7 @@ static void rtsp_cb(pa_rtsp_client *rtsp, pa_rtsp_state state, pa_headerlist *he
         case STATE_ANNOUNCE:
             pa_log_debug("RAOP: ANNOUNCED");
             pa_rtsp_remove_header(c->rtsp, "Apple-Challenge");
-            pa_rtsp_setup(c->rtsp);
+            pa_rtsp_setup(c->rtsp, NULL);
             break;
 
         case STATE_SETUP: {
diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c
index 573a185..ec50b48 100644
--- a/src/modules/rtp/rtsp_client.c
+++ b/src/modules/rtp/rtsp_client.c
@@ -473,14 +473,17 @@ int pa_rtsp_announce(pa_rtsp_client *c, const char *sdp) {
     return rv;
 }
 
-int pa_rtsp_setup(pa_rtsp_client *c) {
+int pa_rtsp_setup(pa_rtsp_client *c, const char *transport) {
     pa_headerlist *headers;
     int rv;
 
     pa_assert(c);
 
     headers = pa_headerlist_new();
-    pa_headerlist_puts(headers, "Transport", "RTP/AVP/TCP;unicast;interleaved=0-1;mode=record");
+    if (!transport)
+        pa_headerlist_puts(headers, "Transport", "RTP/AVP/TCP;unicast;interleaved=0-1;mode=record");
+    else
+        pa_headerlist_puts(headers, "Transport", transport);
 
     c->state = STATE_SETUP;
     rv = rtsp_exec(c, "SETUP", NULL, NULL, 1, headers);
diff --git a/src/modules/rtp/rtsp_client.h b/src/modules/rtp/rtsp_client.h
index aa650f5..46ac0e3 100644
--- a/src/modules/rtp/rtsp_client.h
+++ b/src/modules/rtp/rtsp_client.h
@@ -63,7 +63,7 @@ void pa_rtsp_remove_header(pa_rtsp_client *c, const char *key);
 int pa_rtsp_options(pa_rtsp_client *c);
 int pa_rtsp_announce(pa_rtsp_client *c, const char *sdp);
 
-int pa_rtsp_setup(pa_rtsp_client *c);
+int pa_rtsp_setup(pa_rtsp_client *c, const char *transport);
 int pa_rtsp_record(pa_rtsp_client *c, uint16_t *seq, uint32_t *rtptime);
 int pa_rtsp_teardown(pa_rtsp_client *c);
 
-- 
1.8.1.2



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux