apply some of the changes suggested by natario1

pull/59/merge^2
Tim H 7 years ago
parent 8a16835560
commit 122a2cb174
  1. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java
  2. 7
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java

@ -138,8 +138,8 @@ abstract class CameraController implements CameraPreview.SurfaceCallback {
LOG.i("Stop immediately. Stopped. State is:", ss());
} catch (Exception e) {
// Do nothing.
LOG.i("Stop immediately. Exception while stopping.", e);
mState = STATE_STOPPED;
mCameraCallbacks.onError("Stop immediately. Exception while stopping.", e);
}
}

@ -1569,11 +1569,16 @@ public class CameraView extends FrameLayout {
LOG.e(message, cause);
// redirect
CameraException cameraException = new CameraException(message, cause);
final CameraException cameraException = new CameraException(message, cause);
mUiHandler.post(new Runnable() {
@Override
public void run() {
for (CameraListener listener : mListeners) {
listener.onError(cameraException);
}
}
});
}
}
//endregion

Loading…
Cancel
Save