diff options
-rw-r--r-- | cfg-mplayer.h | 6 | ||||
-rw-r--r-- | libmpdemux/demux_rtp.cpp | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 0c6d38772a..e675fd9059 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -90,6 +90,7 @@ extern void vo_zr_revertoption(config_t* opt,char* pram); #ifdef STREAMING_LIVE_DOT_COM extern int isSDPFile; +extern int rtspStreamOverTCP; #endif #ifdef HAVE_NEW_GUI @@ -302,8 +303,11 @@ static config_t mplayer_opts[]={ #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 ------------------------ diff --git a/libmpdemux/demux_rtp.cpp b/libmpdemux/demux_rtp.cpp index fca1e4d52e..ef9ea15821 100644 --- a/libmpdemux/demux_rtp.cpp +++ b/libmpdemux/demux_rtp.cpp @@ -95,7 +95,13 @@ typedef struct RTPState { 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 @@ extern "C" void demux_open_rtp(demuxer_t* demuxer) { 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; } |