1 /*****************************************************************************
2 * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
3 *****************************************************************************
4 * Copyright (C) 1998-2007 VLC authors and VideoLAN
6 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #ifndef SEGMENTTIMELINE_H
24 #define SEGMENTTIMELINE_H
26 #include "Inheritables.hpp"
28 #include <vlc_common.h>
35 class AbstractMultipleSegmentBaseType
;
37 class SegmentTimeline
: public TimescaleAble
42 SegmentTimeline(AbstractMultipleSegmentBaseType
*);
43 SegmentTimeline(uint64_t);
44 virtual ~SegmentTimeline();
45 void addElement(uint64_t, stime_t d
, uint64_t r
= 0, stime_t t
= 0);
46 uint64_t getElementNumberByScaledPlaybackTime(stime_t
) const;
47 bool getScaledPlaybackTimeDurationBySegmentNumber(uint64_t, stime_t
*, stime_t
*) const;
48 stime_t
getScaledPlaybackTimeByElementNumber(uint64_t) const;
49 stime_t
getMinAheadScaledTime(uint64_t) const;
50 Timescale
inheritTimescale() const; /* reimpl */
51 stime_t
getTotalLength() const;
52 uint64_t maxElementNumber() const;
53 uint64_t minElementNumber() const;
54 uint64_t getElementIndexBySequence(uint64_t) const;
55 void pruneByPlaybackTime(vlc_tick_t
);
56 size_t pruneBySequenceNumber(uint64_t);
57 void updateWith(SegmentTimeline
&);
58 void debug(vlc_object_t
*, int = 0) const;
61 std::list
<Element
*> elements
;
63 AbstractMultipleSegmentBaseType
*parent
;
68 Element(uint64_t, stime_t
, uint64_t, stime_t
);
69 void debug(vlc_object_t
*, int = 0) const;
70 bool contains(stime_t
) const;
80 #endif // SEGMENTTIMELINE_H