Skip to content

Instantly share code, notes, and snippets.

View jethrogillgren's full-sized avatar

Jethro Gillgren jethrogillgren

  • UK
View GitHub Profile
private byte [] getYV12(int inputWidth, int inputHeight, Bitmap scaled) {
int [] argb = new int[inputWidth * inputHeight];
scaled.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight);
byte [] yuv = new byte[inputWidth*inputHeight*3/2];
encodeYV12(yuv, argb, inputWidth, inputHeight);
scaled.recycle();