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
fb4b0f0c
Commit
fb4b0f0c
authored
Jun 06, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: fill result vectors by reference
parent
b304141f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
modules/demux/adaptative/playlist/BaseRepresentation.cpp
modules/demux/adaptative/playlist/BaseRepresentation.cpp
+2
-1
modules/demux/adaptative/playlist/SegmentInformation.cpp
modules/demux/adaptative/playlist/SegmentInformation.cpp
+16
-15
modules/demux/adaptative/playlist/SegmentInformation.hpp
modules/demux/adaptative/playlist/SegmentInformation.hpp
+2
-2
No files found.
modules/demux/adaptative/playlist/BaseRepresentation.cpp
View file @
fb4b0f0c
...
@@ -59,7 +59,8 @@ void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
...
@@ -59,7 +59,8 @@ void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
std
::
string
text
(
indent
,
' '
);
std
::
string
text
(
indent
,
' '
);
text
.
append
(
"Representation"
);
text
.
append
(
"Representation"
);
msg_Dbg
(
obj
,
"%s"
,
text
.
c_str
());
msg_Dbg
(
obj
,
"%s"
,
text
.
c_str
());
std
::
vector
<
ISegment
*>
list
=
getSegments
();
std
::
vector
<
ISegment
*>
list
;
getSegments
(
list
);
std
::
vector
<
ISegment
*>::
const_iterator
l
;
std
::
vector
<
ISegment
*>::
const_iterator
l
;
for
(
l
=
list
.
begin
();
l
!=
list
.
end
();
++
l
)
for
(
l
=
list
.
begin
();
l
!=
list
.
end
();
++
l
)
(
*
l
)
->
debug
(
obj
,
indent
+
1
);
(
*
l
)
->
debug
(
obj
,
indent
+
1
);
...
...
modules/demux/adaptative/playlist/SegmentInformation.cpp
View file @
fb4b0f0c
...
@@ -69,10 +69,8 @@ AbstractPlaylist * SegmentInformation::getPlaylist() const
...
@@ -69,10 +69,8 @@ AbstractPlaylist * SegmentInformation::getPlaylist() const
return
NULL
;
return
NULL
;
}
}
vector
<
ISegment
*>
SegmentInformation
::
getSegments
(
SegmentInfoType
type
)
const
std
::
size_t
SegmentInformation
::
getSegments
(
SegmentInfoType
type
,
vector
<
ISegment
*>
&
retSegments
)
const
{
{
vector
<
ISegment
*>
retSegments
;
switch
(
type
)
switch
(
type
)
{
{
case
INFOTYPE_INIT
:
case
INFOTYPE_INIT
:
...
@@ -136,28 +134,28 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
...
@@ -136,28 +134,28 @@ vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
}
}
if
(
retSegments
.
empty
()
&&
parent
)
if
(
retSegments
.
empty
()
&&
parent
)
return
parent
->
getSegments
(
type
);
return
parent
->
getSegments
(
type
,
retSegments
);
else
else
return
retSegments
;
return
retSegments
.
size
()
;
}
}
vector
<
ISegment
*>
SegmentInformation
::
getSegments
(
)
const
std
::
size_t
SegmentInformation
::
getSegments
(
vector
<
ISegment
*>
&
retSegments
)
const
{
{
vector
<
ISegment
*>
retSegments
;
for
(
int
i
=
0
;
i
<
InfoTypeCount
;
i
++
)
for
(
int
i
=
0
;
i
<
InfoTypeCount
;
i
++
)
{
{
vector
<
ISegment
*>
segs
=
getSegments
(
static_cast
<
SegmentInfoType
>
(
i
));
vector
<
ISegment
*>
segs
;
retSegments
.
insert
(
retSegments
.
end
(),
segs
.
begin
(),
segs
.
end
()
);
if
(
getSegments
(
static_cast
<
SegmentInfoType
>
(
i
),
segs
)
)
retSegments
.
insert
(
retSegments
.
end
(),
segs
.
begin
(),
segs
.
end
()
);
}
}
return
retSegments
;
return
retSegments
.
size
()
;
}
}
ISegment
*
SegmentInformation
::
getSegment
(
SegmentInfoType
type
,
uint64_t
pos
)
const
ISegment
*
SegmentInformation
::
getSegment
(
SegmentInfoType
type
,
uint64_t
pos
)
const
{
{
ISegment
*
segment
=
NULL
;
ISegment
*
segment
=
NULL
;
vector
<
ISegment
*>
retSegments
=
getSegments
(
type
)
;
vector
<
ISegment
*>
retSegments
;
const
size_t
size
=
retSegments
.
size
(
);
const
size_t
size
=
getSegments
(
type
,
retSegments
);
if
(
size
)
if
(
size
)
{
{
/* check if that's a template (fixme: find a better way) */
/* check if that's a template (fixme: find a better way) */
...
@@ -192,7 +190,8 @@ bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) con
...
@@ -192,7 +190,8 @@ bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) con
}
}
else
else
{
{
const
std
::
vector
<
ISegment
*>
segments
=
getSegments
(
INFOTYPE_MEDIA
);
std
::
vector
<
ISegment
*>
segments
;
getSegments
(
INFOTYPE_MEDIA
,
segments
);
std
::
vector
<
ISegment
*>::
const_iterator
it
;
std
::
vector
<
ISegment
*>::
const_iterator
it
;
*
ret
=
0
;
*
ret
=
0
;
for
(
it
=
segments
.
begin
();
it
!=
segments
.
end
();
++
it
)
for
(
it
=
segments
.
begin
();
it
!=
segments
.
end
();
++
it
)
...
@@ -254,7 +253,8 @@ void SegmentInformation::collectTimelines(std::vector<SegmentTimeline *> *timeli
...
@@ -254,7 +253,8 @@ void SegmentInformation::collectTimelines(std::vector<SegmentTimeline *> *timeli
void
SegmentInformation
::
getDurationsRange
(
mtime_t
*
min
,
mtime_t
*
max
)
const
void
SegmentInformation
::
getDurationsRange
(
mtime_t
*
min
,
mtime_t
*
max
)
const
{
{
/* FIXME: cache stuff in segment holders */
/* FIXME: cache stuff in segment holders */
std
::
vector
<
ISegment
*>
seglist
=
getSegments
(
INFOTYPE_MEDIA
);
std
::
vector
<
ISegment
*>
seglist
;
getSegments
(
INFOTYPE_MEDIA
,
seglist
);
std
::
vector
<
ISegment
*>::
const_iterator
it
;
std
::
vector
<
ISegment
*>::
const_iterator
it
;
mtime_t
total
=
0
;
mtime_t
total
=
0
;
for
(
it
=
seglist
.
begin
();
it
!=
seglist
.
end
();
++
it
)
for
(
it
=
seglist
.
begin
();
it
!=
seglist
.
end
();
++
it
)
...
@@ -344,7 +344,8 @@ static void insertIntoSegment(std::vector<ISegment *> &seglist, size_t start,
...
@@ -344,7 +344,8 @@ static void insertIntoSegment(std::vector<ISegment *> &seglist, size_t start,
void
SegmentInformation
::
SplitUsingIndex
(
std
::
vector
<
SplitPoint
>
&
splitlist
)
void
SegmentInformation
::
SplitUsingIndex
(
std
::
vector
<
SplitPoint
>
&
splitlist
)
{
{
std
::
vector
<
ISegment
*>
seglist
=
getSegments
(
INFOTYPE_MEDIA
);
std
::
vector
<
ISegment
*>
seglist
;
getSegments
(
INFOTYPE_MEDIA
,
seglist
);
std
::
vector
<
SplitPoint
>::
const_iterator
splitIt
;
std
::
vector
<
SplitPoint
>::
const_iterator
splitIt
;
size_t
start
=
0
,
end
=
0
;
size_t
start
=
0
,
end
=
0
;
mtime_t
time
=
0
;
mtime_t
time
=
0
;
...
...
modules/demux/adaptative/playlist/SegmentInformation.hpp
View file @
fb4b0f0c
...
@@ -82,8 +82,8 @@ namespace adaptative
...
@@ -82,8 +82,8 @@ namespace adaptative
virtual
void
mergeWith
(
SegmentInformation
*
,
mtime_t
);
virtual
void
mergeWith
(
SegmentInformation
*
,
mtime_t
);
protected:
protected:
std
::
vector
<
ISegment
*>
getSegments
(
)
const
;
std
::
size_t
getSegments
(
std
::
vector
<
ISegment
*>
&
)
const
;
std
::
vector
<
ISegment
*>
getSegments
(
SegmentInfoType
)
const
;
std
::
size_t
getSegments
(
SegmentInfoType
,
std
::
vector
<
ISegment
*>&
)
const
;
std
::
vector
<
SegmentInformation
*>
childs
;
std
::
vector
<
SegmentInformation
*>
childs
;
SegmentInformation
*
parent
;
SegmentInformation
*
parent
;
...
...
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