1 /*****************************************************************************
2 * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
3 *****************************************************************************
4 * Copyright (C) 1998-2007 VLC authors and VideoLAN
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>
35 class SegmentTimeline
: public TimescaleAble
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;
56 std::list
<Element
*> elements
;
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;
73 #endif // SEGMENTTIMELINE_H