MPD.h 4.15 KB
Newer Older
Christopher Mueller's avatar
Christopher Mueller committed
1 2 3 4 5 6 7 8 9
/*
 * MPD.h
 *****************************************************************************
 * Copyright (C) 2010 - 2011 Klagenfurt University
 *
 * Created on: Aug 10, 2010
 * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
 *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
 *
10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
Christopher Mueller's avatar
Christopher Mueller committed
12 13 14 15 16
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
Christopher Mueller's avatar
Christopher Mueller committed
19 20
 *
 * You should have received a copy of the GNU Lesser General Public License
21 22
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
Christopher Mueller's avatar
Christopher Mueller committed
23 24 25 26 27 28 29 30 31 32 33
 *****************************************************************************/

#ifndef MPD_H_
#define MPD_H_

#include <vector>
#include <string>
#include <map>

#include "mpd/Period.h"
#include "mpd/BaseUrl.h"
34
#include "mpd/ICanonicalUrl.hpp"
Christopher Mueller's avatar
Christopher Mueller committed
35
#include "mpd/ProgramInformation.h"
36
#include "mpd/Profile.hpp"
Christopher Mueller's avatar
Christopher Mueller committed
37 38 39 40 41

namespace dash
{
    namespace mpd
    {
42
        class MPD : public ICanonicalUrl
Christopher Mueller's avatar
Christopher Mueller committed
43 44
        {
            public:
45
                MPD(stream_t *, Profile);
Christopher Mueller's avatar
Christopher Mueller committed
46 47
                virtual ~MPD();

48
                Profile                         getProfile() const;
49 50 51 52 53
                bool                            isLive() const;
                time_t                          getAvailabilityStartTime() const;
                void                            setAvailabilityStartTime( time_t time );
                time_t                          getAvailabilityEndTime() const;
                void                            setAvailabilityEndTime( time_t time );
54
                void                            setType(const std::string &);
55 56 57 58 59 60 61 62
                time_t                          getDuration() const;
                void                            setDuration( time_t duration );
                time_t                          getMinUpdatePeriod() const;
                void                            setMinUpdatePeriod( time_t period );
                time_t                          getMinBufferTime() const;
                void                            setMinBufferTime( time_t time );
                time_t                          getTimeShiftBufferDepth() const;
                void                            setTimeShiftBufferDepth( time_t depth );
63
                const ProgramInformation*       getProgramInformation() const;
Christopher Mueller's avatar
Christopher Mueller committed
64 65 66 67 68

                void    addPeriod               (Period *period);
                void    addBaseUrl              (BaseUrl *url);
                void    setProgramInformation   (ProgramInformation *progInfo);

69
                virtual std::string getUrlSegment() const; /* impl */
70
                vlc_object_t *      getVLCObject()  const;
71

72 73 74 75
                virtual const std::vector<Period *>&    getPeriods() const;
                virtual Period*                         getFirstPeriod() const;
                virtual Period*                         getNextPeriod(Period *period);

Christopher Mueller's avatar
Christopher Mueller committed
76
            private:
77
                stream_t                           *stream;
78
                Profile                             profile;
79 80 81 82 83 84
                time_t                              availabilityStartTime;
                time_t                              availabilityEndTime;
                time_t                              duration;
                time_t                              minUpdatePeriod;
                time_t                              minBufferTime;
                time_t                              timeShiftBufferDepth;
Christopher Mueller's avatar
Christopher Mueller committed
85 86 87
                std::vector<Period *>               periods;
                std::vector<BaseUrl *>              baseUrls;
                ProgramInformation                  *programInfo;
88
                std::string                         type;
Christopher Mueller's avatar
Christopher Mueller committed
89 90 91 92
        };
    }
}
#endif /* MPD_H_ */