demux:adaptive: remove dead code
[vlc.git] / modules / demux / adaptive / playlist / SegmentTimeline.h
blobc3cca660d5160954598247ad0796f298593e052b
1 /*****************************************************************************
2 * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
3 *****************************************************************************
4 * Copyright (C) 1998-2007 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef SEGMENTTIMELINE_H
25 #define SEGMENTTIMELINE_H
27 #include "SegmentInfoCommon.h"
28 #include <vlc_common.h>
29 #include <list>
31 namespace adaptive
33 namespace playlist
35 class SegmentTimeline : public TimescaleAble
37 class Element;
39 public:
40 SegmentTimeline(TimescaleAble *);
41 SegmentTimeline(uint64_t);
42 virtual ~SegmentTimeline();
43 void addElement(uint64_t, stime_t d, uint64_t r = 0, stime_t t = 0);
44 uint64_t getElementNumberByScaledPlaybackTime(stime_t) const;
45 bool getScaledPlaybackTimeDurationBySegmentNumber(uint64_t, vlc_tick_t *, vlc_tick_t *) const;
46 stime_t getScaledPlaybackTimeByElementNumber(uint64_t) const;
47 stime_t getMinAheadScaledTime(uint64_t) const;
48 uint64_t maxElementNumber() const;
49 uint64_t minElementNumber() const;
50 void pruneByPlaybackTime(vlc_tick_t);
51 size_t pruneBySequenceNumber(uint64_t);
52 void mergeWith(SegmentTimeline &);
53 void debug(vlc_object_t *, int = 0) const;
55 private:
56 std::list<Element *> elements;
58 class Element
60 public:
61 Element(uint64_t, stime_t, uint64_t, stime_t);
62 void debug(vlc_object_t *, int = 0) const;
63 bool contains(stime_t) const;
64 stime_t t;
65 stime_t d;
66 uint64_t r;
67 uint64_t number;
73 #endif // SEGMENTTIMELINE_H