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 /demuxer
parent1472a4c60c8438a21d2801adc0431e555be9ca94 (diff)
Add support for transport protocol specific RTSP URL handlers
Fixes issue 480. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'demuxer')
-rw-r--r--demuxer/Demuxers/LAVFDemuxer.cpp23
1 files changed, 23 insertions, 0 deletions
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);