Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
967fdaa4
Commit
967fdaa4
authored
Dec 21, 2011
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Dec 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: Adding some basic getters to Representation
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
4a23e2fb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
14 deletions
+38
-14
modules/stream_filter/dash/mpd/BasicCMParser.cpp
modules/stream_filter/dash/mpd/BasicCMParser.cpp
+3
-0
modules/stream_filter/dash/mpd/Representation.cpp
modules/stream_filter/dash/mpd/Representation.cpp
+27
-12
modules/stream_filter/dash/mpd/Representation.h
modules/stream_filter/dash/mpd/Representation.h
+8
-2
No files found.
modules/stream_filter/dash/mpd/BasicCMParser.cpp
View file @
967fdaa4
...
@@ -73,6 +73,7 @@ void BasicCMParser::setPeriods (Node *root)
...
@@ -73,6 +73,7 @@ void BasicCMParser::setPeriods (Node *root)
this
->
mpd
->
addPeriod
(
period
);
this
->
mpd
->
addPeriod
(
period
);
}
}
}
}
void
BasicCMParser
::
setGroups
(
Node
*
root
,
Period
*
period
)
void
BasicCMParser
::
setGroups
(
Node
*
root
,
Period
*
period
)
{
{
std
::
vector
<
Node
*>
groups
=
DOMHelper
::
getElementByTagName
(
root
,
"Group"
,
false
);
std
::
vector
<
Node
*>
groups
=
DOMHelper
::
getElementByTagName
(
root
,
"Group"
,
false
);
...
@@ -89,6 +90,7 @@ void BasicCMParser::setGroups (Node *root, Period *period)
...
@@ -89,6 +90,7 @@ void BasicCMParser::setGroups (Node *root, Period *period)
period
->
addGroup
(
group
);
period
->
addGroup
(
group
);
}
}
}
}
void
BasicCMParser
::
setRepresentations
(
Node
*
root
,
Group
*
group
)
void
BasicCMParser
::
setRepresentations
(
Node
*
root
,
Group
*
group
)
{
{
std
::
vector
<
Node
*>
representations
=
DOMHelper
::
getElementByTagName
(
root
,
"Representation"
,
false
);
std
::
vector
<
Node
*>
representations
=
DOMHelper
::
getElementByTagName
(
root
,
"Representation"
,
false
);
...
@@ -97,6 +99,7 @@ void BasicCMParser::setRepresentations (Node *root, Group *group)
...
@@ -97,6 +99,7 @@ void BasicCMParser::setRepresentations (Node *root, Group *group)
{
{
const
std
::
map
<
std
::
string
,
std
::
string
>
attributes
=
representations
.
at
(
i
)
->
getAttributes
();
const
std
::
map
<
std
::
string
,
std
::
string
>
attributes
=
representations
.
at
(
i
)
->
getAttributes
();
//FIXME: handle @dependencyId afterward
Representation
*
rep
=
new
Representation
(
attributes
);
Representation
*
rep
=
new
Representation
(
attributes
);
if
(
this
->
parseCommonAttributesElements
(
representations
.
at
(
i
),
rep
)
==
false
)
if
(
this
->
parseCommonAttributesElements
(
representations
.
at
(
i
),
rep
)
==
false
)
{
{
...
...
modules/stream_filter/dash/mpd/Representation.cpp
View file @
967fdaa4
...
@@ -33,6 +33,7 @@ using namespace dash::mpd;
...
@@ -33,6 +33,7 @@ using namespace dash::mpd;
using
namespace
dash
::
exception
;
using
namespace
dash
::
exception
;
Representation
::
Representation
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
attributes
)
:
Representation
::
Representation
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
attributes
)
:
qualityRanking
(
-
1
),
attributes
(
attributes
),
attributes
(
attributes
),
segmentInfo
(
NULL
),
segmentInfo
(
NULL
),
trickModeType
(
NULL
)
trickModeType
(
NULL
)
...
@@ -52,26 +53,28 @@ std::string Representation::getDependencyId () const throw(Attri
...
@@ -52,26 +53,28 @@ std::string Representation::getDependencyId () const throw(Attri
throw
AttributeNotPresentException
();
throw
AttributeNotPresentException
();
return
it
->
second
;
return
it
->
second
;
}
}
std
::
string
Representation
::
getId
()
const
throw
(
AttributeNotPresentException
)
{
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
this
->
attributes
.
find
(
"id"
);
if
(
it
==
this
->
attributes
.
end
())
throw
AttributeNotPresentException
();
return
it
->
second
;
const
std
::
string
&
Representation
::
getId
()
const
{
return
this
->
id
;
}
void
Representation
::
setId
(
const
std
::
string
&
id
)
{
if
(
id
.
empty
()
==
false
)
this
->
id
=
id
;
}
}
int
Representation
::
getBandwidth
()
const
int
Representation
::
getBandwidth
()
const
{
{
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
this
->
attributes
.
find
(
"bandwidth"
);
return
this
->
bandwidth
;
if
(
it
==
this
->
attributes
.
end
())
}
return
-
1
;
return
atoi
(
it
->
second
.
c_str
()
)
/
8
;
void
Representation
::
setBandwidth
(
int
bandwidth
)
{
if
(
bandwidth
>=
0
)
this
->
bandwidth
=
bandwidth
;
}
}
SegmentInfo
*
Representation
::
getSegmentInfo
()
const
throw
(
ElementNotPresentException
)
SegmentInfo
*
Representation
::
getSegmentInfo
()
const
throw
(
ElementNotPresentException
)
...
@@ -101,3 +104,15 @@ void Representation::setSegmentInfo (SegmentInfo *info)
...
@@ -101,3 +104,15 @@ void Representation::setSegmentInfo (SegmentInfo *info)
{
{
this
->
segmentInfo
=
info
;
this
->
segmentInfo
=
info
;
}
}
int
Representation
::
getQualityRanking
()
const
{
return
this
->
qualityRanking
;
}
void
Representation
::
setQualityRanking
(
int
qualityRanking
)
{
if
(
qualityRanking
>
0
)
this
->
qualityRanking
=
qualityRanking
;
}
modules/stream_filter/dash/mpd/Representation.h
View file @
967fdaa4
...
@@ -44,13 +44,17 @@ namespace dash
...
@@ -44,13 +44,17 @@ namespace dash
Representation
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
attributes
);
Representation
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
attributes
);
virtual
~
Representation
();
virtual
~
Representation
();
std
::
string
getId
()
const
throw
(
dash
::
exception
::
AttributeNotPresentException
);
const
std
::
string
&
getId
()
const
;
void
setId
(
const
std
::
string
&
id
);
/*
/*
* @return The bitrate required for this representation
* @return The bitrate required for this representation
* in Bytes per seconds.
* in Bytes per seconds.
* -1 if an error occurs.
* -1 if an error occurs.
*/
*/
int
getBandwidth
()
const
;
int
getBandwidth
()
const
;
void
setBandwidth
(
int
bandwidth
);
int
getQualityRanking
()
const
;
void
setQualityRanking
(
int
qualityRanking
);
std
::
string
getDependencyId
()
const
throw
(
dash
::
exception
::
AttributeNotPresentException
);
std
::
string
getDependencyId
()
const
throw
(
dash
::
exception
::
AttributeNotPresentException
);
SegmentInfo
*
getSegmentInfo
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
);
SegmentInfo
*
getSegmentInfo
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
);
TrickModeType
*
getTrickModeType
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
);
TrickModeType
*
getTrickModeType
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
);
...
@@ -60,10 +64,12 @@ namespace dash
...
@@ -60,10 +64,12 @@ namespace dash
void
setContentProtection
(
ContentProtection
*
protection
);
void
setContentProtection
(
ContentProtection
*
protection
);
private:
private:
int
bandwidth
;
std
::
string
id
;
int
qualityRanking
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
SegmentInfo
*
segmentInfo
;
SegmentInfo
*
segmentInfo
;
TrickModeType
*
trickModeType
;
TrickModeType
*
trickModeType
;
};
};
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment