From 8de983fe7f447d5b5a567dc9947184d19f1b6095 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 8 Jun 2010 09:29:14 +0000 Subject: [PATCH] rtsp: Support RTSP/RTP over HTTP via LIVE555 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Malte Särner, malte D sarner A multiq se git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31347 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix compilation with nemesi and live555. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31348 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 5 +++++ cfg-common-opts.h | 3 +++ cfg-common.h | 1 + libmpdemux/demux_nemesi.c | 1 + libmpdemux/demux_rtp.cpp | 8 +++++++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 05fa8a04c0..647fe68164 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1786,6 +1786,11 @@ This option may be useful if you have a broken internet connection that does not pass incoming UDP packets (see http://www.live555.com/\:mplayer/). . .TP +.B \-rtsp\-stream\-over\-http (LIVE555 only) +Used with 'http://' URLs to specify that the resulting incoming RTP and RTCP +packets be streamed over HTTP. +. +.TP .B \-saveidx Force index rebuilding and dump the index to . Currently this only works with AVI files. diff --git a/cfg-common-opts.h b/cfg-common-opts.h index 614392a0b9..aa0f07d237 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -93,6 +93,9 @@ #ifdef CONFIG_LIVE555 {"sdp", "-sdp has been removed, use sdp://file instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"rtsp-stream-over-http", &rtsp_transport_http, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#else + {"rtsp-stream-over-http", "-rtsp-stream-over-http requires the \"LIVE555 Streaming Media\" library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_LIVE555 */ #if defined(CONFIG_LIBNEMESI) || defined(CONFIG_LIVE555) // -rtsp-stream-over-tcp option, specifying TCP streaming of RTP/RTCP diff --git a/cfg-common.h b/cfg-common.h index 0b4ac9addc..f57e376157 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -185,6 +185,7 @@ extern const m_option_t lavfdopts_conf[]; extern int rtspStreamOverTCP; extern int rtsp_transport_tcp; +extern int rtsp_transport_http; extern int rtsp_transport_sctp; extern int rtsp_port; extern char *rtsp_destination; diff --git a/libmpdemux/demux_nemesi.c b/libmpdemux/demux_nemesi.c index 704c31e4b1..3d2d413a4a 100644 --- a/libmpdemux/demux_nemesi.c +++ b/libmpdemux/demux_nemesi.c @@ -27,6 +27,7 @@ #include "nemesi/rtp.h" #include +int rtsp_transport_http = 0; int rtsp_transport_tcp = 0; int rtsp_transport_sctp = 0; int rtsp_port = 0; diff --git a/libmpdemux/demux_rtp.cpp b/libmpdemux/demux_rtp.cpp index 8a5cfb8460..1dc7703921 100644 --- a/libmpdemux/demux_rtp.cpp +++ b/libmpdemux/demux_rtp.cpp @@ -113,8 +113,10 @@ static char* openURL_sip(SIPClient* client, char const* url) { #ifdef CONFIG_LIBNEMESI extern int rtsp_transport_tcp; +extern int rtsp_transport_http; #else int rtsp_transport_tcp = 0; +int rtsp_transport_http = 0; #endif extern int rtsp_port; @@ -147,7 +149,11 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) { char const* url = demuxer->stream->streaming_ctrl->url->url; extern int verbose; if (strcmp(protocol, "rtsp") == 0) { - rtspClient = RTSPClient::createNew(*env, verbose, "MPlayer"); + if (rtsp_transport_http == 1) { + rtsp_transport_http = demuxer->stream->streaming_ctrl->url->port; + rtsp_transport_tcp = 1; + } + rtspClient = RTSPClient::createNew(*env, verbose, "MPlayer", rtsp_transport_http); if (rtspClient == NULL) { fprintf(stderr, "Failed to create RTSP client: %s\n", env->getResultMsg()); -- 2.11.4.GIT