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
Branches
Tags
No related merge requests found
...@@ -76,8 +76,8 @@ public class FMJPlugInConfiguration ...@@ -76,8 +76,8 @@ public class FMJPlugInConfiguration
"org.jitsi.impl.neomedia.codec.video.SwScaler", "org.jitsi.impl.neomedia.codec.video.SwScaler",
"org.jitsi.impl.neomedia.codec.video.vp8.Packetizer", "org.jitsi.impl.neomedia.codec.video.vp8.Packetizer",
"org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer", "org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer",
"org.jitsi.impl.neomedia.codec.video.vp8.JNIEncoder", "org.jitsi.impl.neomedia.codec.video.vp8.VPXEncoder",
"org.jitsi.impl.neomedia.codec.video.vp8.JNIDecoder" "org.jitsi.impl.neomedia.codec.video.vp8.VPXDecoder"
}; };
/** /**
......
...@@ -88,25 +88,14 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer) ...@@ -88,25 +88,14 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
} }
byte[] output; byte[] output;
int offset; int offset;
boolean haveToCopy = true;
final int pdMaxLen = DePacketizer.VP8PayloadDescriptor.MAX_LENGTH; final int pdMaxLen = DePacketizer.VP8PayloadDescriptor.MAX_LENGTH;
//The input will fit in a single packet //The input will fit in a single packet
if(inputBuffer.getLength() <= MAX_SIZE) if(inputBuffer.getLength() <= MAX_SIZE)
{ {
//see if we can reuse the input buffer output = validateByteArraySize(outputBuffer,
if(inputBuffer.getOffset() >= pdMaxLen) inputBuffer.getLength() + pdMaxLen);
{ offset = pdMaxLen;
output = (byte[]) inputBuffer.getData();
offset = inputBuffer.getOffset();
haveToCopy = false;
}
else
{
output = validateByteArraySize(outputBuffer,
inputBuffer.getLength() + pdMaxLen);
offset = pdMaxLen;
}
} }
else else
{ {
...@@ -117,14 +106,12 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer) ...@@ -117,14 +106,12 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
int len = inputBuffer.getLength() <= MAX_SIZE int len = inputBuffer.getLength() <= MAX_SIZE
? inputBuffer.getLength() ? inputBuffer.getLength()
: MAX_SIZE; : MAX_SIZE;
if(haveToCopy)
{ System.arraycopy((byte[])inputBuffer.getData(),
System.arraycopy((byte[])inputBuffer.getData(), inputBuffer.getOffset(),
inputBuffer.getOffset(), output,
output, offset,
offset, len);
len);
}
//get the payload descriptor and copy it to the output //get the payload descriptor and copy it to the output
byte[] pd = DePacketizer.VP8PayloadDescriptor.create(firstPacket); byte[] pd = DePacketizer.VP8PayloadDescriptor.create(firstPacket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment