I have byte[] yuvByteArray
(540x360 image captured from Camera.PreviewCallback.onPreviewFrame
method and dumped into assets/yuv.bin
fi
Our internal test app uses the following sequence to create the YUV allocation.
tb = new Type.Builder(mRS, Element.createPixel(mRS,
Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV));
tb.setX(mWidth);
tb.setY(mHeight);
tb.setYuvFormat(android.graphics.ImageFormat.NV21);
mAllocationIn = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT);
Then inside the callback that new YUV data is available do
mAllocationIn.copyFrom(theYuvByteArray);