demux: adaptive: fix comment
[vlc.git] / modules / demux / adaptive / playlist / BaseRepresentation.h
blobfbc6b2a126374c06565fa8ee3c305eeb4bccff02
1 /*
2 * Representation.h
3 *****************************************************************************
4 * Copyright (C) 2010 - 2011 Klagenfurt University
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>
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.
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.
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 *****************************************************************************/
25 #ifndef BASEREPRESENTATION_H_
26 #define BASEREPRESENTATION_H_
28 #include <string>
29 #include <list>
31 #include "CommonAttributesElements.h"
32 #include "SegmentInformation.hpp"
33 #include "../StreamFormat.hpp"
35 namespace adaptive
37 namespace playlist
39 class BaseAdaptationSet;
40 class AbstractPlaylist;
41 class BaseSegmentTemplate;
43 class BaseRepresentation : public CommonAttributesElements,
44 public SegmentInformation
46 public:
47 BaseRepresentation( BaseAdaptationSet * );
48 virtual ~BaseRepresentation ();
50 virtual StreamFormat getStreamFormat() const;
51 BaseAdaptationSet* getAdaptationSet();
53 * @return The bitrate required for this representation
54 * in bits per seconds.
55 * Will be a valid value, as the parser refuses Representation
56 * without bandwidth.
58 uint64_t getBandwidth () const;
59 void setBandwidth ( uint64_t bandwidth );
60 const std::list<std::string> & getCodecs () const;
61 void addCodec (const std::string &);
62 bool consistentSegmentNumber () const;
63 virtual void pruneByPlaybackTime (mtime_t);
65 virtual mtime_t getMinAheadTime (uint64_t) const;
66 virtual bool needsUpdate () const;
67 virtual bool runLocalUpdates (mtime_t, uint64_t, bool);
68 virtual void scheduleNextUpdate (uint64_t);
70 virtual void debug (vlc_object_t *,int = 0) const;
72 /* for segment templates */
73 virtual std::string contextualize(size_t, const std::string &,
74 const BaseSegmentTemplate *) const;
76 static bool bwCompare(const BaseRepresentation *a,
77 const BaseRepresentation *b);
78 protected:
79 virtual bool validateCodec(const std::string &) const;
80 BaseAdaptationSet *adaptationSet;
81 uint64_t bandwidth;
82 std::list<std::string> codecs;
83 bool b_consistent;
88 #endif /* BASEREPRESENTATION_H_ */