How can I capture the screen as raw rgba buffers ( without encoding ) using MediaProjectionManager ?
I have seen many examples of how to capture the screen and encode it using MediaCodec but I want to use my own encoder instead.
How can I capture the screen as raw rgba buffers ( without encoding ) using MediaProjectionManager ?
I have seen many examples of how to capture the screen and encode it using MediaCodec but I want to use my own encoder instead.
MediaCodec supports RAW MIME type, MIMETYPE_VIDEO_RAW, if you look at http://developer.android.com/reference/android/media/MediaFormat.html#MIMETYPE_VIDEO_RAW
However, if you even want to use your custom codec that can replace MediaCodec, the whole thing should be hooking up to the mInputSurface.
mMediaProjection.createVirtualDisplay("Recording Display",
screenWidth, screenHeight, screenDensity, 0 /* flags */,
mInputSurface, null /* callback */, null /* handler */);
You may notice that Surface API has a lockCanvas, it probably is the API for writing to your codec via Canvas.
Surface: https://developer.android.com/reference/android/view/Surface.html
Canvas: https://developer.android.com/reference/android/graphics/Canvas.html
I will be interested to see your result.