Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3319c47e
Commit
3319c47e
authored
Dec 29, 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 support for Representation's TrickMode element
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
20330719
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
22 deletions
+45
-22
modules/stream_filter/dash/mpd/BasicCMParser.cpp
modules/stream_filter/dash/mpd/BasicCMParser.cpp
+22
-2
modules/stream_filter/dash/mpd/BasicCMParser.h
modules/stream_filter/dash/mpd/BasicCMParser.h
+1
-0
modules/stream_filter/dash/mpd/Representation.cpp
modules/stream_filter/dash/mpd/Representation.cpp
+4
-9
modules/stream_filter/dash/mpd/Representation.h
modules/stream_filter/dash/mpd/Representation.h
+5
-6
modules/stream_filter/dash/mpd/TrickModeType.cpp
modules/stream_filter/dash/mpd/TrickModeType.cpp
+10
-2
modules/stream_filter/dash/mpd/TrickModeType.h
modules/stream_filter/dash/mpd/TrickModeType.h
+3
-3
No files found.
modules/stream_filter/dash/mpd/BasicCMParser.cpp
View file @
3319c47e
...
@@ -150,7 +150,7 @@ void BasicCMParser::setGroups (Node *root, Period *period)
...
@@ -150,7 +150,7 @@ void BasicCMParser::setGroups (Node *root, Period *period)
for
(
size_t
i
=
0
;
i
<
groups
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
groups
.
size
();
i
++
)
{
{
const
std
::
map
<
std
::
string
,
std
::
string
>
attr
=
groups
.
at
(
i
)
->
getAttributes
();
const
std
::
map
<
std
::
string
,
std
::
string
>
attr
=
groups
.
at
(
i
)
->
getAttributes
();
Group
*
group
=
new
Group
()
;
Group
*
group
=
new
Group
;
if
(
this
->
parseCommonAttributesElements
(
groups
.
at
(
i
),
group
,
NULL
)
==
false
)
if
(
this
->
parseCommonAttributesElements
(
groups
.
at
(
i
),
group
,
NULL
)
==
false
)
{
{
delete
group
;
delete
group
;
...
@@ -164,6 +164,25 @@ void BasicCMParser::setGroups (Node *root, Period *period)
...
@@ -164,6 +164,25 @@ void BasicCMParser::setGroups (Node *root, Period *period)
}
}
}
}
void
BasicCMParser
::
parseTrickMode
(
Node
*
node
,
Representation
*
repr
)
{
std
::
vector
<
Node
*>
trickModes
=
DOMHelper
::
getElementByTagName
(
node
,
"TrickMode"
,
false
);
if
(
trickModes
.
size
()
==
0
)
return
;
if
(
trickModes
.
size
()
>
1
)
std
::
cerr
<<
"More than 1 TrickMode element. Only the first one will be used."
<<
std
::
endl
;
Node
*
trickModeNode
=
trickModes
[
0
];
TrickModeType
*
trickMode
=
new
TrickModeType
;
const
std
::
map
<
std
::
string
,
std
::
string
>
attr
=
trickModeNode
->
getAttributes
();
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
attr
.
find
(
"alternatePlayoutRate"
);
if
(
it
!=
attr
.
end
()
)
trickMode
->
setAlternatePlayoutRate
(
atoi
(
it
->
second
.
c_str
()
)
);
repr
->
setTrickMode
(
trickMode
);
}
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
);
...
@@ -249,9 +268,10 @@ bool BasicCMParser::setSegmentInfo (Node *root, Representation *rep)
...
@@ -249,9 +268,10 @@ bool BasicCMParser::setSegmentInfo (Node *root, Representation *rep)
if
(
it
!=
attr
.
end
()
)
if
(
it
!=
attr
.
end
()
)
info
->
setDuration
(
str_duration
(
it
->
second
.
c_str
()
)
);
info
->
setDuration
(
str_duration
(
it
->
second
.
c_str
()
)
);
rep
->
setSegmentInfo
(
info
);
rep
->
setSegmentInfo
(
info
);
return
true
;
return
true
;
}
}
std
::
cerr
<<
"Missing mandatory element: Representation/SegmentInfo"
<<
std
::
endl
;
return
false
;
return
false
;
}
}
...
...
modules/stream_filter/dash/mpd/BasicCMParser.h
View file @
3319c47e
...
@@ -59,6 +59,7 @@ namespace dash
...
@@ -59,6 +59,7 @@ namespace dash
bool
setMPD
();
bool
setMPD
();
void
setPeriods
(
dash
::
xml
::
Node
*
root
);
void
setPeriods
(
dash
::
xml
::
Node
*
root
);
void
setGroups
(
dash
::
xml
::
Node
*
root
,
Period
*
period
);
void
setGroups
(
dash
::
xml
::
Node
*
root
,
Period
*
period
);
void
parseTrickMode
(
dash
::
xml
::
Node
*
node
,
Representation
*
repr
);
void
setRepresentations
(
dash
::
xml
::
Node
*
root
,
Group
*
group
);
void
setRepresentations
(
dash
::
xml
::
Node
*
root
,
Group
*
group
);
bool
setSegmentInfo
(
dash
::
xml
::
Node
*
root
,
Representation
*
rep
);
bool
setSegmentInfo
(
dash
::
xml
::
Node
*
root
,
Representation
*
rep
);
void
setInitSegment
(
dash
::
xml
::
Node
*
root
,
SegmentInfo
*
info
);
void
setInitSegment
(
dash
::
xml
::
Node
*
root
,
SegmentInfo
*
info
);
...
...
modules/stream_filter/dash/mpd/Representation.cpp
View file @
3319c47e
...
@@ -68,22 +68,17 @@ void Representation::setBandwidth( int bandwidth )
...
@@ -68,22 +68,17 @@ void Representation::setBandwidth( int bandwidth )
this
->
bandwidth
=
bandwidth
;
this
->
bandwidth
=
bandwidth
;
}
}
SegmentInfo
*
Representation
::
getSegmentInfo
()
const
throw
(
ElementNotPresentException
)
SegmentInfo
*
Representation
::
getSegmentInfo
()
const
{
{
if
(
this
->
segmentInfo
==
NULL
)
throw
ElementNotPresentException
();
return
this
->
segmentInfo
;
return
this
->
segmentInfo
;
}
}
TrickModeType
*
Representation
::
getTrickModeType
()
const
throw
(
ElementNotPresentException
)
{
if
(
this
->
segmentInfo
==
NULL
)
throw
ElementNotPresentException
();
TrickModeType
*
Representation
::
getTrickModeType
()
const
{
return
this
->
trickModeType
;
return
this
->
trickModeType
;
}
}
void
Representation
::
setTrickMode
Type
(
TrickModeType
*
trickModeType
)
void
Representation
::
setTrickMode
(
TrickModeType
*
trickModeType
)
{
{
this
->
trickModeType
=
trickModeType
;
this
->
trickModeType
=
trickModeType
;
}
}
...
...
modules/stream_filter/dash/mpd/Representation.h
View file @
3319c47e
...
@@ -55,16 +55,15 @@ namespace dash
...
@@ -55,16 +55,15 @@ namespace dash
void
setQualityRanking
(
int
qualityRanking
);
void
setQualityRanking
(
int
qualityRanking
);
const
std
::
list
<
const
Representation
*>&
getDependencies
()
const
;
const
std
::
list
<
const
Representation
*>&
getDependencies
()
const
;
void
addDependency
(
const
Representation
*
dep
);
void
addDependency
(
const
Representation
*
dep
);
SegmentInfo
*
getSegmentInfo
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
)
;
SegmentInfo
*
getSegmentInfo
()
const
;
TrickModeType
*
getTrickModeType
()
const
throw
(
dash
::
exception
::
ElementNotPresentException
)
;
TrickModeType
*
getTrickModeType
()
const
;
void
setSegmentInfo
(
SegmentInfo
*
info
);
void
setSegmentInfo
(
SegmentInfo
*
info
);
void
setTrickModeType
(
TrickModeType
*
trickModeType
);
void
setTrickMode
(
TrickModeType
*
trickModeType
);
private:
private:
int
bandwidth
;
int
bandwidth
;
std
::
string
id
;
std
::
string
id
;
int
qualityRanking
;
int
qualityRanking
;
std
::
list
<
const
Representation
*>
dependencies
;
std
::
list
<
const
Representation
*>
dependencies
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
SegmentInfo
*
segmentInfo
;
SegmentInfo
*
segmentInfo
;
...
...
modules/stream_filter/dash/mpd/TrickModeType.cpp
View file @
3319c47e
...
@@ -29,10 +29,18 @@
...
@@ -29,10 +29,18 @@
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
TrickModeType
::
TrickModeType
()
TrickModeType
::
TrickModeType
()
:
alternatePlayoutRate
(
1
)
{
{
}
int
TrickModeType
::
getAlternatePlayoutRate
()
const
{
return
this
->
alternatePlayoutRate
;
}
}
TrickModeType
::~
TrickModeType
()
void
TrickModeType
::
setAlternatePlayoutRate
(
int
playoutRate
)
{
{
this
->
alternatePlayoutRate
=
playoutRate
;
}
}
modules/stream_filter/dash/mpd/TrickModeType.h
View file @
3319c47e
...
@@ -36,12 +36,12 @@ namespace dash
...
@@ -36,12 +36,12 @@ namespace dash
{
{
public:
public:
TrickModeType
();
TrickModeType
();
virtual
~
TrickModeType
();
std
::
string
getAlternatePlayoutRate
();
int
getAlternatePlayoutRate
()
const
;
void
setAlternatePlayoutRate
(
int
playoutRate
);
private:
private:
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
int
alternatePlayoutRate
;
};
};
}
}
}
}
...
...
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