For one of my applications that saves the cameraโs preview to the buffer, I use the function Mediacodec.createInputSurface () and everything works fine, since I used API 19 and above. Now I want the same code to work for api 17 and below, as well as for some other devices where this api does not exist. Can someone help me out by telling me which alternative I can use?
here is a snippet of my code:
private Surface mInputSurface; private MediaCodec mEncoder; mInputSurface = mEncoder.createInputSurface();
Thanks for any help.
There is no alternative to the API. This feature was not introduced until API 18 (JB-MR2).
, SurfaceMediaSource ( JB-MR1), . Google, , libstagefright (, this), , / .
Pre-API 18 . , MediaCodec - . MediaCodec API 16/17.