From cc7a1a2ab7db8fa14312874ce65c887a36c9c1a1 Mon Sep 17 00:00:00 2001 From: Philipp Hasper Date: Wed, 13 Apr 2016 09:17:33 +0200 Subject: [PATCH] Deactivated two noisy camera-retrieval log messages in android They were issued for every frame retrieved - even in a release build. --- .../java/generator/src/java/android+CameraBridgeViewBase.java | 4 +++- modules/java/generator/src/java/android+JavaCameraView.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/java/generator/src/java/android+CameraBridgeViewBase.java b/modules/java/generator/src/java/android+CameraBridgeViewBase.java index 14e0411460..ef2af818cf 100644 --- a/modules/java/generator/src/java/android+CameraBridgeViewBase.java +++ b/modules/java/generator/src/java/android+CameraBridgeViewBase.java @@ -2,6 +2,7 @@ package org.opencv.android; import java.util.List; +import org.opencv.BuildConfig; import org.opencv.R; import org.opencv.core.Mat; import org.opencv.core.Size; @@ -409,7 +410,8 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac Canvas canvas = getHolder().lockCanvas(); if (canvas != null) { canvas.drawColor(0, android.graphics.PorterDuff.Mode.CLEAR); - Log.d(TAG, "mStretch value: " + mScale); + if (BuildConfig.DEBUG) + Log.d(TAG, "mStretch value: " + mScale); if (mScale != 0) { canvas.drawBitmap(mCacheBitmap, new Rect(0,0,mCacheBitmap.getWidth(), mCacheBitmap.getHeight()), diff --git a/modules/java/generator/src/java/android+JavaCameraView.java b/modules/java/generator/src/java/android+JavaCameraView.java index f4405c3501..7b0ecd4c01 100644 --- a/modules/java/generator/src/java/android+JavaCameraView.java +++ b/modules/java/generator/src/java/android+JavaCameraView.java @@ -12,6 +12,7 @@ import android.util.AttributeSet; import android.util.Log; import android.view.ViewGroup.LayoutParams; +import org.opencv.BuildConfig; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.Size; @@ -283,7 +284,8 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb @Override public void onPreviewFrame(byte[] frame, Camera arg1) { - Log.d(TAG, "Preview Frame received. Frame size: " + frame.length); + if (BuildConfig.DEBUG) + Log.d(TAG, "Preview Frame received. Frame size: " + frame.length); synchronized (this) { mFrameChain[mChainIdx].put(0, 0, frame); mCameraFrameReady = true;