Commit 737a297d authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: add segment start time

parent 6dd2798f
......@@ -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);
}
}
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment