summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/sdp.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/tools/sdp.h b/tools/sdp.h
index 039067a4..514c29c1 100644
--- a/tools/sdp.h
+++ b/tools/sdp.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: sdp.h,v 1.4 2009-02-10 12:41:38 phintuka Exp $
+ * $Id: sdp.h,v 1.5 2009-02-10 12:42:38 phintuka Exp $
*
*/
@@ -14,12 +14,15 @@
#define SDP_MIME_TYPE "application/sdp"
+#define SDP_PAYLOAD_MPEG_PES 96
+#define SDP_PAYLOAD_MPEG_TS 33
static const char *vdr_sdp_description(const char *vdr_ip,
int vdr_svdrp_port,
int vdr_xineliboutput_port,
const char *rtp_ip,
uint32_t rtp_ssrc,
+ uint32_t payload_type,
int rtp_port,
int rtp_ttl)
{
@@ -28,10 +31,26 @@ static const char *vdr_sdp_description(const char *vdr_ip,
static char s_hostname[257] = {0};
uint64_t serial = (time(NULL) << 2) + ((s_serial++) & 0x03);
+ cString payload;
- if(!s_hostname[0])
+ if (!s_hostname[0])
gethostname(s_hostname, 256);
+ if (payload_type == SDP_PAYLOAD_MPEG_PES) {
+ payload = cString::sprintf(
+ /* video/mp2p udp/rtp */
+ /* media */ "m=video %d RTP/AVP 96"
+ /* */ "\r\n" "a=rtpmap:96 MP2P/90000"
+ , rtp_port
+ );
+ } else {
+ payload = cString::sprintf(
+ /* video/mp2t udp/rtp */
+ /* media */ "m=video %d RTP/AVP 33"
+ , rtp_port
+ );
+ }
+
s_data = cString::sprintf(
/*** session ***/
/* version */ "v=0"
@@ -45,8 +64,8 @@ static const char *vdr_sdp_description(const char *vdr_ip,
/* */ "\r\n" "a=recvonly"
/* */ "\r\n" "a=type:broadcast"
/* */ "\r\n" "a=x-plgroup:vdr"
- /* media */ "\r\n" "m=video %d RTP/AVP 96"
- /* */ "\r\n" "a=rtpmap:96 MP2P/90000"
+ /* *media */ "\r\n" "%s"
+
/* media */ /*"\r\n" "m=video %d udp MP2P"*/
/* */ /*"\r\n" "a=mux:ps"*/
/* */ /*"\r\n" "a=packetformat:RAW"*/
@@ -69,9 +88,10 @@ static const char *vdr_sdp_description(const char *vdr_ip,
/* name */
, "vdr", s_hostname, rtp_ip, rtp_port
- /* video/mp2p udp/rtp */
+ /* media */
, rtp_ip, rtp_ttl
- , rtp_port
+ , *payload
+
#if 0
/* tcp/http control/rtsp */
, vdr_ip