SegmentTemplate.cpp 2.05 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*****************************************************************************
 * SegmentTemplate.cpp: Implement the UrlTemplate element.
 *****************************************************************************
 * Copyright (C) 1998-2007 VLC authors and VideoLAN
 * $Id$
 *
 * Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
 *
 * 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.
 *****************************************************************************/
23
24
25
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
26
27
28
29

#include "SegmentTemplate.h"
#include "SegmentTimeline.h"
#include "Representation.h"
30
#include "AdaptationSet.h"
31
32
33

using namespace dash::mpd;

34
35
36
SegmentTemplate::SegmentTemplate( ICanonicalUrl *parent ) :
    Segment( parent ),
    startIndex( 0 )
37
{
38
39
    debugName = "SegmentTemplate";
    classId = Segment::CLASSID_SEGMENT;
40
41
    duration.Set(0);
    timescale.Set(0);
42
43
}

44
Url SegmentTemplate::getUrlSegment() const
45
{
46
47
    Url ret = getParentUrlSegment();
    if (!sourceUrl.empty())
48
    {
49
        ret.append(Url::Component(sourceUrl, this));
50
    }
51
52
    return ret;
}
53

54
55
56
57
58
59
60
61
size_t SegmentTemplate::getStartIndex() const
{
    return startIndex;
}

void SegmentTemplate::setStartIndex(size_t i)
{
    startIndex = i;
62
63
}

64
65
InitSegmentTemplate::InitSegmentTemplate( ICanonicalUrl *parent ) :
    SegmentTemplate(parent)
66
{
67
68
    debugName = "InitSegmentTemplate";
    classId = InitSegment::CLASSID_INITSEGMENT;
69
}