android: fix crash occuring when Camera is busy

parent 739d3809
......@@ -23,6 +23,7 @@ import java.util.List;
import org.linphone.mediastream.Version;
import android.hardware.Camera.Size;
import android.util.Log;
......@@ -58,10 +59,16 @@ public class AndroidCameraConfiguration {
if (camerasCache != null)
return;
if (Version.sdk() < 9)
camerasCache = AndroidCameraConfiguration.probeCamerasSDK5();
else
camerasCache = AndroidCameraConfiguration.probeCamerasSDK9();
try {
if (Version.sdk() < 9)
camerasCache = AndroidCameraConfiguration.probeCamerasSDK5();
else
camerasCache = AndroidCameraConfiguration.probeCamerasSDK9();
} catch (Exception exc) {
Log.e("mediastreamer", "Error: cannot retrieve cameras information (busy ?)", exc);
exc.printStackTrace();
camerasCache = new AndroidCamera[0];
}
}
static AndroidCamera[] probeCamerasSDK5() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment