Skip to content
Snippets Groups Projects
Commit 2be328f0 authored by Boris Grozev's avatar Boris Grozev
Browse files

Fixes a problem with the VP8 Packetizer sometimes not sending the last chunk...

Fixes a problem with the VP8 Packetizer sometimes not sending the last chunk of a packet correctly. Changes the VP8 encoder and decoder used to the ones based on libvpx. Updates libjitsi.jar
parent b0f1d9c5
No related branches found
No related tags found
No related merge requests found
......@@ -76,8 +76,8 @@ public class FMJPlugInConfiguration
"org.jitsi.impl.neomedia.codec.video.SwScaler",
"org.jitsi.impl.neomedia.codec.video.vp8.Packetizer",
"org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer",
"org.jitsi.impl.neomedia.codec.video.vp8.JNIEncoder",
"org.jitsi.impl.neomedia.codec.video.vp8.JNIDecoder"
"org.jitsi.impl.neomedia.codec.video.vp8.VPXEncoder",
"org.jitsi.impl.neomedia.codec.video.vp8.VPXDecoder"
};
/**
......
......@@ -88,25 +88,14 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
}
byte[] output;
int offset;
boolean haveToCopy = true;
final int pdMaxLen = DePacketizer.VP8PayloadDescriptor.MAX_LENGTH;
//The input will fit in a single packet
if(inputBuffer.getLength() <= MAX_SIZE)
{
//see if we can reuse the input buffer
if(inputBuffer.getOffset() >= pdMaxLen)
{
output = (byte[]) inputBuffer.getData();
offset = inputBuffer.getOffset();
haveToCopy = false;
}
else
{
output = validateByteArraySize(outputBuffer,
inputBuffer.getLength() + pdMaxLen);
offset = pdMaxLen;
}
output = validateByteArraySize(outputBuffer,
inputBuffer.getLength() + pdMaxLen);
offset = pdMaxLen;
}
else
{
......@@ -117,14 +106,12 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
int len = inputBuffer.getLength() <= MAX_SIZE
? inputBuffer.getLength()
: MAX_SIZE;
if(haveToCopy)
{
System.arraycopy((byte[])inputBuffer.getData(),
inputBuffer.getOffset(),
output,
offset,
len);
}
System.arraycopy((byte[])inputBuffer.getData(),
inputBuffer.getOffset(),
output,
offset,
len);
//get the payload descriptor and copy it to the output
byte[] pd = DePacketizer.VP8PayloadDescriptor.create(firstPacket);
......
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