- remove grayscale step when sharing desktop

This commit is contained in:
Richard Alam 2012-05-22 17:53:27 +00:00
parent 113cbad759
commit c1a59722f2
3 changed files with 8 additions and 3 deletions

View File

@ -100,7 +100,7 @@ public final class Block {
System.arraycopy(capturedPixels, 0, pixelsCopy, 0, capturedPixels.length);
}
byte[] encodedBlock = ScreenVideoEncoder.encodePixels(pixelsCopy, getWidth(), getHeight(), (sentCount.longValue() > 5) /* send grayscale image */);
byte[] encodedBlock = ScreenVideoEncoder.encodePixels(pixelsCopy, getWidth(), getHeight(), (sentCount.longValue() < 5) /* send grayscale image */);
return new EncodedBlockData(position, encodedBlock);
}

View File

@ -172,7 +172,7 @@ public final class ScreenVideoEncoder {
byte red = (byte) ((pixels[i] >> 16) & 0xff);
byte green = (byte) ((pixels[i] >> 8) & 0xff);
byte blue = (byte) (pixels[i] & 0xff);
/*
if (grayscale) {
byte brightness = convertToGrayScale(red, green, blue);
@ -186,6 +186,11 @@ public final class ScreenVideoEncoder {
rgbPixels[position++] = green;
rgbPixels[position++] = red;
}
*/
// Sequence should be BGR
rgbPixels[position++] = blue;
rgbPixels[position++] = green;
rgbPixels[position++] = red;
}
long end = System.currentTimeMillis();