96c21006e39a2c7526a9246d3377b37bd6eb3b47
[vlc.git] / modules / demux / dash / mpd / MPD.h
1 /*
2  * MPD.h
3  *****************************************************************************
4  * Copyright (C) 2010 - 2011 Klagenfurt University
5  *
6  * Created on: Aug 10, 2010
7  * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
8  *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
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
12  * by 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 MPD_H_
26 #define MPD_H_
27
28 #include <vector>
29 #include <string>
30 #include <map>
31
32 #include "mpd/Period.h"
33 #include "mpd/BaseUrl.h"
34 #include "mpd/ICanonicalUrl.hpp"
35 #include "mpd/ProgramInformation.h"
36 #include "mpd/Profile.hpp"
37 #include "Properties.hpp"
38
39 namespace dash
40 {
41     namespace mpd
42     {
43         class MPD : public ICanonicalUrl
44         {
45             public:
46                 MPD(stream_t *, Profile);
47                 virtual ~MPD();
48
49                 Profile                         getProfile() const;
50                 bool                            isLive() const;
51                 void                            setType(const std::string &);
52
53                 void    addPeriod               (Period *period);
54                 void    addBaseUrl              (BaseUrl *url);
55
56                 virtual Url         getUrlSegment() const; /* impl */
57                 vlc_object_t *      getVLCObject()  const;
58
59                 virtual const std::vector<Period *>&    getPeriods() const;
60                 virtual Period*                         getFirstPeriod() const;
61                 virtual Period*                         getNextPeriod(Period *period);
62
63                 Property<time_t>                    duration;
64                 Property<time_t>                    playbackStart;
65                 Property<time_t>                    availabilityEndTime;
66                 Property<time_t>                    availabilityStartTime;
67                 Property<time_t>                    minUpdatePeriod;
68                 Property<time_t>                    minBufferTime;
69                 Property<time_t>                    timeShiftBufferDepth;
70                 Property<ProgramInformation *>      programInfo;
71
72             private:
73                 stream_t                           *stream;
74                 Profile                             profile;
75                 std::vector<Period *>               periods;
76                 std::vector<BaseUrl *>              baseUrls;
77                 std::string                         type;
78         };
79     }
80 }
81 #endif /* MPD_H_ */