Skip to content
Snippets Groups Projects
Commit ec47542b authored by George Politis's avatar George Politis
Browse files

Use the remote bandwidth estimator for REMBs reported by the...

Use the remote bandwidth estimator for REMBs reported by the MaxThroughputBridgeRTCPTerminationStrategy.
parent 6bcb12d8
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,31 @@ public RTCPREMBPacket(
this.dest = dest;
}
public RTCPREMBPacket(
long senderSSRC,
long mediaSSRC,
long bitrate,
long[] dest)
{
super(FMT, PSFB, senderSSRC, mediaSSRC);
// 6 bit Exp
// 18 bit mantissa
this.exp = 0;
for(int i=0; i<64; i++)
{
if(bitrate <= (0x3ffff << i))
{
this.exp = i;
break;
}
}
/* type of bitrate is an unsigned int (32 bits) */
this.mantissa = (((int)bitrate) >> this.exp);
this.dest = dest;
}
public RTCPREMBPacket(RTCPCompoundPacket base)
{
super(base);
......@@ -161,9 +186,9 @@ public void assemble(DataOutputStream dataoutputstream) throws IOException
// BR Mantissa (18 bits): The mantissa of the maximum total media bit
// rate (ignoring all packet overhead) that the sender of
// the REMB estimates.
buf[off++] = (byte) (((exp & 0x3F) << 2) | (mantissa & 0x30000) >> 16);
buf[off++] = (byte) ((mantissa & 0xFF00) >> 8);
buf[off++] = (byte) (mantissa & 0xFF);
buf[off++] = (byte) (((exp & 0x3f) << 2) | (mantissa & 0x30000) >> 16);
buf[off++] = (byte) ((mantissa & 0xff00) >> 8);
buf[off++] = (byte) (mantissa & 0xff);
// SSRC feedback (32 bits) Consists of one or more SSRC entries which
// this feedback message applies to.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment