[MPlayer-dev-eng] [PATCH] for optional RTP/RTCP streaming over TCP
Ross Finlayson
finlayson at live.com
Tue Oct 8 04:27:54 CEST 2002
These two patches add support for a new flag "-rtsp-stream-over-tcp" which,
when used with the "LIVE.COM Streaming Media" libraries, will allow
RTP/RTCP sessions , initiated via RTSP, to be streamed over the RTSP (TCP)
connection, rather than over UDP (the default behavior). This will allow
those people who are behind broken Internet connections (that block UDP) to
receive RTSP-initiated streams.
E.g.,
mplayer -rtsp-stream-over-tcp rtsp://media.schreiner.edu/realmp3.mp3
Ross.
-------------- next part --------------
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.171
diff -u -r1.171 cfg-mplayer.h
--- cfg-mplayer.h 6 Oct 2002 11:23:00 -0000 1.171
+++ cfg-mplayer.h 8 Oct 2002 02:09:03 -0000
@@ -90,6 +90,7 @@
#ifdef STREAMING_LIVE_DOT_COM
extern int isSDPFile;
+extern int rtspStreamOverTCP;
#endif
#ifdef HAVE_NEW_GUI
@@ -302,8 +303,11 @@
#ifdef STREAMING_LIVE_DOT_COM
// -sdp option, specifying that the source is a SDP file
{"sdp", &isSDPFile, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ // -rtsp-stream-over-tcp option, specifying TCP streaming of RTP/RTCP
+ {"rtsp-stream-over-tcp", &rtspStreamOverTCP, CONF_TYPE_FLAG, 0, 0, 1, NULL},
#else
- {"sdp", "MPlayer was compiled WITHOUT the \"LIVE.COM Streaming Media\" libraries!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+ {"sdp", "SDP file support requires the \"LIVE.COM Streaming Media\" libraries!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+ {"rtsp-stream-over-tcp", "RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif
//---------------------- mplayer-only options ------------------------
-------------- next part --------------
Index: libmpdemux/demux_rtp.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rtp.cpp,v
retrieving revision 1.4
diff -u -r1.4 demux_rtp.cpp
--- libmpdemux/demux_rtp.cpp 28 Sep 2002 18:51:44 -0000 1.4
+++ libmpdemux/demux_rtp.cpp 8 Oct 2002 02:24:16 -0000
@@ -95,7 +95,13 @@
struct timeval firstSyncTime;
};
+int rtspStreamOverTCP = 0;
+
extern "C" void demux_open_rtp(demuxer_t* demuxer) {
+ if (rtspStreamOverTCP && LIVEMEDIA_LIBRARY_VERSION_INT < 1033689600) {
+ fprintf(stderr, "TCP streaming of RTP/RTCP requires \"LIVE.COM Streaming Media\" library version 2002.10.04 or later - ignoring the \"-rtsp-stream-over-tcp\" flag\n");
+ rtspStreamOverTCP = 0;
+ }
do {
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
if (scheduler == NULL) break;
@@ -155,7 +161,8 @@
if (rtspClient != NULL) {
// Issue RTSP "SETUP" and "PLAY" commands on the chosen subsession:
- if (!rtspClient->setupMediaSubsession(*subsession)) break;
+ if (!rtspClient->setupMediaSubsession(*subsession, False,
+ rtspStreamOverTCP)) break;
if (!rtspClient->playMediaSubsession(*subsession)) break;
}
More information about the MPlayer-dev-eng
mailing list