# HG changeset patch # User bertrand # Date 1034055983 0 # Node ID b10d6345f2a60a68f2d8fa995d29878acbf8d44b # Parent eb3afb162aa406eaa1a601732b8cde3db4cb816a Added support for RTSP stream over TCP. Patch from Ross Finlayson diff -r eb3afb162aa4 -r b10d6345f2a6 cfg-mplayer.h --- a/cfg-mplayer.h Mon Oct 07 22:13:34 2002 +0000 +++ b/cfg-mplayer.h Tue Oct 08 05:46:23 2002 +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 ------------------------ diff -r eb3afb162aa4 -r b10d6345f2a6 libmpdemux/demux_rtp.cpp --- a/libmpdemux/demux_rtp.cpp Mon Oct 07 22:13:34 2002 +0000 +++ b/libmpdemux/demux_rtp.cpp Tue Oct 08 05:46:23 2002 +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; }