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)
mimetype = AUDIO;
else if (!mime.compare(0, 12, "application/"))
mimetype = APPLICATION;
else if (!mime.compare(0, 5, "text/"))
mimetype = SUBTITLE;
else /* unknown of unsupported */
mimetype = UNKNOWN;
return mimetype;
......
......@@ -28,6 +28,7 @@ namespace adaptative
UNKNOWN = 0,
VIDEO,
AUDIO,
SUBTITLE,
APPLICATION
};
......
......@@ -45,6 +45,10 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format)
ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource);
break;
case DASHStreamFormat::WEBVTT:
ret = new SlaveDemuxer(p_realdemux, "subtitle", fakeesout->getEsOut(), demuxersource);
break;
default:
case StreamFormat::UNSUPPORTED:
break;
......
......@@ -32,6 +32,7 @@ namespace dash
public:
static const unsigned MPEG2TS = StreamFormat::UNSUPPORTED + 1;
static const unsigned MP4 = StreamFormat::UNSUPPORTED + 2;
static const unsigned WEBVTT = StreamFormat::UNSUPPORTED + 3;
static StreamFormat mimeToFormat(const std::string &mime)
{
......@@ -43,6 +44,8 @@ namespace dash
return StreamFormat(DASHStreamFormat::MP4);
else if (tail == "mp2t")
return StreamFormat(DASHStreamFormat::MPEG2TS);
else if (tail == "vtt")
return StreamFormat(DASHStreamFormat::WEBVTT);
}
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