AbstractPlaylist.hpp 3.25 KB
Newer Older
1 2 3 4
/*
 * AbstractPlaylist.hpp
 *****************************************************************************
 * Copyright (C) 2010 - 2011 Klagenfurt University
5
 * Copyright (C) 2015 VideoLAN and VLC authors
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *
 * 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
 * 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
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
#ifndef ABSTRACTPLAYLIST_HPP_
#define ABSTRACTPLAYLIST_HPP_

#include <vector>
#include <string>

#include "ICanonicalUrl.hpp"
#include "../tools/Properties.hpp"

30
namespace adaptive
31
{
32

33 34 35 36 37 38 39
    namespace playlist
    {
        class BasePeriod;

        class AbstractPlaylist : public ICanonicalUrl
        {
            public:
40
                AbstractPlaylist(vlc_object_t *);
41 42 43 44
                virtual ~AbstractPlaylist();

                virtual bool                    isLive() const = 0;
                void                            setType(const std::string &);
45
                virtual void                    debug() = 0;
46 47

                void    addPeriod               (BasePeriod *period);
48
                void    addBaseUrl              (const std::string &);
49
                void    setPlaylistUrl          (const std::string &);
50 51 52 53 54 55 56 57 58

                virtual Url         getUrlSegment() const; /* impl */
                vlc_object_t *      getVLCObject()  const;

                virtual const std::vector<BasePeriod *>& getPeriods();
                virtual BasePeriod*                      getFirstPeriod();
                virtual BasePeriod*                      getNextPeriod(BasePeriod *period);

                void                mergeWith(AbstractPlaylist *, mtime_t = 0);
59
                void                pruneByPlaybackTime(mtime_t);
60

61
                Property<mtime_t>                   duration;
62 63 64
                Property<time_t>                    playbackStart;
                Property<time_t>                    availabilityEndTime;
                Property<time_t>                    availabilityStartTime;
65
                Property<mtime_t>                   minUpdatePeriod;
66
                Property<mtime_t>                   maxSegmentDuration;
67 68
                Property<mtime_t>                   minBufferTime;
                Property<mtime_t>                   timeShiftBufferDepth;
69 70

            protected:
71
                vlc_object_t                       *p_object;
72
                std::vector<BasePeriod *>           periods;
73
                std::vector<std::string>            baseUrls;
74
                std::string                         playlistUrl;
75
                std::string                         type;
76

77 78 79 80
        };
    }
}
#endif /* ABSTRACTPLAYLIST_HPP_ */