Hi, I had an issue in my app where after stopping and starting the CameraCapture several times, it would crash. On some versions of Android, there is a hard limit to the number of instances of the hardware encoder you can instantiate using Android MediaCodec. I fixed it in CameraCapture.java, in stop(). Please see the comments I have added to the code in question.
public void stop() {
super.stop();
if (previewRender != null) {
/* commenting out this section works because in stop() another instance of MediaCodec is created.
LinkedList videoEffects = videoEffector.getVideoEffects();
videoEffector = androidMediaObjectFactory.createVideoEffector(); //additional instance of MediaCodec is created here when there should be none left
videoEffector.getVideoEffects().addAll(videoEffects);
videoEffector.enablePreview(previewRender);
*/
}
if (microphoneSource != null) {
microphoneSource = null;
}
Hi, I had an issue in my app where after stopping and starting the CameraCapture several times, it would crash. On some versions of Android, there is a hard limit to the number of instances of the hardware encoder you can instantiate using Android MediaCodec. I fixed it in CameraCapture.java, in stop(). Please see the comments I have added to the code in question.
public void stop() { super.stop(); if (previewRender != null) { /* commenting out this section works because in stop() another instance of MediaCodec is created. LinkedList videoEffects = videoEffector.getVideoEffects();
}