[vlc-commits] demux: dash: add support for WebVTT

Francois Cartegnie git at videolan.org
Wed Oct 7 18:56:58 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  6 16:28:42 2015 +0200| [a140a685b8d9289f1c146b20a143a7f094575744] | committer: Francois Cartegnie

demux: dash: add support for WebVTT

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a140a685b8d9289f1c146b20a143a7f094575744
---

 modules/demux/adaptative/Streams.cpp     |    2 ++
 modules/demux/adaptative/StreamsType.hpp |    1 +
 modules/demux/dash/DASHStream.cpp        |    4 ++++
 modules/demux/dash/DASHStreamFormat.hpp  |    3 +++
 4 files changed, 10 insertions(+)

diff --git a/modules/demux/adaptative/Streams.cpp b/modules/demux/adaptative/Streams.cpp
index dac47da..12c8690 100644
--- a/modules/demux/adaptative/Streams.cpp
+++ b/modules/demux/adaptative/Streams.cpp
@@ -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;
diff --git a/modules/demux/adaptative/StreamsType.hpp b/modules/demux/adaptative/StreamsType.hpp
index fcc7f53..69fb1bf 100644
--- a/modules/demux/adaptative/StreamsType.hpp
+++ b/modules/demux/adaptative/StreamsType.hpp
@@ -28,6 +28,7 @@ namespace adaptative
         UNKNOWN = 0,
         VIDEO,
         AUDIO,
+        SUBTITLE,
         APPLICATION
     };
 
diff --git a/modules/demux/dash/DASHStream.cpp b/modules/demux/dash/DASHStream.cpp
index 87a88f8..474af05 100644
--- a/modules/demux/dash/DASHStream.cpp
+++ b/modules/demux/dash/DASHStream.cpp
@@ -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;
diff --git a/modules/demux/dash/DASHStreamFormat.hpp b/modules/demux/dash/DASHStreamFormat.hpp
index c95baa6..8fafa79 100644
--- a/modules/demux/dash/DASHStreamFormat.hpp
+++ b/modules/demux/dash/DASHStreamFormat.hpp
@@ -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();
             }



More information about the vlc-commits mailing list