aboutsummaryrefslogtreecommitdiffstats
path: root/libdash/source/mpd/MPD.cpp
blob: 0c4f2f3a42f415f830bf763ee32410bc4758ed60 (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
 * MPD.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 "MPD.h"

using namespace dash::mpd;
using namespace dash::metrics;

MPD::MPD    () :
        id(""),
        type("static"),
        availabilityStarttime(""),
        availabilityEndtime(""),
        mediaPresentationDuration(""),
        minimumUpdatePeriod(""),
        minBufferTime(""),
        timeShiftBufferDepth(""),
        suggestedPresentationDelay(""),
        maxSegmentDuration(""),
        maxSubsegmentDuration("")
{
}
MPD::~MPD   ()
{
    for(size_t i = 0; i < this->programInformations.size(); i++)
        delete(this->programInformations.at(i));
    for(size_t i = 0; i < this->metrics.size(); i++)
        delete(this->metrics.at(i));
    for(size_t i = 0; i < this->periods.size(); i++)
        delete(this->periods.at(i));
    for(size_t i = 0; i < this->baseUrls.size(); i++)
        delete(this->baseUrls.at(i));
}

const std::vector<IProgramInformation *>&   MPD::GetProgramInformations             () const 
{
    return (std::vector<IProgramInformation *> &) this->programInformations;
}
void                                        MPD::AddProgramInformation              (ProgramInformation *programInformation)
{
    this->programInformations.push_back(programInformation);
}
const std::vector<IBaseUrl*>&               MPD::GetBaseUrls                        () const
{
    return (std::vector<IBaseUrl*> &) this->baseUrls;
}
void                                        MPD::AddBaseUrl                         (BaseUrl *url)
{
    this->baseUrls.push_back(url);
}
const std::vector<std::string>&             MPD::GetLocations                       () const
{
    return this->locations;
}
void                                        MPD::AddLocation                        (const std::string& location)
{
    this->locations.push_back(location);
}
const std::vector<IPeriod*>&                MPD::GetPeriods                         () const 
{
    return (std::vector<IPeriod*> &) this->periods;
}
void                                        MPD::AddPeriod                          (Period *period)
{
    this->periods.push_back(period);
}
const std::vector<IMetrics *>&              MPD::GetMetrics                         () const 
{
    return (std::vector<IMetrics *> &) this->metrics;
}
void                                        MPD::AddMetrics                         (Metrics *metrics)
{
    this->metrics.push_back(metrics);
}
const std::string&                          MPD::GetId                              ()  const
{
    return this->id;
}
void                                        MPD::SetId                              (const std::string& id)
{
    this->id = id;
}
const std::vector<std::string>&             MPD::GetProfiles                        ()  const
{
    return this->profiles;
}
void                                        MPD::SetProfiles                        (const std::string& profiles)
{
    dash::helpers::String::Split(profiles, ',', this->profiles);
}
const std::string&                          MPD::GetType                            ()  const
{
    return this->type;
}
void                                        MPD::SetType                            (const std::string& type)
{
    this->type = type;
}
const std::string&                          MPD::GetPublishTime		            ()  const
{
    return this->publishTime;
}
const std::string&                          MPD::GetAvailabilityStarttime           ()  const
{
    return this->availabilityStarttime;
}
void                                        MPD::SetAvailabilityStarttime           (const std::string& availabilityStarttime)
{
    this->availabilityStarttime = availabilityStarttime;
}
void                                        MPD::SetPublishTime           (const std::string& publishTime)
{
    this->publishTime = publishTime;
}
const std::string&                          MPD::GetAvailabilityEndtime             ()  const
{
    return this->availabilityEndtime;
}
void                                        MPD::SetAvailabilityEndtime             (const std::string& availabilityEndtime)
{
    this->availabilityEndtime = availabilityEndtime;
}
const std::string&                          MPD::GetMediaPresentationDuration       ()  const
{
    return this->mediaPresentationDuration;
}
void                                        MPD::SetMediaPresentationDuration       (const std::string& mediaPresentationDuration)
{
    this->mediaPresentationDuration = mediaPresentationDuration;
}
const std::string&                          MPD::GetMinimumUpdatePeriod             ()  const
{
    return this->minimumUpdatePeriod;
}
void                                        MPD::SetMinimumUpdatePeriod             (const std::string& minimumUpdatePeriod)
{
    this->minimumUpdatePeriod = minimumUpdatePeriod;
}
const std::string&                          MPD::GetMinBufferTime                   ()  const
{
    return this->minBufferTime;
}
void                                        MPD::SetMinBufferTime                   (const std::string& minBufferTime)
{
    this->minBufferTime = minBufferTime;
}
const std::string&                          MPD::GetTimeShiftBufferDepth            ()  const
{
    return this->timeShiftBufferDepth;
}
void                                        MPD::SetTimeShiftBufferDepth            (const std::string& timeShiftBufferDepth)
{
    this->timeShiftBufferDepth = timeShiftBufferDepth;
}
const std::string&                          MPD::GetSuggestedPresentationDelay      ()  const
{
    return this->suggestedPresentationDelay;
}
void                                        MPD::SetSuggestedPresentationDelay      (const std::string& suggestedPresentationDelay)
{
    this->suggestedPresentationDelay = suggestedPresentationDelay;
}
const std::string&                          MPD::GetMaxSegmentDuration              ()  const
{
    return this->maxSegmentDuration;
}
void                                        MPD::SetMaxSegmentDuration              (const std::string& maxSegmentDuration)
{
    this->maxSegmentDuration = maxSegmentDuration;
}
const std::string&                          MPD::GetMaxSubsegmentDuration           ()  const
{
    return this->maxSubsegmentDuration;
}
void                                        MPD::SetMaxSubsegmentDuration           (const std::string& maxSubsegmentDuration)
{
    this->maxSubsegmentDuration = maxSubsegmentDuration;
}
IBaseUrl*                                   MPD::GetMPDPathBaseUrl                  ()  const
{
    return this->mpdPathBaseUrl;
}
void                                        MPD::SetMPDPathBaseUrl                  (BaseUrl *mpdPath)
{
    this->mpdPathBaseUrl = mpdPath;
}
uint32_t                                    MPD::GetFetchTime                       ()  const
{
    return this->fetchTime;
}
void                                        MPD::SetFetchTime                       (uint32_t fetchTimeInSec)
{
    this->fetchTime = fetchTimeInSec;
}


const std::vector<ITCPConnection *>&        MPD::GetTCPConnectionList    () const
{
    return (std::vector<ITCPConnection *> &) this->tcpConnections;
}
void                                        MPD::AddTCPConnection        (TCPConnection *tcpConn)
{
    this->tcpConnections.push_back(tcpConn);
}
const std::vector<IHTTPTransaction *>&      MPD::GetHTTPTransactionList  () const
{
    return (std::vector<IHTTPTransaction *> &) this->httpTransactions;
}
void                                        MPD::AddHTTPTransaction      (HTTPTransaction *httpTransAct)
{
    this->httpTransactions.push_back(httpTransAct);
}