Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
737a297d
Commit
737a297d
authored
Dec 01, 2014
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: add segment start time
parent
6dd2798f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
4 deletions
+23
-4
modules/stream_filter/dash/mpd/Representation.cpp
modules/stream_filter/dash/mpd/Representation.cpp
+6
-3
modules/stream_filter/dash/mpd/Segment.cpp
modules/stream_filter/dash/mpd/Segment.cpp
+14
-1
modules/stream_filter/dash/mpd/Segment.h
modules/stream_filter/dash/mpd/Segment.h
+3
-0
No files found.
modules/stream_filter/dash/mpd/Representation.cpp
View file @
737a297d
...
...
@@ -231,7 +231,7 @@ MPD * Representation::getMPD() const
}
static
void
insertIntoSegment
(
std
::
vector
<
Segment
*>
&
seglist
,
size_t
start
,
size_t
end
)
size_t
end
,
mtime_t
time
)
{
std
::
vector
<
Segment
*>::
iterator
segIt
;
for
(
segIt
=
seglist
.
begin
();
segIt
<
seglist
.
end
();
segIt
++
)
...
...
@@ -244,6 +244,7 @@ static void insertIntoSegment(std::vector<Segment *> &seglist, size_t start,
start
+
segment
->
getOffset
(),
end
+
segment
->
getOffset
());
segment
->
addSubSegment
(
subsegment
);
segment
->
setStartTime
(
time
);
break
;
}
}
...
...
@@ -254,6 +255,7 @@ void Representation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
std
::
vector
<
Segment
*>
seglist
=
segmentList
->
getSegments
();
std
::
vector
<
SplitPoint
>::
const_iterator
splitIt
;
size_t
start
=
0
,
end
=
0
;
mtime_t
time
=
0
;
for
(
splitIt
=
splitlist
.
begin
();
splitIt
<
splitlist
.
end
();
splitIt
++
)
{
...
...
@@ -262,7 +264,8 @@ void Representation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
end
=
split
.
offset
;
if
(
splitIt
==
splitlist
.
begin
()
&&
split
.
offset
==
0
)
continue
;
insertIntoSegment
(
seglist
,
start
,
end
);
time
=
split
.
time
;
insertIntoSegment
(
seglist
,
start
,
end
,
time
);
end
++
;
}
...
...
@@ -270,6 +273,6 @@ void Representation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
{
start
=
end
;
end
=
0
;
insertIntoSegment
(
seglist
,
start
,
end
);
insertIntoSegment
(
seglist
,
start
,
end
,
time
);
}
}
modules/stream_filter/dash/mpd/Segment.cpp
View file @
737a297d
...
...
@@ -25,6 +25,8 @@
# include "config.h"
#endif
#define __STDC_CONSTANT_MACROS
#include "Segment.h"
#include "Representation.h"
#include "MPD.h"
...
...
@@ -38,7 +40,8 @@ using namespace dash::http;
ISegment
::
ISegment
(
const
ICanonicalUrl
*
parent
)
:
ICanonicalUrl
(
parent
),
startByte
(
0
),
endByte
(
0
)
endByte
(
0
),
startTime
(
VLC_TS_INVALID
)
{
debugName
=
"Segment"
;
classId
=
CLASSID_ISEGMENT
;
...
...
@@ -81,6 +84,16 @@ void ISegment::setByteRange(size_t start, size_t end)
endByte
=
end
;
}
void
ISegment
::
setStartTime
(
mtime_t
ztime
)
{
startTime
=
ztime
;
}
mtime_t
ISegment
::
getStartTime
()
const
{
return
startTime
;
}
size_t
ISegment
::
getOffset
()
const
{
return
startByte
;
...
...
modules/stream_filter/dash/mpd/Segment.h
View file @
737a297d
...
...
@@ -53,6 +53,8 @@ namespace dash
virtual
void
done
();
virtual
dash
::
http
::
Chunk
*
toChunk
();
virtual
void
setByteRange
(
size_t
start
,
size_t
end
);
virtual
void
setStartTime
(
mtime_t
ztime
);
virtual
mtime_t
getStartTime
()
const
;
virtual
size_t
getOffset
()
const
;
virtual
std
::
vector
<
ISegment
*>
subSegments
()
=
0
;
virtual
std
::
string
toString
()
const
;
...
...
@@ -65,6 +67,7 @@ namespace dash
protected:
size_t
startByte
;
size_t
endByte
;
mtime_t
startTime
;
std
::
string
debugName
;
int
classId
;
...
...
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