]> git.sesse.net Git - vlc/blob - modules/stream_filter/dash/mpd/SegmentInfoCommon.h
demux: mkv: don't seek on current pos
[vlc] / modules / stream_filter / dash / mpd / SegmentInfoCommon.h
1 /*****************************************************************************
2  * SegmentInfoCommon.h: Implement the common part for both SegmentInfoDefault
3  *                      and SegmentInfo
4  *****************************************************************************
5  * Copyright (C) 1998-2007 VLC authors and VideoLAN
6  * $Id$
7  *
8  * Authors: Hugo BeauzĂ©e-Luyssen <beauze.h@gmail.com>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef SEGMENTINFOCOMMON_H
26 #define SEGMENTINFOCOMMON_H
27
28 #include <string>
29 #include <list>
30 #include <ctime>
31 #include "ICanonicalUrl.hpp"
32
33 namespace dash
34 {
35     namespace mpd
36     {
37         class Segment;
38         class SegmentTimeline;
39
40         class SegmentInfoCommon : public ICanonicalUrl
41         {
42             public:
43                 SegmentInfoCommon( ICanonicalUrl *parent = NULL );
44                 virtual ~SegmentInfoCommon();
45                 time_t                  getDuration() const;
46                 void                    setDuration( time_t duration );
47                 int                     getStartIndex() const;
48                 void                    setStartIndex( int startIndex );
49                 Segment*                getInitialisationSegment() const;
50                 void                    setInitialisationSegment( Segment* seg );
51                 void                    appendBaseURL( const std::string& url );
52                 const SegmentTimeline*  getSegmentTimeline() const;
53                 void                    setSegmentTimeline( const SegmentTimeline *segTl );
54                 virtual Url             getUrlSegment() const; /* impl */
55
56             private:
57                 time_t                  duration;
58                 int                     startIndex;
59                 Segment*                initialisationSegment;
60                 std::list<std::string>  baseURLs;
61                 const SegmentTimeline*  segmentTimeline;
62         };
63     }
64 }
65
66 #endif // SEGMENTINFOCOMMON_H