Open
Description
Is there a better way to generate a bmp other than the code below:
bufferTexID = Common.genBlankTextureID(mRecordWidth, mRecordHeight);
frameBufferObject.bindTexture(bufferTexID);
GLES20.glViewport(0, 0, mRecordWidth, mRecordHeight);
mFrameRecorder.drawCache();
buffer = IntBuffer.allocate(mRecordWidth * mRecordHeight);
GLES20.glReadPixels(0, 0, mRecordWidth, mRecordHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buffer);
bmp = Bitmap.createBitmap(mRecordWidth, mRecordHeight, Bitmap.Config.ARGB_8888);
bmp.copyPixelsFromBuffer(buffer);
Log.i(LOG_TAG, String.format("w: %d, h: %d", mRecordWidth, mRecordHeight));
The code is causing a minor lag in the UI. My use case = While the video is recording, take a BMP periodically and check if there is a face in the BMP. If there is another cleaner way of doing this, please suggest.
Metadata
Metadata
Assignees
Labels
No labels