Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
eb1dd719
Commit
eb1dd719
authored
Apr 30, 2015
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: fix parent context for init segments
parent
51e7ebd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+11
-12
modules/demux/dash/mpd/IsoffMainParser.h
modules/demux/dash/mpd/IsoffMainParser.h
+1
-3
No files found.
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
eb1dd719
...
...
@@ -52,7 +52,6 @@ IsoffMainParser::IsoffMainParser (Node *root_, stream_t *stream)
{
root
=
root_
;
mpd
=
NULL
;
currentRepresentation
=
NULL
;
p_stream
=
stream
;
}
...
...
@@ -229,7 +228,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
for
(
size_t
i
=
0
;
i
<
representations
.
size
();
i
++
)
{
this
->
currentRepresentation
=
new
Representation
(
adaptationSet
,
getMPD
());
Representation
*
currentRepresentation
=
new
Representation
(
adaptationSet
,
getMPD
());
Node
*
repNode
=
representations
.
at
(
i
);
std
::
vector
<
Node
*>
baseUrls
=
DOMHelper
::
getChildElementByTagName
(
repNode
,
"BaseURL"
);
...
...
@@ -240,13 +239,13 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
currentRepresentation
->
setId
(
repNode
->
getAttributeValue
(
"id"
));
if
(
repNode
->
hasAttribute
(
"width"
))
this
->
currentRepresentation
->
setWidth
(
atoi
(
repNode
->
getAttributeValue
(
"width"
).
c_str
()));
currentRepresentation
->
setWidth
(
atoi
(
repNode
->
getAttributeValue
(
"width"
).
c_str
()));
if
(
repNode
->
hasAttribute
(
"height"
))
this
->
currentRepresentation
->
setHeight
(
atoi
(
repNode
->
getAttributeValue
(
"height"
).
c_str
()));
currentRepresentation
->
setHeight
(
atoi
(
repNode
->
getAttributeValue
(
"height"
).
c_str
()));
if
(
repNode
->
hasAttribute
(
"bandwidth"
))
this
->
currentRepresentation
->
setBandwidth
(
atoi
(
repNode
->
getAttributeValue
(
"bandwidth"
).
c_str
()));
currentRepresentation
->
setBandwidth
(
atoi
(
repNode
->
getAttributeValue
(
"bandwidth"
).
c_str
()));
if
(
repNode
->
hasAttribute
(
"mimeType"
))
currentRepresentation
->
setMimeType
(
repNode
->
getAttributeValue
(
"mimeType"
));
...
...
@@ -269,7 +268,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
}
}
adaptationSet
->
addRepresentation
(
this
->
currentRepresentation
);
adaptationSet
->
addRepresentation
(
currentRepresentation
);
}
}
size_t
IsoffMainParser
::
parseSegmentBase
(
Node
*
segmentBaseNode
,
SegmentInformation
*
info
)
...
...
@@ -307,14 +306,14 @@ size_t IsoffMainParser::parseSegmentBase(Node * segmentBaseNode, SegmentInformat
if
(
initSeg
)
{
SegmentBase
*
base
=
new
SegmentBase
();
parseInitSegment
(
initSeg
,
base
);
parseInitSegment
(
initSeg
,
base
,
info
);
info
->
setSegmentBase
(
base
);
}
}
else
{
SegmentBase
*
base
=
new
SegmentBase
();
parseInitSegment
(
DOMHelper
::
getFirstChildElementByName
(
segmentBaseNode
,
"Initialization"
),
base
);
parseInitSegment
(
DOMHelper
::
getFirstChildElementByName
(
segmentBaseNode
,
"Initialization"
),
base
,
info
);
info
->
setSegmentBase
(
base
);
}
...
...
@@ -329,9 +328,9 @@ size_t IsoffMainParser::parseSegmentList(Node * segListNode, SegmentInformation
{
std
::
vector
<
Node
*>
segments
=
DOMHelper
::
getElementByTagName
(
segListNode
,
"SegmentURL"
,
false
);
SegmentList
*
list
;
if
(
!
segments
.
empty
()
&&
(
list
=
new
(
std
::
nothrow
)
SegmentList
()))
if
((
list
=
new
(
std
::
nothrow
)
SegmentList
()))
{
parseInitSegment
(
DOMHelper
::
getFirstChildElementByName
(
segListNode
,
"Initialization"
),
list
);
parseInitSegment
(
DOMHelper
::
getFirstChildElementByName
(
segListNode
,
"Initialization"
),
list
,
info
);
if
(
segListNode
->
hasAttribute
(
"duration"
))
list
->
setDuration
(
Integer
<
mtime_t
>
(
segListNode
->
getAttributeValue
(
"duration"
)));
...
...
@@ -376,12 +375,12 @@ size_t IsoffMainParser::parseSegmentList(Node * segListNode, SegmentInformation
return
total
;
}
void
IsoffMainParser
::
parseInitSegment
(
Node
*
initNode
,
Initializable
<
Segment
>
*
init
)
void
IsoffMainParser
::
parseInitSegment
(
Node
*
initNode
,
Initializable
<
Segment
>
*
init
,
SegmentInformation
*
parent
)
{
if
(
!
initNode
)
return
;
Segment
*
seg
=
new
InitSegment
(
currentRepresentation
);
Segment
*
seg
=
new
InitSegment
(
parent
);
seg
->
setSourceUrl
(
initNode
->
getAttributeValue
(
"sourceURL"
));
if
(
initNode
->
hasAttribute
(
"range"
))
...
...
modules/demux/dash/mpd/IsoffMainParser.h
View file @
eb1dd719
...
...
@@ -57,7 +57,6 @@ namespace dash
{
class
Period
;
class
AdaptationSet
;
class
Representation
;
class
MPD
;
using
namespace
adaptative
::
playlist
;
...
...
@@ -76,7 +75,7 @@ namespace dash
void
setMPDAttributes
();
void
setAdaptationSets
(
xml
::
Node
*
periodNode
,
Period
*
period
);
void
setRepresentations
(
xml
::
Node
*
adaptationSetNode
,
AdaptationSet
*
adaptationSet
);
void
parseInitSegment
(
xml
::
Node
*
,
Initializable
<
Segment
>
*
);
void
parseInitSegment
(
xml
::
Node
*
,
Initializable
<
Segment
>
*
,
SegmentInformation
*
);
void
parseTimeline
(
xml
::
Node
*
,
MediaSegmentTemplate
*
);
void
parsePeriods
(
xml
::
Node
*
);
size_t
parseSegmentInformation
(
xml
::
Node
*
,
SegmentInformation
*
);
...
...
@@ -88,7 +87,6 @@ namespace dash
xml
::
Node
*
root
;
MPD
*
mpd
;
stream_t
*
p_stream
;
Representation
*
currentRepresentation
;
};
class
IsoTime
...
...
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