AbstractPlaylist.hpp 3.55 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 46
                void                            setMinBuffering( mtime_t );
                mtime_t                         getMinBuffering() const;
47
                mtime_t                         getMaxBuffering() const;
48
                virtual void                    debug() = 0;
49 50

                void    addPeriod               (BasePeriod *period);
51
                void    addBaseUrl              (const std::string &);
52
                void    setPlaylistUrl          (const std::string &);
53 54 55 56 57 58 59 60 61

                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);
62
                void                pruneByPlaybackTime(mtime_t);
63

64
                Property<mtime_t>                   duration;
65 66 67
                Property<time_t>                    playbackStart;
                Property<time_t>                    availabilityEndTime;
                Property<time_t>                    availabilityStartTime;
68
                Property<mtime_t>                   minUpdatePeriod;
69
                Property<mtime_t>                   maxSegmentDuration;
70
                Property<mtime_t>                   timeShiftBufferDepth;
71
                Property<mtime_t>                   suggestedPresentationDelay;
72 73

            protected:
74
                vlc_object_t                       *p_object;
75
                std::vector<BasePeriod *>           periods;
76
                std::vector<std::string>            baseUrls;
77
                std::string                         playlistUrl;
78
                std::string                         type;
79
                mtime_t                             minBufferTime;
80 81 82 83
        };
    }
}
#endif /* ABSTRACTPLAYLIST_HPP_ */