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
|
/*
* Representation.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 "Representation.h"
using namespace dash::mpd;
Representation::Representation () :
segmentBase (NULL),
segmentList (NULL),
segmentTemplate (NULL),
id(""),
bandwidth (0),
qualityRanking (0)
{
}
Representation::~Representation ()
{
for(size_t i = 0; i < this->baseURLs.size(); i++)
delete(this->baseURLs.at(i));
for(size_t i = 0; i < this->subRepresentations.size(); i++)
delete(this->subRepresentations.at(i));
delete(this->segmentTemplate);
delete(this->segmentBase);
delete(this->segmentList);
}
const std::vector<IBaseUrl *>& Representation::GetBaseURLs () const
{
return (std::vector<IBaseUrl *> &) this->baseURLs;
}
void Representation::AddBaseURL (BaseUrl *baseUrl)
{
this->baseURLs.push_back(baseUrl);
}
const std::vector<ISubRepresentation *>& Representation::GetSubRepresentations () const
{
return (std::vector<ISubRepresentation *> &) this->subRepresentations;
}
void Representation::AddSubRepresentation (SubRepresentation *subRepresentation)
{
this->subRepresentations.push_back(subRepresentation);
}
ISegmentBase* Representation::GetSegmentBase () const
{
return this->segmentBase;
}
void Representation::SetSegmentBase (SegmentBase *segmentBase)
{
this->segmentBase = segmentBase;
}
ISegmentList* Representation::GetSegmentList () const
{
return this->segmentList;
}
void Representation::SetSegmentList (SegmentList *segmentList)
{
this->segmentList = segmentList;
}
ISegmentTemplate* Representation::GetSegmentTemplate () const
{
return this->segmentTemplate;
}
void Representation::SetSegmentTemplate (SegmentTemplate *segmentTemplate)
{
this->segmentTemplate = segmentTemplate;
}
const std::string& Representation::GetId () const
{
return this->id;
}
void Representation::SetId (const std::string &id)
{
this->id = id;
}
uint32_t Representation::GetBandwidth () const
{
return this->bandwidth;
}
void Representation::SetBandwidth (uint32_t bandwidth)
{
this->bandwidth = bandwidth;
}
uint32_t Representation::GetQualityRanking () const
{
return this->qualityRanking;
}
void Representation::SetQualityRanking (uint32_t qualityRanking)
{
this->qualityRanking = qualityRanking;
}
const std::vector<std::string>& Representation::GetDependencyId () const
{
return this->dependencyId;
}
void Representation::SetDependencyId (const std::string &dependencyId)
{
dash::helpers::String::Split(dependencyId, ' ', this->dependencyId);
}
const std::vector<std::string>& Representation::GetMediaStreamStructureId () const
{
return this->mediaStreamStructureId;
}
void Representation::SetMediaStreamStructureId (const std::string& mediaStreamStructureId)
{
dash::helpers::String::Split(mediaStreamStructureId, ' ', this->mediaStreamStructureId);
}
|