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
a53fc8ff
Commit
a53fc8ff
authored
Apr 30, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: rewrite segments inheritance
parent
eb1dd719
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
76 deletions
+45
-76
modules/demux/adaptative/playlist/SegmentInformation.cpp
modules/demux/adaptative/playlist/SegmentInformation.cpp
+44
-59
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+1
-17
No files found.
modules/demux/adaptative/playlist/SegmentInformation.cpp
View file @
a53fc8ff
...
@@ -69,24 +69,32 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
...
@@ -69,24 +69,32 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
case
INFOTYPE_INIT
:
case
INFOTYPE_INIT
:
{
{
/* init segments are always single segment */
/* init segments are always single segment */
ISegment
*
segment
=
getSegment
(
INFOTYPE_INIT
);
if
(
segmentBase
&&
segmentBase
->
initialisationSegment
.
Get
()
)
if
(
segment
)
{
retSegments
.
push_back
(
segment
);
retSegments
.
push_back
(
segmentBase
->
initialisationSegment
.
Get
()
);
}
else
if
(
segmentList
&&
segmentList
->
initialisationSegment
.
Get
()
)
{
retSegments
.
push_back
(
segmentList
->
initialisationSegment
.
Get
()
);
}
else
if
(
mediaSegmentTemplate
&&
mediaSegmentTemplate
->
initialisationSegment
.
Get
()
)
{
retSegments
.
push_back
(
mediaSegmentTemplate
->
initialisationSegment
.
Get
()
);
}
}
}
break
;
break
;
case
INFOTYPE_MEDIA
:
case
INFOTYPE_MEDIA
:
{
{
SegmentList
*
segList
=
inheritSegmentList
();
if
(
mediaSegmentTemplate
)
if
(
inheritSegmentTemplate
()
)
{
{
retSegments
.
push_back
(
inheritSegmentTemplate
()
);
retSegments
.
push_back
(
mediaSegmentTemplate
);
}
}
else
if
(
seg
List
&&
!
seg
List
->
getSegments
().
empty
()
)
else
if
(
seg
mentList
&&
!
segment
List
->
getSegments
().
empty
()
)
{
{
std
::
vector
<
Segment
*>::
const_iterator
it
;
std
::
vector
<
Segment
*>::
const_iterator
it
;
for
(
it
=
segList
->
getSegments
().
begin
();
for
(
it
=
seg
ment
List
->
getSegments
().
begin
();
it
!=
segList
->
getSegments
().
end
();
it
++
)
it
!=
seg
ment
List
->
getSegments
().
end
();
it
++
)
{
{
std
::
vector
<
ISegment
*>
list
=
(
*
it
)
->
subSegments
();
std
::
vector
<
ISegment
*>
list
=
(
*
it
)
->
subSegments
();
retSegments
.
insert
(
retSegments
.
end
(),
list
.
begin
(),
list
.
end
()
);
retSegments
.
insert
(
retSegments
.
end
(),
list
.
begin
(),
list
.
end
()
);
...
@@ -97,15 +105,25 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
...
@@ -97,15 +105,25 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
case
INFOTYPE_INDEX
:
case
INFOTYPE_INDEX
:
{
{
ISegment
*
segment
=
getSegment
(
INFOTYPE_INDEX
);
/* index segments are always single segment */
if
(
segment
)
if
(
segmentBase
&&
segmentBase
->
indexSegment
.
Get
()
)
retSegments
.
push_back
(
segment
);
{
retSegments
.
push_back
(
segmentBase
->
indexSegment
.
Get
()
);
}
else
if
(
segmentList
&&
segmentList
->
indexSegment
.
Get
()
)
{
retSegments
.
push_back
(
segmentList
->
indexSegment
.
Get
()
);
}
// templated index ?
}
}
default:
default:
break
;
break
;
}
}
if
(
retSegments
.
empty
()
&&
parent
)
return
parent
->
getSegments
(
type
);
else
return
retSegments
;
return
retSegments
;
}
}
...
@@ -122,55 +140,22 @@ vector<ISegment *> SegmentInformation::getSegments() const
...
@@ -122,55 +140,22 @@ vector<ISegment *> SegmentInformation::getSegments() const
ISegment
*
SegmentInformation
::
getSegment
(
SegmentInfoType
type
,
uint64_t
pos
)
const
ISegment
*
SegmentInformation
::
getSegment
(
SegmentInfoType
type
,
uint64_t
pos
)
const
{
{
SegmentBase
*
segBase
=
inheritSegmentBase
();
SegmentList
*
segList
=
inheritSegmentList
();
ISegment
*
segment
=
NULL
;
ISegment
*
segment
=
NULL
;
switch
(
type
)
vector
<
ISegment
*>
retSegments
=
getSegments
(
type
);
const
size_t
size
=
retSegments
.
size
();
if
(
size
)
{
{
case
INFOTYPE_INIT
:
/* check if that's a template (fixme: find a better way) */
if
(
segBase
&&
segBase
->
initialisationSegment
.
Get
()
)
BaseSegmentTemplate
*
templ
;
if
(
size
==
1
&&
(
templ
=
dynamic_cast
<
BaseSegmentTemplate
*>
(
retSegments
[
0
]))
)
{
{
segment
=
segBase
->
initialisationSegment
.
Get
()
;
return
templ
;
}
}
else
if
(
segList
&&
segList
->
initialisationSegment
.
Get
()
)
else
if
(
pos
<
size
)
{
{
segment
=
segList
->
initialisationSegment
.
Get
()
;
segment
=
retSegments
[
pos
]
;
}
}
else
if
(
inheritSegmentTemplate
()
)
{
segment
=
inheritSegmentTemplate
()
->
initialisationSegment
.
Get
();
}
break
;
case
INFOTYPE_MEDIA
:
if
(
inheritSegmentTemplate
()
)
{
segment
=
inheritSegmentTemplate
();
}
else
if
(
segList
&&
!
segList
->
getSegments
().
empty
()
)
{
std
::
vector
<
Segment
*>
list
=
segList
->
getSegments
();
if
(
pos
<
list
.
size
())
segment
=
list
.
at
(
pos
);
}
break
;
case
INFOTYPE_INDEX
:
if
(
segBase
&&
segBase
->
indexSegment
.
Get
()
)
{
segment
=
segBase
->
indexSegment
.
Get
();
}
else
if
(
segList
&&
segList
->
indexSegment
.
Get
()
)
{
segment
=
segList
->
indexSegment
.
Get
();
}
// templated index ?
break
;
default:
break
;
}
}
return
segment
;
return
segment
;
...
...
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
a53fc8ff
...
@@ -250,23 +250,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
...
@@ -250,23 +250,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
if
(
repNode
->
hasAttribute
(
"mimeType"
))
if
(
repNode
->
hasAttribute
(
"mimeType"
))
currentRepresentation
->
setMimeType
(
repNode
->
getAttributeValue
(
"mimeType"
));
currentRepresentation
->
setMimeType
(
repNode
->
getAttributeValue
(
"mimeType"
));
size_t
totalmediasegments
=
parseSegmentInformation
(
repNode
,
currentRepresentation
);
parseSegmentInformation
(
repNode
,
currentRepresentation
);
if
(
!
totalmediasegments
)
{
/* unranged & segment less representation, add fake segment */
SegmentList
*
list
=
new
SegmentList
();
Segment
*
seg
=
new
Segment
(
currentRepresentation
);
if
(
list
&&
seg
)
{
list
->
addSegment
(
seg
);
currentRepresentation
->
setSegmentList
(
list
);
}
else
{
delete
seg
;
delete
list
;
}
}
adaptationSet
->
addRepresentation
(
currentRepresentation
);
adaptationSet
->
addRepresentation
(
currentRepresentation
);
}
}
...
...
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