Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lumsden <james@flit.com.au>2014-09-06 17:40:43 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2014-09-06 17:41:27 +0400
commitd440798f5747143f02557e735c574a2c42e29931 (patch)
treee1a2948831de6b4fd8283eac17b80dc275389bf9
parent1472a4c60c8438a21d2801adc0431e555be9ca94 (diff)
Add support for transport protocol specific RTSP URL handlers
Fixes issue 480. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r--LAVFilters.iss2
-rw-r--r--demuxer/Demuxers/LAVFDemuxer.cpp23
2 files changed, 24 insertions, 1 deletions
diff --git a/LAVFilters.iss b/LAVFilters.iss
index 11f2ced9..8a2cace1 100644
--- a/LAVFilters.iss
+++ b/LAVFilters.iss
@@ -203,7 +203,7 @@ begin
FR(SplitterFormats[13], 'avisynth', 'AviSynth scripts', True, ['avs', '']);
- FP(SplitterFormats[14], 'rtsp', 'RTSP Streaming Protocol', True, ['rtsp', '']);
+ FP(SplitterFormats[14], 'rtsp', 'RTSP Streaming Protocol', True, ['rtsp', 'rtspu', 'rtspm', 'rtspt', 'rtsph', '']);
FP(SplitterFormats[15], 'rtp', 'RTP Streaming Protocol', True, ['rtp', '']);
FP(SplitterFormats[16], 'mms', 'MMS Streaming Protocol', True, ['mms', 'mmsh', 'mmst', '']);
diff --git a/demuxer/Demuxers/LAVFDemuxer.cpp b/demuxer/Demuxers/LAVFDemuxer.cpp
index 56c2ca03..c601b9c6 100644
--- a/demuxer/Demuxers/LAVFDemuxer.cpp
+++ b/demuxer/Demuxers/LAVFDemuxer.cpp
@@ -204,6 +204,25 @@ STDMETHODIMP CLAVFDemuxer::OpenInputStream(AVIOContext *byteContext, LPCOLESTR p
memcpy(fileName, "http", 4);
}
+ const char * rtsp_transport = nullptr;
+ // check for rtsp transport protocol options
+ if (_strnicmp("rtsp", fileName, 4) == 0) {
+ if (_strnicmp("rtspu:", fileName, 6) == 0) {
+ rtsp_transport = "udp";
+ } else if (_strnicmp("rtspm:", fileName, 6) == 0) {
+ rtsp_transport = "udp_multicast";
+ } else if (_strnicmp("rtspt:", fileName, 6) == 0) {
+ rtsp_transport = "tcp";
+ } else if (_strnicmp("rtsph:", fileName, 6) == 0) {
+ rtsp_transport = "http";
+ }
+
+ // replace "rtsp[u|m|t|h]" protocol by rtsp
+ if (rtsp_transport != nullptr) {
+ memmove(fileName + 4, fileName + 5, strlen(fileName) - 4);
+ }
+ }
+
AVIOInterruptCB cb = {avio_interrupt_cb, this};
trynoformat:
@@ -250,6 +269,10 @@ trynoformat:
AVDictionary *options = nullptr;
av_dict_set(&options, "icy", "1", 0); // request ICY metadata
+ if (rtsp_transport != nullptr) {
+ av_dict_set(&options, "rtsp_transport", rtsp_transport, 0);
+ }
+
m_timeOpening = time(nullptr);
ret = avformat_open_input(&m_avFormat, fileName, inputFormat, &options);
av_dict_free(&options);