Release PreviewCallback (#86)

pull/88/head
Mattia Iavarone 7 years ago committed by GitHub
parent 62504d37b1
commit 85dc1a05d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ISSUE_TEMPLATE.md
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java
  3. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java

@ -7,19 +7,19 @@ Prerequisites:*
- [ ] *I can reproduce the bug in the demo app, and if not...* - [ ] *I can reproduce the bug in the demo app, and if not...*
- [ ] *I have tried to reproduce the bug in the demo app* - [ ] *I have tried to reproduce the bug in the demo app*
##### Detailed steps to reproduce the issue: #### Detailed steps to reproduce the issue:
1. 1.
2. 2.
3. 3.
##### Expected behavior: #### Expected behavior:
##### Actual behavior: #### Actual behavior:
##### Screenshots: #### Screenshots:
##### Interesting logs: #### Interesting logs:
*You can use `CameraLogger.setLogLevel(LEVEL_VERBOSE)` *You can use `CameraLogger.setLogLevel(LEVEL_VERBOSE)`
to add logs to logcat, and `CameraLogger.registerLogger()` to add logs to logcat, and `CameraLogger.registerLogger()`

@ -196,12 +196,14 @@ class Camera1 extends CameraController implements Camera.PreviewCallback {
LOG.i("onStop:", "About to clean up."); LOG.i("onStop:", "About to clean up.");
mHandler.get().removeCallbacks(mPostFocusResetRunnable); mHandler.get().removeCallbacks(mPostFocusResetRunnable);
if (mCamera != null) { if (mCamera != null) {
LOG.i("onStop:", "Clean up.", "Ending video?", mIsCapturingVideo); LOG.i("onStop:", "Clean up.", "Ending video?", mIsCapturingVideo);
if (mIsCapturingVideo) endVideo(); if (mIsCapturingVideo) endVideo();
try { try {
LOG.i("onStop:", "Clean up.", "Stopping preview."); LOG.i("onStop:", "Clean up.", "Stopping preview.");
mCamera.stopPreview(); mCamera.stopPreview();
mCamera.setPreviewCallback(null);
LOG.i("onStop:", "Clean up.", "Stopped preview."); LOG.i("onStop:", "Clean up.", "Stopped preview.");
} catch (Exception e) { } catch (Exception e) {
LOG.w("onStop:", "Clean up.", "Exception while stopping preview."); LOG.w("onStop:", "Clean up.", "Exception while stopping preview.");

@ -1607,8 +1607,8 @@ public class CameraView extends FrameLayout {
@Override @Override
public void dispatchFrame(final byte[] frame, final long time, final int rotation, public void dispatchFrame(final byte[] frame, final long time, final int rotation,
final Size size, final int previewFormat) { final Size size, final int previewFormat) {
mLogger.i("dispatchFrame", time, rotation, "processors:", mFrameProcessors.size());
if (mFrameProcessors.isEmpty()) return; if (mFrameProcessors.isEmpty()) return;
mLogger.v("dispatchFrame", time, rotation, "processors:", mFrameProcessors.size());
if (mFrame == null) mFrame = new Frame(); if (mFrame == null) mFrame = new Frame();
mFrameProcessorsHandler.post(new Runnable() { mFrameProcessorsHandler.post(new Runnable() {
@Override @Override

Loading…
Cancel
Save