Commit 33d200ee authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: for now set adaptation interval

parent 614eb9b9
...@@ -36,7 +36,8 @@ using namespace dash::mpd; ...@@ -36,7 +36,8 @@ using namespace dash::mpd;
RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPD *mpd) : RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPD *mpd) :
AbstractAdaptationLogic (mpd), AbstractAdaptationLogic (mpd),
bpsAvg(0), bpsSamplecount(0) bpsAvg(0), bpsSamplecount(0),
currentBps(0)
{ {
width = var_InheritInteger(mpd->getVLCObject(), "dash-prefwidth"); width = var_InheritInteger(mpd->getVLCObject(), "dash-prefwidth");
height = var_InheritInteger(mpd->getVLCObject(), "dash-prefheight"); height = var_InheritInteger(mpd->getVLCObject(), "dash-prefheight");
...@@ -48,7 +49,7 @@ const Representation *RateBasedAdaptationLogic::getCurrentRepresentation(Streams ...@@ -48,7 +49,7 @@ const Representation *RateBasedAdaptationLogic::getCurrentRepresentation(Streams
return NULL; return NULL;
RepresentationSelector selector; RepresentationSelector selector;
Representation *rep = selector.select(currentPeriod, type, bpsAvg, width, height); Representation *rep = selector.select(currentPeriod, type, currentBps, width, height);
if ( rep == NULL ) if ( rep == NULL )
{ {
rep = selector.select(currentPeriod, type); rep = selector.select(currentPeriod, type);
...@@ -71,4 +72,7 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time) ...@@ -71,4 +72,7 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
bpsAvg = bpsAvg - (bpsAvg - current) / (bpsSamplecount + 1); bpsAvg = bpsAvg - (bpsAvg - current) / (bpsSamplecount + 1);
bpsSamplecount++; bpsSamplecount++;
if(bpsSamplecount % 5 == 0)
currentBps = bpsAvg;
} }
...@@ -46,6 +46,7 @@ namespace dash ...@@ -46,6 +46,7 @@ namespace dash
int height; int height;
size_t bpsAvg; size_t bpsAvg;
size_t bpsSamplecount; size_t bpsSamplecount;
size_t currentBps;
}; };
} }
} }
......
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