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
36145354
Commit
36145354
authored
May 23, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: recursively merge segmentinfo
parent
f48876f3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
15 deletions
+48
-15
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
+2
-14
modules/demux/adaptative/playlist/ICanonicalUrl.hpp
modules/demux/adaptative/playlist/ICanonicalUrl.hpp
+2
-1
modules/demux/adaptative/playlist/SegmentInformation.cpp
modules/demux/adaptative/playlist/SegmentInformation.cpp
+15
-0
modules/demux/adaptative/playlist/SegmentInformation.hpp
modules/demux/adaptative/playlist/SegmentInformation.hpp
+1
-0
modules/demux/adaptative/playlist/SegmentList.cpp
modules/demux/adaptative/playlist/SegmentList.cpp
+16
-0
modules/demux/adaptative/playlist/SegmentList.h
modules/demux/adaptative/playlist/SegmentList.h
+1
-0
modules/demux/adaptative/playlist/SegmentTemplate.cpp
modules/demux/adaptative/playlist/SegmentTemplate.cpp
+10
-0
modules/demux/adaptative/playlist/SegmentTemplate.h
modules/demux/adaptative/playlist/SegmentTemplate.h
+1
-0
No files found.
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
View file @
36145354
...
@@ -133,20 +133,8 @@ void AbstractPlaylist::getTimeLinesBoundaries(mtime_t *min, mtime_t *max) const
...
@@ -133,20 +133,8 @@ void AbstractPlaylist::getTimeLinesBoundaries(mtime_t *min, mtime_t *max) const
void
AbstractPlaylist
::
mergeWith
(
AbstractPlaylist
*
updatedAbstractPlaylist
,
mtime_t
prunebarrier
)
void
AbstractPlaylist
::
mergeWith
(
AbstractPlaylist
*
updatedAbstractPlaylist
,
mtime_t
prunebarrier
)
{
{
availabilityEndTime
.
Set
(
updatedAbstractPlaylist
->
availabilityEndTime
.
Get
());
availabilityEndTime
.
Set
(
updatedAbstractPlaylist
->
availabilityEndTime
.
Get
());
/* Only merge timelines for now */
for
(
size_t
i
=
0
;
i
<
periods
.
size
()
&&
i
<
updatedAbstractPlaylist
->
periods
.
size
();
i
++
)
{
std
::
vector
<
SegmentTimeline
*>
timelines
;
std
::
vector
<
SegmentTimeline
*>
timelinesUpdate
;
periods
.
at
(
i
)
->
collectTimelines
(
&
timelines
);
updatedAbstractPlaylist
->
periods
.
at
(
i
)
->
collectTimelines
(
&
timelinesUpdate
);
for
(
size_t
j
=
0
;
j
<
timelines
.
size
()
&&
j
<
timelinesUpdate
.
size
();
j
++
)
for
(
size_t
i
=
0
;
i
<
periods
.
size
()
&&
i
<
updatedAbstractPlaylist
->
periods
.
size
();
i
++
)
{
periods
.
at
(
i
)
->
mergeWith
(
updatedAbstractPlaylist
->
periods
.
at
(
i
),
prunebarrier
);
timelines
.
at
(
j
)
->
mergeWith
(
*
timelinesUpdate
.
at
(
j
));
if
(
prunebarrier
)
timelines
.
at
(
j
)
->
prune
(
prunebarrier
);
}
}
}
}
modules/demux/adaptative/playlist/ICanonicalUrl.hpp
View file @
36145354
...
@@ -29,8 +29,9 @@ namespace adaptative
...
@@ -29,8 +29,9 @@ namespace adaptative
class
ICanonicalUrl
class
ICanonicalUrl
{
{
public:
public:
ICanonicalUrl
(
const
ICanonicalUrl
*
parent
=
NULL
)
{
parentUrlMember
=
parent
;
}
ICanonicalUrl
(
const
ICanonicalUrl
*
parent
=
NULL
)
{
setParent
(
parent
)
;
}
virtual
Url
getUrlSegment
()
const
=
0
;
virtual
Url
getUrlSegment
()
const
=
0
;
void
setParent
(
const
ICanonicalUrl
*
parent
)
{
parentUrlMember
=
parent
;
}
protected:
protected:
Url
getParentUrlSegment
()
const
{
Url
getParentUrlSegment
()
const
{
...
...
modules/demux/adaptative/playlist/SegmentInformation.cpp
View file @
36145354
...
@@ -251,6 +251,21 @@ void SegmentInformation::collectTimelines(std::vector<SegmentTimeline *> *timeli
...
@@ -251,6 +251,21 @@ void SegmentInformation::collectTimelines(std::vector<SegmentTimeline *> *timeli
(
*
it
)
->
collectTimelines
(
timelines
);
(
*
it
)
->
collectTimelines
(
timelines
);
}
}
void
SegmentInformation
::
mergeWith
(
SegmentInformation
*
updated
,
mtime_t
prunetime
)
{
/* Support Segment List for now */
if
(
segmentList
&&
updated
->
segmentList
)
segmentList
->
mergeWith
(
updated
->
segmentList
);
if
(
mediaSegmentTemplate
&&
updated
->
mediaSegmentTemplate
)
mediaSegmentTemplate
->
mergeWith
(
updated
->
mediaSegmentTemplate
,
prunetime
);
for
(
size_t
i
=
0
;
i
<
childs
.
size
()
&&
i
<
updated
->
childs
.
size
();
i
++
)
{
childs
.
at
(
i
)
->
mergeWith
(
updated
->
childs
.
at
(
i
),
prunetime
);
}
}
bool
SegmentInformation
::
canBitswitch
()
const
bool
SegmentInformation
::
canBitswitch
()
const
{
{
if
(
bitswitch_policy
==
BITSWITCH_INHERIT
)
if
(
bitswitch_policy
==
BITSWITCH_INHERIT
)
...
...
modules/demux/adaptative/playlist/SegmentInformation.hpp
View file @
36145354
...
@@ -78,6 +78,7 @@ namespace adaptative
...
@@ -78,6 +78,7 @@ namespace adaptative
bool
getSegmentNumberByTime
(
mtime_t
,
uint64_t
*
)
const
;
bool
getSegmentNumberByTime
(
mtime_t
,
uint64_t
*
)
const
;
mtime_t
getPlaybackTimeBySegmentNumber
(
uint64_t
)
const
;
mtime_t
getPlaybackTimeBySegmentNumber
(
uint64_t
)
const
;
void
collectTimelines
(
std
::
vector
<
SegmentTimeline
*>
*
)
const
;
void
collectTimelines
(
std
::
vector
<
SegmentTimeline
*>
*
)
const
;
virtual
void
mergeWith
(
SegmentInformation
*
,
mtime_t
);
protected:
protected:
std
::
vector
<
ISegment
*>
getSegments
()
const
;
std
::
vector
<
ISegment
*>
getSegments
()
const
;
...
...
modules/demux/adaptative/playlist/SegmentList.cpp
View file @
36145354
...
@@ -46,5 +46,21 @@ const std::vector<Segment*>& SegmentList::getSegments() const
...
@@ -46,5 +46,21 @@ const std::vector<Segment*>& SegmentList::getSegments() const
void
SegmentList
::
addSegment
(
Segment
*
seg
)
void
SegmentList
::
addSegment
(
Segment
*
seg
)
{
{
seg
->
setParent
(
this
);
segments
.
push_back
(
seg
);
segments
.
push_back
(
seg
);
}
}
void
SegmentList
::
mergeWith
(
SegmentList
*
updated
)
{
const
Segment
*
lastSegment
=
(
segments
.
empty
())
?
NULL
:
segments
.
back
();
std
::
vector
<
Segment
*>::
iterator
it
;
for
(
it
=
updated
->
segments
.
begin
();
it
!=
updated
->
segments
.
end
();
++
it
)
{
if
(
!
lastSegment
||
lastSegment
->
compare
(
*
it
)
<
0
)
addSegment
(
*
it
);
else
delete
*
it
;
}
updated
->
segments
.
clear
();
}
modules/demux/adaptative/playlist/SegmentList.h
View file @
36145354
...
@@ -47,6 +47,7 @@ namespace adaptative
...
@@ -47,6 +47,7 @@ namespace adaptative
const
std
::
vector
<
Segment
*>&
getSegments
()
const
;
const
std
::
vector
<
Segment
*>&
getSegments
()
const
;
void
addSegment
(
Segment
*
seg
);
void
addSegment
(
Segment
*
seg
);
void
mergeWith
(
SegmentList
*
);
private:
private:
std
::
vector
<
Segment
*>
segments
;
std
::
vector
<
Segment
*>
segments
;
...
...
modules/demux/adaptative/playlist/SegmentTemplate.cpp
View file @
36145354
...
@@ -57,6 +57,16 @@ MediaSegmentTemplate::MediaSegmentTemplate( SegmentInformation *parent ) :
...
@@ -57,6 +57,16 @@ MediaSegmentTemplate::MediaSegmentTemplate( SegmentInformation *parent ) :
initialisationSegment
.
Set
(
NULL
);
initialisationSegment
.
Set
(
NULL
);
}
}
void
MediaSegmentTemplate
::
mergeWith
(
MediaSegmentTemplate
*
updated
,
mtime_t
prunebarrier
)
{
if
(
segmentTimeline
.
Get
()
&&
updated
->
segmentTimeline
.
Get
())
{
segmentTimeline
.
Get
()
->
mergeWith
(
*
updated
->
segmentTimeline
.
Get
());
if
(
prunebarrier
)
segmentTimeline
.
Get
()
->
prune
(
prunebarrier
);
}
}
InitSegmentTemplate
::
InitSegmentTemplate
(
ICanonicalUrl
*
parent
)
:
InitSegmentTemplate
::
InitSegmentTemplate
(
ICanonicalUrl
*
parent
)
:
BaseSegmentTemplate
(
parent
)
BaseSegmentTemplate
(
parent
)
{
{
...
...
modules/demux/adaptative/playlist/SegmentTemplate.h
View file @
36145354
...
@@ -50,6 +50,7 @@ namespace adaptative
...
@@ -50,6 +50,7 @@ namespace adaptative
{
{
public:
public:
MediaSegmentTemplate
(
SegmentInformation
*
=
NULL
);
MediaSegmentTemplate
(
SegmentInformation
*
=
NULL
);
void
mergeWith
(
MediaSegmentTemplate
*
,
mtime_t
);
Property
<
size_t
>
startNumber
;
Property
<
size_t
>
startNumber
;
};
};
...
...
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