demux: adaptative: rename to adaptive
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 19 Feb 2016 18:17:52 +0000 (19:17 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 19 Feb 2016 18:20:07 +0000 (19:20 +0100)
234 files changed:
modules/MODULES_LIST
modules/demux/Makefile.am
modules/demux/adaptative/ChunksSource.hpp [deleted file]
modules/demux/adaptative/PlaylistManager.cpp [deleted file]
modules/demux/adaptative/PlaylistManager.h [deleted file]
modules/demux/adaptative/SegmentTracker.cpp [deleted file]
modules/demux/adaptative/SegmentTracker.hpp [deleted file]
modules/demux/adaptative/StreamFormat.cpp [deleted file]
modules/demux/adaptative/StreamFormat.hpp [deleted file]
modules/demux/adaptative/Streams.cpp [deleted file]
modules/demux/adaptative/Streams.hpp [deleted file]
modules/demux/adaptative/Time.hpp [deleted file]
modules/demux/adaptative/adaptative.cpp [deleted file]
modules/demux/adaptative/http/BytesRange.cpp [deleted file]
modules/demux/adaptative/http/BytesRange.hpp [deleted file]
modules/demux/adaptative/http/Chunk.cpp [deleted file]
modules/demux/adaptative/http/Chunk.h [deleted file]
modules/demux/adaptative/http/Downloader.cpp [deleted file]
modules/demux/adaptative/http/Downloader.hpp [deleted file]
modules/demux/adaptative/http/HTTPConnection.cpp [deleted file]
modules/demux/adaptative/http/HTTPConnection.hpp [deleted file]
modules/demux/adaptative/http/HTTPConnectionManager.cpp [deleted file]
modules/demux/adaptative/http/HTTPConnectionManager.h [deleted file]
modules/demux/adaptative/http/Sockets.cpp [deleted file]
modules/demux/adaptative/http/Sockets.hpp [deleted file]
modules/demux/adaptative/logic/AbstractAdaptationLogic.cpp [deleted file]
modules/demux/adaptative/logic/AbstractAdaptationLogic.h [deleted file]
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp [deleted file]
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h [deleted file]
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp [deleted file]
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp [deleted file]
modules/demux/adaptative/logic/IDownloadRateObserver.h [deleted file]
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp [deleted file]
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h [deleted file]
modules/demux/adaptative/logic/Representationselectors.cpp [deleted file]
modules/demux/adaptative/logic/Representationselectors.hpp [deleted file]
modules/demux/adaptative/mp4/AtomsReader.cpp [deleted file]
modules/demux/adaptative/mp4/AtomsReader.hpp [deleted file]
modules/demux/adaptative/playlist/AbstractPlaylist.cpp [deleted file]
modules/demux/adaptative/playlist/AbstractPlaylist.hpp [deleted file]
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp [deleted file]
modules/demux/adaptative/playlist/BaseAdaptationSet.h [deleted file]
modules/demux/adaptative/playlist/BasePeriod.cpp [deleted file]
modules/demux/adaptative/playlist/BasePeriod.h [deleted file]
modules/demux/adaptative/playlist/BaseRepresentation.cpp [deleted file]
modules/demux/adaptative/playlist/BaseRepresentation.h [deleted file]
modules/demux/adaptative/playlist/CommonAttributesElements.cpp [deleted file]
modules/demux/adaptative/playlist/CommonAttributesElements.h [deleted file]
modules/demux/adaptative/playlist/ICanonicalUrl.hpp [deleted file]
modules/demux/adaptative/playlist/ID.cpp [deleted file]
modules/demux/adaptative/playlist/ID.hpp [deleted file]
modules/demux/adaptative/playlist/Inheritables.cpp [deleted file]
modules/demux/adaptative/playlist/Inheritables.hpp [deleted file]
modules/demux/adaptative/playlist/Segment.cpp [deleted file]
modules/demux/adaptative/playlist/Segment.h [deleted file]
modules/demux/adaptative/playlist/SegmentBase.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentBase.h [deleted file]
modules/demux/adaptative/playlist/SegmentChunk.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentChunk.hpp [deleted file]
modules/demux/adaptative/playlist/SegmentInfoCommon.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentInfoCommon.h [deleted file]
modules/demux/adaptative/playlist/SegmentInformation.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentInformation.hpp [deleted file]
modules/demux/adaptative/playlist/SegmentList.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentList.h [deleted file]
modules/demux/adaptative/playlist/SegmentTemplate.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentTemplate.h [deleted file]
modules/demux/adaptative/playlist/SegmentTimeline.cpp [deleted file]
modules/demux/adaptative/playlist/SegmentTimeline.h [deleted file]
modules/demux/adaptative/playlist/Templates.hpp [deleted file]
modules/demux/adaptative/playlist/Url.cpp [deleted file]
modules/demux/adaptative/playlist/Url.hpp [deleted file]
modules/demux/adaptative/plumbing/CommandsQueue.cpp [deleted file]
modules/demux/adaptative/plumbing/CommandsQueue.hpp [deleted file]
modules/demux/adaptative/plumbing/Demuxer.cpp [deleted file]
modules/demux/adaptative/plumbing/Demuxer.hpp [deleted file]
modules/demux/adaptative/plumbing/FakeESOut.cpp [deleted file]
modules/demux/adaptative/plumbing/FakeESOut.hpp [deleted file]
modules/demux/adaptative/plumbing/FakeESOutID.cpp [deleted file]
modules/demux/adaptative/plumbing/FakeESOutID.hpp [deleted file]
modules/demux/adaptative/plumbing/SourceStream.cpp [deleted file]
modules/demux/adaptative/plumbing/SourceStream.hpp [deleted file]
modules/demux/adaptative/tools/Conversions.cpp [deleted file]
modules/demux/adaptative/tools/Conversions.hpp [deleted file]
modules/demux/adaptative/tools/Debug.hpp [deleted file]
modules/demux/adaptative/tools/Helper.cpp [deleted file]
modules/demux/adaptative/tools/Helper.h [deleted file]
modules/demux/adaptative/tools/Properties.hpp [deleted file]
modules/demux/adaptative/tools/Retrieve.cpp [deleted file]
modules/demux/adaptative/tools/Retrieve.hpp [deleted file]
modules/demux/adaptative/xml/DOMHelper.cpp [deleted file]
modules/demux/adaptative/xml/DOMHelper.h [deleted file]
modules/demux/adaptative/xml/DOMParser.cpp [deleted file]
modules/demux/adaptative/xml/DOMParser.h [deleted file]
modules/demux/adaptative/xml/Node.cpp [deleted file]
modules/demux/adaptative/xml/Node.h [deleted file]
modules/demux/adaptive/ChunksSource.hpp [new file with mode: 0644]
modules/demux/adaptive/PlaylistManager.cpp [new file with mode: 0644]
modules/demux/adaptive/PlaylistManager.h [new file with mode: 0644]
modules/demux/adaptive/SegmentTracker.cpp [new file with mode: 0644]
modules/demux/adaptive/SegmentTracker.hpp [new file with mode: 0644]
modules/demux/adaptive/StreamFormat.cpp [new file with mode: 0644]
modules/demux/adaptive/StreamFormat.hpp [new file with mode: 0644]
modules/demux/adaptive/Streams.cpp [new file with mode: 0644]
modules/demux/adaptive/Streams.hpp [new file with mode: 0644]
modules/demux/adaptive/Time.hpp [new file with mode: 0644]
modules/demux/adaptive/adaptive.cpp [new file with mode: 0644]
modules/demux/adaptive/http/BytesRange.cpp [new file with mode: 0644]
modules/demux/adaptive/http/BytesRange.hpp [new file with mode: 0644]
modules/demux/adaptive/http/Chunk.cpp [new file with mode: 0644]
modules/demux/adaptive/http/Chunk.h [new file with mode: 0644]
modules/demux/adaptive/http/Downloader.cpp [new file with mode: 0644]
modules/demux/adaptive/http/Downloader.hpp [new file with mode: 0644]
modules/demux/adaptive/http/HTTPConnection.cpp [new file with mode: 0644]
modules/demux/adaptive/http/HTTPConnection.hpp [new file with mode: 0644]
modules/demux/adaptive/http/HTTPConnectionManager.cpp [new file with mode: 0644]
modules/demux/adaptive/http/HTTPConnectionManager.h [new file with mode: 0644]
modules/demux/adaptive/http/Sockets.cpp [new file with mode: 0644]
modules/demux/adaptive/http/Sockets.hpp [new file with mode: 0644]
modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp [new file with mode: 0644]
modules/demux/adaptive/logic/AbstractAdaptationLogic.h [new file with mode: 0644]
modules/demux/adaptive/logic/AlwaysBestAdaptationLogic.cpp [new file with mode: 0644]
modules/demux/adaptive/logic/AlwaysBestAdaptationLogic.h [new file with mode: 0644]
modules/demux/adaptive/logic/AlwaysLowestAdaptationLogic.cpp [new file with mode: 0644]
modules/demux/adaptive/logic/AlwaysLowestAdaptationLogic.hpp [new file with mode: 0644]
modules/demux/adaptive/logic/IDownloadRateObserver.h [new file with mode: 0644]
modules/demux/adaptive/logic/RateBasedAdaptationLogic.cpp [new file with mode: 0644]
modules/demux/adaptive/logic/RateBasedAdaptationLogic.h [new file with mode: 0644]
modules/demux/adaptive/logic/Representationselectors.cpp [new file with mode: 0644]
modules/demux/adaptive/logic/Representationselectors.hpp [new file with mode: 0644]
modules/demux/adaptive/mp4/AtomsReader.cpp [new file with mode: 0644]
modules/demux/adaptive/mp4/AtomsReader.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/AbstractPlaylist.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/AbstractPlaylist.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/BaseAdaptationSet.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/BaseAdaptationSet.h [new file with mode: 0644]
modules/demux/adaptive/playlist/BasePeriod.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/BasePeriod.h [new file with mode: 0644]
modules/demux/adaptive/playlist/BaseRepresentation.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/BaseRepresentation.h [new file with mode: 0644]
modules/demux/adaptive/playlist/CommonAttributesElements.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/CommonAttributesElements.h [new file with mode: 0644]
modules/demux/adaptive/playlist/ICanonicalUrl.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/ID.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/ID.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Inheritables.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Inheritables.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Segment.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Segment.h [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentBase.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentBase.h [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentChunk.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentChunk.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentInfoCommon.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentInfoCommon.h [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentInformation.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentInformation.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentList.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentList.h [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentTemplate.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentTemplate.h [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentTimeline.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/SegmentTimeline.h [new file with mode: 0644]
modules/demux/adaptive/playlist/Templates.hpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Url.cpp [new file with mode: 0644]
modules/demux/adaptive/playlist/Url.hpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/CommandsQueue.cpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/CommandsQueue.hpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/Demuxer.cpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/Demuxer.hpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/FakeESOut.cpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/FakeESOut.hpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/FakeESOutID.cpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/FakeESOutID.hpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/SourceStream.cpp [new file with mode: 0644]
modules/demux/adaptive/plumbing/SourceStream.hpp [new file with mode: 0644]
modules/demux/adaptive/tools/Conversions.cpp [new file with mode: 0644]
modules/demux/adaptive/tools/Conversions.hpp [new file with mode: 0644]
modules/demux/adaptive/tools/Debug.hpp [new file with mode: 0644]
modules/demux/adaptive/tools/Helper.cpp [new file with mode: 0644]
modules/demux/adaptive/tools/Helper.h [new file with mode: 0644]
modules/demux/adaptive/tools/Properties.hpp [new file with mode: 0644]
modules/demux/adaptive/tools/Retrieve.cpp [new file with mode: 0644]
modules/demux/adaptive/tools/Retrieve.hpp [new file with mode: 0644]
modules/demux/adaptive/xml/DOMHelper.cpp [new file with mode: 0644]
modules/demux/adaptive/xml/DOMHelper.h [new file with mode: 0644]
modules/demux/adaptive/xml/DOMParser.cpp [new file with mode: 0644]
modules/demux/adaptive/xml/DOMParser.h [new file with mode: 0644]
modules/demux/adaptive/xml/Node.cpp [new file with mode: 0644]
modules/demux/adaptive/xml/Node.h [new file with mode: 0644]
modules/demux/dash/DASHManager.cpp
modules/demux/dash/DASHManager.h
modules/demux/dash/DASHStream.hpp
modules/demux/dash/mp4/IndexReader.cpp
modules/demux/dash/mp4/IndexReader.hpp
modules/demux/dash/mpd/AdaptationSet.cpp
modules/demux/dash/mpd/AdaptationSet.h
modules/demux/dash/mpd/DASHCommonAttributesElements.cpp
modules/demux/dash/mpd/DASHSegment.cpp
modules/demux/dash/mpd/DASHSegment.h
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.h
modules/demux/dash/mpd/MPD.h
modules/demux/dash/mpd/Period.h
modules/demux/dash/mpd/Representation.cpp
modules/demux/dash/mpd/Representation.h
modules/demux/hls/HLSManager.cpp
modules/demux/hls/HLSManager.hpp
modules/demux/hls/HLSStreams.hpp
modules/demux/hls/playlist/HLSSegment.cpp
modules/demux/hls/playlist/HLSSegment.hpp
modules/demux/hls/playlist/M3U8.cpp
modules/demux/hls/playlist/M3U8.hpp
modules/demux/hls/playlist/Parser.cpp
modules/demux/hls/playlist/Parser.hpp
modules/demux/hls/playlist/Representation.cpp
modules/demux/hls/playlist/Representation.hpp
modules/demux/smooth/SmoothManager.cpp
modules/demux/smooth/SmoothManager.hpp
modules/demux/smooth/SmoothStream.hpp
modules/demux/smooth/mp4/IndexReader.cpp
modules/demux/smooth/mp4/IndexReader.hpp
modules/demux/smooth/playlist/ForgedInitSegment.cpp
modules/demux/smooth/playlist/ForgedInitSegment.hpp
modules/demux/smooth/playlist/Manifest.cpp
modules/demux/smooth/playlist/Manifest.hpp
modules/demux/smooth/playlist/MemoryChunk.hpp
modules/demux/smooth/playlist/Parser.cpp
modules/demux/smooth/playlist/Parser.hpp
modules/demux/smooth/playlist/Representation.cpp
modules/demux/smooth/playlist/Representation.hpp
modules/demux/smooth/playlist/SmoothSegment.cpp
modules/demux/smooth/playlist/SmoothSegment.hpp
po/POTFILES.in

index 8083c59..55822e1 100644 (file)
@@ -23,7 +23,7 @@ $Id$
  * access_realrtsp: Real RTSP access
  * access_wasapi: WASAPI audio input
  * accesstweaks: access control tweaking module (dev tool)
- * adaptative: Unified adaptative streaming module (DASH/HLS)
+ * adaptive: Unified adaptive streaming module (DASH/HLS)
  * addonsfsstorage: Local storage extensions repository
  * addonsvorepository: Videolan extensions repository
  * adjust: Contrast/Hue/saturation/Brightness adjust module
index db63e7c..5bbc732 100644 (file)
@@ -264,102 +264,102 @@ if HAVE_DVBPSI
 demux_LTLIBRARIES += libts_plugin.la
 endif
 
-libadaptative_plugin_la_SOURCES = \
-    demux/adaptative/playlist/AbstractPlaylist.cpp \
-    demux/adaptative/playlist/AbstractPlaylist.hpp \
-    demux/adaptative/playlist/BaseAdaptationSet.cpp \
-    demux/adaptative/playlist/BaseAdaptationSet.h \
-    demux/adaptative/playlist/BasePeriod.cpp \
-    demux/adaptative/playlist/BasePeriod.h \
-    demux/adaptative/playlist/BaseRepresentation.cpp \
-    demux/adaptative/playlist/BaseRepresentation.h \
-    demux/adaptative/playlist/CommonAttributesElements.cpp \
-    demux/adaptative/playlist/CommonAttributesElements.h \
-    demux/adaptative/playlist/ICanonicalUrl.hpp \
-    demux/adaptative/playlist/ID.hpp \
-    demux/adaptative/playlist/ID.cpp \
-    demux/adaptative/playlist/Inheritables.hpp \
-    demux/adaptative/playlist/Inheritables.cpp \
-    demux/adaptative/playlist/Segment.cpp \
-    demux/adaptative/playlist/Segment.h \
-    demux/adaptative/playlist/SegmentBase.cpp \
-    demux/adaptative/playlist/SegmentBase.h \
-    demux/adaptative/playlist/SegmentChunk.cpp \
-    demux/adaptative/playlist/SegmentChunk.hpp \
-    demux/adaptative/playlist/SegmentInfoCommon.cpp \
-    demux/adaptative/playlist/SegmentInfoCommon.h \
-    demux/adaptative/playlist/SegmentList.cpp \
-    demux/adaptative/playlist/SegmentList.h \
-    demux/adaptative/playlist/SegmentTimeline.cpp \
-    demux/adaptative/playlist/SegmentTimeline.h \
-    demux/adaptative/playlist/SegmentInformation.cpp \
-    demux/adaptative/playlist/SegmentInformation.hpp \
-    demux/adaptative/playlist/SegmentTemplate.cpp \
-    demux/adaptative/playlist/SegmentTemplate.h \
-    demux/adaptative/playlist/Url.cpp \
-    demux/adaptative/playlist/Url.hpp \
-    demux/adaptative/playlist/Templates.hpp \
-    demux/adaptative/logic/AbstractAdaptationLogic.cpp \
-    demux/adaptative/logic/AbstractAdaptationLogic.h \
-    demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp \
-    demux/adaptative/logic/AlwaysBestAdaptationLogic.h \
-    demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp \
-    demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp \
-    demux/adaptative/logic/IDownloadRateObserver.h \
-    demux/adaptative/logic/RateBasedAdaptationLogic.h \
-    demux/adaptative/logic/RateBasedAdaptationLogic.cpp \
-    demux/adaptative/logic/Representationselectors.hpp \
-    demux/adaptative/logic/Representationselectors.cpp \
-    demux/adaptative/mp4/AtomsReader.cpp \
-    demux/adaptative/mp4/AtomsReader.hpp \
-    demux/adaptative/http/BytesRange.cpp \
-    demux/adaptative/http/BytesRange.hpp \
-    demux/adaptative/http/Chunk.cpp \
-    demux/adaptative/http/Chunk.h \
-    demux/adaptative/http/Downloader.cpp \
-    demux/adaptative/http/Downloader.hpp \
-    demux/adaptative/http/HTTPConnection.cpp \
-    demux/adaptative/http/HTTPConnection.hpp \
-    demux/adaptative/http/HTTPConnectionManager.cpp \
-    demux/adaptative/http/HTTPConnectionManager.h \
-    demux/adaptative/http/Sockets.hpp \
-    demux/adaptative/http/Sockets.cpp \
-    demux/adaptative/plumbing/CommandsQueue.cpp \
-    demux/adaptative/plumbing/CommandsQueue.hpp \
-    demux/adaptative/plumbing/Demuxer.cpp \
-    demux/adaptative/plumbing/Demuxer.hpp \
-    demux/adaptative/plumbing/FakeESOut.cpp \
-    demux/adaptative/plumbing/FakeESOut.hpp \
-    demux/adaptative/plumbing/FakeESOutID.cpp \
-    demux/adaptative/plumbing/FakeESOutID.hpp \
-    demux/adaptative/plumbing/SourceStream.cpp \
-    demux/adaptative/plumbing/SourceStream.hpp \
-    demux/adaptative/ChunksSource.hpp \
-    demux/adaptative/PlaylistManager.cpp \
-    demux/adaptative/PlaylistManager.h \
-    demux/adaptative/SegmentTracker.cpp \
-    demux/adaptative/SegmentTracker.hpp \
-    demux/adaptative/StreamFormat.cpp \
-    demux/adaptative/StreamFormat.hpp \
-    demux/adaptative/Streams.cpp \
-    demux/adaptative/Streams.hpp \
-    demux/adaptative/Time.hpp \
-    demux/adaptative/tools/Conversions.hpp \
-    demux/adaptative/tools/Conversions.cpp \
-    demux/adaptative/tools/Debug.hpp \
-    demux/adaptative/tools/Helper.cpp \
-    demux/adaptative/tools/Helper.h \
-    demux/adaptative/tools/Properties.hpp \
-    demux/adaptative/tools/Retrieve.cpp \
-    demux/adaptative/tools/Retrieve.hpp \
-    demux/adaptative/xml/DOMHelper.cpp \
-    demux/adaptative/xml/DOMHelper.h \
-    demux/adaptative/xml/DOMParser.cpp \
-    demux/adaptative/xml/DOMParser.h \
-    demux/adaptative/xml/Node.cpp \
-    demux/adaptative/xml/Node.h
-
-libadaptative_dash_SOURCES = \
+libadaptive_plugin_la_SOURCES = \
+    demux/adaptive/playlist/AbstractPlaylist.cpp \
+    demux/adaptive/playlist/AbstractPlaylist.hpp \
+    demux/adaptive/playlist/BaseAdaptationSet.cpp \
+    demux/adaptive/playlist/BaseAdaptationSet.h \
+    demux/adaptive/playlist/BasePeriod.cpp \
+    demux/adaptive/playlist/BasePeriod.h \
+    demux/adaptive/playlist/BaseRepresentation.cpp \
+    demux/adaptive/playlist/BaseRepresentation.h \
+    demux/adaptive/playlist/CommonAttributesElements.cpp \
+    demux/adaptive/playlist/CommonAttributesElements.h \
+    demux/adaptive/playlist/ICanonicalUrl.hpp \
+    demux/adaptive/playlist/ID.hpp \
+    demux/adaptive/playlist/ID.cpp \
+    demux/adaptive/playlist/Inheritables.hpp \
+    demux/adaptive/playlist/Inheritables.cpp \
+    demux/adaptive/playlist/Segment.cpp \
+    demux/adaptive/playlist/Segment.h \
+    demux/adaptive/playlist/SegmentBase.cpp \
+    demux/adaptive/playlist/SegmentBase.h \
+    demux/adaptive/playlist/SegmentChunk.cpp \
+    demux/adaptive/playlist/SegmentChunk.hpp \
+    demux/adaptive/playlist/SegmentInfoCommon.cpp \
+    demux/adaptive/playlist/SegmentInfoCommon.h \
+    demux/adaptive/playlist/SegmentList.cpp \
+    demux/adaptive/playlist/SegmentList.h \
+    demux/adaptive/playlist/SegmentTimeline.cpp \
+    demux/adaptive/playlist/SegmentTimeline.h \
+    demux/adaptive/playlist/SegmentInformation.cpp \
+    demux/adaptive/playlist/SegmentInformation.hpp \
+    demux/adaptive/playlist/SegmentTemplate.cpp \
+    demux/adaptive/playlist/SegmentTemplate.h \
+    demux/adaptive/playlist/Url.cpp \
+    demux/adaptive/playlist/Url.hpp \
+    demux/adaptive/playlist/Templates.hpp \
+    demux/adaptive/logic/AbstractAdaptationLogic.cpp \
+    demux/adaptive/logic/AbstractAdaptationLogic.h \
+    demux/adaptive/logic/AlwaysBestAdaptationLogic.cpp \
+    demux/adaptive/logic/AlwaysBestAdaptationLogic.h \
+    demux/adaptive/logic/AlwaysLowestAdaptationLogic.cpp \
+    demux/adaptive/logic/AlwaysLowestAdaptationLogic.hpp \
+    demux/adaptive/logic/IDownloadRateObserver.h \
+    demux/adaptive/logic/RateBasedAdaptationLogic.h \
+    demux/adaptive/logic/RateBasedAdaptationLogic.cpp \
+    demux/adaptive/logic/Representationselectors.hpp \
+    demux/adaptive/logic/Representationselectors.cpp \
+    demux/adaptive/mp4/AtomsReader.cpp \
+    demux/adaptive/mp4/AtomsReader.hpp \
+    demux/adaptive/http/BytesRange.cpp \
+    demux/adaptive/http/BytesRange.hpp \
+    demux/adaptive/http/Chunk.cpp \
+    demux/adaptive/http/Chunk.h \
+    demux/adaptive/http/Downloader.cpp \
+    demux/adaptive/http/Downloader.hpp \
+    demux/adaptive/http/HTTPConnection.cpp \
+    demux/adaptive/http/HTTPConnection.hpp \
+    demux/adaptive/http/HTTPConnectionManager.cpp \
+    demux/adaptive/http/HTTPConnectionManager.h \
+    demux/adaptive/http/Sockets.hpp \
+    demux/adaptive/http/Sockets.cpp \
+    demux/adaptive/plumbing/CommandsQueue.cpp \
+    demux/adaptive/plumbing/CommandsQueue.hpp \
+    demux/adaptive/plumbing/Demuxer.cpp \
+    demux/adaptive/plumbing/Demuxer.hpp \
+    demux/adaptive/plumbing/FakeESOut.cpp \
+    demux/adaptive/plumbing/FakeESOut.hpp \
+    demux/adaptive/plumbing/FakeESOutID.cpp \
+    demux/adaptive/plumbing/FakeESOutID.hpp \
+    demux/adaptive/plumbing/SourceStream.cpp \
+    demux/adaptive/plumbing/SourceStream.hpp \
+    demux/adaptive/ChunksSource.hpp \
+    demux/adaptive/PlaylistManager.cpp \
+    demux/adaptive/PlaylistManager.h \
+    demux/adaptive/SegmentTracker.cpp \
+    demux/adaptive/SegmentTracker.hpp \
+    demux/adaptive/StreamFormat.cpp \
+    demux/adaptive/StreamFormat.hpp \
+    demux/adaptive/Streams.cpp \
+    demux/adaptive/Streams.hpp \
+    demux/adaptive/Time.hpp \
+    demux/adaptive/tools/Conversions.hpp \
+    demux/adaptive/tools/Conversions.cpp \
+    demux/adaptive/tools/Debug.hpp \
+    demux/adaptive/tools/Helper.cpp \
+    demux/adaptive/tools/Helper.h \
+    demux/adaptive/tools/Properties.hpp \
+    demux/adaptive/tools/Retrieve.cpp \
+    demux/adaptive/tools/Retrieve.hpp \
+    demux/adaptive/xml/DOMHelper.cpp \
+    demux/adaptive/xml/DOMHelper.h \
+    demux/adaptive/xml/DOMParser.cpp \
+    demux/adaptive/xml/DOMParser.h \
+    demux/adaptive/xml/Node.cpp \
+    demux/adaptive/xml/Node.h
+
+libadaptive_dash_SOURCES = \
     demux/dash/mpd/AdaptationSet.cpp \
     demux/dash/mpd/AdaptationSet.h \
     demux/dash/mpd/DASHCommonAttributesElements.cpp \
@@ -389,7 +389,7 @@ libadaptative_dash_SOURCES = \
     demux/dash/DASHStream.cpp \
     demux/dash/DASHStream.hpp
 
-libadaptative_hls_SOURCES = \
+libadaptive_hls_SOURCES = \
     demux/hls/playlist/M3U8.hpp \
     demux/hls/playlist/M3U8.cpp \
     demux/hls/playlist/Parser.hpp \
@@ -405,7 +405,7 @@ libadaptative_hls_SOURCES = \
     demux/hls/HLSStreams.hpp \
     demux/hls/HLSStreams.cpp
 
-libadaptative_smooth_SOURCES = \
+libadaptive_smooth_SOURCES = \
     demux/smooth/mp4/IndexReader.cpp \
     demux/smooth/mp4/IndexReader.hpp \
     demux/smooth/playlist/ForgedInitSegment.hpp \
@@ -424,24 +424,24 @@ libadaptative_smooth_SOURCES = \
     demux/smooth/SmoothManager.cpp \
     demux/smooth/SmoothStream.hpp \
     demux/smooth/SmoothStream.cpp
-libadaptative_smooth_SOURCES += mux/mp4/libmp4mux.c mux/mp4/libmp4mux.h \
+libadaptive_smooth_SOURCES += mux/mp4/libmp4mux.c mux/mp4/libmp4mux.h \
                                packetizer/h264_nal.c packetizer/h264_nal.h
 
-libadaptative_plugin_la_SOURCES += $(libadaptative_hls_SOURCES)
-libadaptative_plugin_la_SOURCES += $(libadaptative_dash_SOURCES)
-libadaptative_plugin_la_SOURCES += $(libadaptative_smooth_SOURCES)
-libadaptative_plugin_la_SOURCES += demux/adaptative/adaptative.cpp
-libadaptative_plugin_la_SOURCES += demux/mp4/libmp4.c demux/mp4/libmp4.h
-libadaptative_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir)/demux/adaptative
-libadaptative_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBM)
+libadaptive_plugin_la_SOURCES += $(libadaptive_hls_SOURCES)
+libadaptive_plugin_la_SOURCES += $(libadaptive_dash_SOURCES)
+libadaptive_plugin_la_SOURCES += $(libadaptive_smooth_SOURCES)
+libadaptive_plugin_la_SOURCES += demux/adaptive/adaptive.cpp
+libadaptive_plugin_la_SOURCES += demux/mp4/libmp4.c demux/mp4/libmp4.h
+libadaptive_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir)/demux/adaptive
+libadaptive_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBM)
 if HAVE_ZLIB
-libadaptative_plugin_la_LIBADD += -lz
+libadaptive_plugin_la_LIBADD += -lz
 endif
 if HAVE_GCRYPT
-libadaptative_plugin_la_CXXFLAGS += $(GCRYPT_CFLAGS)
-libadaptative_plugin_la_LIBADD += $(GCRYPT_LIBS)
+libadaptive_plugin_la_CXXFLAGS += $(GCRYPT_CFLAGS)
+libadaptive_plugin_la_LIBADD += $(GCRYPT_LIBS)
 endif
-demux_LTLIBRARIES += libadaptative_plugin.la
+demux_LTLIBRARIES += libadaptive_plugin.la
 
 libttml_plugin_la_SOURCES = demux/ttml.c
 demux_LTLIBRARIES += libttml_plugin.la
diff --git a/modules/demux/adaptative/ChunksSource.hpp b/modules/demux/adaptative/ChunksSource.hpp
deleted file mode 100644 (file)
index 52ee7fe..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * ChunksSource.hpp
- *****************************************************************************
- * Copyright © 2015 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef CHUNKSSOURCE_HPP
-#define CHUNKSSOURCE_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-
-namespace adaptative
-{
-    class ChunksSource
-    {
-        public:
-            virtual ~ChunksSource() {}
-            virtual block_t *readNextBlock() = 0;
-    };
-}
-
-#endif // CHUNKSSOURCE_HPP
-
diff --git a/modules/demux/adaptative/PlaylistManager.cpp b/modules/demux/adaptative/PlaylistManager.cpp
deleted file mode 100644 (file)
index 52e4467..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * PlaylistManager.cpp
- *****************************************************************************
- * Copyright © 2010 - 2011 Klagenfurt University
- *             2015 VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "PlaylistManager.h"
-#include "SegmentTracker.hpp"
-#include "playlist/AbstractPlaylist.hpp"
-#include "playlist/BasePeriod.h"
-#include "playlist/BaseAdaptationSet.h"
-#include "playlist/BaseRepresentation.h"
-#include "http/HTTPConnectionManager.h"
-#include "logic/AlwaysBestAdaptationLogic.h"
-#include "logic/RateBasedAdaptationLogic.h"
-#include "logic/AlwaysLowestAdaptationLogic.hpp"
-#include "tools/Debug.hpp"
-#include <vlc_stream.h>
-#include <vlc_demux.h>
-
-#include <ctime>
-
-using namespace adaptative::http;
-using namespace adaptative::logic;
-using namespace adaptative;
-
-PlaylistManager::PlaylistManager( demux_t *p_demux_,
-                                  AbstractPlaylist *pl,
-                                  AbstractStreamFactory *factory,
-                                  AbstractAdaptationLogic::LogicType type ) :
-             conManager     ( NULL ),
-             logicType      ( type ),
-             logic          ( NULL ),
-             playlist       ( pl ),
-             streamFactory  ( factory ),
-             p_demux        ( p_demux_ ),
-             nextPlaylistupdate  ( 0 ),
-             i_nzpcr        ( 0 )
-{
-    currentPeriod = playlist->getFirstPeriod();
-    failedupdates = 0;
-}
-
-PlaylistManager::~PlaylistManager   ()
-{
-    delete streamFactory;
-    unsetPeriod();
-    delete playlist;
-    delete conManager;
-    delete logic;
-}
-
-void PlaylistManager::unsetPeriod()
-{
-    std::vector<AbstractStream *>::iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-        delete *it;
-    streams.clear();
-}
-
-bool PlaylistManager::setupPeriod()
-{
-    if(!currentPeriod)
-        return false;
-
-    if(!logic && !(logic = createLogic(logicType, conManager)))
-        return false;
-
-    std::vector<BaseAdaptationSet*> sets = currentPeriod->getAdaptationSets();
-    std::vector<BaseAdaptationSet*>::iterator it;
-    for(it=sets.begin();it!=sets.end();++it)
-    {
-        BaseAdaptationSet *set = *it;
-        if(set && streamFactory)
-        {
-            SegmentTracker *tracker = new (std::nothrow) SegmentTracker(logic, set);
-            if(!tracker)
-                continue;
-
-            AbstractStream *st = streamFactory->create(p_demux, set->getStreamFormat(),
-                                                       tracker, conManager);
-            if(!st)
-            {
-                delete tracker;
-                continue;
-            }
-
-            streams.push_back(st);
-
-            /* Generate stream description */
-            std::list<std::string> languages;
-            if(!set->getLang().empty())
-            {
-                languages = set->getLang();
-            }
-            else if(!set->getRepresentations().empty())
-            {
-                languages = set->getRepresentations().front()->getLang();
-            }
-
-            if(!languages.empty())
-                st->setLanguage(languages.front());
-
-            if(!set->description.Get().empty())
-                st->setDescription(set->description.Get());
-        }
-    }
-    return true;
-}
-
-bool PlaylistManager::start()
-{
-    if(!conManager && !(conManager = new (std::nothrow) HTTPConnectionManager(VLC_OBJECT(p_demux->s))))
-        return false;
-
-    if(!setupPeriod())
-        return false;
-
-    playlist->playbackStart.Set(time(NULL));
-    nextPlaylistupdate = playlist->playbackStart.Get();
-
-    return true;
-}
-
-AbstractStream::status PlaylistManager::demux(mtime_t nzdeadline, bool send)
-{
-    AbstractStream::status i_return = AbstractStream::status_eof;
-
-    std::vector<AbstractStream *>::iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-    {
-        AbstractStream *st = *it;
-
-        if (st->isDisabled())
-        {
-            if(st->isSelected() && !st->isEOF())
-                reactivateStream(st);
-            else
-                continue;
-        }
-
-        AbstractStream::status i_ret = st->demux(nzdeadline, send);
-        if(i_ret == AbstractStream::status_buffering_ahead ||
-           i_return == AbstractStream::status_buffering_ahead)
-        {
-            i_return = AbstractStream::status_buffering_ahead;
-        }
-        else if(i_ret == AbstractStream::status_buffering)
-        {
-            i_return = AbstractStream::status_buffering;
-        }
-        else if(i_ret == AbstractStream::status_demuxed &&
-                i_return != AbstractStream::status_buffering)
-        {
-            i_return = AbstractStream::status_demuxed;
-        }
-        else if(i_ret == AbstractStream::status_dis)
-        {
-            i_return = AbstractStream::status_dis;
-        }
-    }
-
-    /* might be end of current period */
-    if(i_return == AbstractStream::status_eof && currentPeriod)
-    {
-        unsetPeriod();
-        currentPeriod = playlist->getNextPeriod(currentPeriod);
-        i_return = (setupPeriod()) ? AbstractStream::status_eop : AbstractStream::status_eof;
-    }
-
-    return i_return;
-}
-
-mtime_t PlaylistManager::getPCR() const
-{
-    mtime_t pcr = VLC_TS_INVALID;
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-    {
-        if ((*it)->isDisabled() || (*it)->isEOF())
-            continue;
-        if(pcr == VLC_TS_INVALID || pcr > (*it)->getPCR())
-            pcr = (*it)->getPCR();
-    }
-    return pcr;
-}
-
-mtime_t PlaylistManager::getFirstDTS() const
-{
-    mtime_t dts = VLC_TS_INVALID;
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-    {
-        if ((*it)->isDisabled() || (*it)->isEOF())
-            continue;
-        if(dts == VLC_TS_INVALID || dts > (*it)->getFirstDTS())
-            dts = (*it)->getFirstDTS();
-    }
-    return dts;
-}
-
-int PlaylistManager::esCount() const
-{
-    int es = 0;
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-    {
-        es += (*it)->esCount();
-    }
-    return es;
-}
-
-mtime_t PlaylistManager::getDuration() const
-{
-    if (playlist->isLive())
-        return 0;
-    else
-        return playlist->duration.Get();
-}
-
-bool PlaylistManager::setPosition(mtime_t time)
-{
-    bool ret = true;
-    for(int real = 0; real < 2; real++)
-    {
-        /* Always probe if we can seek first */
-        std::vector<AbstractStream *>::iterator it;
-        for(it=streams.begin(); it!=streams.end(); ++it)
-        {
-            ret &= (*it)->setPosition(time, !real);
-        }
-        if(!ret)
-            break;
-    }
-    return ret;
-}
-
-bool PlaylistManager::needsUpdate() const
-{
-    return playlist->isLive() && (failedupdates < 3);
-}
-
-bool PlaylistManager::seekAble() const
-{
-    if(playlist->isLive())
-        return false;
-
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-    {
-        if(!(*it)->seekAble())
-            return false;
-    }
-    return true;
-}
-
-void PlaylistManager::scheduleNextUpdate()
-{
-
-}
-
-bool PlaylistManager::updatePlaylist()
-{
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); ++it)
-        (*it)->runUpdates();
-
-    return true;
-}
-
-void PlaylistManager::pruneLiveStream()
-{
-    mtime_t minValidPos = 0;
-    std::vector<AbstractStream *>::const_iterator it;
-    for(it=streams.begin(); it!=streams.end(); it++)
-    {
-        const AbstractStream *st = *it;
-        if(st->isDisabled() || !st->isSelected() || st->isEOF())
-            continue;
-        const mtime_t t = st->getPlaybackTime();
-        if(minValidPos == 0 || t < minValidPos)
-            minValidPos = t;
-    }
-
-    if(minValidPos)
-        playlist->pruneByPlaybackTime(minValidPos);
-}
-
-bool PlaylistManager::reactivateStream(AbstractStream *stream)
-{
-    return stream->reactivate(getPCR());
-}
-
-#define DEMUX_INCREMENT (CLOCK_FREQ / 20)
-int PlaylistManager::demux_callback(demux_t *p_demux)
-{
-    PlaylistManager *manager = reinterpret_cast<PlaylistManager *>(p_demux->p_sys);
-    return manager->doDemux(DEMUX_INCREMENT);
-}
-
-int PlaylistManager::doDemux(int64_t increment)
-{
-    if(i_nzpcr == VLC_TS_INVALID)
-    {
-        if( AbstractStream::status_eof == demux(i_nzpcr + increment, false) )
-        {
-            return VLC_DEMUXER_EOF;
-        }
-        i_nzpcr = getFirstDTS();
-        if(i_nzpcr == VLC_TS_INVALID)
-            i_nzpcr = getPCR();
-    }
-
-    AbstractStream::status status = demux(i_nzpcr + increment, true);
-    AdvDebug(msg_Dbg( p_demux, "doDemux() status %d dts %ld pcr %ld", status, getFirstDTS(), getPCR() ));
-    switch(status)
-    {
-    case AbstractStream::status_eof:
-        return VLC_DEMUXER_EOF;
-    case AbstractStream::status_buffering:
-    case AbstractStream::status_buffering_ahead:
-        break;
-    case AbstractStream::status_dis:
-    case AbstractStream::status_eop:
-        i_nzpcr = VLC_TS_INVALID;
-        es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
-        break;
-    case AbstractStream::status_demuxed:
-        if( i_nzpcr != VLC_TS_INVALID )
-        {
-            i_nzpcr += increment;
-            es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, 0, VLC_TS_0 + i_nzpcr);
-        }
-        break;
-    }
-
-    if(needsUpdate())
-    {
-        if(updatePlaylist())
-            scheduleNextUpdate();
-        else
-            failedupdates++;
-    }
-
-    /* Live starved and update still not there ? */
-    if(status == AbstractStream::status_buffering_ahead && needsUpdate())
-        msleep(CLOCK_FREQ / 20); /* Ugly */
-
-    return VLC_DEMUXER_SUCCESS;
-}
-
-int PlaylistManager::control_callback(demux_t *p_demux, int i_query, va_list args)
-{
-    PlaylistManager *manager = reinterpret_cast<PlaylistManager *>(p_demux->p_sys);
-    return manager->doControl(i_query, args);
-}
-
-int PlaylistManager::doControl(int i_query, va_list args)
-{
-    switch (i_query)
-    {
-        case DEMUX_CAN_SEEK:
-            *(va_arg (args, bool *)) = seekAble();
-            break;
-
-        case DEMUX_CAN_CONTROL_PACE:
-            *(va_arg (args, bool *)) = true;
-            break;
-
-        case DEMUX_CAN_PAUSE:
-            *(va_arg (args, bool *)) = playlist->isLive();
-            break;
-
-        case DEMUX_GET_TIME:
-            *(va_arg (args, int64_t *)) = i_nzpcr;
-            break;
-
-        case DEMUX_GET_LENGTH:
-            *(va_arg (args, int64_t *)) = getDuration();
-            break;
-
-        case DEMUX_GET_POSITION:
-            if(!getDuration())
-                return VLC_EGENERIC;
-
-            *(va_arg (args, double *)) = (double) i_nzpcr
-                                         / getDuration();
-            break;
-
-        case DEMUX_SET_POSITION:
-        {
-            int64_t time = getDuration() * va_arg(args, double);
-            if(playlist->isLive() ||
-               !getDuration() ||
-               !setPosition(time))
-                return VLC_EGENERIC;
-            i_nzpcr = VLC_TS_INVALID;
-            break;
-        }
-
-        case DEMUX_SET_TIME:
-        {
-            int64_t time = va_arg(args, int64_t);
-            if(playlist->isLive() ||
-               !setPosition(time))
-                return VLC_EGENERIC;
-            i_nzpcr = VLC_TS_INVALID;
-            break;
-        }
-
-        case DEMUX_GET_PTS_DELAY:
-            *va_arg (args, int64_t *) = INT64_C(1000) *
-                var_InheritInteger(p_demux, "network-caching");
-             break;
-
-        default:
-            return VLC_EGENERIC;
-    }
-    return VLC_SUCCESS;
-}
-
-AbstractAdaptationLogic *PlaylistManager::createLogic(AbstractAdaptationLogic::LogicType type, HTTPConnectionManager *conn)
-{
-    switch(type)
-    {
-        case AbstractAdaptationLogic::FixedRate:
-        {
-            size_t bps = var_InheritInteger(p_demux, "adaptative-bw") * 8192;
-            return new (std::nothrow) FixedRateAdaptationLogic(bps);
-        }
-        case AbstractAdaptationLogic::AlwaysLowest:
-            return new (std::nothrow) AlwaysLowestAdaptationLogic();
-        case AbstractAdaptationLogic::AlwaysBest:
-            return new (std::nothrow) AlwaysBestAdaptationLogic();
-        case AbstractAdaptationLogic::Default:
-        case AbstractAdaptationLogic::RateBased:
-        {
-            int width = var_InheritInteger(p_demux, "adaptative-width");
-            int height = var_InheritInteger(p_demux, "adaptative-height");
-            RateBasedAdaptationLogic *logic =
-                    new (std::nothrow) RateBasedAdaptationLogic(VLC_OBJECT(p_demux), width, height);
-            conn->setDownloadRateObserver(logic);
-            return logic;
-        }
-        default:
-            return NULL;
-    }
-}
diff --git a/modules/demux/adaptative/PlaylistManager.h b/modules/demux/adaptative/PlaylistManager.h
deleted file mode 100644 (file)
index a6fbf29..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * PlaylistManager.h
- *****************************************************************************
- * Copyright © 2010 - 2011 Klagenfurt University
- *             2015 VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef PLAYLISTMANAGER_H_
-#define PLAYLISTMANAGER_H_
-
-#include "logic/AbstractAdaptationLogic.h"
-#include "Streams.hpp"
-#include <vector>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class AbstractPlaylist;
-        class BasePeriod;
-    }
-
-    namespace http
-    {
-        class HTTPConnectionManager;
-    }
-
-    using namespace playlist;
-    using namespace logic;
-    using namespace http;
-
-    class PlaylistManager
-    {
-        public:
-            PlaylistManager( demux_t *, AbstractPlaylist *,
-                             AbstractStreamFactory *,
-                             AbstractAdaptationLogic::LogicType type );
-            virtual ~PlaylistManager    ();
-
-            bool    start();
-
-            AbstractStream::status demux(mtime_t, bool);
-            mtime_t getDuration() const;
-            mtime_t getPCR() const;
-            mtime_t getFirstDTS() const;
-            int     esCount() const;
-            bool    setPosition(mtime_t);
-            bool    seekAble() const;
-            virtual bool needsUpdate() const;
-            virtual bool updatePlaylist();
-            virtual void scheduleNextUpdate();
-
-            /* static callbacks */
-            static int control_callback(demux_t *, int, va_list);
-            static int demux_callback(demux_t *);
-
-        protected:
-            /* Demux calls */
-            virtual int doControl(int, va_list);
-            virtual int doDemux(int64_t);
-
-            void pruneLiveStream();
-            virtual bool reactivateStream(AbstractStream *);
-            bool setupPeriod();
-            void unsetPeriod();
-            /* local factories */
-            virtual AbstractAdaptationLogic *createLogic(AbstractAdaptationLogic::LogicType,
-                                                         HTTPConnectionManager *);
-
-            HTTPConnectionManager              *conManager;
-            AbstractAdaptationLogic::LogicType  logicType;
-            AbstractAdaptationLogic             *logic;
-            AbstractPlaylist                    *playlist;
-            AbstractStreamFactory               *streamFactory;
-            demux_t                             *p_demux;
-            std::vector<AbstractStream *>        streams;
-            time_t                               nextPlaylistupdate;
-            mtime_t                              i_nzpcr;
-            BasePeriod                          *currentPeriod;
-            int                                  failedupdates;
-    };
-
-}
-
-#endif /* PLAYLISTMANAGER_H_ */
diff --git a/modules/demux/adaptative/SegmentTracker.cpp b/modules/demux/adaptative/SegmentTracker.cpp
deleted file mode 100644 (file)
index a36eaf7..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * SegmentTracker.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "SegmentTracker.hpp"
-#include "playlist/AbstractPlaylist.hpp"
-#include "playlist/BaseRepresentation.h"
-#include "playlist/BaseAdaptationSet.h"
-#include "playlist/Segment.h"
-#include "playlist/SegmentChunk.hpp"
-#include "logic/AbstractAdaptationLogic.h"
-
-using namespace adaptative;
-using namespace adaptative::logic;
-using namespace adaptative::playlist;
-
-SegmentTrackerEvent::SegmentTrackerEvent(SegmentChunk *s)
-{
-    type = DISCONTINUITY;
-    u.discontinuity.sc = s;
-}
-
-SegmentTrackerEvent::SegmentTrackerEvent(BaseRepresentation *prev, BaseRepresentation *next)
-{
-    type = SWITCHING;
-    u.switching.prev = prev;
-    u.switching.next = next;
-}
-
-SegmentTrackerEvent::SegmentTrackerEvent(const StreamFormat *fmt)
-{
-    type = FORMATCHANGE;
-    u.format.f = fmt;
-}
-
-SegmentTracker::SegmentTracker(AbstractAdaptationLogic *logic_, BaseAdaptationSet *adaptSet)
-{
-    first = true;
-    curNumber = next = 0;
-    initializing = true;
-    index_sent = false;
-    init_sent = false;
-    curRepresentation = NULL;
-    setAdaptationLogic(logic_);
-    adaptationSet = adaptSet;
-    format = StreamFormat::UNSUPPORTED;
-}
-
-SegmentTracker::~SegmentTracker()
-{
-    reset();
-}
-
-void SegmentTracker::setAdaptationLogic(AbstractAdaptationLogic *logic_)
-{
-    logic = logic_;
-    registerListener(logic);
-}
-
-StreamFormat SegmentTracker::initialFormat() const
-{
-    BaseRepresentation *rep = curRepresentation;
-    if(!rep)
-        rep = logic->getNextRepresentation(adaptationSet, NULL);
-    if(rep)
-        return rep->getStreamFormat();
-    return StreamFormat();
-}
-
-bool SegmentTracker::segmentsListReady() const
-{
-    BaseRepresentation *rep = curRepresentation;
-    if(!rep)
-        rep = logic->getNextRepresentation(adaptationSet, NULL);
-    if(rep && rep->getPlaylist()->isLive())
-        return rep->getMinAheadTime(curNumber) > 0;
-    return true;
-}
-
-void SegmentTracker::reset()
-{
-    notify(SegmentTrackerEvent(curRepresentation, NULL));
-    curRepresentation = NULL;
-    init_sent = false;
-    index_sent = false;
-    initializing = true;
-    format = StreamFormat::UNSUPPORTED;
-}
-
-SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed, HTTPConnectionManager *connManager)
-{
-    BaseRepresentation *rep = NULL, *prevRep = NULL;
-    ISegment *segment;
-
-    if(!adaptationSet)
-        return NULL;
-
-    /* Ensure we don't keep chaining init/index without data */
-    if( initializing )
-    {
-        if( curRepresentation )
-            switch_allowed = false;
-        else
-            switch_allowed = true;
-    }
-
-    if( !switch_allowed ||
-       (curRepresentation && curRepresentation->getSwitchPolicy() == SegmentInformation::SWITCH_UNAVAILABLE) )
-        rep = curRepresentation;
-    else
-        rep = logic->getNextRepresentation(adaptationSet, curRepresentation);
-
-    if ( rep == NULL )
-            return NULL;
-
-
-    if(rep != curRepresentation)
-    {
-        notify(SegmentTrackerEvent(curRepresentation, rep));
-        prevRep = curRepresentation;
-        curRepresentation = rep;
-        init_sent = false;
-        index_sent = false;
-        initializing = true;
-    }
-
-    bool b_updated = false;
-    /* Ensure ephemere content is updated/loaded */
-    if(rep->needsUpdate())
-        b_updated = rep->runLocalUpdates(getPlaybackTime(), curNumber, false);
-
-    if(prevRep && !rep->consistentSegmentNumber())
-    {
-        /* Convert our segment number */
-        next = rep->translateSegmentNumber(next, prevRep);
-    }
-    else if(first && rep->getPlaylist()->isLive())
-    {
-        next = rep->getLiveStartSegmentNumber(next);
-        first = false;
-    }
-
-    if(b_updated)
-    {
-        if(!rep->consistentSegmentNumber())
-            curRepresentation->pruneBySegmentNumber(curNumber);
-        curRepresentation->scheduleNextUpdate(curNumber);
-    }
-
-    if(!init_sent)
-    {
-        init_sent = true;
-        segment = rep->getSegment(BaseRepresentation::INFOTYPE_INIT);
-        if(segment)
-            return segment->toChunk(next, rep, connManager);
-    }
-
-    if(!index_sent)
-    {
-        index_sent = true;
-        segment = rep->getSegment(BaseRepresentation::INFOTYPE_INDEX);
-        if(segment)
-            return segment->toChunk(next, rep, connManager);
-    }
-
-    bool b_gap = false;
-    segment = rep->getNextSegment(BaseRepresentation::INFOTYPE_MEDIA, next, &next, &b_gap);
-    if(!segment)
-    {
-        reset();
-        return NULL;
-    }
-
-    if(initializing)
-    {
-        b_gap = false;
-        /* stop initializing after 1st chunk */
-        initializing = false;
-    }
-
-    SegmentChunk *chunk = segment->toChunk(next, rep, connManager);
-
-    /* We need to check segment/chunk format changes, as we can't rely on representation's (HLS)*/
-    if(chunk && format != chunk->getStreamFormat())
-    {
-        format = chunk->getStreamFormat();
-        notify(SegmentTrackerEvent(&format));
-    }
-
-    /* Handle both implicit and explicit discontinuities */
-    if( (b_gap && next) || (chunk && chunk->discontinuity) )
-    {
-        notify(SegmentTrackerEvent(chunk));
-    }
-
-    if(chunk)
-    {
-        curNumber = next;
-        next++;
-    }
-
-    return chunk;
-}
-
-bool SegmentTracker::setPositionByTime(mtime_t time, bool restarted, bool tryonly)
-{
-    uint64_t segnumber;
-    BaseRepresentation *rep = curRepresentation;
-    if(!rep)
-        rep = logic->getNextRepresentation(adaptationSet, NULL);
-
-    if(rep &&
-       rep->getSegmentNumberByTime(time, &segnumber))
-    {
-        if(!tryonly)
-            setPositionByNumber(segnumber, restarted);
-        return true;
-    }
-    return false;
-}
-
-void SegmentTracker::setPositionByNumber(uint64_t segnumber, bool restarted)
-{
-    if(restarted)
-    {
-        initializing = true;
-        index_sent = false;
-        init_sent = false;
-    }
-    curNumber = next = segnumber;
-}
-
-mtime_t SegmentTracker::getPlaybackTime() const
-{
-    if(curRepresentation)
-        return curRepresentation->getPlaybackTimeBySegmentNumber(next);
-    else
-        return 0;
-}
-
-mtime_t SegmentTracker::getMinAheadTime() const
-{
-    BaseRepresentation *rep = curRepresentation;
-    if(!rep)
-        rep = logic->getNextRepresentation(adaptationSet, NULL);
-    if(rep)
-        return rep->getMinAheadTime(curNumber);
-    return 0;
-}
-
-void SegmentTracker::registerListener(SegmentTrackerListenerInterface *listener)
-{
-    listeners.push_back(listener);
-}
-
-void SegmentTracker::updateSelected()
-{
-    if(curRepresentation && curRepresentation->needsUpdate())
-    {
-        curRepresentation->runLocalUpdates(getPlaybackTime(), curNumber, true);
-        curRepresentation->scheduleNextUpdate(curNumber);
-    }
-}
-
-void SegmentTracker::notify(const SegmentTrackerEvent &event)
-{
-    std::list<SegmentTrackerListenerInterface *>::const_iterator it;
-    for(it=listeners.begin();it != listeners.end(); ++it)
-        (*it)->trackerEvent(event);
-}
diff --git a/modules/demux/adaptative/SegmentTracker.hpp b/modules/demux/adaptative/SegmentTracker.hpp
deleted file mode 100644 (file)
index b80a642..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * SegmentTracker.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef SEGMENTTRACKER_HPP
-#define SEGMENTTRACKER_HPP
-
-#include <StreamFormat.hpp>
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <list>
-
-namespace adaptative
-{
-    namespace http
-    {
-        class HTTPConnectionManager;
-    }
-
-    namespace logic
-    {
-        class AbstractAdaptationLogic;
-    }
-
-    namespace playlist
-    {
-        class BaseAdaptationSet;
-        class BaseRepresentation;
-        class SegmentChunk;
-    }
-
-    using namespace playlist;
-    using namespace logic;
-    using namespace http;
-
-    class SegmentTrackerEvent
-    {
-        public:
-            SegmentTrackerEvent(SegmentChunk *);
-            SegmentTrackerEvent(BaseRepresentation *, BaseRepresentation *);
-            SegmentTrackerEvent(const StreamFormat *);
-            enum
-            {
-                DISCONTINUITY,
-                SWITCHING,
-                FORMATCHANGE,
-            } type;
-            union
-            {
-               struct
-               {
-                    SegmentChunk *sc;
-               } discontinuity;
-               struct
-               {
-                    BaseRepresentation *prev;
-                    BaseRepresentation *next;
-               } switching;
-               struct
-               {
-                    const StreamFormat *f;
-               } format;
-            } u;
-    };
-
-    class SegmentTrackerListenerInterface
-    {
-        public:
-            virtual void trackerEvent(const SegmentTrackerEvent &) = 0;
-    };
-
-    class SegmentTracker
-    {
-        public:
-            SegmentTracker(AbstractAdaptationLogic *, BaseAdaptationSet *);
-            ~SegmentTracker();
-
-            void setAdaptationLogic(AbstractAdaptationLogic *);
-            StreamFormat initialFormat() const;
-            bool segmentsListReady() const;
-            void reset();
-            SegmentChunk* getNextChunk(bool, HTTPConnectionManager *);
-            bool setPositionByTime(mtime_t, bool, bool);
-            void setPositionByNumber(uint64_t, bool);
-            mtime_t getPlaybackTime() const; /* Current segment start time if selected */
-            mtime_t getMinAheadTime() const;
-            void registerListener(SegmentTrackerListenerInterface *);
-            void updateSelected();
-
-        private:
-            void notify(const SegmentTrackerEvent &);
-            bool first;
-            bool initializing;
-            bool index_sent;
-            bool init_sent;
-            uint64_t next;
-            uint64_t curNumber;
-            StreamFormat format;
-            AbstractAdaptationLogic *logic;
-            BaseAdaptationSet *adaptationSet;
-            BaseRepresentation *curRepresentation;
-            std::list<SegmentTrackerListenerInterface *> listeners;
-    };
-}
-
-#endif // SEGMENTTRACKER_HPP
diff --git a/modules/demux/adaptative/StreamFormat.cpp b/modules/demux/adaptative/StreamFormat.cpp
deleted file mode 100644 (file)
index 3626969..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * StreamFormat.cpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "StreamFormat.hpp"
-
-using namespace adaptative;
-
-StreamFormat::operator unsigned() const
-{
-    return formatid;
-}
-
-std::string StreamFormat::str() const
-{
-    switch(formatid)
-    {
-        case MPEG2TS:
-            return "TS";
-        case MP4:
-            return "MP4";
-        case WEBVTT:
-            return "WebVTT";
-        case TTML:
-            return "Timed Text";
-        case PACKEDAAC:
-            return "Packed AAC";
-        case UNSUPPORTED:
-            return "Unsupported";
-        default:
-        case UNKNOWN:
-            return "Unknown";
-    }
-}
-
-StreamFormat::StreamFormat( unsigned formatid_ )
-{
-    formatid = formatid_;
-}
-
-StreamFormat::~StreamFormat()
-{
-
-}
-
-bool StreamFormat::operator ==(const StreamFormat &other) const
-{
-    return formatid == other.formatid;
-}
-
-bool StreamFormat::operator !=(const StreamFormat &other) const
-{
-    return formatid != other.formatid;
-}
diff --git a/modules/demux/adaptative/StreamFormat.hpp b/modules/demux/adaptative/StreamFormat.hpp
deleted file mode 100644 (file)
index e729f3e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * StreamFormat.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef STREAMFORMAT_HPP
-#define STREAMFORMAT_HPP
-
-#include <string>
-
-namespace adaptative
-{
-
-    class StreamFormat
-    {
-        public:
-            static const unsigned UNSUPPORTED = 0;
-            static const unsigned MPEG2TS     = 1;
-            static const unsigned MP4         = 2;
-            static const unsigned WEBVTT      = 3;
-            static const unsigned TTML        = 4;
-            static const unsigned PACKEDAAC   = 5;
-            static const unsigned UNKNOWN     = 0xFF; /* will probe */
-
-            StreamFormat( unsigned = UNSUPPORTED );
-            ~StreamFormat();
-            operator unsigned() const;
-            std::string str() const;
-            bool operator==(const StreamFormat &) const;
-            bool operator!=(const StreamFormat &) const;
-
-        private:
-            unsigned formatid;
-    };
-
-}
-
-#endif // STREAMFORMAT_HPP
diff --git a/modules/demux/adaptative/Streams.cpp b/modules/demux/adaptative/Streams.cpp
deleted file mode 100644 (file)
index 31bfe6f..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Streams.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "Streams.hpp"
-#include "http/HTTPConnection.hpp"
-#include "http/HTTPConnectionManager.h"
-#include "playlist/BaseRepresentation.h"
-#include "playlist/SegmentChunk.hpp"
-#include "plumbing/SourceStream.hpp"
-#include "plumbing/CommandsQueue.hpp"
-#include "tools/Debug.hpp"
-#include <vlc_demux.h>
-
-using namespace adaptative;
-using namespace adaptative::http;
-
-AbstractStream::AbstractStream(demux_t * demux_, const StreamFormat &format_)
-{
-    p_realdemux = demux_;
-    format = format_;
-    currentChunk = NULL;
-    eof = false;
-    dead = false;
-    disabled = false;
-    flushing = false;
-    discontinuity = false;
-    segmentTracker = NULL;
-    pcr = VLC_TS_INVALID;
-
-    demuxer = NULL;
-    fakeesout = NULL;
-
-    /* Don't even try if not supported */
-    if((unsigned)format == StreamFormat::UNSUPPORTED)
-        throw VLC_EGENERIC;
-
-    demuxersource = new (std::nothrow) ChunksSourceStream( VLC_OBJECT(p_realdemux), this );
-    if(!demuxersource)
-        throw VLC_EGENERIC;
-
-    CommandsFactory *factory = new CommandsFactory();
-    fakeesout = new (std::nothrow) FakeESOut(p_realdemux->out, factory);
-    if(!fakeesout)
-    {
-        delete demuxersource;
-        throw VLC_EGENERIC;
-    }
-    fakeesout->setExtraInfoProvider( this );
-}
-
-AbstractStream::~AbstractStream()
-{
-    delete currentChunk;
-    delete segmentTracker;
-
-    delete demuxer;
-    delete demuxersource;
-    delete fakeesout;
-}
-
-
-void AbstractStream::bind(SegmentTracker *tracker, HTTPConnectionManager *conn)
-{
-    segmentTracker = tracker;
-    segmentTracker->registerListener(this);
-    connManager = conn;
-}
-
-void AbstractStream::prepareFormatChange()
-{
-    if(demuxer)
-    {
-        /* Enqueue Del Commands for all current ES */
-        demuxer->drain();
-        /* Enqueue Del Commands for all current ES */
-        fakeesout->scheduleAllForDeletion();
-        fakeesout->schedulePCRReset();
-        fakeesout->commandsqueue.Commit();
-        /* ignoring demuxer's own Del commands */
-        fakeesout->commandsqueue.setDrop(true);
-        delete demuxer;
-        fakeesout->commandsqueue.setDrop(false);
-        demuxer = NULL;
-    }
-}
-
-void AbstractStream::setLanguage(const std::string &lang)
-{
-    language = lang;
-}
-
-void AbstractStream::setDescription(const std::string &desc)
-{
-    description = desc;
-}
-
-bool AbstractStream::isEOF() const
-{
-    return dead;
-}
-
-mtime_t AbstractStream::getPCR() const
-{
-    return pcr;
-}
-
-mtime_t AbstractStream::getMinAheadTime() const
-{
-    if(!segmentTracker)
-        return 0;
-    return segmentTracker->getMinAheadTime();
-}
-
-mtime_t AbstractStream::getBufferingLevel() const
-{
-    return fakeesout->commandsqueue.getBufferingLevel();
-}
-
-mtime_t AbstractStream::getFirstDTS() const
-{
-    return fakeesout->commandsqueue.getFirstDTS();
-}
-
-int AbstractStream::esCount() const
-{
-    return fakeesout->esCount();
-}
-
-bool AbstractStream::seekAble() const
-{
-    return (demuxer &&
-            !fakeesout->restarting() &&
-            !discontinuity &&
-            !flushing );
-}
-
-bool AbstractStream::isSelected() const
-{
-    return fakeesout->hasSelectedEs();
-}
-
-bool AbstractStream::reactivate(mtime_t basetime)
-{
-    if(setPosition(basetime, false))
-    {
-        disabled = false;
-        return true;
-    }
-    else
-    {
-        eof = true; /* can't reactivate */
-        return false;
-    }
-}
-
-bool AbstractStream::startDemux()
-{
-    if(demuxer)
-        return false;
-
-    try
-    {
-        demuxersource->Reset();
-        demuxer = createDemux(format);
-    } catch(int) {
-        msg_Err(p_realdemux, "Failed to create demuxer");
-    }
-
-    return !!demuxer;
-}
-
-bool AbstractStream::restartDemux()
-{
-    if(!demuxer)
-    {
-        return startDemux();
-    }
-    else if(demuxer->reinitsOnSeek())
-    {
-        /* Push all ES as recycling candidates */
-        fakeesout->recycleAll();
-        /* Restart with ignoring pushes to queue */
-        return demuxer->restart(fakeesout->commandsqueue);
-    }
-    fakeesout->commandsqueue.Commit();
-    return true;
-}
-
-bool AbstractStream::isDisabled() const
-{
-    return disabled;
-}
-
-AbstractStream::status AbstractStream::demux(mtime_t nz_deadline, bool send)
-{
-    /* Ensure it is configured */
-    if(!segmentTracker || !connManager || dead)
-        return AbstractStream::status_eof;
-
-    if(flushing)
-    {
-        if(!send)
-            return AbstractStream::status_buffering;
-
-        pcr = fakeesout->commandsqueue.Process(p_realdemux->out, VLC_TS_0 + nz_deadline);
-        if(!fakeesout->commandsqueue.isEmpty())
-            return AbstractStream::status_demuxed;
-
-        fakeesout->commandsqueue.Abort(true); /* reset buffering level */
-        flushing = false;
-        pcr = 0;
-        return AbstractStream::status_dis;
-    }
-
-    if(!demuxer)
-    {
-        format = segmentTracker->initialFormat();
-        if(!startDemux())
-        {
-            /* If demux fails because of probing failure / wrong format*/
-            if(discontinuity)
-            {
-                msg_Dbg( p_realdemux, "Flushing on format change" );
-                prepareFormatChange();
-                discontinuity = false;
-                flushing = true;
-                return AbstractStream::status_buffering;
-            }
-            dead = true; /* Prevent further retries */
-            return AbstractStream::status_eof;
-        }
-    }
-
-    if(nz_deadline + VLC_TS_0 > getBufferingLevel()) /* not already demuxed */
-    {
-        if(!segmentTracker->segmentsListReady()) /* Live Streams */
-            return AbstractStream::status_buffering_ahead;
-
-        /* need to read, demuxer still buffering, ... */
-        if(demuxer->demux(nz_deadline) != VLC_DEMUXER_SUCCESS)
-        {
-            if(discontinuity)
-            {
-                msg_Dbg( p_realdemux, "Flushing on discontinuity" );
-                prepareFormatChange();
-                discontinuity = false;
-                flushing = true;
-                return AbstractStream::status_buffering;
-            }
-
-            fakeesout->commandsqueue.Commit();
-            if(fakeesout->commandsqueue.isEmpty())
-                return AbstractStream::status_eof;
-        }
-        else if(nz_deadline + VLC_TS_0 > getBufferingLevel()) /* need to read more */
-        {
-            return AbstractStream::status_buffering;
-        }
-    }
-
-    AdvDebug(msg_Dbg(p_realdemux, "Stream %s pcr %ld dts %ld deadline %ld buflevel %ld",
-             description.c_str(), getPCR(), getFirstDTS(), nz_deadline, getBufferingLevel()));
-
-    if(send)
-        pcr = fakeesout->commandsqueue.Process( p_realdemux->out, VLC_TS_0 + nz_deadline );
-
-    /* Disable streams that are not selected (alternate streams) */
-    if(esCount() && !isSelected() && !fakeesout->restarting())
-    {
-        disabled = true;
-        segmentTracker->reset();
-    }
-
-    return AbstractStream::status_demuxed;
-}
-
-block_t * AbstractStream::readNextBlock()
-{
-    if (currentChunk == NULL && !eof)
-        currentChunk = segmentTracker->getNextChunk(!fakeesout->restarting(), connManager);
-
-    if(discontinuity)
-    {
-        msg_Info(p_realdemux, "Encountered discontinuity");
-        /* Force stream/demuxer to end for this call */
-        return NULL;
-    }
-
-    if(currentChunk == NULL)
-    {
-        eof = true;
-        return NULL;
-    }
-
-    const bool b_segment_head_chunk = (currentChunk->getBytesRead() == 0);
-
-    block_t *block = currentChunk->readBlock();
-    if(block == NULL)
-    {
-        delete currentChunk;
-        currentChunk = NULL;
-        return NULL;
-    }
-
-    if (currentChunk->isEmpty())
-    {
-        delete currentChunk;
-        currentChunk = NULL;
-    }
-
-    block = checkBlock(block, b_segment_head_chunk);
-
-    return block;
-}
-
-bool AbstractStream::setPosition(mtime_t time, bool tryonly)
-{
-    if(!demuxer)
-        return false;
-
-    bool ret = segmentTracker->setPositionByTime(time, demuxer->reinitsOnSeek(), tryonly);
-    if(!tryonly && ret)
-    {
-        if(demuxer->reinitsOnSeek())
-        {
-            if(currentChunk)
-                delete currentChunk;
-            currentChunk = NULL;
-
-            if( !restartDemux() )
-                dead = true;
-
-            /* Check if we need to set an offset as the demuxer
-             * will start from zero from seek point */
-            if(demuxer->alwaysStartsFromZero())
-                fakeesout->setTimestampOffset(time);
-        }
-
-        es_out_Control(p_realdemux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
-                       VLC_TS_0 + time);
-    }
-    return ret;
-}
-
-mtime_t AbstractStream::getPlaybackTime() const
-{
-    return segmentTracker->getPlaybackTime();
-}
-
-void AbstractStream::runUpdates()
-{
-    if(!isDisabled())
-        segmentTracker->updateSelected();
-}
-
-void AbstractStream::fillExtraFMTInfo( es_format_t *p_fmt ) const
-{
-    if(!p_fmt->psz_language && !language.empty())
-        p_fmt->psz_language = strdup(language.c_str());
-    if(!p_fmt->psz_description && !description.empty())
-        p_fmt->psz_description = strdup(description.c_str());
-}
-
-void AbstractStream::trackerEvent(const SegmentTrackerEvent &event)
-{
-    switch(event.type)
-    {
-        case SegmentTrackerEvent::DISCONTINUITY:
-            discontinuity = true;
-            break;
-
-        case SegmentTrackerEvent::FORMATCHANGE:
-            /* Check if our current demux is still valid */
-            if(*event.u.format.f != format)
-            {
-                /* Format has changed between segments, we need to drain and change demux */
-                msg_Info(p_realdemux, "Changing stream format %s -> %s",
-                         format.str().c_str(), event.u.format.f->str().c_str());
-                format = *event.u.format.f;
-
-                /* This is an implict discontinuity */
-                discontinuity = true;
-            }
-            break;
-
-        case SegmentTrackerEvent::SWITCHING:
-        default:
-            break;
-    }
-}
diff --git a/modules/demux/adaptative/Streams.hpp b/modules/demux/adaptative/Streams.hpp
deleted file mode 100644 (file)
index 8155c39..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Streams.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef STREAM_HPP
-#define STREAM_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include "StreamFormat.hpp"
-#include "ChunksSource.hpp"
-#include "SegmentTracker.hpp"
-
-#include "plumbing/Demuxer.hpp"
-#include "plumbing/SourceStream.hpp"
-#include "plumbing/FakeESOut.hpp"
-
-#include <string>
-
-namespace adaptative
-{
-    class SegmentTracker;
-
-    namespace http
-    {
-        class HTTPConnectionManager;
-    }
-
-    namespace playlist
-    {
-        class SegmentChunk;
-    }
-
-    using namespace http;
-    using namespace playlist;
-
-    class AbstractStream : public ChunksSource,
-                           public ExtraFMTInfoInterface,
-                           public SegmentTrackerListenerInterface
-    {
-    public:
-        AbstractStream(demux_t *, const StreamFormat &);
-        virtual ~AbstractStream();
-        void bind(SegmentTracker *, HTTPConnectionManager *);
-
-        void setLanguage(const std::string &);
-        void setDescription(const std::string &);
-        bool isEOF() const;
-        mtime_t getPCR() const;
-        mtime_t getBufferingLevel() const;
-        mtime_t getMinAheadTime() const;
-        mtime_t getFirstDTS() const;
-        int esCount() const;
-        bool seekAble() const;
-        bool isSelected() const;
-        virtual bool reactivate(mtime_t);
-        bool isDisabled() const;
-        typedef enum {status_eof,
-                      status_eop,
-                      status_dis,
-                      status_buffering,
-                      status_buffering_ahead, /* Special case for live waiting new segments */
-                      status_demuxed} status;
-        status demux(mtime_t, bool);
-        virtual bool setPosition(mtime_t, bool);
-        mtime_t getPlaybackTime() const;
-        void runUpdates();
-
-        virtual block_t *readNextBlock(); /* impl */
-
-        virtual void fillExtraFMTInfo( es_format_t * ) const; /* impl */
-        virtual void trackerEvent(const SegmentTrackerEvent &); /* impl */
-
-    protected:
-        virtual block_t *checkBlock(block_t *, bool) = 0;
-        virtual AbstractDemuxer * createDemux(const StreamFormat &) = 0;
-        virtual bool startDemux();
-        virtual bool restartDemux();
-
-        virtual void prepareFormatChange();
-
-        bool discontinuity;
-
-        demux_t *p_realdemux;
-        StreamFormat format;
-
-        HTTPConnectionManager *connManager; /* not owned */
-        SegmentTracker *segmentTracker;
-
-        SegmentChunk *currentChunk;
-        bool disabled;
-        bool eof;
-        bool dead;
-        bool flushing;
-        mtime_t pcr;
-        std::string language;
-        std::string description;
-
-        AbstractDemuxer *demuxer;
-        AbstractSourceStream *demuxersource;
-        FakeESOut *fakeesout; /* to intercept/proxy what is sent from demuxstream */
-    };
-
-    class AbstractStreamFactory
-    {
-        public:
-            virtual ~AbstractStreamFactory() {}
-            virtual AbstractStream *create(demux_t*, const StreamFormat &,
-                                   SegmentTracker *, HTTPConnectionManager *) const = 0;
-    };
-}
-#endif // STREAMS_HPP
diff --git a/modules/demux/adaptative/Time.hpp b/modules/demux/adaptative/Time.hpp
deleted file mode 100644 (file)
index 9ffa17b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- * Time.hpp: Adaptative streaming time definitions
- *****************************************************************************
- * Copyright © 2015 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef TIME_HPP
-#define TIME_HPP
-
-/* Scaled time */
-typedef int64_t stime_t;
-
-#endif // TIME_HPP
-
diff --git a/modules/demux/adaptative/adaptative.cpp b/modules/demux/adaptative/adaptative.cpp
deleted file mode 100644 (file)
index ea860b1..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*****************************************************************************
- * adaptative.cpp: Adaptative streaming module
- *****************************************************************************
- * Copyright © 2015 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdint.h>
-
-#include <vlc_common.h>
-#include <vlc_plugin.h>
-#include <vlc_demux.h>
-
-#include "playlist/BasePeriod.h"
-#include "xml/DOMParser.h"
-
-#include "../dash/DASHManager.h"
-#include "../dash/DASHStream.hpp"
-#include "../dash/mpd/IsoffMainParser.h"
-
-#include "../hls/HLSManager.hpp"
-#include "../hls/HLSStreams.hpp"
-#include "../hls/playlist/Parser.hpp"
-#include "../hls/playlist/M3U8.hpp"
-#include "../smooth/SmoothManager.hpp"
-#include "../smooth/SmoothStream.hpp"
-#include "../smooth/playlist/Parser.hpp"
-
-using namespace adaptative::logic;
-using namespace adaptative::playlist;
-using namespace adaptative::xml;
-using namespace dash::mpd;
-using namespace dash;
-using namespace hls;
-using namespace hls::playlist;
-using namespace smooth;
-using namespace smooth::playlist;
-
-/*****************************************************************************
- * Module descriptor
- *****************************************************************************/
-static int  Open    (vlc_object_t *);
-static void Close   (vlc_object_t *);
-
-#define ADAPT_WIDTH_TEXT N_("Preferred Width")
-
-#define ADAPT_HEIGHT_TEXT N_("Preferred Height")
-
-#define ADAPT_BW_TEXT N_("Fixed Bandwidth in KiB/s")
-#define ADAPT_BW_LONGTEXT N_("Preferred bandwidth for non adaptative streams")
-
-#define ADAPT_LOGIC_TEXT N_("Adaptation Logic")
-
-static const int pi_logics[] = {AbstractAdaptationLogic::RateBased,
-                                AbstractAdaptationLogic::FixedRate,
-                                AbstractAdaptationLogic::AlwaysLowest,
-                                AbstractAdaptationLogic::AlwaysBest};
-
-static const char *const ppsz_logics[] = { N_("Bandwidth Adaptive"),
-                                           N_("Fixed Bandwidth"),
-                                           N_("Lowest Bandwidth/Quality"),
-                                           N_("Highest Bandwidth/Quality")};
-
-vlc_module_begin ()
-        set_shortname( N_("Adaptative"))
-        set_description( N_("Unified adaptative streaming for DASH/HLS") )
-        set_capability( "demux", 12 )
-        set_category( CAT_INPUT )
-        set_subcategory( SUBCAT_INPUT_DEMUX )
-        add_integer( "adaptative-logic",  AbstractAdaptationLogic::Default,
-                                          ADAPT_LOGIC_TEXT, NULL, false )
-            change_integer_list( pi_logics, ppsz_logics )
-        add_integer( "adaptative-width",  480, ADAPT_WIDTH_TEXT,  ADAPT_WIDTH_TEXT,  true )
-        add_integer( "adaptative-height", 360, ADAPT_HEIGHT_TEXT, ADAPT_HEIGHT_TEXT, true )
-        add_integer( "adaptative-bw",     250, ADAPT_BW_TEXT,     ADAPT_BW_LONGTEXT,     false )
-        set_callbacks( Open, Close )
-vlc_module_end ()
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static PlaylistManager * HandleDash(demux_t *, DOMParser &,
-                                    const std::string &, AbstractAdaptationLogic::LogicType);
-static PlaylistManager * HandleSmooth(demux_t *, DOMParser &,
-                                      const std::string &, AbstractAdaptationLogic::LogicType);
-
-/*****************************************************************************
- * Open:
- *****************************************************************************/
-static int Open(vlc_object_t *p_obj)
-{
-    demux_t *p_demux = (demux_t*) p_obj;
-
-    std::string mimeType;
-
-    char *psz_mime = stream_ContentType(p_demux->s);
-    if(psz_mime)
-    {
-        mimeType = std::string(psz_mime);
-        free(psz_mime);
-    }
-
-    PlaylistManager *p_manager = NULL;
-    AbstractAdaptationLogic::LogicType logic =
-            static_cast<AbstractAdaptationLogic::LogicType>(var_InheritInteger(p_obj, "adaptative-logic"));
-
-    std::string playlisturl(p_demux->psz_access);
-    playlisturl.append("://");
-    playlisturl.append(p_demux->psz_location);
-
-    bool dashmime = DASHManager::mimeMatched(mimeType);
-    bool smoothmime = SmoothManager::mimeMatched(mimeType);
-
-    if(!dashmime && !smoothmime && HLSManager::isHTTPLiveStreaming(p_demux->s))
-    {
-        M3U8Parser parser;
-        M3U8 *p_playlist = parser.parse(p_demux->s, playlisturl);
-        if(!p_playlist)
-        {
-            msg_Err( p_demux, "Could not parse playlist" );
-            return VLC_EGENERIC;
-        }
-
-        p_manager = new (std::nothrow) HLSManager(p_demux, p_playlist,
-                                                  new (std::nothrow) HLSStreamFactory, logic);
-    }
-    else
-    {
-        /* Handle XML Based ones */
-        DOMParser xmlParser; /* Share that xml reader */
-        if(dashmime)
-        {
-            p_manager = HandleDash(p_demux, xmlParser, playlisturl, logic);
-        }
-        else if(smoothmime)
-        {
-            p_manager = HandleSmooth(p_demux, xmlParser, playlisturl, logic);
-        }
-        else
-        {
-            /* We need to probe content */
-            const uint8_t *p_peek;
-            const ssize_t i_peek = stream_Peek(p_demux->s, &p_peek, 2048);
-            if(i_peek > 0)
-            {
-                stream_t *peekstream = stream_MemoryNew(p_demux, const_cast<uint8_t *>(p_peek), (size_t)i_peek, true);
-                if(peekstream)
-                {
-                    if(xmlParser.reset(peekstream) && xmlParser.parse(false))
-                    {
-                        if(DASHManager::isDASH(xmlParser.getRootNode()))
-                        {
-                            p_manager = HandleDash(p_demux, xmlParser, playlisturl, logic);
-                        }
-                        else if(SmoothManager::isSmoothStreaming(xmlParser.getRootNode()))
-                        {
-                            p_manager = HandleSmooth(p_demux, xmlParser, playlisturl, logic);
-                        }
-                    }
-                    stream_Delete(peekstream);
-                }
-            }
-        }
-    }
-
-    if(!p_manager || !p_manager->start())
-    {
-        delete p_manager;
-        return VLC_EGENERIC;
-    }
-
-    p_demux->p_sys         = reinterpret_cast<demux_sys_t *>(p_manager);
-    p_demux->pf_demux      = p_manager->demux_callback;
-    p_demux->pf_control    = p_manager->control_callback;
-
-    msg_Dbg(p_obj,"opening playlist file (%s)", p_demux->psz_location);
-
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * Close:
- *****************************************************************************/
-static void Close(vlc_object_t *p_obj)
-{
-    demux_t         *p_demux       = (demux_t*) p_obj;
-    PlaylistManager *p_manager  = reinterpret_cast<PlaylistManager *>(p_demux->p_sys);
-
-    delete p_manager;
-}
-
-/*****************************************************************************
- *
- *****************************************************************************/
-static PlaylistManager * HandleDash(demux_t *p_demux, DOMParser &xmlParser,
-                                    const std::string & playlisturl,
-                                    AbstractAdaptationLogic::LogicType logic)
-{
-    if(!xmlParser.reset(p_demux->s) || !xmlParser.parse(true))
-    {
-        msg_Err(p_demux, "Cannot parse MPD");
-        return NULL;
-    }
-    IsoffMainParser mpdparser(xmlParser.getRootNode(), p_demux->s, playlisturl);
-    MPD *p_playlist = mpdparser.parse();
-    if(p_playlist == NULL)
-    {
-        msg_Err( p_demux, "Cannot create/unknown MPD for profile");
-        return NULL;
-    }
-
-    return new (std::nothrow) DASHManager( p_demux, p_playlist,
-                                 new (std::nothrow) DASHStreamFactory,
-                                 logic );
-}
-
-static PlaylistManager * HandleSmooth(demux_t *p_demux, DOMParser &xmlParser,
-                                    const std::string & playlisturl,
-                                    AbstractAdaptationLogic::LogicType logic)
-{
-    if(!xmlParser.reset(p_demux->s) || !xmlParser.parse(true))
-    {
-        msg_Err(p_demux, "Cannot parse Manifest");
-        return NULL;
-    }
-    ManifestParser mparser(xmlParser.getRootNode(), p_demux->s, playlisturl);
-    Manifest *p_playlist = mparser.parse();
-    if(p_playlist == NULL)
-    {
-        msg_Err( p_demux, "Cannot create Manifest");
-        return NULL;
-    }
-
-    return new (std::nothrow) SmoothManager( p_demux, p_playlist,
-                                 new (std::nothrow) SmoothStreamFactory,
-                                 logic );
-}
diff --git a/modules/demux/adaptative/http/BytesRange.cpp b/modules/demux/adaptative/http/BytesRange.cpp
deleted file mode 100644 (file)
index 13cc7cd..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * BytesRange.cpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "BytesRange.hpp"
-
-using namespace adaptative::http;
-
-BytesRange::BytesRange()
-{
-    bytesStart = 2;
-    bytesEnd = 1;
-}
-
-BytesRange::BytesRange(size_t start, size_t end)
-{
-    bytesStart = start;
-    bytesEnd = end;
-}
-
-bool BytesRange::isValid() const
-{
-    if(bytesEnd < bytesStart)
-        return bytesEnd == 0;
-    return true;
-}
-
-size_t BytesRange::getStartByte() const
-{
-    return bytesStart;
-}
-
-size_t BytesRange::getEndByte() const
-{
-    return bytesEnd;
-}
diff --git a/modules/demux/adaptative/http/BytesRange.hpp b/modules/demux/adaptative/http/BytesRange.hpp
deleted file mode 100644 (file)
index b4b58fc..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * BytesRange.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef BYTESRANGE_HPP
-#define BYTESRANGE_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-
-namespace adaptative
-{
-    namespace http
-    {
-        class BytesRange
-        {
-            public:
-                BytesRange();
-                BytesRange(size_t start, size_t end);
-                bool isValid() const;
-                size_t getStartByte() const;
-                size_t getEndByte() const;
-
-            private:
-                size_t bytesStart;
-                size_t bytesEnd;
-        };
-    }
-}
-
-#endif // BYTESRANGE_HPP
diff --git a/modules/demux/adaptative/http/Chunk.cpp b/modules/demux/adaptative/http/Chunk.cpp
deleted file mode 100644 (file)
index e1a2280..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * Chunk.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "Chunk.h"
-#include "HTTPConnection.hpp"
-#include "HTTPConnectionManager.h"
-#include "Downloader.hpp"
-
-#include <vlc_common.h>
-#include <vlc_url.h>
-#include <vlc_block.h>
-
-#include <algorithm>
-
-using namespace adaptative::http;
-
-AbstractChunkSource::AbstractChunkSource()
-{
-    contentLength = 0;
-}
-
-AbstractChunkSource::~AbstractChunkSource()
-{
-
-}
-
-void AbstractChunkSource::setBytesRange(const BytesRange &range)
-{
-    bytesRange = range;
-    if(bytesRange.isValid() && bytesRange.getEndByte())
-        contentLength = bytesRange.getEndByte() - bytesRange.getStartByte();
-}
-
-const BytesRange & AbstractChunkSource::getBytesRange() const
-{
-    return bytesRange;
-}
-
-AbstractChunk::AbstractChunk(AbstractChunkSource *source_)
-{
-    bytesRead = 0;
-    source = source_;
-}
-
-AbstractChunk::~AbstractChunk()
-{
-    delete source;
-}
-
-size_t AbstractChunk::getBytesRead() const
-{
-    return this->bytesRead;
-}
-
-block_t * AbstractChunk::doRead(size_t size, bool b_block)
-{
-    if(!source)
-        return NULL;
-
-    block_t *block = (b_block) ? source->readBlock() : source->read(size);
-    if(block)
-    {
-        if(bytesRead == 0)
-            block->i_flags |= BLOCK_FLAG_HEADER;
-        bytesRead += block->i_buffer;
-        onDownload(&block);
-        block->i_flags ^= BLOCK_FLAG_HEADER;
-    }
-
-    return block;
-}
-
-bool AbstractChunk::isEmpty() const
-{
-    return !source->hasMoreData();
-}
-
-block_t * AbstractChunk::readBlock()
-{
-    return doRead(0, true);
-}
-
-block_t * AbstractChunk::read(size_t size)
-{
-    return doRead(size, false);
-}
-
-HTTPChunkSource::HTTPChunkSource(const std::string& url, HTTPConnectionManager *manager) :
-    AbstractChunkSource(),
-    connection   (NULL),
-    connManager  (manager),
-    consumed     (0),
-    port         (0)
-{
-    prepared = false;
-    eof = false;
-    if(!init(url))
-        throw VLC_EGENERIC;
-}
-
-HTTPChunkSource::~HTTPChunkSource()
-{
-    if(connection)
-        connection->setUsed(false);
-}
-
-bool HTTPChunkSource::init(const std::string &url)
-{
-    this->url = url;
-
-    std::size_t pos = url.find("://");
-    if(pos != std::string::npos)
-    {
-        scheme = url.substr(0, pos);
-    }
-
-    if(scheme != "http" && scheme != "https")
-        return false;
-
-    vlc_url_t url_components;
-    vlc_UrlParse(&url_components, url.c_str());
-
-    if(url_components.psz_path)
-        path = url_components.psz_path;
-    if(url_components.psz_option)
-    {
-        path += "?";
-        path += url_components.psz_option;
-    }
-    port = url_components.i_port ? url_components.i_port :
-                         ((scheme == "https") ? 443 : 80);
-    if(url_components.psz_host)
-        hostname = url_components.psz_host;
-
-    vlc_UrlClean(&url_components);
-
-    if(path.empty() || hostname.empty())
-        return false;
-
-    return true;
-}
-
-bool HTTPChunkSource::hasMoreData() const
-{
-    if(eof)
-        return false;
-    else if(contentLength)
-        return consumed < contentLength;
-    else return true;
-}
-
-block_t * HTTPChunkSource::read(size_t readsize)
-{
-    if(!prepare())
-    {
-        eof = true;
-        return NULL;
-    }
-
-    if(consumed == contentLength && consumed > 0)
-    {
-        eof = true;
-        return NULL;
-    }
-
-    if(contentLength && readsize > contentLength - consumed)
-        readsize = contentLength - consumed;
-
-    block_t *p_block = block_Alloc(readsize);
-    if(!p_block)
-    {
-        eof = true;
-        return NULL;
-    }
-
-    mtime_t time = mdate();
-    ssize_t ret = connection->read(p_block->p_buffer, readsize);
-    time = mdate() - time;
-    if(ret < 0)
-    {
-        block_Release(p_block);
-        p_block = NULL;
-        eof = true;
-    }
-    else
-    {
-        p_block->i_buffer = (size_t) ret;
-        consumed += p_block->i_buffer;
-        if((size_t)ret < readsize)
-            eof = true;
-        connManager->updateDownloadRate(p_block->i_buffer, time);
-    }
-
-    return p_block;
-}
-
-bool HTTPChunkSource::prepare()
-{
-    if(prepared)
-        return true;
-
-    if(!connManager)
-        return false;
-
-    if(!connection)
-    {
-        connection = connManager->getConnection(scheme, hostname, port);
-        if(!connection)
-            return false;
-    }
-
-    if( connection->query(path, bytesRange) != VLC_SUCCESS )
-        return false;
-    /* Because we don't know Chunk size at start, we need to get size
-           from content length */
-    contentLength = connection->getContentLength();
-    prepared = true;
-
-    return true;
-}
-
-block_t * HTTPChunkSource::readBlock()
-{
-    return read(HTTPChunkSource::CHUNK_SIZE);
-}
-
-HTTPChunkBufferedSource::HTTPChunkBufferedSource(const std::string& url, HTTPConnectionManager *manager) :
-    HTTPChunkSource(url, manager),
-    p_head     (NULL),
-    pp_tail    (&p_head),
-    buffered     (0)
-{
-    vlc_mutex_init(&lock);
-    vlc_cond_init(&avail);
-    done = false;
-    eof = false;
-    downloadstart = 0;
-}
-
-HTTPChunkBufferedSource::~HTTPChunkBufferedSource()
-{
-    vlc_mutex_lock(&lock);
-    if(p_head)
-    {
-        block_ChainRelease(p_head);
-        p_head = NULL;
-        pp_tail = &p_head;
-    }
-    done = true;
-    buffered = 0;
-    vlc_mutex_unlock(&lock);
-
-    connManager->downloader->cancel(this);
-
-    vlc_cond_destroy(&avail);
-    vlc_mutex_destroy(&lock);
-}
-
-bool HTTPChunkBufferedSource::isDone() const
-{
-    bool b_done;
-    vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    b_done = done;
-    vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
-    return b_done;
-}
-
-void HTTPChunkBufferedSource::bufferize(size_t readsize)
-{
-    vlc_mutex_lock(&lock);
-    if(!prepare())
-    {
-        done = true;
-        vlc_cond_signal(&avail);
-        vlc_mutex_unlock(&lock);
-        return;
-    }
-
-    if(readsize < HTTPChunkSource::CHUNK_SIZE)
-        readsize = HTTPChunkSource::CHUNK_SIZE;
-
-    if(contentLength && readsize > contentLength - buffered)
-        readsize = contentLength - buffered;
-
-    vlc_mutex_unlock(&lock);
-
-    block_t *p_block = block_Alloc(readsize);
-    if(!p_block)
-        return;
-
-    struct
-    {
-        size_t size;
-        mtime_t time;
-    } rate = {0,0};
-
-    ssize_t ret = connection->read(p_block->p_buffer, readsize);
-    if(ret <= 0)
-    {
-        block_Release(p_block);
-        vlc_mutex_lock(&lock);
-        done = true;
-        rate.size = buffered + consumed;
-        rate.time = mdate() - downloadstart;
-        downloadstart = 0;
-        vlc_mutex_unlock(&lock);
-    }
-    else
-    {
-        p_block->i_buffer = (size_t) ret;
-        vlc_mutex_lock(&lock);
-        buffered += p_block->i_buffer;
-        block_ChainLastAppend(&pp_tail, p_block);
-        if((size_t) ret < readsize)
-        {
-            done = true;
-            rate.size = buffered + consumed;
-            rate.time = mdate() - downloadstart;
-            downloadstart = 0;
-        }
-        vlc_mutex_unlock(&lock);
-    }
-
-    if(rate.size)
-    {
-        connManager->updateDownloadRate(rate.size, rate.time);
-    }
-
-    vlc_cond_signal(&avail);
-}
-
-bool HTTPChunkBufferedSource::prepare()
-{
-    if(!prepared)
-    {
-        downloadstart = mdate();
-        return HTTPChunkSource::prepare();
-    }
-    return true;
-}
-
-bool HTTPChunkBufferedSource::hasMoreData() const
-{
-    bool b_hasdata;
-    vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    b_hasdata = !eof;
-    vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
-    return b_hasdata;
-}
-
-block_t * HTTPChunkBufferedSource::readBlock()
-{
-    block_t *p_block = NULL;
-
-    vlc_mutex_lock(&lock);
-
-    while(!p_head && !done)
-        vlc_cond_wait(&avail, &lock);
-
-    if(!p_head && done)
-    {
-        if(!eof)
-            p_block = block_Alloc(0);
-        eof = true;
-        vlc_mutex_unlock(&lock);
-        return p_block;
-    }
-
-    /* dequeue */
-    p_block = p_head;
-    p_head = p_head->p_next;
-    if(p_head == NULL)
-    {
-        pp_tail = &p_head;
-        if(done)
-            eof = true;
-    }
-    p_block->p_next = NULL;
-
-    consumed += p_block->i_buffer;
-    buffered -= p_block->i_buffer;
-
-    vlc_mutex_unlock(&lock);
-
-    return p_block;
-}
-
-block_t * HTTPChunkBufferedSource::read(size_t readsize)
-{
-    vlc_mutex_lock(&lock);
-
-    while(readsize > buffered && !done)
-        vlc_cond_wait(&avail, &lock);
-
-    block_t *p_block = NULL;
-    if(!readsize || !buffered || !(p_block = block_Alloc(readsize)) )
-    {
-        eof = true;
-        vlc_mutex_unlock(&lock);
-        return NULL;
-    }
-
-    size_t copied = 0;
-    while(buffered && readsize)
-    {
-        const size_t toconsume = std::min(p_head->i_buffer, readsize);
-        memcpy(&p_block->p_buffer[copied], p_head->p_buffer, toconsume);
-        copied += toconsume;
-        readsize -= toconsume;
-        buffered -= toconsume;
-        p_head->i_buffer -= toconsume;
-        p_head->p_buffer += toconsume;
-        if(p_head->i_buffer == 0)
-        {
-            block_t *next = p_head->p_next;
-            p_head->p_next = NULL;
-            block_Release(p_head);
-            p_head = next;
-            if(next == NULL)
-                pp_tail = &p_head;
-        }
-    }
-
-    consumed += copied;
-    p_block->i_buffer = copied;
-
-    if(copied < readsize)
-        eof = true;
-
-    vlc_mutex_unlock(&lock);
-
-    return p_block;
-}
-
-HTTPChunk::HTTPChunk(const std::string &url, HTTPConnectionManager *manager):
-    AbstractChunk(new HTTPChunkSource(url, manager))
-{
-
-}
-
-HTTPChunk::~HTTPChunk()
-{
-
-}
diff --git a/modules/demux/adaptative/http/Chunk.h b/modules/demux/adaptative/http/Chunk.h
deleted file mode 100644 (file)
index 0e632b7..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Chunk.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef CHUNK_H_
-#define CHUNK_H_
-
-#include "BytesRange.hpp"
-#include <vector>
-#include <string>
-#include <stdint.h>
-
-typedef struct block_t block_t;
-
-namespace adaptative
-{
-    namespace http
-    {
-        class HTTPConnection;
-        class HTTPConnectionManager;
-        class AbstractChunk;
-
-        class AbstractChunkSource
-        {
-            public:
-                AbstractChunkSource();
-                virtual ~AbstractChunkSource();
-                virtual block_t *   readBlock       () = 0;
-                virtual block_t *   read            (size_t) = 0;
-                virtual bool        hasMoreData     () const = 0;
-                void                setBytesRange   (const BytesRange &);
-                const BytesRange &  getBytesRange   () const;
-
-            protected:
-                size_t              contentLength;
-                BytesRange          bytesRange;
-        };
-
-        class AbstractChunk
-        {
-            public:
-                virtual ~AbstractChunk();
-
-                size_t              getBytesRead            () const;
-                bool                isEmpty                 () const;
-
-                virtual block_t *   readBlock       ();
-                virtual block_t *   read            (size_t);
-                virtual void        onDownload      (block_t **) = 0;
-
-            protected:
-                AbstractChunk(AbstractChunkSource *);
-                AbstractChunkSource *source;
-
-            private:
-                size_t              bytesRead;
-                block_t *           doRead(size_t, bool);
-        };
-
-        class HTTPChunkSource : public AbstractChunkSource
-        {
-            public:
-                HTTPChunkSource(const std::string &url, HTTPConnectionManager *);
-                virtual ~HTTPChunkSource();
-
-                virtual block_t *   readBlock       (); /* impl */
-                virtual block_t *   read            (size_t); /* impl */
-                virtual bool        hasMoreData     () const; /* impl */
-
-                static const size_t CHUNK_SIZE = 32768;
-
-            protected:
-                virtual bool      prepare();
-                HTTPConnection     *connection;
-                HTTPConnectionManager *connManager;
-                size_t              consumed; /* read pointer */
-                bool                prepared;
-                bool                eof;
-
-            private:
-                bool init(const std::string &);
-                std::string         url;
-                std::string         scheme;
-                std::string         path;
-                std::string         hostname;
-                uint16_t            port;
-        };
-
-        class HTTPChunkBufferedSource : public HTTPChunkSource
-        {
-            friend class Downloader;
-
-            public:
-                HTTPChunkBufferedSource(const std::string &url, HTTPConnectionManager *);
-                virtual ~HTTPChunkBufferedSource();
-                virtual block_t *  readBlock       (); /* reimpl */
-                virtual block_t *  read            (size_t); /* reimpl */
-                virtual bool       hasMoreData     () const; /* impl */
-
-            protected:
-                virtual bool       prepare(); /* reimpl */
-                void               bufferize(size_t);
-                bool               isDone() const;
-
-            private:
-                block_t            *p_head; /* read cache buffer */
-                block_t           **pp_tail;
-                size_t              buffered; /* read cache size */
-                bool                done;
-                bool                eof;
-                mtime_t             downloadstart;
-                vlc_mutex_t         lock;
-                vlc_cond_t          avail;
-        };
-
-        class HTTPChunk : public AbstractChunk
-        {
-            public:
-                HTTPChunk(const std::string &url, HTTPConnectionManager *);
-                virtual ~HTTPChunk();
-
-                virtual void        onDownload      (block_t **) {} /* impl */
-        };
-
-    }
-}
-
-#endif /* CHUNK_H_ */
diff --git a/modules/demux/adaptative/http/Downloader.cpp b/modules/demux/adaptative/http/Downloader.cpp
deleted file mode 100644 (file)
index 97fc43a..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Downloader.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "Downloader.hpp"
-
-#include <vlc_threads.h>
-#include <vlc_atomic.h>
-
-using namespace adaptative::http;
-
-Downloader::Downloader()
-{
-    vlc_mutex_init(&lock);
-    vlc_cond_init(&waitcond);
-    killed = false;
-    thread_handle = { 0 };
-    thread_handle_valid = false;
-}
-
-bool Downloader::start()
-{
-    if(!thread_handle_valid &&
-       vlc_clone(&thread_handle, downloaderThread,
-                 reinterpret_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT))
-    {
-        return false;
-    }
-    thread_handle_valid = true;
-    return true;
-}
-
-Downloader::~Downloader()
-{
-    killed = true;
-    vlc_cond_signal(&waitcond);
-    if(thread_handle_valid)
-        vlc_join(thread_handle, NULL);
-    vlc_mutex_destroy(&lock);
-    vlc_cond_destroy(&waitcond);
-}
-void Downloader::schedule(HTTPChunkBufferedSource *source)
-{
-    vlc_mutex_lock(&lock);
-    chunks.push_back(source);
-    vlc_mutex_unlock(&lock);
-    vlc_cond_signal(&waitcond);
-}
-
-void Downloader::cancel(HTTPChunkBufferedSource *source)
-{
-    vlc_mutex_lock(&lock);
-    chunks.remove(source);
-    vlc_mutex_unlock(&lock);
-}
-
-void * Downloader::downloaderThread(void *opaque)
-{
-    Downloader *instance = reinterpret_cast<Downloader *>(opaque);
-    int canc = vlc_savecancel();
-    instance->Run();
-    vlc_restorecancel( canc );
-    return NULL;
-}
-
-void Downloader::DownloadSource(HTTPChunkBufferedSource *source)
-{
-    if(!source->isDone())
-        source->bufferize(HTTPChunkSource::CHUNK_SIZE);
-}
-
-void Downloader::Run()
-{
-    while(1)
-    {
-        vlc_mutex_lock(&lock);
-        if(killed)
-            break;
-
-        while(chunks.empty() && !killed)
-        {
-            vlc_cond_wait(&waitcond, &lock);
-        }
-
-        if(killed)
-            break;
-
-        if(!chunks.empty())
-        {
-            HTTPChunkBufferedSource *source = chunks.front();
-            DownloadSource(source);
-            if(source->isDone())
-                chunks.pop_front();
-        }
-
-        vlc_mutex_unlock(&lock);
-    }
-    vlc_mutex_unlock(&lock);
-}
diff --git a/modules/demux/adaptative/http/Downloader.hpp b/modules/demux/adaptative/http/Downloader.hpp
deleted file mode 100644 (file)
index 2555a70..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Downloader.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef DOWNLOADER_HPP
-#define DOWNLOADER_HPP
-
-#include "Chunk.h"
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <list>
-
-namespace adaptative
-{
-
-    namespace http
-    {
-
-        class Downloader
-        {
-            public:
-                Downloader();
-                ~Downloader();
-                bool start();
-                void schedule(HTTPChunkBufferedSource *);
-                void cancel(HTTPChunkBufferedSource *);
-
-            private:
-                static void * downloaderThread(void *);
-                void Run();
-                void DownloadSource(HTTPChunkBufferedSource *);
-                vlc_thread_t thread_handle;
-                vlc_mutex_t  lock;
-                vlc_cond_t   waitcond;
-                vlc_mutex_t  processlock;
-                bool         thread_handle_valid;
-                bool         killed;
-                std::list<HTTPChunkBufferedSource *> chunks;
-        };
-
-    }
-
-}
-
-#endif // DOWNLOADER_HPP
diff --git a/modules/demux/adaptative/http/HTTPConnection.cpp b/modules/demux/adaptative/http/HTTPConnection.cpp
deleted file mode 100644 (file)
index dd148ea..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * HTTPConnection.cpp
- *****************************************************************************
- * Copyright (C) 2014-2015 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "HTTPConnection.hpp"
-#include "Sockets.hpp"
-#include "../adaptative/tools/Helper.h"
-
-#include <sstream>
-
-using namespace adaptative::http;
-
-HTTPConnection::HTTPConnection(vlc_object_t *stream_, Socket *socket_, bool persistent)
-{
-    socket = socket_;
-    stream = stream_;
-    psz_useragent = var_InheritString(stream, "http-user-agent");
-    bytesRead = 0;
-    contentLength = 0;
-    queryOk = false;
-    retries = 0;
-    connectionClose = !persistent;
-    port = 80;
-    available = true;
-}
-
-HTTPConnection::~HTTPConnection()
-{
-    free(psz_useragent);
-    delete socket;
-}
-
-bool HTTPConnection::compare(const std::string &hostname, uint16_t port, int type) const
-{
-    return ( hostname == this->hostname &&
-            (socket && socket->getType() == type) &&
-             port == this->port );
-}
-
-bool HTTPConnection::connect(const std::string &hostname, uint16_t port)
-{
-    if(!socket->connect(stream, hostname.c_str(), port))
-        return false;
-
-    this->hostname = hostname;
-    this->port = port;
-
-    return true;
-}
-
-bool HTTPConnection::connected() const
-{
-    return socket->connected();
-}
-
-void HTTPConnection::disconnect()
-{
-    queryOk = false;
-    bytesRead = 0;
-    contentLength = 0;
-    bytesRange = BytesRange();
-    socket->disconnect();
-}
-
-int HTTPConnection::query(const std::string &path, const BytesRange &range)
-{
-    queryOk = false;
-
-    msg_Dbg(stream, "Retrieving ://%s:%u%s @%zu", hostname.c_str(), port, path.c_str(),
-            range.isValid() ? range.getStartByte() : 0);
-
-    if(!connected() && ( hostname.empty() || !connect(hostname, port) ))
-        return VLC_EGENERIC;
-
-    bytesRange = range;
-    if(range.isValid() && range.getEndByte() > 0)
-        contentLength = range.getEndByte() - range.getStartByte() + 1;
-
-    std::string header = buildRequestHeader(path);
-    if(connectionClose)
-        header.append("Connection: close\r\n");
-    header.append("\r\n");
-
-    if(!send( header ))
-    {
-        socket->disconnect();
-        if(!connectionClose)
-        {
-            /* server closed connection pipeline after last req. need new */
-            connectionClose = true;
-            return query(path, range);
-        }
-        return VLC_EGENERIC;
-    }
-
-    int i_ret = parseReply();
-    if(i_ret == VLC_SUCCESS)
-    {
-        queryOk = true;
-    }
-    else if(i_ret == VLC_EGENERIC)
-    {
-        socket->disconnect();
-        if(!connectionClose)
-        {
-            connectionClose = true;
-            return query(path, range);
-        }
-    }
-
-    return i_ret;
-}
-
-ssize_t HTTPConnection::read(void *p_buffer, size_t len)
-{
-    if( !connected() ||
-       (!queryOk && bytesRead == 0) )
-        return VLC_EGENERIC;
-
-    if(len == 0)
-        return VLC_SUCCESS;
-
-    queryOk = false;
-
-    const size_t toRead = (contentLength) ? contentLength - bytesRead : len;
-    if (toRead == 0)
-        return VLC_SUCCESS;
-
-    if(len > toRead)
-        len = toRead;
-
-    ssize_t ret = socket->read(stream, p_buffer, len);
-    if(ret >= 0)
-        bytesRead += ret;
-
-    if(ret < 0 || (size_t)ret < len) /* set EOF */
-    {
-        socket->disconnect();
-        return ret;
-    }
-
-    return ret;
-}
-
-bool HTTPConnection::send(const std::string &data)
-{
-    return send(data.c_str(), data.length());
-}
-
-bool HTTPConnection::send(const void *buf, size_t size)
-{
-    return socket->send(stream, buf, size);
-}
-
-int HTTPConnection::parseReply()
-{
-    std::string line = readLine();
-
-    if(line.empty())
-        return VLC_EGENERIC;
-
-    if (line.compare(0, 9, "HTTP/1.1 ")!=0)
-        return VLC_ENOOBJ;
-
-    std::istringstream ss(line.substr(9));
-    ss.imbue(std::locale("C"));
-    int replycode;
-    ss >> replycode;
-    if (replycode != 200 && replycode != 206)
-        return VLC_ENOOBJ;
-
-    line = readLine();
-
-    while(!line.empty() && line.compare("\r\n"))
-    {
-        size_t split = line.find_first_of(':');
-        size_t value = split + 1;
-
-        while(line.at(value) == ' ')
-            value++;
-
-        onHeader(line.substr(0, split), line.substr(value));
-        line = readLine();
-    }
-
-    return VLC_SUCCESS;
-}
-
-std::string HTTPConnection::readLine()
-{
-    return socket->readline(stream);
-}
-
-bool HTTPConnection::isAvailable() const
-{
-    return available;
-}
-
-void HTTPConnection::setUsed( bool b )
-{
-    available = !b;
-    if(available)
-    {
-        if(!connectionClose && contentLength == bytesRead )
-        {
-            queryOk = false;
-            bytesRead = 0;
-            contentLength = 0;
-            bytesRange = BytesRange();
-        }
-        else  /* We can't resend request if we haven't finished reading */
-            disconnect();
-    }
-}
-
-size_t HTTPConnection::getContentLength() const
-{
-    return contentLength;
-}
-
-void HTTPConnection::onHeader(const std::string &key,
-                              const std::string &value)
-{
-    if(key == "Content-Length")
-    {
-        std::istringstream ss(value);
-        ss.imbue(std::locale("C"));
-        size_t length;
-        ss >> length;
-        contentLength = length;
-    }
-    else if (key == "Connection" && value =="close")
-    {
-        connectionClose = true;
-    }
-}
-
-std::string HTTPConnection::buildRequestHeader(const std::string &path) const
-{
-    std::stringstream req;
-    req << "GET " << path << " HTTP/1.1\r\n" <<
-           "Host: " << hostname << "\r\n" <<
-           "Cache-Control: no-cache" << "\r\n" <<
-           "Accept-Encoding: " << "\r\n" <<
-           "User-Agent: " << std::string(psz_useragent) << "\r\n";
-    req << extraRequestHeaders();
-    return req.str();
-}
-
-std::string HTTPConnection::extraRequestHeaders() const
-{
-    std::stringstream ss;
-    ss.imbue(std::locale("C"));
-    if(bytesRange.isValid())
-    {
-        ss << "Range: bytes=" << bytesRange.getStartByte() << "-";
-        if(bytesRange.getEndByte())
-            ss << bytesRange.getEndByte();
-        ss << "\r\n";
-    }
-    return ss.str();
-}
diff --git a/modules/demux/adaptative/http/HTTPConnection.hpp b/modules/demux/adaptative/http/HTTPConnection.hpp
deleted file mode 100644 (file)
index ffb561e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * HTTPConnection.hpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *               2014 - 2015 VideoLAN and VLC Authors
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef HTTPCONNECTION_H_
-#define HTTPCONNECTION_H_
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "BytesRange.hpp"
-#include <vlc_common.h>
-#include <string>
-
-namespace adaptative
-{
-    namespace http
-    {
-        class Socket;
-
-        class HTTPConnection
-        {
-            public:
-                HTTPConnection(vlc_object_t *stream, Socket *, bool = false);
-                virtual ~HTTPConnection();
-
-                virtual bool    compare     (const std::string &, uint16_t, int) const;
-                virtual bool    connect     (const std::string& hostname, uint16_t port = 80);
-                virtual bool    connected   () const;
-                virtual int     query       (const std::string& path, const BytesRange & = BytesRange());
-                virtual bool    send        (const void *buf, size_t size);
-                virtual ssize_t read        (void *p_buffer, size_t len);
-                virtual void    disconnect  ();
-                virtual bool    send        (const std::string &data);
-
-                size_t getContentLength() const;
-                bool isAvailable () const;
-                void setUsed( bool );
-
-            protected:
-
-                virtual void    onHeader    (const std::string &line,
-                                             const std::string &value);
-                virtual std::string extraRequestHeaders() const;
-                virtual std::string buildRequestHeader(const std::string &path) const;
-
-                int parseReply();
-                std::string readLine();
-                std::string hostname;
-                uint16_t port;
-                char * psz_useragent;
-                vlc_object_t *stream;
-                size_t bytesRead;
-                size_t contentLength;
-                BytesRange bytesRange;
-                bool available;
-
-                bool                connectionClose;
-                bool                queryOk;
-                int                 retries;
-                static const int    retryCount = 5;
-
-            private:
-                Socket *socket;
-       };
-    }
-}
-
-#endif /* HTTPCONNECTION_H_ */
diff --git a/modules/demux/adaptative/http/HTTPConnectionManager.cpp b/modules/demux/adaptative/http/HTTPConnectionManager.cpp
deleted file mode 100644 (file)
index e828e1e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * HTTPConnectionManager.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "HTTPConnectionManager.h"
-#include "HTTPConnection.hpp"
-#include "Sockets.hpp"
-#include "Downloader.hpp"
-#include <vlc_url.h>
-
-using namespace adaptative::http;
-
-HTTPConnectionManager::HTTPConnectionManager    (vlc_object_t *stream) :
-                       stream                   (stream),
-                       rateObserver             (NULL)
-{
-    vlc_mutex_init(&lock);
-    downloader = new (std::nothrow) Downloader();
-    downloader->start();
-}
-HTTPConnectionManager::~HTTPConnectionManager   ()
-{
-    delete downloader;
-    this->closeAllConnections();
-    vlc_mutex_destroy(&lock);
-}
-
-void HTTPConnectionManager::closeAllConnections      ()
-{
-    vlc_mutex_lock(&lock);
-    releaseAllConnections();
-    vlc_delete_all(this->connectionPool);
-    vlc_mutex_unlock(&lock);
-}
-
-void HTTPConnectionManager::releaseAllConnections()
-{
-    std::vector<HTTPConnection *>::iterator it;
-    for(it = connectionPool.begin(); it != connectionPool.end(); ++it)
-        (*it)->setUsed(false);
-}
-
-HTTPConnection * HTTPConnectionManager::getConnection(const std::string &hostname, uint16_t port, int sockettype)
-{
-    std::vector<HTTPConnection *>::const_iterator it;
-    for(it = connectionPool.begin(); it != connectionPool.end(); ++it)
-    {
-        HTTPConnection *conn = *it;
-        if(conn->isAvailable() && conn->compare(hostname, port, sockettype))
-            return conn;
-    }
-    return NULL;
-}
-
-HTTPConnection * HTTPConnectionManager::getConnection(const std::string &scheme,
-                                                      const std::string &hostname,
-                                                      uint16_t port)
-{
-    if((scheme != "http" && scheme != "https") || hostname.empty())
-        return NULL;
-
-    const int sockettype = (scheme == "https") ? TLSSocket::TLS : Socket::REGULAR;
-    vlc_mutex_lock(&lock);
-    HTTPConnection *conn = getConnection(hostname, port, sockettype);
-    if(!conn)
-    {
-        Socket *socket = (sockettype == TLSSocket::TLS) ? new (std::nothrow) TLSSocket()
-                                                        : new (std::nothrow) Socket();
-        if(!socket)
-        {
-            vlc_mutex_unlock(&lock);
-            return NULL;
-        }
-        /* disable pipelined tls until we have ticket/resume session support */
-        conn = new (std::nothrow) HTTPConnection(stream, socket, sockettype != TLSSocket::TLS);
-        if(!conn)
-        {
-            delete socket;
-            vlc_mutex_unlock(&lock);
-            return NULL;
-        }
-
-        connectionPool.push_back(conn);
-
-        if (!conn->connect(hostname, port))
-        {
-            vlc_mutex_unlock(&lock);
-            return NULL;
-        }
-    }
-
-    conn->setUsed(true);
-    vlc_mutex_unlock(&lock);
-    return conn;
-}
-
-void HTTPConnectionManager::updateDownloadRate(size_t size, mtime_t time)
-{
-    if(rateObserver)
-        rateObserver->updateDownloadRate(size, time);
-}
-
-void HTTPConnectionManager::setDownloadRateObserver(IDownloadRateObserver *obs)
-{
-    rateObserver = obs;
-}
diff --git a/modules/demux/adaptative/http/HTTPConnectionManager.h b/modules/demux/adaptative/http/HTTPConnectionManager.h
deleted file mode 100644 (file)
index af6044e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * HTTPConnectionManager.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef HTTPCONNECTIONMANAGER_H_
-#define HTTPCONNECTIONMANAGER_H_
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "../logic/IDownloadRateObserver.h"
-
-#include <vlc_common.h>
-#include <vector>
-#include <string>
-
-namespace adaptative
-{
-    namespace http
-    {
-        class HTTPConnection;
-        class Downloader;
-
-        class HTTPConnectionManager : public IDownloadRateObserver
-        {
-            public:
-                HTTPConnectionManager           (vlc_object_t *stream);
-                virtual ~HTTPConnectionManager  ();
-
-                void    closeAllConnections ();
-                HTTPConnection * getConnection(const std::string &scheme,
-                                               const std::string &hostname,
-                                               uint16_t port);
-
-                virtual void updateDownloadRate(size_t, mtime_t); /* reimpl */
-                void setDownloadRateObserver(IDownloadRateObserver *);
-                Downloader *downloader;
-
-            private:
-                void    releaseAllConnections ();
-                vlc_mutex_t                                         lock;
-                std::vector<HTTPConnection *>                       connectionPool;
-                vlc_object_t                                       *stream;
-                IDownloadRateObserver                              *rateObserver;
-                HTTPConnection * getConnection(const std::string &hostname, uint16_t port, int);
-        };
-    }
-}
-
-#endif /* HTTPCONNECTIONMANAGER_H_ */
diff --git a/modules/demux/adaptative/http/Sockets.cpp b/modules/demux/adaptative/http/Sockets.cpp
deleted file mode 100644 (file)
index f98cd1b..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Sockets.cpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "Sockets.hpp"
-
-#include <vlc_network.h>
-#include <cerrno>
-
-using namespace adaptative::http;
-
-Socket::Socket()
-{
-    netfd = -1;
-    type = REGULAR;
-}
-
-Socket::Socket( int type_ )
-{
-    netfd = -1;
-    type = type_;
-}
-
-Socket::~Socket()
-{
-    disconnect();
-}
-
-bool Socket::connect(vlc_object_t *stream, const std::string &hostname, int port)
-{
-    netfd = net_ConnectTCP(stream, hostname.c_str(), port);
-
-    if(netfd == -1)
-        return false;
-
-    return true;
-}
-
-int Socket::getType() const
-{
-    return type;
-}
-
-bool Socket::connected() const
-{
-    return (netfd != -1);
-}
-
-void Socket::disconnect()
-{
-    if (netfd >= 0)
-    {
-        net_Close(netfd);
-        netfd = -1;
-    }
-}
-
-ssize_t Socket::read(vlc_object_t *stream, void *p_buffer, size_t len)
-{
-    return net_Read(stream, netfd, p_buffer, len);
-}
-
-std::string Socket::readline(vlc_object_t *stream)
-{
-    char *line = ::net_Gets(stream, netfd);
-    if(line == NULL)
-        return "";
-    std::string ret(line);
-    ::free(line);
-    return ret;
-}
-
-bool Socket::send(vlc_object_t *stream, const void *buf, size_t size)
-{
-    if (netfd == -1)
-        return false;
-
-    if (size == 0)
-        return true;
-
-    return net_Write(stream, netfd, buf, size) == (ssize_t)size;
-}
-
-TLSSocket::TLSSocket() : Socket( TLS )
-{
-    creds = NULL;
-    tls = NULL;
-}
-
-TLSSocket::~TLSSocket()
-{
-    disconnect();
-}
-
-bool TLSSocket::connect(vlc_object_t *stream, const std::string &hostname, int port)
-{
-    disconnect();
-    if(!Socket::connect(stream, hostname, port))
-        return false;
-
-    creds = vlc_tls_ClientCreate(stream);
-    if(!creds)
-    {
-        disconnect();
-        return false;
-    }
-
-    tls = vlc_tls_ClientSessionCreateFD(creds, netfd, hostname.c_str(), "https", NULL, NULL);
-    if(!tls)
-    {
-        disconnect();
-        return false;
-    }
-
-    return true;
-}
-
-bool TLSSocket::connected() const
-{
-    return Socket::connected() && tls;
-}
-
-ssize_t TLSSocket::read(vlc_object_t *, void *p_buffer, size_t len)
-{
-    return vlc_tls_Read(tls, p_buffer, len, true);
-}
-
-std::string TLSSocket::readline(vlc_object_t *)
-{
-    char *line = ::vlc_tls_GetLine(tls);
-    if(line == NULL)
-        return "";
-
-    std::string ret(line);
-    ::free(line);
-    return ret;
-}
-
-bool TLSSocket::send(vlc_object_t *, const void *buf, size_t size)
-{
-    if (!connected())
-        return false;
-
-    if (size == 0)
-        return true;
-
-    return vlc_tls_Write(tls, buf, size) == (ssize_t)size;
-}
-
-void TLSSocket::disconnect()
-{
-    if(tls)
-        vlc_tls_SessionDelete(tls);
-    if(creds)
-        vlc_tls_Delete(creds);
-    tls = NULL;
-    creds = NULL;
-    Socket::disconnect();
-}
diff --git a/modules/demux/adaptative/http/Sockets.hpp b/modules/demux/adaptative/http/Sockets.hpp
deleted file mode 100644 (file)
index 09608d7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Sockets.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef SOCKETS_HPP
-#define SOCKETS_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_tls.h>
-#include <string>
-
-namespace adaptative
-{
-    namespace http
-    {
-        class Socket
-        {
-            public:
-                Socket();
-                virtual ~Socket();
-                virtual bool    connect     (vlc_object_t *, const std::string&, int port = 80);
-                virtual bool    connected   () const;
-                virtual bool    send        (vlc_object_t *, const void *buf, size_t size);
-                virtual ssize_t read        (vlc_object_t *, void *p_buffer, size_t len);
-                virtual std::string readline(vlc_object_t *);
-                virtual void    disconnect  ();
-                int     getType() const;
-                static const int REGULAR = 0;
-
-            protected:
-                Socket( int );
-                int netfd;
-                int type;
-        };
-
-        class TLSSocket : public Socket
-        {
-            public:
-                TLSSocket();
-                virtual ~TLSSocket();
-                virtual bool    connect     (vlc_object_t *, const std::string&, int port = 443);
-                virtual bool    connected   () const;
-                virtual bool    send        (vlc_object_t *, const void *buf, size_t size);
-                virtual ssize_t read        (vlc_object_t *, void *p_buffer, size_t len);
-                virtual std::string readline(vlc_object_t *);
-                virtual void    disconnect  ();
-                static const int TLS = REGULAR + 1;
-
-            private:
-                vlc_tls_creds_t *creds;
-                vlc_tls_t *tls;
-        };
-    }
-}
-
-
-#endif // SOCKETS_HPP
diff --git a/modules/demux/adaptative/logic/AbstractAdaptationLogic.cpp b/modules/demux/adaptative/logic/AbstractAdaptationLogic.cpp
deleted file mode 100644 (file)
index 0e1e2e7..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * AbstractAdaptationLogic.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "AbstractAdaptationLogic.h"
-
-using namespace adaptative::logic;
-
-AbstractAdaptationLogic::AbstractAdaptationLogic    ()
-{
-}
-
-AbstractAdaptationLogic::~AbstractAdaptationLogic   ()
-{
-}
-
-void AbstractAdaptationLogic::updateDownloadRate    (size_t, mtime_t)
-{
-}
diff --git a/modules/demux/adaptative/logic/AbstractAdaptationLogic.h b/modules/demux/adaptative/logic/AbstractAdaptationLogic.h
deleted file mode 100644 (file)
index a456a3d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * AbstractAdaptationLogic.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef ABSTRACTADAPTATIONLOGIC_H_
-#define ABSTRACTADAPTATIONLOGIC_H_
-
-#include "IDownloadRateObserver.h"
-#include "../SegmentTracker.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class BaseRepresentation;
-        class BaseAdaptationSet;
-    }
-
-    namespace logic
-    {
-        using namespace playlist;
-
-        class AbstractAdaptationLogic : public IDownloadRateObserver,
-                                        public SegmentTrackerListenerInterface
-        {
-            public:
-                AbstractAdaptationLogic             ();
-                virtual ~AbstractAdaptationLogic    ();
-
-                virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) const = 0;
-                virtual void                updateDownloadRate     (size_t, mtime_t);
-                virtual void                trackerEvent           (const SegmentTrackerEvent &) {}
-
-                enum LogicType
-                {
-                    Default,
-                    AlwaysBest,
-                    AlwaysLowest,
-                    RateBased,
-                    FixedRate
-                };
-        };
-    }
-}
-
-#endif /* ABSTRACTADAPTATIONLOGIC_H_ */
diff --git a/modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp b/modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp
deleted file mode 100644 (file)
index bc43a4d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * AlwaysBestAdaptationLogic.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "AlwaysBestAdaptationLogic.h"
-#include "Representationselectors.hpp"
-
-using namespace adaptative::logic;
-using namespace adaptative::playlist;
-
-AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic    () :
-                           AbstractAdaptationLogic      ()
-{
-}
-
-BaseRepresentation *AlwaysBestAdaptationLogic::getNextRepresentation(BaseAdaptationSet *adaptSet, BaseRepresentation *) const
-{
-    RepresentationSelector selector;
-    return selector.select(adaptSet);
-}
diff --git a/modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h b/modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h
deleted file mode 100644 (file)
index 4495946..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * AlwaysBestAdaptationLogic.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef ALWAYSBESTADAPTATIONLOGIC_H_
-#define ALWAYSBESTADAPTATIONLOGIC_H_
-
-#include "AbstractAdaptationLogic.h"
-
-namespace adaptative
-{
-    namespace logic
-    {
-        class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic
-        {
-            public:
-                AlwaysBestAdaptationLogic           ();
-
-                virtual BaseRepresentation *getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) const;
-        };
-    }
-}
-
-#endif /* ALWAYSBESTADAPTATIONLOGIC_H_ */
diff --git a/modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp b/modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp
deleted file mode 100644 (file)
index 38bb821..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * AlwaysLowestAdaptationLogic.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
-  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "AlwaysLowestAdaptationLogic.hpp"
-#include "Representationselectors.hpp"
-
-using namespace adaptative::logic;
-using namespace adaptative::playlist;
-
-AlwaysLowestAdaptationLogic::AlwaysLowestAdaptationLogic():
-    AbstractAdaptationLogic()
-{
-}
-
-BaseRepresentation *AlwaysLowestAdaptationLogic::getNextRepresentation(BaseAdaptationSet *adaptSet, BaseRepresentation *) const
-{
-    RepresentationSelector selector;
-    return selector.select(adaptSet, 0);
-}
diff --git a/modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp b/modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp
deleted file mode 100644 (file)
index 4876d2d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * AlwaysLowestAdaptationLogic.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
-  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef ALWAYSLOWESTADAPTATIONLOGIC_HPP
-#define ALWAYSLOWESTADAPTATIONLOGIC_HPP
-
-#include "AbstractAdaptationLogic.h"
-
-namespace adaptative
-{
-    namespace logic
-    {
-        class AlwaysLowestAdaptationLogic : public AbstractAdaptationLogic
-        {
-            public:
-                AlwaysLowestAdaptationLogic();
-
-                virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) const;
-        };
-    }
-}
-
-#endif // ALWAYSLOWESTADAPTATIONLOGIC_HPP
diff --git a/modules/demux/adaptative/logic/IDownloadRateObserver.h b/modules/demux/adaptative/logic/IDownloadRateObserver.h
deleted file mode 100644 (file)
index d5434ce..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * IDownloadRateObserver.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef IDOWNLOADRATEOBSERVER_H_
-#define IDOWNLOADRATEOBSERVER_H_
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-
-namespace adaptative
-{
-    class IDownloadRateObserver
-    {
-        public:
-            virtual void updateDownloadRate(size_t, mtime_t) = 0;
-            virtual ~IDownloadRateObserver(){}
-    };
-}
-
-#endif /* IDOWNLOADRATEOBSERVER_H_ */
diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
deleted file mode 100644 (file)
index a8940bd..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * RateBasedAdaptationLogic.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "RateBasedAdaptationLogic.h"
-#include "Representationselectors.hpp"
-
-#include "../playlist/BaseRepresentation.h"
-#include "../playlist/BasePeriod.h"
-#include "../http/Chunk.h"
-#include "../tools/Debug.hpp"
-
-using namespace adaptative::logic;
-using namespace adaptative;
-
-RateBasedAdaptationLogic::RateBasedAdaptationLogic  (vlc_object_t *p_obj_, int w, int h) :
-                          AbstractAdaptationLogic   (),
-                          bpsAvg(0),
-                          currentBps(0)
-{
-    width  = w;
-    height = h;
-    usedBps = 0;
-    dllength = 0;
-    p_obj = p_obj_;
-    for(unsigned i=0; i<10; i++) window[i].bw = window[i].diff = 0;
-    window_idx = 0;
-    prevbps = 0;
-    dlsize = 0;
-    vlc_mutex_init(&lock);
-}
-
-RateBasedAdaptationLogic::~RateBasedAdaptationLogic()
-{
-    vlc_mutex_destroy(&lock);
-}
-
-BaseRepresentation *RateBasedAdaptationLogic::getNextRepresentation(BaseAdaptationSet *adaptSet, BaseRepresentation *currep) const
-{
-    if(adaptSet == NULL)
-        return NULL;
-
-    vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    size_t availBps = currentBps + ((currep) ? currep->getBandwidth() : 0);
-    vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
-    if(availBps > usedBps)
-        availBps -= usedBps;
-    else
-        availBps = 0;
-
-    RepresentationSelector selector;
-    BaseRepresentation *rep = selector.select(adaptSet, availBps, width, height);
-    if ( rep == NULL )
-    {
-        rep = selector.select(adaptSet);
-        if ( rep == NULL )
-            return NULL;
-    }
-
-    return rep;
-}
-
-void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
-{
-    if(unlikely(time == 0))
-        return;
-    /* Accumulate up to observation window */
-    dllength += time;
-    dlsize += size;
-
-    if(dllength < CLOCK_FREQ / 4)
-        return;
-
-    const size_t bps = CLOCK_FREQ * dlsize * 8 / dllength;
-
-    /* set window value */
-    if(window[0].bw == 0)
-    {
-        for(unsigned i=0; i<TOTALOBS; i++) window[i].bw = bps;
-    }
-    else
-    {
-        window_idx = (window_idx + 1) % TOTALOBS;
-        window[window_idx].bw = bps;
-        window[window_idx].diff = bps >= prevbps ? bps - prevbps : prevbps - bps;
-    }
-
-    /* compute for deltamax */
-    size_t diffsum = 0;
-    size_t omin = SIZE_MAX;
-    size_t omax = 0;
-    for(unsigned i=0; i < TOTALOBS; i++)
-    {
-        /* Find max and min */
-        if(window[i].bw > omax)
-            omax = window[i].bw;
-        if(window[i].bw < omin)
-            omin = window[i].bw;
-        diffsum += window[i].diff;
-    }
-
-    /* Vertical Horizontal Filter / Moving Average
-     *
-     * Bandwidth stability during observation window alters the alpha parameter
-     * and then defines how fast we adapt to current bandwidth */
-    const size_t deltamax = omax - omin;
-    double alpha = (diffsum) ? 0.33 * ((double)deltamax / diffsum) : 0.5;
-
-    vlc_mutex_lock(&lock);
-    bpsAvg = alpha * bpsAvg + (1.0 - alpha) * bps;
-
-    BwDebug(msg_Dbg(p_obj, "alpha1 %lf alpha0 %lf dmax %ld ds %ld", alpha,
-                    (double)deltamax / diffsum, deltamax, diffsum));
-    BwDebug(msg_Dbg(p_obj, "bw estimation bps %zu -> avg %zu",
-                            bps / 8192, bpsAvg / 8192));
-
-    currentBps = bpsAvg * 3/4;
-    dlsize = dllength = 0;
-    prevbps = bps;
-
-    BwDebug(msg_Info(p_obj, "Current bandwidth %zu KiB/s using %u%%",
-                    (bpsAvg / 8192), (bpsAvg) ? (unsigned)(usedBps * 100.0 / bpsAvg) : 0));
-    vlc_mutex_unlock(&lock);
-}
-
-void RateBasedAdaptationLogic::trackerEvent(const SegmentTrackerEvent &event)
-{
-    if(event.type == SegmentTrackerEvent::SWITCHING)
-    {
-        vlc_mutex_lock(&lock);
-        if(event.u.switching.prev)
-            usedBps -= event.u.switching.prev->getBandwidth();
-        if(event.u.switching.next)
-            usedBps += event.u.switching.next->getBandwidth();
-
-        BwDebug(msg_Info(p_obj, "New bandwidth usage %zu KiB/s %u%%",
-                        (usedBps / 8192), (bpsAvg) ? (unsigned)(usedBps * 100.0 / bpsAvg) : 0 ));
-        vlc_mutex_unlock(&lock);
-    }
-}
-
-FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) :
-    AbstractAdaptationLogic()
-{
-    currentBps = bps;
-}
-
-BaseRepresentation *FixedRateAdaptationLogic::getNextRepresentation(BaseAdaptationSet *adaptSet, BaseRepresentation *) const
-{
-    if(adaptSet == NULL)
-        return NULL;
-
-    RepresentationSelector selector;
-    BaseRepresentation *rep = selector.select(adaptSet, currentBps);
-    if ( rep == NULL )
-    {
-        rep = selector.select(adaptSet);
-        if ( rep == NULL )
-            return NULL;
-    }
-    return rep;
-}
diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
deleted file mode 100644 (file)
index e2d8eb6..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * RateBasedAdaptationLogic.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef RATEBASEDADAPTATIONLOGIC_H_
-#define RATEBASEDADAPTATIONLOGIC_H_
-
-#include "AbstractAdaptationLogic.h"
-
-namespace adaptative
-{
-    namespace logic
-    {
-
-        class RateBasedAdaptationLogic : public AbstractAdaptationLogic
-        {
-            public:
-                RateBasedAdaptationLogic            (vlc_object_t *, int, int);
-                virtual ~RateBasedAdaptationLogic   ();
-
-                BaseRepresentation *getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) const;
-                virtual void updateDownloadRate(size_t, mtime_t); /* reimpl */
-                virtual void trackerEvent(const SegmentTrackerEvent &); /* reimpl */
-
-            private:
-                int                     width;
-                int                     height;
-                size_t                  bpsAvg;
-                size_t                  currentBps;
-                size_t                  usedBps;
-                vlc_object_t *          p_obj;
-
-                static const unsigned   TOTALOBS = 10;
-                struct
-                {
-                    size_t bw;
-                    size_t diff;
-                } window[TOTALOBS];
-                unsigned                window_idx;
-                size_t                  prevbps;
-
-                size_t                  dlsize;
-                mtime_t                 dllength;
-
-                vlc_mutex_t             lock;
-        };
-
-        class FixedRateAdaptationLogic : public AbstractAdaptationLogic
-        {
-            public:
-                FixedRateAdaptationLogic(size_t);
-
-                BaseRepresentation *getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) const;
-
-            private:
-                size_t                  currentBps;
-        };
-    }
-}
-
-#endif /* RATEBASEDADAPTATIONLOGIC_H_ */
diff --git a/modules/demux/adaptative/logic/Representationselectors.cpp b/modules/demux/adaptative/logic/Representationselectors.cpp
deleted file mode 100644 (file)
index e260447..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Representationselectors.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "Representationselectors.hpp"
-#include "../playlist/BaseRepresentation.h"
-#include "../playlist/BaseAdaptationSet.h"
-#include "../playlist/BasePeriod.h"
-#include <limits>
-
-using namespace adaptative::logic;
-
-RepresentationSelector::RepresentationSelector()
-{
-}
-
-BaseRepresentation * RepresentationSelector::select(BaseAdaptationSet *adaptSet) const
-{
-    return select(adaptSet, std::numeric_limits<uint64_t>::max());
-}
-BaseRepresentation * RepresentationSelector::select(BaseAdaptationSet *adaptSet, uint64_t bitrate) const
-{
-    if (adaptSet == NULL)
-        return NULL;
-
-    BaseRepresentation *best = NULL;
-    std::vector<BaseRepresentation *> reps = adaptSet->getRepresentations();
-    BaseRepresentation *candidate = select(reps, (best)?best->getBandwidth():0, bitrate);
-    if (candidate)
-    {
-        if (candidate->getBandwidth() > bitrate) /* none matched, returned lowest */
-            return candidate;
-        best = candidate;
-    }
-
-    return best;
-}
-
-BaseRepresentation * RepresentationSelector::select(BaseAdaptationSet *adaptSet, uint64_t bitrate,
-                                                int width, int height) const
-{
-    if(adaptSet == NULL)
-        return NULL;
-
-    std::vector<BaseRepresentation *> resMatchReps;
-
-    /* subset matching WxH */
-    std::vector<BaseRepresentation *> reps = adaptSet->getRepresentations();
-    std::vector<BaseRepresentation *>::const_iterator repIt;
-    for(repIt=reps.begin(); repIt!=reps.end(); ++repIt)
-    {
-        if((*repIt)->getWidth() == width && (*repIt)->getHeight() == height)
-            resMatchReps.push_back(*repIt);
-    }
-
-    if(resMatchReps.empty())
-        return select(adaptSet, bitrate);
-    else
-        return select(resMatchReps, 0, bitrate);
-}
-
-BaseRepresentation * RepresentationSelector::select(std::vector<BaseRepresentation *>& reps,
-                                                uint64_t minbitrate, uint64_t maxbitrate) const
-{
-    BaseRepresentation  *candidate = NULL, *lowest = NULL;
-    std::vector<BaseRepresentation *>::const_iterator repIt;
-    for(repIt=reps.begin(); repIt!=reps.end(); ++repIt)
-    {
-        if ( !lowest || (*repIt)->getBandwidth() < lowest->getBandwidth())
-            lowest = *repIt;
-
-        if ( (*repIt)->getBandwidth() < maxbitrate &&
-             (*repIt)->getBandwidth() > minbitrate )
-        {
-            candidate = (*repIt);
-            minbitrate = (*repIt)->getBandwidth();
-        }
-    }
-
-    if (!candidate)
-        return candidate = lowest;
-
-    return candidate;
-}
diff --git a/modules/demux/adaptative/logic/Representationselectors.hpp b/modules/demux/adaptative/logic/Representationselectors.hpp
deleted file mode 100644 (file)
index b39aa9b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Representationselectors.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef REPRESENTATIONSELECTORS_HPP
-#define REPRESENTATIONSELECTORS_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vector>
-#include <vlc_common.h>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class BaseRepresentation;
-        class BaseAdaptationSet;
-    }
-
-    namespace logic
-    {
-        using namespace playlist;
-
-        class RepresentationSelector
-        {
-        public:
-            RepresentationSelector();
-            virtual ~RepresentationSelector() {}
-            virtual BaseRepresentation * select(BaseAdaptationSet *) const;
-            virtual BaseRepresentation * select(BaseAdaptationSet *, uint64_t bitrate) const;
-            virtual BaseRepresentation * select(BaseAdaptationSet *, uint64_t bitrate,
-                                            int width, int height) const;
-        protected:
-            virtual BaseRepresentation * select(std::vector<BaseRepresentation *>&reps,
-                                            uint64_t minbitrate, uint64_t maxbitrate) const;
-        };
-
-    }
-}
-
-#endif // REPRESENTATIONSELECTORS_HPP
diff --git a/modules/demux/adaptative/mp4/AtomsReader.cpp b/modules/demux/adaptative/mp4/AtomsReader.cpp
deleted file mode 100644 (file)
index fe84e16..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * AtomsReader.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "AtomsReader.hpp"
-#include <new>
-
-using namespace adaptative::mp4;
-
-AtomsReader::AtomsReader(vlc_object_t *object_)
-{
-    object = object_;
-    rootbox = NULL;
-}
-
-AtomsReader::~AtomsReader()
-{
-    clean();
-}
-
-void AtomsReader::clean()
-{
-    while(rootbox && rootbox->p_first)
-    {
-        MP4_Box_t *p_next = rootbox->p_first->p_next;
-        MP4_BoxFree( rootbox->p_first );
-        rootbox->p_first = p_next;
-    }
-    delete rootbox;
-    rootbox = NULL;
-}
-
-bool AtomsReader::parseBlock(block_t *p_block)
-{
-    if(rootbox)
-        clean();
-
-    stream_t *stream = stream_MemoryNew( object, p_block->p_buffer, p_block->i_buffer, true);
-    if (stream)
-    {
-        rootbox = new (std::nothrow) MP4_Box_t;
-        if(!rootbox)
-        {
-            stream_Delete(stream);
-            return false;
-        }
-        memset(rootbox, 0, sizeof(*rootbox));
-        rootbox->i_type = ATOM_root;
-        rootbox->i_size = p_block->i_buffer;
-        if ( MP4_ReadBoxContainerChildren( stream, rootbox, NULL ) == 1 )
-        {
-#ifndef NDEBUG
-            MP4_BoxDumpStructure(stream, rootbox);
-#endif
-        }
-        stream_Delete(stream);
-    }
-
-    return true;
-}
diff --git a/modules/demux/adaptative/mp4/AtomsReader.hpp b/modules/demux/adaptative/mp4/AtomsReader.hpp
deleted file mode 100644 (file)
index 376e58a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * AtomsReader.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef ATOMSREADER_HPP
-#define ATOMSREADER_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_stream.h>
-extern "C" {
-#include "../../demux/mp4/libmp4.h"
-}
-
-namespace adaptative
-{
-    namespace mp4
-    {
-        class AtomsReader
-        {
-            public:
-                AtomsReader(vlc_object_t *);
-                ~AtomsReader();
-                void clean();
-                bool parseBlock(block_t *);
-
-            protected:
-                vlc_object_t *object;
-                MP4_Box_t *rootbox;
-        };
-    }
-}
-
-#endif // ATOMSREADER_HPP
diff --git a/modules/demux/adaptative/playlist/AbstractPlaylist.cpp b/modules/demux/adaptative/playlist/AbstractPlaylist.cpp
deleted file mode 100644 (file)
index 45e136f..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * AbstractAbstractPlaylist.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- * Copyright (C) 2015 VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "AbstractPlaylist.hpp"
-#include "../tools/Helper.h"
-#include "BasePeriod.h"
-#include "SegmentTimeline.h"
-#include <vlc_common.h>
-#include <vlc_stream.h>
-
-using namespace adaptative::playlist;
-
-AbstractPlaylist::AbstractPlaylist (stream_t *stream_) :
-    ICanonicalUrl(),
-    stream(stream_)
-{
-    playbackStart.Set(0);
-    availabilityStartTime.Set( 0 );
-    availabilityEndTime.Set( 0 );
-    duration.Set( 0 );
-    minUpdatePeriod.Set( 2 * CLOCK_FREQ );
-    maxSegmentDuration.Set( 0 );
-    minBufferTime.Set( 0 );
-    timeShiftBufferDepth.Set( 0 );
-}
-
-AbstractPlaylist::~AbstractPlaylist()
-{
-    for(size_t i = 0; i < this->periods.size(); i++)
-        delete(this->periods.at(i));
-}
-
-const std::vector<BasePeriod *>& AbstractPlaylist::getPeriods()
-{
-    return periods;
-}
-
-void AbstractPlaylist::addBaseUrl(const std::string &url)
-{
-    baseUrls.push_back(url);
-}
-
-void AbstractPlaylist::setPlaylistUrl(const std::string &url)
-{
-    playlistUrl = url;
-}
-
-void AbstractPlaylist::addPeriod(BasePeriod *period)
-{
-    periods.push_back(period);
-}
-
-void AbstractPlaylist::setType(const std::string &type_)
-{
-    type = type_;
-}
-
-Url AbstractPlaylist::getUrlSegment() const
-{
-    Url ret;
-
-    if (!baseUrls.empty())
-        ret = Url(baseUrls.front());
-
-    if( !ret.hasScheme() && !playlistUrl.empty() )
-        ret.prepend( Url(playlistUrl) );
-
-    return ret;
-}
-
-vlc_object_t * AbstractPlaylist::getVLCObject() const
-{
-    return VLC_OBJECT(stream);
-}
-
-BasePeriod* AbstractPlaylist::getFirstPeriod()
-{
-    std::vector<BasePeriod *> periods = getPeriods();
-
-    if( !periods.empty() )
-        return periods.front();
-    else
-        return NULL;
-}
-
-BasePeriod* AbstractPlaylist::getNextPeriod(BasePeriod *period)
-{
-    std::vector<BasePeriod *> periods = getPeriods();
-
-    for(size_t i = 0; i < periods.size(); i++)
-    {
-        if(periods.at(i) == period && (i + 1) < periods.size())
-            return periods.at(i + 1);
-    }
-
-    return NULL;
-}
-
-void AbstractPlaylist::mergeWith(AbstractPlaylist *updatedAbstractPlaylist, mtime_t prunebarrier)
-{
-    availabilityEndTime.Set(updatedAbstractPlaylist->availabilityEndTime.Get());
-
-    for(size_t i = 0; i < periods.size() && i < updatedAbstractPlaylist->periods.size(); i++)
-        periods.at(i)->mergeWith(updatedAbstractPlaylist->periods.at(i), prunebarrier);
-}
-
-void AbstractPlaylist::pruneByPlaybackTime(mtime_t time)
-{
-    for(size_t i = 0; i < periods.size(); i++)
-        periods.at(i)->pruneByPlaybackTime(time);
-}
-
diff --git a/modules/demux/adaptative/playlist/AbstractPlaylist.hpp b/modules/demux/adaptative/playlist/AbstractPlaylist.hpp
deleted file mode 100644 (file)
index 9e0babc..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * AbstractPlaylist.hpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- * Copyright (C) 2015 VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef ABSTRACTPLAYLIST_HPP_
-#define ABSTRACTPLAYLIST_HPP_
-
-#include <vector>
-#include <string>
-
-#include "ICanonicalUrl.hpp"
-#include "../tools/Properties.hpp"
-
-namespace adaptative
-{
-
-    namespace playlist
-    {
-        class BasePeriod;
-
-        class AbstractPlaylist : public ICanonicalUrl
-        {
-            public:
-                AbstractPlaylist(stream_t *);
-                virtual ~AbstractPlaylist();
-
-                virtual bool                    isLive() const = 0;
-                void                            setType(const std::string &);
-                virtual void                    debug() = 0;
-
-                void    addPeriod               (BasePeriod *period);
-                void    addBaseUrl              (const std::string &);
-                void    setPlaylistUrl          (const std::string &);
-
-                virtual Url         getUrlSegment() const; /* impl */
-                vlc_object_t *      getVLCObject()  const;
-
-                virtual const std::vector<BasePeriod *>& getPeriods();
-                virtual BasePeriod*                      getFirstPeriod();
-                virtual BasePeriod*                      getNextPeriod(BasePeriod *period);
-
-                void                mergeWith(AbstractPlaylist *, mtime_t = 0);
-                void                pruneByPlaybackTime(mtime_t);
-
-                Property<mtime_t>                   duration;
-                Property<time_t>                    playbackStart;
-                Property<time_t>                    availabilityEndTime;
-                Property<time_t>                    availabilityStartTime;
-                Property<mtime_t>                   minUpdatePeriod;
-                Property<mtime_t>                   maxSegmentDuration;
-                Property<mtime_t>                   minBufferTime;
-                Property<mtime_t>                   timeShiftBufferDepth;
-
-            protected:
-                stream_t                           *stream;
-                std::vector<BasePeriod *>           periods;
-                std::vector<std::string>            baseUrls;
-                std::string                         playlistUrl;
-                std::string                         type;
-
-        };
-    }
-}
-#endif /* ABSTRACTPLAYLIST_HPP_ */
diff --git a/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp b/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
deleted file mode 100644 (file)
index 3471e15..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * BaseAdaptationSet.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "BaseAdaptationSet.h"
-#include "BaseRepresentation.h"
-
-#include <vlc_common.h>
-#include <vlc_arrays.h>
-
-#include "SegmentTemplate.h"
-#include "BasePeriod.h"
-#include "Inheritables.hpp"
-
-using namespace adaptative;
-using namespace adaptative::playlist;
-
-BaseAdaptationSet::BaseAdaptationSet(BasePeriod *period) :
-    CommonAttributesElements(),
-    SegmentInformation( period ),
-    isBitstreamSwitching( false )
-{
-}
-
-BaseAdaptationSet::~BaseAdaptationSet   ()
-{
-    vlc_delete_all( representations );
-    childs.clear();
-}
-
-StreamFormat BaseAdaptationSet::getStreamFormat() const
-{
-    if (!representations.empty())
-        return representations.front()->getStreamFormat();
-    else
-        return StreamFormat();
-}
-
-std::vector<BaseRepresentation*>& BaseAdaptationSet::getRepresentations()
-{
-    return representations;
-}
-
-BaseRepresentation * BaseAdaptationSet::getRepresentationByID(const ID &id)
-{
-    std::vector<BaseRepresentation *>::const_iterator it;
-    for(it = representations.begin(); it != representations.end(); ++it)
-    {
-        if((*it)->getID() == id)
-            return *it;
-    }
-    return NULL;
-}
-
-void BaseAdaptationSet::addRepresentation(BaseRepresentation *rep)
-{
-    representations.push_back(rep);
-    childs.push_back(rep);
-}
-
-void BaseAdaptationSet::setSwitchPolicy  (bool value)
-{
-    this->isBitstreamSwitching = value;
-}
-
-bool BaseAdaptationSet::getBitstreamSwitching  () const
-{
-    return this->isBitstreamSwitching;
-}
-
-void BaseAdaptationSet::debug(vlc_object_t *obj, int indent) const
-{
-    std::string text(indent, ' ');
-    text.append("BaseAdaptationSet ");
-    text.append(id.str());
-    msg_Dbg(obj, "%s", text.c_str());
-    std::vector<BaseRepresentation *>::const_iterator k;
-    for(k = representations.begin(); k != representations.end(); ++k)
-        (*k)->debug(obj, indent + 1);
-}
diff --git a/modules/demux/adaptative/playlist/BaseAdaptationSet.h b/modules/demux/adaptative/playlist/BaseAdaptationSet.h
deleted file mode 100644 (file)
index f261337..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * AdaptationSet.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef BASEADAPTATIONSET_H_
-#define BASEADAPTATIONSET_H_
-
-#include <vector>
-#include <string>
-
-#include "CommonAttributesElements.h"
-#include "SegmentInformation.hpp"
-#include "../StreamFormat.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class BaseRepresentation;
-        class BasePeriod;
-        class ID;
-
-        class BaseAdaptationSet : public CommonAttributesElements,
-                                  public SegmentInformation
-        {
-            public:
-                BaseAdaptationSet(BasePeriod *);
-                virtual ~BaseAdaptationSet();
-
-                virtual StreamFormat            getStreamFormat() const; /*reimpl*/
-                std::vector<BaseRepresentation *>&  getRepresentations      ();
-                BaseRepresentation *            getRepresentationByID(const ID &);
-                void                            setSwitchPolicy(bool value);
-                bool                            getBitstreamSwitching() const;
-                void                            addRepresentation( BaseRepresentation *rep );
-                void                            debug(vlc_object_t *,int = 0) const;
-                Property<std::string>           description;
-
-            protected:
-                std::vector<BaseRepresentation *>   representations;
-                bool                            isBitstreamSwitching;
-        };
-    }
-}
-
-#endif /* BASEADAPTATIONSET_H_ */
diff --git a/modules/demux/adaptative/playlist/BasePeriod.cpp b/modules/demux/adaptative/playlist/BasePeriod.cpp
deleted file mode 100644 (file)
index 33f11a2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * BasePeriod.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "BasePeriod.h"
-#include "AbstractPlaylist.hpp"
-#include "../Streams.hpp"
-
-#include <vlc_common.h>
-#include <vlc_arrays.h>
-
-using namespace adaptative::playlist;
-
-BasePeriod::BasePeriod(AbstractPlaylist *playlist_) :
-    SegmentInformation( playlist_ )
-{
-    duration.Set(0);
-    startTime.Set(0);
-    baseUrl.Set(NULL);
-    playlist = playlist_;
-}
-
-BasePeriod::~BasePeriod ()
-{
-    vlc_delete_all( adaptationSets );
-    delete baseUrl.Get();
-    childs.clear();
-}
-
-AbstractPlaylist *BasePeriod::getPlaylist() const
-{
-    return playlist;
-}
-
-const std::vector<BaseAdaptationSet*>&  BasePeriod::getAdaptationSets() const
-{
-    return adaptationSets;
-}
-
-void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
-{
-    if ( adaptationSet != NULL )
-    {
-        adaptationSets.push_back(adaptationSet);
-        childs.push_back(adaptationSet);
-    }
-}
-
-BaseAdaptationSet *BasePeriod::getAdaptationSetByID(const ID &id)
-{
-    std::vector<BaseAdaptationSet*>::const_iterator it;
-    for(it = adaptationSets.begin(); it!= adaptationSets.end(); ++it)
-    {
-        if( (*it)->getID() == id )
-            return *it;
-    }
-    return NULL;
-}
-
-void BasePeriod::debug(vlc_object_t *obj, int indent) const
-{
-    std::string text(indent, ' ');
-    text.append("Period");
-    msg_Dbg(obj, "%s", text.c_str());
-    std::vector<BaseAdaptationSet *>::const_iterator k;
-    for(k = adaptationSets.begin(); k != adaptationSets.end(); ++k)
-        (*k)->debug(obj, indent + 1);
-}
-
-mtime_t BasePeriod::getPeriodStart() const
-{
-    return startTime.Get();
-}
diff --git a/modules/demux/adaptative/playlist/BasePeriod.h b/modules/demux/adaptative/playlist/BasePeriod.h
deleted file mode 100644 (file)
index b5acf8e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Period.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef BASEPERIOD_H_
-#define BASEPERIOD_H_
-
-#include <vector>
-
-#include "BaseAdaptationSet.h"
-#include "SegmentInformation.hpp"
-#include "../tools/Properties.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class BasePeriod : public SegmentInformation
-        {
-            public:
-                BasePeriod(AbstractPlaylist *);
-                virtual ~BasePeriod ();
-
-                const std::vector<BaseAdaptationSet *>& getAdaptationSets   () const;
-                BaseAdaptationSet *                 getAdaptationSetByID(const ID &);
-                void                                addAdaptationSet    (BaseAdaptationSet *AdaptationSet);
-                void                                debug               (vlc_object_t *,int = 0) const;
-
-                virtual mtime_t getPeriodStart() const; /* reimpl */
-                virtual AbstractPlaylist *getPlaylist() const; /* reimpl */
-
-                Property<mtime_t> duration;
-                Property<mtime_t> startTime;
-
-            private:
-                std::vector<BaseAdaptationSet *>    adaptationSets;
-                AbstractPlaylist *playlist;
-        };
-    }
-}
-
-#endif /* BASEPERIOD_H_ */
diff --git a/modules/demux/adaptative/playlist/BaseRepresentation.cpp b/modules/demux/adaptative/playlist/BaseRepresentation.cpp
deleted file mode 100644 (file)
index 130e647..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * BaseRepresentation.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cstdlib>
-
-#include "BaseRepresentation.h"
-#include "BaseAdaptationSet.h"
-#include "SegmentTemplate.h"
-#include "SegmentTimeline.h"
-#include "ID.hpp"
-
-using namespace adaptative;
-using namespace adaptative::playlist;
-
-BaseRepresentation::BaseRepresentation( BaseAdaptationSet *set ) :
-                SegmentInformation( set ),
-                adaptationSet   ( set ),
-                bandwidth       (0)
-{
-    b_consistent = true;
-}
-
-BaseRepresentation::~BaseRepresentation ()
-{
-}
-
-StreamFormat BaseRepresentation::getStreamFormat() const
-{
-    return StreamFormat();
-}
-
-uint64_t     BaseRepresentation::getBandwidth            () const
-{
-    return bandwidth;
-}
-
-void    BaseRepresentation::setBandwidth( uint64_t bandwidth )
-{
-    this->bandwidth = bandwidth;
-}
-
-const std::list<std::string> & BaseRepresentation::getCodecs() const
-{
-    return codecs;
-}
-
-void BaseRepresentation::addCodec(const std::string &codec)
-{
-    codecs.push_back(codec);
-}
-
-bool BaseRepresentation::needsUpdate() const
-{
-    return false;
-}
-
-bool BaseRepresentation::runLocalUpdates(mtime_t, uint64_t, bool)
-{
-    return false;
-}
-
-void BaseRepresentation::scheduleNextUpdate(uint64_t)
-{
-
-}
-
-bool BaseRepresentation::consistentSegmentNumber() const
-{
-    return b_consistent;
-}
-
-void BaseRepresentation::pruneByPlaybackTime(mtime_t time)
-{
-    uint64_t num;
-    if(getSegmentNumberByTime(time, &num))
-        pruneBySegmentNumber(num);
-}
-
-mtime_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
-{
-    std::vector<ISegment *> seglist;
-    getSegments(INFOTYPE_MEDIA, seglist);
-
-    if(seglist.size() == 1 && seglist.front()->isTemplate())
-    {
-        const MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate *>(seglist.front());
-        const SegmentTimeline *timeline;
-        if(templ && (timeline = templ->segmentTimeline.Get()))
-        {
-            const uint64_t timescale = templ->inheritTimescale();
-            return timeline->getMinAheadScaledTime(curnum) * CLOCK_FREQ / timescale;
-        }
-    }
-
-    mtime_t minTime = 0;
-    std::vector<ISegment *>::const_iterator it;
-    for(it = seglist.begin(); it != seglist.end(); ++it)
-    {
-        const ISegment *seg = *it;
-        if(seg->getSequenceNumber() > curnum)
-            minTime += seg->duration.Get() * CLOCK_FREQ / inheritTimescale();
-    }
-
-    return minTime;
-}
-
-void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
-{
-    std::string text(indent, ' ');
-    text.append("Representation ");
-    text.append(id.str());
-    msg_Dbg(obj, "%s", text.c_str());
-    std::vector<ISegment *> list;
-    getAllSegments(list);
-    std::vector<ISegment *>::const_iterator l;
-    for(l = list.begin(); l != list.end(); ++l)
-        (*l)->debug(obj, indent + 1);
-}
-
-std::string BaseRepresentation::contextualize(size_t, const std::string &component,
-                                              const BaseSegmentTemplate *) const
-{
-    return component;
-}
-
-bool BaseRepresentation::validateCodec(const std::string &) const
-{
-    return true;
-}
diff --git a/modules/demux/adaptative/playlist/BaseRepresentation.h b/modules/demux/adaptative/playlist/BaseRepresentation.h
deleted file mode 100644 (file)
index 578fd3d..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Representation.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef BASEREPRESENTATION_H_
-#define BASEREPRESENTATION_H_
-
-#include <string>
-#include <list>
-
-#include "CommonAttributesElements.h"
-#include "SegmentInformation.hpp"
-#include "../StreamFormat.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class BaseAdaptationSet;
-        class AbstractPlaylist;
-        class BaseSegmentTemplate;
-
-        class BaseRepresentation : public CommonAttributesElements,
-                                   public SegmentInformation
-        {
-            public:
-                BaseRepresentation( BaseAdaptationSet * );
-                virtual ~BaseRepresentation ();
-
-                virtual StreamFormat getStreamFormat() const;
-                /*
-                 *  @return The bitrate required for this representation
-                 *          in bits per seconds.
-                 *          Will be a valid value, as the parser refuses Representation
-                 *          without bandwidth.
-                 */
-                uint64_t            getBandwidth            () const;
-                void                setBandwidth            ( uint64_t bandwidth );
-                const std::list<std::string> & getCodecs    () const;
-                void                addCodec                (const std::string &);
-                bool                consistentSegmentNumber () const;
-                virtual void        pruneByPlaybackTime     (mtime_t);
-
-                virtual mtime_t     getMinAheadTime         (uint64_t) const;
-                virtual bool        needsUpdate             () const;
-                virtual bool        runLocalUpdates         (mtime_t, uint64_t, bool);
-                virtual void        scheduleNextUpdate      (uint64_t);
-
-                virtual void        debug                   (vlc_object_t *,int = 0) const;
-
-                /* for segment templates */
-                virtual std::string contextualize(size_t, const std::string &,
-                                                  const BaseSegmentTemplate *) const;
-
-            protected:
-                virtual bool        validateCodec(const std::string &) const;
-                BaseAdaptationSet                  *adaptationSet;
-                uint64_t                            bandwidth;
-                std::list<std::string>              codecs;
-                bool                                b_consistent;
-        };
-    }
-}
-
-#endif /* BASEREPRESENTATION_H_ */
diff --git a/modules/demux/adaptative/playlist/CommonAttributesElements.cpp b/modules/demux/adaptative/playlist/CommonAttributesElements.cpp
deleted file mode 100644 (file)
index ccac5aa..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*****************************************************************************
- * CommonAttributesElements.cpp: Defines the common attributes and elements
- *                               for some Dash elements.
- *****************************************************************************
- * Copyright © 2011 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "CommonAttributesElements.h"
-
-#include <vlc_common.h>
-#include <vlc_arrays.h>
-
-using namespace adaptative::playlist;
-
-CommonAttributesElements::CommonAttributesElements() :
-    width( -1 ),
-    height( -1 )
-{
-}
-
-CommonAttributesElements::~CommonAttributesElements()
-{
-}
-
-const std::string& CommonAttributesElements::getMimeType() const
-{
-    return mimeType;
-}
-
-void CommonAttributesElements::setMimeType( const std::string &mimeType )
-{
-    this->mimeType = mimeType;
-}
-
-int     CommonAttributesElements::getWidth                () const
-{
-    return width;
-}
-
-void    CommonAttributesElements::setWidth( int width )
-{
-    if ( width > 0 )
-        this->width = width;
-}
-
-int     CommonAttributesElements::getHeight               () const
-{
-    return height;
-}
-
-void    CommonAttributesElements::setHeight( int height )
-{
-    if ( height > 0 )
-        this->height = height;
-}
-
-const std::list<std::string>& CommonAttributesElements::getLang() const
-{
-    return lang;
-}
-
-void    CommonAttributesElements::addLang( const std::string &lang )
-{
-    if ( lang.empty() == false )
-        this->lang.push_back( lang );
-}
diff --git a/modules/demux/adaptative/playlist/CommonAttributesElements.h b/modules/demux/adaptative/playlist/CommonAttributesElements.h
deleted file mode 100644 (file)
index a208936..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*****************************************************************************
- * CommonAttributesElements.h: Defines the common attributes and elements
- *                             for some Dash elements.
- *****************************************************************************
- * Copyright © 2011 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef COMMONATTRIBUTESELEMENTS_H
-#define COMMONATTRIBUTESELEMENTS_H
-
-#include <list>
-#include <string>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class CommonAttributesElements
-        {
-            public:
-                CommonAttributesElements();
-                virtual ~CommonAttributesElements();
-                virtual const std::string&      getMimeType() const;
-                void                            setMimeType( const std::string &mimeType );
-                int                             getWidth() const;
-                void                            setWidth( int width );
-                int                             getHeight() const;
-                void                            setHeight( int height );
-                const std::list<std::string>&   getLang() const;
-                void                            addLang( const std::string &lang );
-
-            protected:
-                std::string                         mimeType;
-                int                                 width;
-                int                                 height;
-                std::list<std::string>              lang;
-        };
-    }
-}
-
-#endif // COMMONATTRIBUTESELEMENTS_H
diff --git a/modules/demux/adaptative/playlist/ICanonicalUrl.hpp b/modules/demux/adaptative/playlist/ICanonicalUrl.hpp
deleted file mode 100644 (file)
index b751248..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ICanonicalUrl.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef CANONICALURL_HPP
-#define CANONICALURL_HPP
-
-#include "Url.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class ICanonicalUrl
-        {
-            public:
-                ICanonicalUrl( const ICanonicalUrl *parent = NULL ) { setParent(parent); }
-                virtual Url getUrlSegment() const = 0;
-                void setParent( const ICanonicalUrl *parent ) { parentUrlMember = parent; }
-
-            protected:
-                Url getParentUrlSegment() const {
-                    return (parentUrlMember) ? parentUrlMember->getUrlSegment()
-                                             : Url();
-                }
-
-            private:
-                const ICanonicalUrl *parentUrlMember;
-        };
-    }
-}
-
-#endif // CANONICALURL_HPP
diff --git a/modules/demux/adaptative/playlist/ID.cpp b/modules/demux/adaptative/playlist/ID.cpp
deleted file mode 100644 (file)
index a475a40..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * ID.cpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "ID.hpp"
-#include <sstream>
-
-using namespace adaptative::playlist;
-
-ID::ID(const std::string &id_)
-{
-    id = id_;
-}
-
-ID::ID(uint64_t id_)
-{
-    std::stringstream ss;
-    ss.imbue(std::locale("C"));
-    ss << "default_id#" << id_;
-    id = ss.str();
-}
-
-bool ID::operator==(const ID &other) const
-{
-    return (!id.empty() && id == other.id);
-}
-
-std::string ID::str() const
-{
-    return id;
-}
-
diff --git a/modules/demux/adaptative/playlist/ID.hpp b/modules/demux/adaptative/playlist/ID.hpp
deleted file mode 100644 (file)
index bead7ab..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * ID.hpp
- *****************************************************************************
- * Copyright (C) 2015 - VideoLAN and VLC authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef ID_HPP
-#define ID_HPP
-
-#include <string>
-#include <inttypes.h>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-
-        class ID
-        {
-            public:
-                ID(const std::string &);
-                ID(uint64_t = 0);
-                bool operator==(const ID &) const;
-                std::string str() const;
-
-            private:
-                std::string id;
-        };
-
-    }
-}
-
-#endif // ID_HPP
diff --git a/modules/demux/adaptative/playlist/Inheritables.cpp b/modules/demux/adaptative/playlist/Inheritables.cpp
deleted file mode 100644 (file)
index f497f68..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * Inheritables.cpp
- *****************************************************************************
- * Copyright (C) 1998-2015 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "Inheritables.hpp"
-#include "SegmentTimeline.h"
-
-using namespace adaptative::playlist;
-
-Timelineable::Timelineable()
-{
-    segmentTimeline.Set(NULL);
-}
-
-Timelineable::~Timelineable()
-{
-    delete segmentTimeline.Get();
-}
-
-TimescaleAble::TimescaleAble(TimescaleAble *parent)
-{
-    timescale.Set(0);
-    parentTimescale = parent;
-}
-
-TimescaleAble::~TimescaleAble()
-{
-}
-
-void TimescaleAble::setParentTimescale(TimescaleAble *parent)
-{
-    parentTimescale = parent;
-}
-
-uint64_t TimescaleAble::inheritTimescale() const
-{
-    if(timescale.Get())
-        return timescale.Get();
-    else if(parentTimescale)
-        return parentTimescale->inheritTimescale();
-    else
-        return 1;
-}
-
-const ID & Unique::getID() const
-{
-    return id;
-}
-
-void Unique::setID(const ID &id_)
-{
-    id = id_;
-}
diff --git a/modules/demux/adaptative/playlist/Inheritables.hpp b/modules/demux/adaptative/playlist/Inheritables.hpp
deleted file mode 100644 (file)
index 63da716..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*****************************************************************************
- * Inheritables.hpp Nodes inheritables properties
- *****************************************************************************
- * Copyright (C) 1998-2015 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef INHERITABLES_H
-#define INHERITABLES_H
-
-#include "../tools/Properties.hpp"
-#include <string>
-#include <stdint.h>
-#include "ID.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class SegmentTimeline;
-
-        class Timelineable
-        {
-            public:
-                Timelineable();
-                ~Timelineable();
-                Property<SegmentTimeline *> segmentTimeline;
-        };
-
-        class TimescaleAble
-        {
-            public:
-                TimescaleAble( TimescaleAble * = NULL );
-                ~TimescaleAble();
-                void setParentTimescale( TimescaleAble * );
-                uint64_t inheritTimescale() const;
-                Property<uint64_t> timescale;
-
-            protected:
-                TimescaleAble *parentTimescale;
-        };
-
-        class Unique
-        {
-            public:
-                const ID & getID() const;
-                void       setID(const ID &);
-
-            protected:
-                ID id;
-        };
-    }
-}
-
-#endif // INHERITABLES_H
diff --git a/modules/demux/adaptative/playlist/Segment.cpp b/modules/demux/adaptative/playlist/Segment.cpp
deleted file mode 100644 (file)
index d196d2b..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Segment.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "Segment.h"
-#include "BaseRepresentation.h"
-#include "AbstractPlaylist.hpp"
-#include "SegmentChunk.hpp"
-#include "../http/BytesRange.hpp"
-#include "../http/HTTPConnectionManager.h"
-#include "../http/Downloader.hpp"
-#include <cassert>
-
-using namespace adaptative::http;
-using namespace adaptative::playlist;
-
-const int ISegment::SEQUENCE_INVALID = 0;
-const int ISegment::SEQUENCE_FIRST   = 1;
-
-ISegment::ISegment(const ICanonicalUrl *parent):
-    ICanonicalUrl( parent ),
-    startByte  (0),
-    endByte    (0)
-{
-    debugName = "Segment";
-    classId = CLASSID_ISEGMENT;
-    startTime.Set(0);
-    duration.Set(0);
-    chunksuse.Set(0);
-    sequence = SEQUENCE_INVALID;
-    templated = false;
-    discontinuity = false;
-}
-
-ISegment::~ISegment()
-{
-    assert(chunksuse.Get() == 0);
-}
-
-SegmentChunk * ISegment::getChunk(const std::string &url, HTTPConnectionManager *connManager)
-{
-    HTTPChunkBufferedSource *source = new HTTPChunkBufferedSource(url, connManager);
-    if(startByte != endByte)
-        source->setBytesRange(BytesRange(startByte, endByte));
-    connManager->downloader->schedule(source);
-    return new (std::nothrow) SegmentChunk(this, source);
-}
-
-void ISegment::onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *)
-{
-
-}
-
-SegmentChunk* ISegment::toChunk(size_t index, BaseRepresentation *ctxrep, HTTPConnectionManager *connManager)
-{
-    SegmentChunk *chunk;
-    try
-    {
-        chunk = getChunk(getUrlSegment().toString(index, ctxrep), connManager);
-        if (!chunk)
-            return NULL;
-    }
-    catch (int)
-    {
-        return NULL;
-    };
-
-    chunk->setRepresentation(ctxrep);
-
-    return chunk;
-}
-
-bool ISegment::isTemplate() const
-{
-    return templated;
-}
-
-void ISegment::setByteRange(size_t start, size_t end)
-{
-    startByte = start;
-    endByte   = end;
-}
-
-void ISegment::setSequenceNumber(uint64_t seq)
-{
-    sequence = SEQUENCE_FIRST + seq;
-}
-
-uint64_t ISegment::getSequenceNumber() const
-{
-    return sequence;
-}
-
-size_t ISegment::getOffset() const
-{
-    return startByte;
-}
-
-void ISegment::debug(vlc_object_t *obj, int indent) const
-{
-    std::stringstream ss;
-    ss.imbue(std::locale("C"));
-    ss << std::string(indent, ' ') << debugName << " #" << getSequenceNumber();
-    ss << " url=" << getUrlSegment().toString();
-    if(startByte!=endByte)
-        ss << " @" << startByte << ".." << endByte;
-    msg_Dbg(obj, "%s", ss.str().c_str());
-}
-
-bool ISegment::contains(size_t byte) const
-{
-    if (startByte == endByte)
-        return false;
-    return (byte >= startByte &&
-            (!endByte || byte <= endByte) );
-}
-
-int ISegment::compare(ISegment *other) const
-{
-    if(duration.Get())
-    {
-        stime_t diff = startTime.Get() - other->startTime.Get();
-        if(diff)
-            return diff / diff;
-    }
-
-    size_t diff = startByte - other->startByte;
-    if(diff)
-        return diff / diff;
-
-    diff = endByte - other->endByte;
-    if(diff)
-        return diff / diff;
-
-    return 0;
-}
-
-int ISegment::getClassId() const
-{
-    return classId;
-}
-
-Segment::Segment(ICanonicalUrl *parent) :
-        ISegment(parent)
-{
-    size = -1;
-    classId = CLASSID_SEGMENT;
-}
-
-void Segment::addSubSegment(SubSegment *subsegment)
-{
-    if(!subsegments.empty())
-    {
-        /* Use our own sequence number, and since it it now
-           uneffective, also for next subsegments numbering */
-        subsegment->setSequenceNumber(getSequenceNumber());
-        setSequenceNumber(getSequenceNumber());
-    }
-    subsegments.push_back(subsegment);
-}
-
-Segment::~Segment()
-{
-    std::vector<SubSegment*>::iterator it;
-    for(it=subsegments.begin();it!=subsegments.end();++it)
-        delete *it;
-}
-
-void                    Segment::setSourceUrl   ( const std::string &url )
-{
-    if ( url.empty() == false )
-        this->sourceUrl = Url(url);
-}
-
-void Segment::debug(vlc_object_t *obj, int indent) const
-{
-    if (subsegments.empty())
-    {
-        ISegment::debug(obj, indent);
-    }
-    else
-    {
-        std::string text(indent, ' ');
-        text.append("Segment");
-        msg_Dbg(obj, "%s", text.c_str());
-        std::vector<SubSegment *>::const_iterator l;
-        for(l = subsegments.begin(); l != subsegments.end(); ++l)
-            (*l)->debug(obj, indent + 1);
-    }
-}
-
-Url Segment::getUrlSegment() const
-{
-    if(sourceUrl.hasScheme())
-    {
-        return sourceUrl;
-    }
-    else
-    {
-        Url ret = getParentUrlSegment();
-        if (!sourceUrl.empty())
-            ret.append(sourceUrl);
-        return ret;
-    }
-}
-
-std::vector<ISegment*> Segment::subSegments()
-{
-    std::vector<ISegment*> list;
-    if(!subsegments.empty())
-    {
-        std::vector<SubSegment*>::iterator it;
-        for(it=subsegments.begin();it!=subsegments.end();++it)
-            list.push_back(*it);
-    }
-    else
-    {
-        list.push_back(this);
-    }
-    return list;
-}
-
-InitSegment::InitSegment(ICanonicalUrl *parent) :
-    Segment(parent)
-{
-    debugName = "InitSegment";
-    classId = CLASSID_INITSEGMENT;
-}
-
-IndexSegment::IndexSegment(ICanonicalUrl *parent) :
-    Segment(parent)
-{
-    debugName = "IndexSegment";
-    classId = CLASSID_INDEXSEGMENT;
-}
-
-SubSegment::SubSegment(ISegment *main, size_t start, size_t end) :
-    ISegment(main), parent(main)
-{
-    setByteRange(start, end);
-    debugName = "SubSegment";
-    classId = CLASSID_SUBSEGMENT;
-}
-
-Url SubSegment::getUrlSegment() const
-{
-    return getParentUrlSegment();
-}
-
-std::vector<ISegment*> SubSegment::subSegments()
-{
-    std::vector<ISegment*> list;
-    list.push_back(this);
-    return list;
-}
-
-void SubSegment::addSubSegment(SubSegment *)
-{
-
-}
diff --git a/modules/demux/adaptative/playlist/Segment.h b/modules/demux/adaptative/playlist/Segment.h
deleted file mode 100644 (file)
index 84b0fee..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Segment.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENT_H_
-#define SEGMENT_H_
-
-#include <string>
-#include <sstream>
-#include <vector>
-#include "ICanonicalUrl.hpp"
-#include "../http/Chunk.h"
-#include "../tools/Properties.hpp"
-#include "Time.hpp"
-
-namespace adaptative
-{
-    namespace http
-    {
-        class HTTPConnectionManager;
-    }
-
-    namespace playlist
-    {
-        class BaseRepresentation;
-        class SubSegment;
-        class SegmentChunk;
-
-        using namespace http;
-
-        class ISegment : public ICanonicalUrl
-        {
-            public:
-                ISegment(const ICanonicalUrl *parent);
-                virtual ~ISegment();
-                /**
-                 *  @return true if the segment should be dropped after being read.
-                 *          That is basically true when using an Url, and false
-                 *          when using an UrlTemplate
-                 */
-                virtual SegmentChunk*                   toChunk         (size_t, BaseRepresentation *, HTTPConnectionManager *);
-                virtual void                            setByteRange    (size_t start, size_t end);
-                virtual void                            setSequenceNumber(uint64_t);
-                virtual uint64_t                        getSequenceNumber() const;
-                virtual bool                            isTemplate      () const;
-                virtual size_t                          getOffset       () const;
-                virtual std::vector<ISegment*>          subSegments     () = 0;
-                virtual void                            addSubSegment   (SubSegment *) = 0;
-                virtual void                            debug           (vlc_object_t *,int = 0) const;
-                virtual bool                            contains        (size_t byte) const;
-                virtual int                             compare         (ISegment *) const;
-                int                                     getClassId      () const;
-                Property<stime_t>       startTime;
-                Property<stime_t>       duration;
-                Property<unsigned>      chunksuse;
-                bool                    discontinuity;
-
-                static const int CLASSID_ISEGMENT = 0;
-                /* callbacks */
-                virtual void                            onChunkDownload (block_t **, SegmentChunk *, BaseRepresentation *);
-
-            protected:
-                size_t                  startByte;
-                size_t                  endByte;
-                std::string             debugName;
-                int                     classId;
-                bool                    templated;
-                uint64_t                sequence;
-                static const int        SEQUENCE_INVALID;
-                static const int        SEQUENCE_FIRST;
-
-                virtual SegmentChunk * getChunk(const std::string &, HTTPConnectionManager *);
-        };
-
-        class Segment : public ISegment
-        {
-            public:
-                Segment( ICanonicalUrl *parent );
-                ~Segment();
-                virtual void setSourceUrl( const std::string &url );
-                virtual Url getUrlSegment() const; /* impl */
-                virtual std::vector<ISegment*> subSegments();
-                virtual void debug(vlc_object_t *,int = 0) const;
-                virtual void addSubSegment(SubSegment *);
-                static const int CLASSID_SEGMENT = 1;
-
-            protected:
-                std::vector<SubSegment *> subsegments;
-                Url sourceUrl;
-                int size;
-        };
-
-        class InitSegment : public Segment
-        {
-            public:
-                InitSegment( ICanonicalUrl *parent );
-                static const int CLASSID_INITSEGMENT = 2;
-        };
-
-        class IndexSegment : public Segment
-        {
-            public:
-                IndexSegment( ICanonicalUrl *parent );
-                static const int CLASSID_INDEXSEGMENT = 3;
-        };
-
-        class SubSegment : public ISegment
-        {
-            public:
-                SubSegment(ISegment *, size_t start, size_t end);
-                virtual Url getUrlSegment() const; /* impl */
-                virtual std::vector<ISegment*> subSegments();
-                virtual void addSubSegment(SubSegment *);
-                static const int CLASSID_SUBSEGMENT = 4;
-            private:
-                ISegment *parent;
-        };
-    }
-}
-
-#endif /* SEGMENT_H_ */
diff --git a/modules/demux/adaptative/playlist/SegmentBase.cpp b/modules/demux/adaptative/playlist/SegmentBase.cpp
deleted file mode 100644 (file)
index 573751c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SegmentBase.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2012 Klagenfurt University
- *
- * Created on: Jan 27, 2012
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "SegmentBase.h"
-
-using namespace adaptative::playlist;
-
-SegmentBase::SegmentBase(ICanonicalUrl *parent) :
-             Segment(parent),
-             Initializable(),
-             Indexable()
-{
-}
-SegmentBase::~SegmentBase   ()
-{
-}
diff --git a/modules/demux/adaptative/playlist/SegmentBase.h b/modules/demux/adaptative/playlist/SegmentBase.h
deleted file mode 100644 (file)
index f9c55ad..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SegmentBase.h
- *****************************************************************************
- * Copyright (C) 2010 - 2012 Klagenfurt University
- *
- * Created on: Jan 27, 2012
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENTBASE_H_
-#define SEGMENTBASE_H_
-
-#include "Segment.h"
-#include "SegmentInfoCommon.h"
-#include "../tools/Properties.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        /* SegmentBase can contain only one segment */
-        class SegmentBase : public Segment,
-                            public Initializable<Segment>,
-                            public Indexable<Segment>
-        {
-            public:
-                SegmentBase             (ICanonicalUrl *);
-                virtual ~SegmentBase    ();
-        };
-    }
-}
-
-#endif /* SEGMENTBASE_H_ */
diff --git a/modules/demux/adaptative/playlist/SegmentChunk.cpp b/modules/demux/adaptative/playlist/SegmentChunk.cpp
deleted file mode 100644 (file)
index 031a31a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * SegmentChunk.cpp
- *****************************************************************************
- * Copyright (C) 2014 - 2015 VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "SegmentChunk.hpp"
-#include "Segment.h"
-#include "BaseRepresentation.h"
-#include <cassert>
-
-using namespace adaptative::playlist;
-using namespace adaptative;
-
-SegmentChunk::SegmentChunk(ISegment *segment_, AbstractChunkSource *source) :
-    AbstractChunk(source)
-{
-    segment = segment_;
-    segment->chunksuse.Set(segment->chunksuse.Get() + 1);
-    rep = NULL;
-    discontinuity = segment_->discontinuity;
-}
-
-SegmentChunk::~SegmentChunk()
-{
-    assert(segment->chunksuse.Get() > 0);
-    segment->chunksuse.Set(segment->chunksuse.Get() - 1);
-}
-
-void SegmentChunk::setRepresentation(BaseRepresentation *rep_)
-{
-    rep = rep_;
-}
-
-void SegmentChunk::onDownload(block_t **pp_block)
-{
-    segment->onChunkDownload(pp_block, this, rep);
-}
-
-StreamFormat SegmentChunk::getStreamFormat() const
-{
-    if(rep)
-        return rep->getStreamFormat();
-    else
-        return StreamFormat();
-}
-
diff --git a/modules/demux/adaptative/playlist/SegmentChunk.hpp b/modules/demux/adaptative/playlist/SegmentChunk.hpp
deleted file mode 100644 (file)
index 3711bc0..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SegmentChunk.hpp
- *****************************************************************************
- * Copyright (C) 2014 - 2015 VideoLAN Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef SEGMENTCHUNK_HPP
-#define SEGMENTCHUNK_HPP
-
-#include <string>
-#include "ICanonicalUrl.hpp"
-#include "../http/Chunk.h"
-#include "../StreamFormat.hpp"
-
-namespace adaptative
-{
-
-    namespace playlist
-    {
-        using namespace http;
-
-        class BaseRepresentation;
-        class ISegment;
-
-        class SegmentChunk : public AbstractChunk
-        {
-        public:
-            SegmentChunk(ISegment *segment, AbstractChunkSource *);
-            virtual ~SegmentChunk();
-            void setRepresentation(BaseRepresentation *);
-            virtual void onDownload(block_t **); // reimpl
-            StreamFormat getStreamFormat() const;
-            bool discontinuity;
-
-        protected:
-            ISegment *segment;
-            BaseRepresentation *rep;
-        };
-
-    }
-}
-#endif // SEGMENTCHUNK_HPP
diff --git a/modules/demux/adaptative/playlist/SegmentInfoCommon.cpp b/modules/demux/adaptative/playlist/SegmentInfoCommon.cpp
deleted file mode 100644 (file)
index 8e91b88..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*****************************************************************************
- * SegmentInfoCommon.cpp: Implement the common part for both SegmentInfoDefault
- *                        and SegmentInfo
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "SegmentInfoCommon.h"
-
-using namespace adaptative::playlist;
-
-SegmentInfoCommon::SegmentInfoCommon( ICanonicalUrl *parent ) :
-    ICanonicalUrl( parent ), Initializable(), Indexable(),
-    startIndex( 0 )
-{
-    duration.Set(0);
-}
-
-SegmentInfoCommon::~SegmentInfoCommon()
-{
-}
-
-int         SegmentInfoCommon::getStartIndex() const
-{
-    return this->startIndex;
-}
-
-void        SegmentInfoCommon::setStartIndex(int startIndex)
-{
-    if ( startIndex >= 0 )
-        this->startIndex = startIndex;
-}
-
-void SegmentInfoCommon::appendBaseURL(const std::string &url)
-{
-    this->baseURLs.push_back( url );
-}
-
-Url SegmentInfoCommon::getUrlSegment() const
-{
-    Url ret = getParentUrlSegment();
-    if (!baseURLs.empty())
-        ret.append(baseURLs.front());
-    return ret;
-}
-
-bool SegmentInfoCommon::getSegmentNumberByScaledTime(const std::vector<ISegment *> &segments,
-                                                      stime_t time, uint64_t *ret)
-{
-    if(segments.empty() || (segments.size() > 1 && segments[1]->startTime.Get() == 0) )
-        return false;
-
-    *ret = 0;
-
-    std::vector<ISegment *>::const_iterator it = segments.begin();
-    while(it != segments.end())
-    {
-        const ISegment *seg = *it;
-        if(seg->startTime.Get() > time)
-        {
-            if(it == segments.begin())
-                return false;
-            else
-                break;
-        }
-
-        *ret = seg->getSequenceNumber();
-        it++;
-    }
-
-    return true;
-}
diff --git a/modules/demux/adaptative/playlist/SegmentInfoCommon.h b/modules/demux/adaptative/playlist/SegmentInfoCommon.h
deleted file mode 100644 (file)
index e813a25..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * SegmentInfoCommon.h: Implement the common part for both SegmentInfoDefault
- *                      and SegmentInfo
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENTINFOCOMMON_H
-#define SEGMENTINFOCOMMON_H
-
-#include <string>
-#include <list>
-#include "Inheritables.hpp"
-#include "Templates.hpp"
-#include "Segment.h"
-#include "ICanonicalUrl.hpp"
-#include "../tools/Properties.hpp"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class Segment;
-
-        class SegmentInfoCommon : public ICanonicalUrl,
-                                  public Initializable<Segment>,
-                                  public Indexable<Segment>
-        {
-            public:
-                SegmentInfoCommon( ICanonicalUrl *parent = NULL );
-                virtual ~SegmentInfoCommon();
-                int                     getStartIndex() const;
-                void                    setStartIndex( int startIndex );
-                void                    appendBaseURL( const std::string& url );
-                virtual Url             getUrlSegment() const; /* impl */
-                Property<stime_t>      duration;
-                static bool             getSegmentNumberByScaledTime(const std::vector<ISegment *> &,
-                                                                     stime_t, uint64_t *);
-
-            private:
-                int                     startIndex;
-                std::list<std::string>  baseURLs;
-        };
-    }
-}
-
-#endif // SEGMENTINFOCOMMON_H
diff --git a/modules/demux/adaptative/playlist/SegmentInformation.cpp b/modules/demux/adaptative/playlist/SegmentInformation.cpp
deleted file mode 100644 (file)
index a07d3a0..0000000
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * SegmentInformation.cpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#include "SegmentInformation.hpp"
-
-#include "Segment.h"
-#include "SegmentBase.h"
-#include "SegmentList.h"
-#include "SegmentTemplate.h"
-#include "SegmentTimeline.h"
-#include "AbstractPlaylist.hpp"
-#include "BaseRepresentation.h"
-
-#include <algorithm>
-#include <cassert>
-
-using namespace adaptative::playlist;
-
-SegmentInformation::SegmentInformation(SegmentInformation *parent_) :
-    ICanonicalUrl( parent_ ),
-    TimescaleAble( parent_ )
-{
-    parent = parent_;
-    init();
-}
-
-SegmentInformation::SegmentInformation(AbstractPlaylist * parent_) :
-    ICanonicalUrl(parent_),
-    TimescaleAble()
-{
-    parent = NULL;
-    init();
-}
-
-void SegmentInformation::init()
-{
-    baseUrl.Set(NULL);
-    segmentBase = NULL;
-    segmentList = NULL;
-    mediaSegmentTemplate = NULL;
-    switchpolicy = SWITCH_UNKNOWN;
-}
-
-SegmentInformation::~SegmentInformation()
-{
-    delete segmentBase;
-    delete segmentList;
-    delete mediaSegmentTemplate;
-}
-
-AbstractPlaylist * SegmentInformation::getPlaylist() const
-{
-    if(parent)
-        return parent->getPlaylist();
-    else
-        return NULL;
-}
-
-std::size_t SegmentInformation::getSegments(SegmentInfoType type, std::vector<ISegment *> &retSegments) const
-{
-    switch (type)
-    {
-        case INFOTYPE_INIT:
-        {
-            /* init segments are always single segment */
-            if( segmentBase && segmentBase->initialisationSegment.Get() )
-            {
-                retSegments.push_back( segmentBase->initialisationSegment.Get() );
-            }
-            else if( segmentList && segmentList->initialisationSegment.Get() )
-            {
-                retSegments.push_back( segmentList->initialisationSegment.Get() );
-            }
-            else if( mediaSegmentTemplate && mediaSegmentTemplate->initialisationSegment.Get() )
-            {
-                retSegments.push_back( mediaSegmentTemplate->initialisationSegment.Get() );
-            }
-        }
-        break;
-
-        case INFOTYPE_MEDIA:
-        {
-            if( mediaSegmentTemplate )
-            {
-                retSegments.push_back( mediaSegmentTemplate );
-            }
-            else if ( segmentList && !segmentList->getSegments().empty() )
-            {
-                std::vector<ISegment *>::const_iterator it;
-                for(it=segmentList->getSegments().begin();
-                    it!=segmentList->getSegments().end(); ++it)
-                {
-                    std::vector<ISegment *> list = (*it)->subSegments();
-                    retSegments.insert( retSegments.end(), list.begin(), list.end() );
-                }
-            }
-            else if( segmentBase )
-            {
-                std::vector<ISegment *> list = segmentBase->subSegments();
-                retSegments.insert( retSegments.end(), list.begin(), list.end() );
-            }
-        }
-        break;
-
-        case INFOTYPE_INDEX:
-        {
-            /* index segments are always single segment */
-            if( segmentBase && segmentBase->indexSegment.Get() )
-            {
-                retSegments.push_back( segmentBase->indexSegment.Get() );
-            }
-            else if( segmentList && segmentList->indexSegment.Get() )
-            {
-                retSegments.push_back( segmentList->indexSegment.Get() );
-            }
-            // templated index ?
-        }
-
-        default:
-        break;
-    }
-
-    if( retSegments.empty() && parent )
-    {
-        return parent->getSegments( type, retSegments );
-    }
-    else
-    {
-        return retSegments.size();
-    }
-}
-
-std::size_t SegmentInformation::getAllSegments(std::vector<ISegment *> &retSegments) const
-{
-    for(int i=0; i<InfoTypeCount; i++)
-    {
-        std::vector<ISegment *> segs;
-        if( getSegments(static_cast<SegmentInfoType>(i), segs) )
-            retSegments.insert( retSegments.end(), segs.begin(), segs.end() );
-    }
-    return retSegments.size();
-}
-
-uint64_t SegmentInformation::getLiveStartSegmentNumber(uint64_t def) const
-{
-    if( mediaSegmentTemplate )
-    {
-        SegmentTimeline *timeline = mediaSegmentTemplate->segmentTimeline.Get();
-        if(timeline)
-        {
-            const uint64_t start = timeline->minElementNumber();
-            const uint64_t end = timeline->maxElementNumber();
-            if(end > 2 && (end - start >= 2))
-                return end - 2;
-            else
-                return start;
-        }
-        return mediaSegmentTemplate->startNumber.Get();
-    }
-    else if ( segmentList && !segmentList->getSegments().empty() )
-    {
-        const std::vector<ISegment *> list = segmentList->getSegments();
-        if(list.size() > 3)
-            return list.at(list.size() - 3)->getSequenceNumber();
-        else if(!list.empty())
-            return list.front()->getSequenceNumber();
-        else
-            return segmentList->getStartIndex();
-    }
-    else if( segmentBase )
-    {
-        const std::vector<ISegment *> list = segmentBase->subSegments();
-        if(list.size() > 3)
-            return list.at(list.size() - 3)->getSequenceNumber();
-        else if(!list.empty())
-            return list.front()->getSequenceNumber();
-        else
-            return segmentBase->getSequenceNumber();
-    }
-
-    if(parent)
-        return parent->getLiveStartSegmentNumber(def);
-    else
-        return def;
-}
-
-/* Returns wanted segment, or next in sequence if not found */
-ISegment * SegmentInformation::getNextSegment(SegmentInfoType type, uint64_t i_pos,
-                                              uint64_t *pi_newpos, bool *pb_gap) const
-{
-    *pb_gap = false;
-    *pi_newpos = i_pos;
-    if( type != INFOTYPE_MEDIA )
-        return NULL;
-
-    std::vector<ISegment *> retSegments;
-    const size_t size = getSegments( type, retSegments );
-    if( size )
-    {
-        std::vector<ISegment *>::const_iterator it;
-        for(it = retSegments.begin(); it != retSegments.end(); ++it)
-        {
-            ISegment *seg = *it;
-            if(seg->isTemplate()) /* we don't care about seq number */
-            {
-                /* Check if we don't exceed timeline */
-                MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate*>(retSegments[0]);
-                SegmentTimeline *timeline = (templ) ? templ->segmentTimeline.Get() : NULL;
-                if(timeline)
-                {
-                    *pi_newpos = std::max(timeline->minElementNumber(), i_pos);
-                    if(timeline->maxElementNumber() < i_pos)
-                        return NULL;
-                }
-                else
-                {
-                    *pi_newpos = i_pos;
-                    /* start number */
-                    *pi_newpos = std::max((uint64_t)templ->startNumber.Get(), i_pos);
-                }
-                return seg;
-            }
-            else if(seg->getSequenceNumber() >= i_pos)
-            {
-                *pi_newpos = seg->getSequenceNumber();
-                *pb_gap = (*pi_newpos != i_pos);
-                return seg;
-            }
-        }
-    }
-
-    return NULL;
-}
-
-ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) const
-{
-    std::vector<ISegment *> retSegments;
-    const size_t size = getSegments( type, retSegments );
-    if( size )
-    {
-        if(size == 1 && retSegments[0]->isTemplate())
-        {
-            MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate*>(retSegments[0]);
-            if(!templ || templ->segmentTimeline.Get() == NULL ||
-               templ->segmentTimeline.Get()->maxElementNumber() > pos)
-                return templ;
-        }
-        else
-        {
-            std::vector<ISegment *>::const_iterator it;
-            for(it = retSegments.begin(); it != retSegments.end(); ++it)
-            {
-                ISegment *seg = *it;
-                if(seg->getSequenceNumber() >= pos)
-                {
-                    if(seg->getSequenceNumber() == pos)
-                        return seg;
-                    else
-                        return NULL;
-                }
-            }
-        }
-    }
-
-    return NULL;
-}
-
-bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) const
-{
-    if( mediaSegmentTemplate )
-    {
-        const uint64_t timescale = mediaSegmentTemplate->inheritTimescale();
-
-        SegmentTimeline *timeline = mediaSegmentTemplate->segmentTimeline.Get();
-        if(timeline)
-        {
-            time = time * timescale / CLOCK_FREQ;
-            *ret = timeline->getElementNumberByScaledPlaybackTime(time);
-            return true;
-        }
-
-        const mtime_t duration = mediaSegmentTemplate->duration.Get();
-        *ret = mediaSegmentTemplate->startNumber.Get();
-        if(duration)
-        {
-            *ret += time / (CLOCK_FREQ * duration / timescale);
-            return true;
-        }
-    }
-    else if ( segmentList && !segmentList->getSegments().empty() )
-    {
-        const uint64_t timescale = segmentList->inheritTimescale();
-        time = time * timescale / CLOCK_FREQ;
-        return segmentList->getSegmentNumberByScaledTime(time, ret);
-    }
-    else if( segmentBase )
-    {
-        const uint64_t timescale = inheritTimescale();
-        time = time * timescale / CLOCK_FREQ;
-        *ret = 0;
-        const std::vector<ISegment *> list = segmentBase->subSegments();
-        return SegmentInfoCommon::getSegmentNumberByScaledTime(list, time, ret);
-    }
-
-    if(parent)
-        return parent->getSegmentNumberByTime(time, ret);
-    else
-        return false;
-}
-
-mtime_t SegmentInformation::getPlaybackTimeBySegmentNumber(uint64_t number) const
-{
-    SegmentList *segList;
-    MediaSegmentTemplate *mediaTemplate;
-    mtime_t time = 0;
-    if( (mediaTemplate = inheritSegmentTemplate()) )
-    {
-        uint64_t timescale = mediaTemplate->inheritTimescale();
-        if(mediaTemplate->segmentTimeline.Get())
-        {
-            time = mediaTemplate->segmentTimeline.Get()->
-                    getScaledPlaybackTimeByElementNumber(number);
-        }
-        else
-        {
-            time = number * mediaTemplate->duration.Get();
-        }
-        time = CLOCK_FREQ * time / timescale;
-    }
-    else if ( (segList = inheritSegmentList()) )
-    {
-        time = segList->getPlaybackTimeBySegmentNumber(number);
-    }
-
-    return time;
-}
-
-SegmentInformation * SegmentInformation::getChildByID(const ID &id)
-{
-    std::vector<SegmentInformation *>::const_iterator it;
-    for(it=childs.begin(); it!=childs.end(); ++it)
-    {
-        if( (*it)->getID() == id )
-            return *it;
-    }
-    return NULL;
-}
-
-void SegmentInformation::mergeWith(SegmentInformation *updated, mtime_t prunetime)
-{
-    /* Support Segment List for now */
-    if(segmentList && updated->segmentList)
-        segmentList->mergeWith(updated->segmentList);
-
-    if(mediaSegmentTemplate && updated->mediaSegmentTemplate)
-        mediaSegmentTemplate->mergeWith(updated->mediaSegmentTemplate, prunetime);
-
-    std::vector<SegmentInformation *>::const_iterator it;
-    for(it=childs.begin(); it!=childs.end(); ++it)
-    {
-        SegmentInformation *child = *it;
-        SegmentInformation *updatedChild = updated->getChildByID(child->getID());
-        if(updatedChild)
-            child->mergeWith(updatedChild, prunetime);
-    }
-    /* FIXME: handle difference */
-}
-
-void SegmentInformation::mergeWithTimeline(SegmentTimeline *updated)
-{
-    MediaSegmentTemplate *templ = inheritSegmentTemplate();
-    if(templ)
-    {
-        SegmentTimeline *timeline = templ->segmentTimeline.Get();
-        if(timeline)
-            timeline->mergeWith(*updated);
-    }
-}
-
-void SegmentInformation::pruneByPlaybackTime(mtime_t time)
-{
-    if(segmentList)
-        segmentList->pruneByPlaybackTime(time);
-
-    if(mediaSegmentTemplate)
-        mediaSegmentTemplate->pruneByPlaybackTime(time);
-
-    std::vector<SegmentInformation *>::const_iterator it;
-    for(it=childs.begin(); it!=childs.end(); ++it)
-        (*it)->pruneByPlaybackTime(time);
-}
-
-void SegmentInformation::pruneBySegmentNumber(uint64_t num)
-{
-    assert(dynamic_cast<BaseRepresentation *>(this));
-
-    if(segmentList)
-        segmentList->pruneBySegmentNumber(num);
-
-    if(mediaSegmentTemplate)
-         mediaSegmentTemplate->pruneBySequenceNumber(num);
-}
-
-uint64_t SegmentInformation::translateSegmentNumber(uint64_t num, const SegmentInformation *from) const
-{
-    mtime_t time = from->getPlaybackTimeBySegmentNumber(num);
-    getSegmentNumberByTime(time, &num);
-    return num;
-}
-
-SegmentInformation::SwitchPolicy SegmentInformation::getSwitchPolicy() const
-{
-    if(switchpolicy == SWITCH_UNKNOWN)
-        return (parent) ? parent->getSwitchPolicy() : SWITCH_UNAVAILABLE;
-    else
-        return switchpolicy;
-}
-
-mtime_t SegmentInformation::getPeriodStart() const
-{
-    if(parent)
-        return parent->getPeriodStart();
-    else
-        return 0;
-}
-
-void SegmentInformation::setSegmentList(SegmentList *list)
-{
-    if(segmentList)
-    {
-        segmentList->mergeWith(list);
-        delete list;
-    }
-    else
-    {
-        segmentList = list;
-    }
-}
-
-void SegmentInformation::setSegmentBase(SegmentBase *base)
-{
-    if(segmentBase)
-        delete segmentBase;
-    segmentBase = base;
-}
-
-void SegmentInformation::setSegmentTemplate(MediaSegmentTemplate *templ)
-{
-    if(mediaSegmentTemplate)
-    {
-        mediaSegmentTemplate->mergeWith(templ, 0);
-        delete templ;
-    }
-    else
-        mediaSegmentTemplate = templ;
-}
-
-static void insertIntoSegment(std::vector<ISegment *> &seglist, size_t start,
-                              size_t end, stime_t time)
-{
-    std::vector<ISegment *>::iterator segIt;
-    for(segIt = seglist.begin(); segIt < seglist.end(); ++segIt)
-    {
-        ISegment *segment = *segIt;
-        if(segment->getClassId() == Segment::CLASSID_SEGMENT &&
-           segment->contains(end + segment->getOffset()))
-        {
-            SubSegment *subsegment = new SubSegment(segment,
-                                                    start + segment->getOffset(),
-                                                    (end != 0) ? end + segment->getOffset() : 0);
-            subsegment->startTime.Set(time);
-            segment->addSubSegment(subsegment);
-            break;
-        }
-    }
-}
-
-void SegmentInformation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
-{
-    std::vector<ISegment *> seglist;
-    getSegments(INFOTYPE_MEDIA, seglist);
-    std::vector<SplitPoint>::const_iterator splitIt;
-    size_t start = 0, end = 0;
-    mtime_t time = 0;
-    const uint64_t i_timescale = inheritTimescale();
-
-    for(splitIt = splitlist.begin(); splitIt < splitlist.end(); ++splitIt)
-    {
-        start = end;
-        SplitPoint split = *splitIt;
-        end = split.offset;
-        if(splitIt == splitlist.begin() && split.offset == 0)
-            continue;
-        time = split.time;
-        insertIntoSegment(seglist, start, end - 1, time * i_timescale / CLOCK_FREQ);
-    }
-
-    if(start != 0)
-    {
-        start = end;
-        end = 0;
-        insertIntoSegment(seglist, start, end, time * i_timescale / CLOCK_FREQ);
-    }
-}
-
-void SegmentInformation::setSwitchPolicy(SegmentInformation::SwitchPolicy policy)
-{
-    switchpolicy = policy;
-}
-
-Url SegmentInformation::getUrlSegment() const
-{
-    if(baseUrl.Get() && baseUrl.Get()->hasScheme())
-    {
-        return *(baseUrl.Get());
-    }
-    else
-    {
-        Url ret = getParentUrlSegment();
-        if (baseUrl.Get())
-            ret.append(*(baseUrl.Get()));
-        return ret;
-    }
-}
-
-SegmentBase * SegmentInformation::inheritSegmentBase() const
-{
-    if(segmentBase)
-        return segmentBase;
-    else if (parent)
-        return parent->inheritSegmentBase();
-    else
-        return NULL;
-}
-
-SegmentList * SegmentInformation::inheritSegmentList() const
-{
-    if(segmentList)
-        return segmentList;
-    else if (parent)
-        return parent->inheritSegmentList();
-    else
-        return NULL;
-}
-
-MediaSegmentTemplate * SegmentInformation::inheritSegmentTemplate() const
-{
-    if(mediaSegmentTemplate)
-        return mediaSegmentTemplate;
-    else if (parent)
-        return parent->inheritSegmentTemplate();
-    else
-        return NULL;
-}
diff --git a/modules/demux/adaptative/playlist/SegmentInformation.hpp b/modules/demux/adaptative/playlist/SegmentInformation.hpp
deleted file mode 100644 (file)
index 38eddc3..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * SegmentInformation.hpp
- *****************************************************************************
- * Copyright (C) 2014 - VideoLAN and VLC Authors
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef SEGMENTINFORMATION_HPP
-#define SEGMENTINFORMATION_HPP
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "ICanonicalUrl.hpp"
-#include "../tools/Properties.hpp"
-#include "SegmentInfoCommon.h"
-#include <vlc_common.h>
-#include <vector>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class SegmentBase;
-        class SegmentList;
-        class SegmentTimeline;
-        class SegmentTemplate;
-        class AbstractPlaylist;
-        class ISegment;
-
-        /* common segment elements for period/adaptset/rep 5.3.9.1,
-         * with properties inheritance */
-        class SegmentInformation : public ICanonicalUrl,
-                                   public TimescaleAble,
-                                   public Unique
-        {
-            public:
-                SegmentInformation( SegmentInformation * = 0 );
-                explicit SegmentInformation( AbstractPlaylist * );
-                virtual ~SegmentInformation();
-                typedef enum SwitchPolicy
-                {
-                    SWITCH_UNKNOWN,
-                    SWITCH_UNAVAILABLE,
-                    SWITCH_SEGMENT_ALIGNED,
-                    SWITCH_BITSWITCHEABLE
-                } SwitchPolicy;
-                SwitchPolicy getSwitchPolicy() const;
-                virtual mtime_t getPeriodStart() const;
-                virtual AbstractPlaylist *getPlaylist() const;
-
-                class SplitPoint
-                {
-                    public:
-                        size_t offset;
-                        mtime_t time;
-                };
-                void SplitUsingIndex(std::vector<SplitPoint>&);
-
-                enum SegmentInfoType
-                {
-                    INFOTYPE_INIT = 0,
-                    INFOTYPE_MEDIA,
-                    INFOTYPE_INDEX
-                };
-                static const int InfoTypeCount = INFOTYPE_INDEX + 1;
-
-                ISegment * getSegment(SegmentInfoType, uint64_t = 0) const;
-                ISegment * getNextSegment(SegmentInfoType, uint64_t, uint64_t *, bool *) const;
-                bool getSegmentNumberByTime(mtime_t, uint64_t *) const;
-                mtime_t getPlaybackTimeBySegmentNumber(uint64_t) const;
-                uint64_t getLiveStartSegmentNumber(uint64_t) const;
-                virtual void mergeWith(SegmentInformation *, mtime_t);
-                virtual void mergeWithTimeline(SegmentTimeline *); /* ! don't use with global merge */
-                virtual void pruneBySegmentNumber(uint64_t);
-                virtual void pruneByPlaybackTime(mtime_t);
-                virtual uint64_t translateSegmentNumber(uint64_t, const SegmentInformation *) const;
-
-            protected:
-                std::size_t getAllSegments(std::vector<ISegment *> &) const;
-                std::size_t getSegments(SegmentInfoType, std::vector<ISegment *>&) const;
-                std::vector<SegmentInformation *> childs;
-                SegmentInformation * getChildByID( const ID & );
-                SegmentInformation *parent;
-                SwitchPolicy switchpolicy;
-
-            public:
-                void setSegmentList(SegmentList *);
-                void setSegmentBase(SegmentBase *);
-                void setSegmentTemplate(MediaSegmentTemplate *);
-                void setSwitchPolicy(SwitchPolicy);
-                virtual Url getUrlSegment() const; /* impl */
-                Property<Url *> baseUrl;
-
-            private:
-                void init();
-                SegmentBase *     inheritSegmentBase() const;
-                SegmentList *     inheritSegmentList() const;
-                MediaSegmentTemplate * inheritSegmentTemplate() const;
-
-                SegmentBase     *segmentBase;
-                SegmentList     *segmentList;
-                MediaSegmentTemplate *mediaSegmentTemplate;
-        };
-    }
-}
-
-#endif // SEGMENTINFORMATION_HPP
diff --git a/modules/demux/adaptative/playlist/SegmentList.cpp b/modules/demux/adaptative/playlist/SegmentList.cpp
deleted file mode 100644 (file)
index 99c9670..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * SegmentList.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2012 Klagenfurt University
- *
- * Created on: Jan 27, 2012
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "SegmentList.h"
-#include "Segment.h"
-#include "SegmentInformation.hpp"
-
-using namespace adaptative::playlist;
-
-SegmentList::SegmentList( SegmentInformation *parent ):
-    SegmentInfoCommon( parent ), TimescaleAble( parent )
-{
-}
-SegmentList::~SegmentList()
-{
-    std::vector<ISegment *>::iterator it;
-    for(it = segments.begin(); it != segments.end(); ++it)
-        delete(*it);
-}
-
-const std::vector<ISegment*>& SegmentList::getSegments() const
-{
-    return segments;
-}
-
-ISegment * SegmentList::getSegmentByNumber(uint64_t number)
-{
-    std::vector<ISegment *>::const_iterator it = segments.begin();
-    for(it = segments.begin(); it != segments.end(); ++it)
-    {
-        ISegment *seg = *it;
-        if(seg->getSequenceNumber() == number)
-        {
-            return seg;
-        }
-        else if (seg->getSequenceNumber() > number)
-        {
-            break;
-        }
-    }
-    return NULL;
-}
-
-void SegmentList::addSegment(ISegment *seg)
-{
-    seg->setParent(this);
-    segments.push_back(seg);
-}
-
-void SegmentList::mergeWith(SegmentList *updated)
-{
-    const ISegment * lastSegment = (segments.empty()) ? NULL : segments.back();
-
-    std::vector<ISegment *>::iterator it;
-    for(it = updated->segments.begin(); it != updated->segments.end(); ++it)
-    {
-        if( !lastSegment || lastSegment->compare( *it ) < 0 )
-            addSegment(*it);
-        else
-            delete *it;
-    }
-    updated->segments.clear();
-}
-
-void SegmentList::pruneByPlaybackTime(mtime_t time)
-{
-    uint64_t num;
-    const uint64_t timescale = inheritTimescale();
-    if(getSegmentNumberByScaledTime(time * timescale / CLOCK_FREQ, &num))
-        pruneBySegmentNumber(num);
-}
-
-void SegmentList::pruneBySegmentNumber(uint64_t tobelownum)
-{
-    std::vector<ISegment *>::iterator it = segments.begin();
-    while(it != segments.end())
-    {
-        ISegment *seg = *it;
-
-        if(seg->getSequenceNumber() >= tobelownum)
-            break;
-
-        if(seg->chunksuse.Get()) /* can't prune from here, still in use */
-            break;
-
-        delete *it;
-        it = segments.erase(it);
-    }
-}
-
-bool SegmentList::getSegmentNumberByScaledTime(stime_t time, uint64_t *ret) const
-{
-    std::vector<ISegment *> allsubsegments;
-    std::vector<ISegment *>::const_iterator it;
-    for(it=segments.begin(); it!=segments.end(); ++it)
-    {
-        std::vector<ISegment *> list = (*it)->subSegments();
-        allsubsegments.insert( allsubsegments.end(), list.begin(), list.end() );
-    }
-
-    return SegmentInfoCommon::getSegmentNumberByScaledTime(allsubsegments, time, ret);
-}
-
-mtime_t SegmentList::getPlaybackTimeBySegmentNumber(uint64_t number)
-{
-    if(segments.empty())
-        return VLC_TS_INVALID;
-
-    const uint64_t timescale = inheritTimescale();
-    const ISegment *first = segments.front();
-    if(first->getSequenceNumber() > number)
-        return VLC_TS_INVALID;
-
-    stime_t time = first->startTime.Get();
-    std::vector<ISegment *>::iterator it = segments.begin();
-    for(it = segments.begin(); it != segments.end(); ++it)
-    {
-        const ISegment *seg = *it;
-        /* Assuming there won't be any discontinuity in sequence */
-        if(seg->getSequenceNumber() == number)
-        {
-            break;
-        }
-        else if(seg->duration.Get())
-        {
-            time += seg->duration.Get();
-        }
-        else
-        {
-            time += duration.Get();
-        }
-    }
-
-    return VLC_TS_0 + CLOCK_FREQ * time / timescale;
-}
diff --git a/modules/demux/adaptative/playlist/SegmentList.h b/modules/demux/adaptative/playlist/SegmentList.h
deleted file mode 100644 (file)
index 97d0f16..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SegmentList.h
- *****************************************************************************
- * Copyright (C) 2010 - 2012 Klagenfurt University
- *
- * Created on: Jan 27, 2012
- * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENTLIST_H_
-#define SEGMENTLIST_H_
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "SegmentInfoCommon.h"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class SegmentInformation;
-        class Segment;
-
-        class SegmentList : public SegmentInfoCommon,
-                            public TimescaleAble
-        {
-            public:
-                SegmentList             ( SegmentInformation * = NULL );
-                virtual ~SegmentList    ();
-
-                const std::vector<ISegment *>&   getSegments() const;
-                ISegment *              getSegmentByNumber(uint64_t);
-                void                    addSegment(ISegment *seg);
-                void                    mergeWith(SegmentList *);
-                void                    pruneBySegmentNumber(uint64_t);
-                void                    pruneByPlaybackTime(mtime_t);
-                bool                    getSegmentNumberByScaledTime(stime_t, uint64_t *) const;
-                mtime_t                 getPlaybackTimeBySegmentNumber(uint64_t);
-
-            private:
-                std::vector<ISegment *>  segments;
-        };
-    }
-}
-
-#endif /* SEGMENTLIST_H_ */
diff --git a/modules/demux/adaptative/playlist/SegmentTemplate.cpp b/modules/demux/adaptative/playlist/SegmentTemplate.cpp
deleted file mode 100644 (file)
index e3e5f9d..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*****************************************************************************
- * SegmentTemplate.cpp: Implement the UrlTemplate element.
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "SegmentTemplate.h"
-#include "SegmentTimeline.h"
-#include "SegmentInformation.hpp"
-
-using namespace adaptative::playlist;
-
-BaseSegmentTemplate::BaseSegmentTemplate( ICanonicalUrl *parent ) :
-    Segment( parent )
-{
-}
-
-
-MediaSegmentTemplate::MediaSegmentTemplate( SegmentInformation *parent ) :
-    BaseSegmentTemplate( parent ), Timelineable(), TimescaleAble( parent )
-{
-    debugName = "SegmentTemplate";
-    classId = Segment::CLASSID_SEGMENT;
-    startNumber.Set( 1 );
-    initialisationSegment.Set( NULL );
-    templated = true;
-}
-
-void MediaSegmentTemplate::mergeWith(MediaSegmentTemplate *updated, mtime_t prunebarrier)
-{
-    SegmentTimeline *timeline = segmentTimeline.Get();
-    if(timeline && updated->segmentTimeline.Get())
-    {
-        timeline->mergeWith(*updated->segmentTimeline.Get());
-        if(prunebarrier)
-        {
-            const uint64_t timescale = timeline->inheritTimescale();
-            const uint64_t number =
-                    timeline->getElementNumberByScaledPlaybackTime(prunebarrier * timescale / CLOCK_FREQ);
-            timeline->pruneBySequenceNumber(number);
-        }
-    }
-}
-
-void MediaSegmentTemplate::pruneByPlaybackTime(mtime_t time)
-{
-    if(segmentTimeline.Get())
-        return segmentTimeline.Get()->pruneByPlaybackTime(time);
-}
-
-size_t MediaSegmentTemplate::pruneBySequenceNumber(uint64_t number)
-{
-    if(segmentTimeline.Get())
-        return segmentTimeline.Get()->pruneBySequenceNumber(number);
-    return 0;
-}
-
-uint64_t MediaSegmentTemplate::getSequenceNumber() const
-{
-    return startNumber.Get();
-}
-
-void MediaSegmentTemplate::setSourceUrl(const std::string &url)
-{
-    sourceUrl = Url(Url::Component(url, this));
-}
-
-void MediaSegmentTemplate::debug(vlc_object_t *obj, int indent) const
-{
-    Segment::debug(obj, indent);
-    if(segmentTimeline.Get())
-        segmentTimeline.Get()->debug(obj, indent + 1);
-}
-
-InitSegmentTemplate::InitSegmentTemplate( ICanonicalUrl *parent ) :
-    BaseSegmentTemplate(parent)
-{
-    debugName = "InitSegmentTemplate";
-    classId = InitSegment::CLASSID_INITSEGMENT;
-}
diff --git a/modules/demux/adaptative/playlist/SegmentTemplate.h b/modules/demux/adaptative/playlist/SegmentTemplate.h
deleted file mode 100644 (file)
index 27d3514..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*****************************************************************************
- * SegmentTemplate.cpp: Implement the UrlTemplate element.
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENTTEMPLATE_H
-#define SEGMENTTEMPLATE_H
-
-#include "Segment.h"
-#include "../tools/Properties.hpp"
-#include "SegmentInfoCommon.h"
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class ICanonicalUrl;
-        class InitSegmentTemplate;
-        class SegmentInformation;
-
-        class BaseSegmentTemplate : public Segment
-        {
-            public:
-                BaseSegmentTemplate( ICanonicalUrl * = NULL );
-        };
-
-        class MediaSegmentTemplate : public BaseSegmentTemplate,
-                                     public Initializable<InitSegmentTemplate>,
-                                     public Timelineable,
-                                     public TimescaleAble
-        {
-            public:
-                MediaSegmentTemplate( SegmentInformation * = NULL );
-                virtual void setSourceUrl( const std::string &url ); /* reimpl */
-                void mergeWith( MediaSegmentTemplate *, mtime_t );
-                virtual uint64_t getSequenceNumber() const; /* reimpl */
-                void pruneByPlaybackTime(mtime_t);
-                size_t pruneBySequenceNumber(uint64_t);
-                virtual void debug(vlc_object_t *, int = 0) const; /* reimpl */
-                Property<size_t>        startNumber;
-        };
-
-        class InitSegmentTemplate : public BaseSegmentTemplate
-        {
-            public:
-                InitSegmentTemplate( ICanonicalUrl * = NULL );
-        };
-    }
-}
-#endif // SEGMENTTEMPLATE_H
diff --git a/modules/demux/adaptative/playlist/SegmentTimeline.cpp b/modules/demux/adaptative/playlist/SegmentTimeline.cpp
deleted file mode 100644 (file)
index f249a56..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*****************************************************************************
- * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "SegmentTimeline.h"
-
-#include <algorithm>
-
-using namespace adaptative::playlist;
-
-SegmentTimeline::SegmentTimeline(TimescaleAble *parent)
-    :TimescaleAble(parent)
-{
-}
-
-SegmentTimeline::SegmentTimeline(uint64_t scale)
-    :TimescaleAble(NULL)
-{
-    timescale.Set(scale);
-}
-
-SegmentTimeline::~SegmentTimeline()
-{
-    std::list<Element *>::iterator it;
-    for(it = elements.begin(); it != elements.end(); ++it)
-        delete *it;
-}
-
-void SegmentTimeline::addElement(uint64_t number, stime_t d, uint64_t r, stime_t t)
-{
-    Element *element = new (std::nothrow) Element(number, d, r, t);
-    if(element)
-    {
-        if(!elements.empty() && !t)
-        {
-            const Element *el = elements.back();
-            element->t = el->t + (el->d * (el->r + 1));
-        }
-        elements.push_back(element);
-    }
-}
-
-mtime_t SegmentTimeline::getMinAheadScaledTime(uint64_t number) const
-{
-    stime_t totalscaledtime = 0;
-
-    std::list<Element *>::const_reverse_iterator it;
-    for(it = elements.rbegin(); it != elements.rend(); ++it)
-    {
-        const Element *el = *it;
-
-        if(number < el->number)
-        {
-            totalscaledtime += (el->d * (el->r + 1));
-            break;
-        }
-        else if(number <= el->number + el->r)
-        {
-            totalscaledtime += el->d * (el->number + el->r - number);
-        }
-        else break;
-    }
-
-    return totalscaledtime;
-}
-
-uint64_t SegmentTimeline::getElementNumberByScaledPlaybackTime(stime_t scaled) const
-{
-    uint64_t prevnumber = 0;
-    std::list<Element *>::const_iterator it;
-    for(it = elements.begin(); it != elements.end(); ++it)
-    {
-        const Element *el = *it;
-        if(it == elements.begin())
-            scaled -= el->t;
-
-        for(uint64_t repeat = 1 + el->r; repeat; repeat--)
-        {
-            if(el->d >= scaled)
-                return prevnumber;
-
-            scaled -= el->d;
-            prevnumber++;
-        }
-
-        /* might have been discontinuity */
-        prevnumber = el->number;
-    }
-
-    return prevnumber;
-}
-
-stime_t SegmentTimeline::getScaledPlaybackTimeByElementNumber(uint64_t number) const
-{
-    stime_t totalscaledtime = 0;
-
-    std::list<Element *>::const_iterator it;
-    for(it = elements.begin(); it != elements.end(); ++it)
-    {
-        const Element *el = *it;
-
-        /* set start time, or from discontinuity */
-        if(it == elements.begin() || el->t)
-        {
-            totalscaledtime = el->t;
-        }
-
-        if(number <= el->number)
-            break;
-
-        if(number <= el->number + el->r)
-        {
-            totalscaledtime += el->d * (number - el->number);
-            break;
-        }
-
-        totalscaledtime += (el->d * (el->r + 1));
-    }
-
-    return totalscaledtime;
-}
-
-uint64_t SegmentTimeline::maxElementNumber() const
-{
-    if(elements.empty())
-        return 0;
-
-    const Element *e = elements.back();
-    return e->number + e->r;
-}
-
-uint64_t SegmentTimeline::minElementNumber() const
-{
-    if(elements.empty())
-        return 0;
-    return elements.front()->number;
-}
-
-void SegmentTimeline::pruneByPlaybackTime(mtime_t time)
-{
-    const uint64_t timescale = inheritTimescale();
-    uint64_t num = getElementNumberByScaledPlaybackTime(time * timescale / CLOCK_FREQ);
-    pruneBySequenceNumber(num);
-}
-
-size_t SegmentTimeline::pruneBySequenceNumber(uint64_t number)
-{
-    size_t prunednow = 0;
-    while(elements.size())
-    {
-        Element *el = elements.front();
-        if(el->number >= number)
-        {
-            break;
-        }
-        else if(el->number + el->r >= number)
-        {
-            uint64_t count = number - el->number;
-            el->number += count;
-            el->t += count * el->d;
-            el->r -= count;
-            prunednow += count;
-            break;
-        }
-        else
-        {
-            prunednow += el->r + 1;
-            elements.pop_front();
-            delete el;
-        }
-    }
-
-    return prunednow;
-}
-
-void SegmentTimeline::mergeWith(SegmentTimeline &other)
-{
-    if(elements.empty())
-    {
-        while(other.elements.size())
-        {
-            elements.push_back(other.elements.front());
-            other.elements.pop_front();
-        }
-        return;
-    }
-
-    Element *last = elements.back();
-    while(other.elements.size())
-    {
-        Element *el = other.elements.front();
-        other.elements.pop_front();
-
-        if(last->contains(el->t)) /* Same element, but prev could have been middle of repeat */
-        {
-            const uint64_t count = (el->t - last->t) / last->d;
-            last->r = std::max(last->r, el->r + count);
-            delete el;
-        }
-        else if(el->t < last->t)
-        {
-            delete el;
-        }
-        else /* Did not exist in previous list */
-        {
-            elements.push_back(el);
-            el->number = last->number + last->r + 1;
-            last = el;
-        }
-    }
-}
-
-mtime_t SegmentTimeline::start() const
-{
-    if(elements.empty())
-        return 0;
-    return elements.front()->t * CLOCK_FREQ / inheritTimescale();
-}
-
-mtime_t SegmentTimeline::end() const
-{
-    if(elements.empty())
-        return 0;
-    const Element *last = elements.back();
-    stime_t scaled = last->t + last->d * (last->r + 1);
-    return scaled  * CLOCK_FREQ / inheritTimescale();
-}
-
-void SegmentTimeline::debug(vlc_object_t *obj, int indent) const
-{
-    std::stringstream ss;
-    ss << std::string(indent, ' ') << "Timeline";
-    msg_Dbg(obj, "%s", ss.str().c_str());
-
-    std::list<Element *>::const_iterator it;
-    for(it = elements.begin(); it != elements.end(); ++it)
-        (*it)->debug(obj, indent + 1);
-}
-
-SegmentTimeline::Element::Element(uint64_t number_, stime_t d_, uint64_t r_, stime_t t_)
-{
-    number = number_;
-    d = d_;
-    t = t_;
-    r = r_;
-}
-
-bool SegmentTimeline::Element::contains(stime_t time) const
-{
-    if(time >= t && time < t + (stime_t)(r + 1) * d)
-        return true;
-    return false;
-}
-
-void SegmentTimeline::Element::debug(vlc_object_t *obj, int indent) const
-{
-    std::stringstream ss;
-    ss.imbue(std::locale("C"));
-    ss << std::string(indent + 1, ' ') << "Element #" << number
-       << " d=" << d << " r=" << r << " @t=" << t;
-    msg_Dbg(obj, "%s", ss.str().c_str());
-}
diff --git a/modules/demux/adaptative/playlist/SegmentTimeline.h b/modules/demux/adaptative/playlist/SegmentTimeline.h
deleted file mode 100644 (file)
index 46aa171..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*****************************************************************************
- * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
- *****************************************************************************
- * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef SEGMENTTIMELINE_H
-#define SEGMENTTIMELINE_H
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "SegmentInfoCommon.h"
-#include <vlc_common.h>
-#include <list>
-
-namespace adaptative
-{
-    namespace playlist
-    {
-        class SegmentTimeline : public TimescaleAble
-        {
-            class Element;
-
-            public:
-                SegmentTimeline(TimescaleAble *);
-                SegmentTimeline(uint64_t);
-                virtual ~SegmentTimeline();
-                void addElement(uint64_t, stime_t d, uint64_t r = 0, stime_t t = 0);
-                uint64_t getElementNumberByScaledPlaybackTime(stime_t) const;
-                stime_t getScaledPlaybackTimeByElementNumber(uint64_t) const;
-                stime_t getMinAheadScaledTime(uint64_t) const;
-                uint64_t maxElementNumber() const;
-                uint64_t minElementNumber() const;
-                void pruneByPlaybackTime(mtime_t);
-                size_t pruneBySequenceNumber(uint64_t);
-                void mergeWith(SegmentTimeline &);
-                mtime_t start() const;
-                mtime_t end() const;
-                void debug(vlc_object_t *, int = 0) const;
-
-            private:
-                std::list<Element *> elements;
-
-                class Element
-                {
-                    public:
-                        Element(uint64_t, stime_t, uint64_t, stime_t);
-                        void debug(vlc_object_t *, int = 0) const;
-                        bool contains(stime_t) const;
-                        stime_t  t;
-                        stime_t  d;
-                        uint64_t r;
-                        uint64_t number;
-                };
-        };
-    }
-}
-
-#endif // SEGMENTTIMELINE_H
diff --git a/modules/demux/adaptative/playlist/Templates.hpp b/modules/demux/adaptative/playlist/Templates.hpp
deleted file mode 100644 (file)
index c5c4ddf..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Templates.hpp
- *****************************************************************************
- * Copyright (C) 2014-2015 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef TEMPLATES_HPP
-#define TEMPLATES_HPP
-
-namespace adaptative
-{
-    namespace playlist
-    {
-
-        template<class T> class Initializable
-        {
-        public:
-            Initializable()
-            {
-                initialisationSegment.Set(NULL);
-            }
-            ~Initializable()
-            {
-                delete initialisationSegment.Get();
-            }
-            Property<T *> initialisationSegment;
-        };
-
-        template<class T> class Indexable
-        {
-        public:
-            Indexable()
-            {
-                indexSegment.Set(NULL);
-            }
-            ~Indexable()
-            {
-                delete indexSegment.Get();
-            }
-            Property<T *> indexSegment;
-        };
-
-    }
-}
-
-#endif // TEMPLATES_HPP
-
diff --git