mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 17:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package org.osmf.net.rtmpstreaming
|
||||
{
|
||||
import org.osmf.net.SwitchingRuleBase;
|
||||
|
||||
public class InsufficientBandwidthRule extends SwitchingRuleBase
|
||||
{
|
||||
|
||||
private var bitrateMultiplier:Number;
|
||||
|
||||
public function InsufficientBandwidthRule(param1:RTMPNetStreamMetrics, param2:Number = 1.15)
|
||||
{
|
||||
super(param1);
|
||||
this.bitrateMultiplier = param2;
|
||||
}
|
||||
|
||||
override public function getNewIndex() : int
|
||||
{
|
||||
var _loc3_:* = null;
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:* = -1;
|
||||
if(rtmpMetrics.averageMaxBytesPerSecond != 0)
|
||||
{
|
||||
_loc1_ = rtmpMetrics.currentIndex;
|
||||
while(_loc1_ >= 0)
|
||||
{
|
||||
if(rtmpMetrics.averageMaxBytesPerSecond * 8 / 1024 > rtmpMetrics.resource.streamItems[_loc1_].bitrate * bitrateMultiplier)
|
||||
{
|
||||
_loc2_ = _loc1_;
|
||||
break;
|
||||
}
|
||||
_loc1_--;
|
||||
}
|
||||
_loc2_ = int(_loc2_ == rtmpMetrics.currentIndex ? -1 : _loc2_);
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function get rtmpMetrics() : RTMPNetStreamMetrics
|
||||
{
|
||||
return metrics as RTMPNetStreamMetrics;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user