aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdash/source/mpd/Period.cpp
blob: 291677eab5e48e63f2255fc3c1b6b61deb9dbbdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * Period.cpp
 *****************************************************************************
 * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved
 *
 * Email: libdash-dev@vicky.bitmovin.net
 *
 * This source code and its use and distribution, is subject to the terms
 * and conditions of the applicable license agreement.
 *****************************************************************************/

#include "Period.h"

using namespace dash::mpd;

Period::Period  () :
        segmentBase(NULL),
        segmentList(NULL),
        segmentTemplate(NULL),
        xlinkActuate("onRequest"),
        xlinkHref(""),
        id(""),
        start(""),
        duration(""),
        isBitstreamSwitching(false)
{
}
Period::~Period ()
{
    for(size_t i = 0; i < this->baseURLs.size(); i++)
        delete(this->baseURLs.at(i));
    for(size_t i = 0; i < this->adaptationSets.size(); i++)
        delete(this->adaptationSets.at(i));
    for(size_t i = 0; i < this->subsets.size(); i++)
        delete(this->subsets.at(i));
    delete(segmentBase);
    delete(segmentList);
    delete(segmentTemplate);
}

const std::vector<IBaseUrl *>&      Period::GetBaseURLs             ()  const
{
    return (std::vector<IBaseUrl *> &) this->baseURLs;
}
void                                Period::AddBaseURL              (BaseUrl *baseUrl)
{
    this->baseURLs.push_back(baseUrl);
}
ISegmentBase*                       Period::GetSegmentBase          ()  const
{
    return this->segmentBase;
}
void                                Period::SetSegmentBase          (SegmentBase *segmentBase)
{
    this->segmentBase = segmentBase;
}
ISegmentList*                       Period::GetSegmentList          ()  const
{
    return this->segmentList;
}
void                                Period::SetSegmentList          (SegmentList *segmentList)
{
    this->segmentList = segmentList;
}
ISegmentTemplate*                   Period::GetSegmentTemplate      ()  const
{
    return this->segmentTemplate;
}
void                                Period::SetSegmentTemplate      (SegmentTemplate *segmentTemplate) 
{
    this->segmentTemplate = segmentTemplate;
}
const std::vector<IAdaptationSet*>& Period::GetAdaptationSets       () const
{
    return (std::vector<IAdaptationSet*> &) this->adaptationSets;
}
void                                Period::AddAdaptationSet        (AdaptationSet *adaptationSet)
{
    if(adaptationSet != NULL)
        this->adaptationSets.push_back(adaptationSet);
}
const std::vector<ISubset *>&       Period::GetSubsets              () const
{
    return (std::vector<ISubset *> &) this->subsets;
}
void                                Period::AddSubset               (Subset *subset)
{
    this->subsets.push_back(subset);
}
const std::string&                  Period::GetXlinkHref            ()  const
{
    return this->xlinkHref;
}
void                                Period::SetXlinkHref            (const std::string& xlinkHref)
{
    this->xlinkHref = xlinkHref;
}
const std::string&                  Period::GetXlinkActuate         ()  const
{
    return this->xlinkActuate;
}
void                                Period::SetXlinkActuate         (const std::string& xlinkActuate)
{
    this->xlinkActuate = xlinkActuate;
}
const std::string&                  Period::GetId                   ()  const
{
    return this->id;
}
void                                Period::SetId                   (const std::string& id)
{
    this->id = id;
}
const std::string&                  Period::GetStart                ()  const
{
    return this->start;
}
void                                Period::SetStart                (const std::string& start)
{
    this->start = start;
}
const std::string&                  Period::GetDuration             ()  const
{
    return this->duration;
}
void                                Period::SetDuration             (const std::string& duration)
{
    this->duration = duration;
}
bool                                Period::GetBitstreamSwitching   ()  const
{
    return this->isBitstreamSwitching;
}
void                                Period::SetBitstreamSwitching   (bool value)
{
    this->isBitstreamSwitching = value;
}