Commit a140a685 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: add support for WebVTT

parent 31c781a9
...@@ -89,6 +89,8 @@ StreamType AbstractStream::mimeToType(const std::string &mime) ...@@ -89,6 +89,8 @@ StreamType AbstractStream::mimeToType(const std::string &mime)
mimetype = AUDIO; mimetype = AUDIO;
else if (!mime.compare(0, 12, "application/")) else if (!mime.compare(0, 12, "application/"))
mimetype = APPLICATION; mimetype = APPLICATION;
else if (!mime.compare(0, 5, "text/"))
mimetype = SUBTITLE;
else /* unknown of unsupported */ else /* unknown of unsupported */
mimetype = UNKNOWN; mimetype = UNKNOWN;
return mimetype; return mimetype;
......
...@@ -28,6 +28,7 @@ namespace adaptative ...@@ -28,6 +28,7 @@ namespace adaptative
UNKNOWN = 0, UNKNOWN = 0,
VIDEO, VIDEO,
AUDIO, AUDIO,
SUBTITLE,
APPLICATION APPLICATION
}; };
......
...@@ -45,6 +45,10 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format) ...@@ -45,6 +45,10 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format)
ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource);
break; break;
case DASHStreamFormat::WEBVTT:
ret = new SlaveDemuxer(p_realdemux, "subtitle", fakeesout->getEsOut(), demuxersource);
break;
default: default:
case StreamFormat::UNSUPPORTED: case StreamFormat::UNSUPPORTED:
break; break;
......
...@@ -32,6 +32,7 @@ namespace dash ...@@ -32,6 +32,7 @@ namespace dash
public: public:
static const unsigned MPEG2TS = StreamFormat::UNSUPPORTED + 1; static const unsigned MPEG2TS = StreamFormat::UNSUPPORTED + 1;
static const unsigned MP4 = StreamFormat::UNSUPPORTED + 2; static const unsigned MP4 = StreamFormat::UNSUPPORTED + 2;
static const unsigned WEBVTT = StreamFormat::UNSUPPORTED + 3;
static StreamFormat mimeToFormat(const std::string &mime) static StreamFormat mimeToFormat(const std::string &mime)
{ {
...@@ -43,6 +44,8 @@ namespace dash ...@@ -43,6 +44,8 @@ namespace dash
return StreamFormat(DASHStreamFormat::MP4); return StreamFormat(DASHStreamFormat::MP4);
else if (tail == "mp2t") else if (tail == "mp2t")
return StreamFormat(DASHStreamFormat::MPEG2TS); return StreamFormat(DASHStreamFormat::MPEG2TS);
else if (tail == "vtt")
return StreamFormat(DASHStreamFormat::WEBVTT);
} }
return StreamFormat(); return StreamFormat();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment