Added support for RTSP stream over TCP.

Patch from Ross Finlayson <finlayson@live.com>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7665 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
bertrand 2002-10-08 05:46:23 +00:00
parent feec550941
commit f767a62a42
2 changed files with 13 additions and 2 deletions

View File

@ -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 ------------------------

View File

@ -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;
}