Merge "Camera2: Remove isLoggable" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
717a2d09fa
@@ -56,7 +56,7 @@ import java.util.ArrayList;
|
||||
public final class CameraManager {
|
||||
|
||||
private static final String TAG = "CameraManager";
|
||||
private final boolean DEBUG;
|
||||
private final boolean DEBUG = false;
|
||||
|
||||
private static final int USE_CALLING_UID = -1;
|
||||
|
||||
@@ -73,7 +73,6 @@ public final class CameraManager {
|
||||
* @hide
|
||||
*/
|
||||
public CameraManager(Context context) {
|
||||
DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
synchronized(mLock) {
|
||||
mContext = context;
|
||||
}
|
||||
@@ -722,7 +721,7 @@ public final class CameraManager {
|
||||
implements IBinder.DeathRecipient {
|
||||
|
||||
private static final String TAG = "CameraManagerGlobal";
|
||||
private final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private final boolean DEBUG = false;
|
||||
|
||||
// Singleton instance
|
||||
private static final CameraManagerGlobal gCameraManager =
|
||||
|
||||
@@ -51,7 +51,7 @@ import java.util.List;
|
||||
public abstract class CameraMetadata<TKey> {
|
||||
|
||||
private static final String TAG = "CameraMetadataAb";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/**
|
||||
* Set a camera metadata field to a value. The field definitions can be
|
||||
@@ -131,7 +131,7 @@ public abstract class CameraMetadata<TKey> {
|
||||
CameraMetadata<TKey> instance,
|
||||
int[] filterTags) {
|
||||
|
||||
if (VERBOSE) Log.v(TAG, "getKeysStatic for " + type);
|
||||
if (DEBUG) Log.v(TAG, "getKeysStatic for " + type);
|
||||
|
||||
// TotalCaptureResult does not have any of the keys on it, use CaptureResult instead
|
||||
if (type.equals(TotalCaptureResult.class)) {
|
||||
@@ -163,10 +163,10 @@ public abstract class CameraMetadata<TKey> {
|
||||
if (shouldKeyBeAdded(key, field, filterTags)) {
|
||||
keyList.add(key);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "getKeysStatic - key was added - " + key);
|
||||
}
|
||||
} else if (VERBOSE) {
|
||||
} else if (DEBUG) {
|
||||
Log.v(TAG, "getKeysStatic - key was filtered - " + key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import static com.android.internal.util.Preconditions.*;
|
||||
|
||||
public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
private static final String TAG = "CameraCaptureSession";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/** Simple integer ID for session for debugging */
|
||||
private final int mId;
|
||||
@@ -124,7 +124,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
if (configureSuccess) {
|
||||
mStateCallback.onConfigured(this);
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "Created session successfully");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "Created session successfully");
|
||||
mConfigureSuccess = true;
|
||||
} else {
|
||||
mStateCallback.onConfigureFailed(this);
|
||||
@@ -160,7 +160,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
handler = checkHandler(handler, callback);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, mIdString + "capture - request " + request + ", callback " + callback +
|
||||
" handler " + handler);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
handler = checkHandler(handler, callback);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
CaptureRequest[] requestArray = requests.toArray(new CaptureRequest[0]);
|
||||
Log.v(TAG, mIdString + "captureBurst - requests " + Arrays.toString(requestArray) +
|
||||
", callback " + callback + " handler " + handler);
|
||||
@@ -218,7 +218,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
handler = checkHandler(handler, callback);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, mIdString + "setRepeatingRequest - request " + request + ", callback " +
|
||||
callback + " handler" + " " + handler);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
handler = checkHandler(handler, callback);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
CaptureRequest[] requestArray = requests.toArray(new CaptureRequest[0]);
|
||||
Log.v(TAG, mIdString + "setRepeatingBurst - requests " + Arrays.toString(requestArray) +
|
||||
", callback " + callback + " handler" + "" + handler);
|
||||
@@ -261,7 +261,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
public synchronized void stopRepeating() throws CameraAccessException {
|
||||
checkNotClosed();
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, mIdString + "stopRepeating");
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
public synchronized void abortCaptures() throws CameraAccessException {
|
||||
checkNotClosed();
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, mIdString + "abortCaptures");
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
* but this would introduce nondeterministic behavior.
|
||||
*/
|
||||
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "replaceSessionClose");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "replaceSessionClose");
|
||||
|
||||
// Set up fast shutdown. Possible alternative paths:
|
||||
// - This session is active, so close() below starts the shutdown drain
|
||||
@@ -345,11 +345,11 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
public synchronized void close() {
|
||||
|
||||
if (mClosed) {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "close - reentering");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "close - reentering");
|
||||
return;
|
||||
}
|
||||
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "close - first time");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "close - first time");
|
||||
|
||||
mClosed = true;
|
||||
|
||||
@@ -498,7 +498,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
|
||||
@Override
|
||||
public void onDisconnected(CameraDevice camera) {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onDisconnected");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onDisconnected");
|
||||
close();
|
||||
}
|
||||
|
||||
@@ -513,14 +513,14 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
mIdleDrainer.taskStarted();
|
||||
mActive = true;
|
||||
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onActive");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onActive");
|
||||
mStateCallback.onActive(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIdle(CameraDevice camera) {
|
||||
boolean isAborting;
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onIdle");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onIdle");
|
||||
|
||||
synchronized (session) {
|
||||
isAborting = mAborting;
|
||||
@@ -562,17 +562,17 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
// TODO: Queue captures during abort instead of failing them
|
||||
// since the app won't be able to distinguish the two actives
|
||||
// Don't signal the application since there's no clean mapping here
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onBusy");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onBusy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnconfigured(CameraDevice camera) {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onUnconfigured");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onUnconfigured");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfacePrepared(Surface surface) {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onPrepared");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onPrepared");
|
||||
mStateCallback.onSurfacePrepared(session, surface);
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
* If the camera is already "IDLE" and no aborts are pending,
|
||||
* then the drain immediately finishes.
|
||||
*/
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onSequenceDrained");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onSequenceDrained");
|
||||
|
||||
|
||||
// Fire session close as soon as all sequences are complete.
|
||||
@@ -652,7 +652,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
private class AbortDrainListener implements TaskDrainer.DrainListener {
|
||||
@Override
|
||||
public void onDrained() {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onAbortDrained");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onAbortDrained");
|
||||
synchronized (CameraCaptureSessionImpl.this) {
|
||||
/*
|
||||
* Any queued aborts have now completed.
|
||||
@@ -676,7 +676,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
private class IdleDrainListener implements TaskDrainer.DrainListener {
|
||||
@Override
|
||||
public void onDrained() {
|
||||
if (VERBOSE) Log.v(TAG, mIdString + "onIdleDrained");
|
||||
if (DEBUG) Log.v(TAG, mIdString + "onIdleDrained");
|
||||
|
||||
// Take device lock before session lock so that we can call back into device
|
||||
// without causing a deadlock
|
||||
@@ -690,7 +690,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
*
|
||||
* This operation is idempotent; a session will not be closed twice.
|
||||
*/
|
||||
if (VERBOSE)
|
||||
if (DEBUG)
|
||||
Log.v(TAG, mIdString + "Session drain complete, skip unconfigure: " +
|
||||
mSkipUnconfigure);
|
||||
|
||||
@@ -712,7 +712,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
|
||||
// TODO: call onError instead of onClosed if this happens
|
||||
} catch (IllegalStateException e) {
|
||||
// Camera is already closed, so nothing left to do
|
||||
if (VERBOSE) Log.v(TAG, mIdString +
|
||||
if (DEBUG) Log.v(TAG, mIdString +
|
||||
"Camera was already closed or busy, skipping unconfigure");
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ import java.util.TreeMap;
|
||||
*/
|
||||
public class CameraDeviceImpl extends CameraDevice {
|
||||
private final String TAG;
|
||||
private final boolean DEBUG;
|
||||
private final boolean DEBUG = false;
|
||||
|
||||
private static final int REQUEST_ID_NONE = -1;
|
||||
|
||||
@@ -240,7 +240,6 @@ public class CameraDeviceImpl extends CameraDevice {
|
||||
tag = tag.substring(0, MAX_TAG_LEN);
|
||||
}
|
||||
TAG = tag;
|
||||
DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
Integer partialCount =
|
||||
mCharacteristics.get(CameraCharacteristics.REQUEST_PARTIAL_RESULT_COUNT);
|
||||
|
||||
@@ -222,7 +222,8 @@ public class CameraMetadataNative implements Parcelable {
|
||||
}
|
||||
|
||||
private static final String TAG = "CameraMetadataJV";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
// this should be in sync with HAL_PIXEL_FORMAT_BLOB defined in graphics.h
|
||||
public static final int NATIVE_JPEG_FORMAT = 0x21;
|
||||
|
||||
@@ -1197,7 +1198,7 @@ public class CameraMetadataNative implements Parcelable {
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
private static void registerAllMarshalers() {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "Shall register metadata marshalers");
|
||||
}
|
||||
|
||||
@@ -1234,7 +1235,7 @@ public class CameraMetadataNative implements Parcelable {
|
||||
for (MarshalQueryable query : queryList) {
|
||||
MarshalRegistry.registerMarshalQueryable(query);
|
||||
}
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "Registered metadata marshalers");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import android.util.Log;
|
||||
*/
|
||||
public class CameraDeviceState {
|
||||
private static final String TAG = "CameraDeviceState";
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final int STATE_ERROR = 0;
|
||||
private static final int STATE_UNCONFIGURED = 1;
|
||||
|
||||
@@ -61,7 +61,7 @@ import java.util.List;
|
||||
public class CameraDeviceUserShim implements ICameraDeviceUser {
|
||||
private static final String TAG = "CameraDeviceUserShim";
|
||||
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
private static final int OPEN_CAMERA_TIMEOUT_MS = 5000; // 5 sec (same as api1 cts timeout)
|
||||
|
||||
private final LegacyCameraDevice mLegacyDevice;
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
public class CaptureCollector {
|
||||
private static final String TAG = "CaptureCollector";
|
||||
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final int FLAG_RECEIVED_JPEG = 1;
|
||||
private static final int FLAG_RECEIVED_JPEG_TS = 2;
|
||||
|
||||
@@ -35,7 +35,7 @@ import static com.android.internal.util.Preconditions.*;
|
||||
*/
|
||||
public class GLThreadManager {
|
||||
private final String TAG;
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final int MSG_NEW_CONFIGURATION = 1;
|
||||
private static final int MSG_NEW_FRAME = 2;
|
||||
|
||||
@@ -59,10 +59,9 @@ import static com.android.internal.util.Preconditions.*;
|
||||
* </p>
|
||||
*/
|
||||
public class LegacyCameraDevice implements AutoCloseable {
|
||||
public static final String DEBUG_PROP = "HAL1ShimLogging";
|
||||
private final String TAG;
|
||||
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
private final int mCameraId;
|
||||
private final CameraCharacteristics mStaticCharacteristics;
|
||||
private final ICameraDeviceCallbacks mDeviceCallbacks;
|
||||
|
||||
@@ -44,7 +44,7 @@ import static com.android.internal.util.Preconditions.*;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyFaceDetectMapper {
|
||||
private static String TAG = "LegacyFaceDetectMapper";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private final Camera mCamera;
|
||||
/** Is the camera capable of face detection? */
|
||||
@@ -97,7 +97,7 @@ public class LegacyFaceDetectMapper {
|
||||
}
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "onFaceDetection - read " + lengthFaces + " faces");
|
||||
}
|
||||
}
|
||||
@@ -170,13 +170,13 @@ public class LegacyFaceDetectMapper {
|
||||
if (enableFaceDetect) {
|
||||
mCamera.startFaceDetection();
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "processFaceDetectMode - start face detection");
|
||||
}
|
||||
} else {
|
||||
mCamera.stopFaceDetection();
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "processFaceDetectMode - stop face detection");
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ public class LegacyFaceDetectMapper {
|
||||
}
|
||||
}
|
||||
|
||||
if (VERBOSE && previousFaces != faces) { // Log only in verbose and IF the faces changed
|
||||
if (DEBUG && previousFaces != faces) { // Log only in verbose and IF the faces changed
|
||||
Log.v(TAG, "mapResultFaces - changed to " + ListUtils.listToString(convertedFaces));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import static com.android.internal.util.Preconditions.*;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyFocusStateMapper {
|
||||
private static String TAG = "LegacyFocusStateMapper";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private final Camera mCamera;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class LegacyFocusStateMapper {
|
||||
final String afMode = parameters.getFocusMode();
|
||||
|
||||
if (!Objects.equals(mAfModePrevious, afMode)) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "processRequestTriggers - AF mode switched from " + mAfModePrevious +
|
||||
" to " + afMode);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class LegacyFocusStateMapper {
|
||||
synchronized (mLock) {
|
||||
int latestAfRun = mAfRun;
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"onAutoFocusMoving - start " + start + " latest AF run " +
|
||||
latestAfRun + ", last AF run " + currentAfRun
|
||||
@@ -192,7 +192,7 @@ public class LegacyFocusStateMapper {
|
||||
mAfState = afStateAfterStart;
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "processRequestTriggers - got AF_TRIGGER_START, " +
|
||||
"new AF run is " + currentAfRun);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ public class LegacyFocusStateMapper {
|
||||
synchronized (mLock) {
|
||||
int latestAfRun = mAfRun;
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "onAutoFocus - success " + success + " latest AF run " +
|
||||
latestAfRun + ", last AF run " + currentAfRun);
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class LegacyFocusStateMapper {
|
||||
|
||||
mCamera.cancelAutoFocus();
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "processRequestTriggers - got AF_TRIGGER_CANCEL, " +
|
||||
"new AF run is " + updatedAfRun);
|
||||
}
|
||||
@@ -288,7 +288,7 @@ public class LegacyFocusStateMapper {
|
||||
newAfState = mAfState;
|
||||
}
|
||||
|
||||
if (VERBOSE && newAfState != mAfStatePrevious) {
|
||||
if (DEBUG && newAfState != mAfStatePrevious) {
|
||||
Log.v(TAG, String.format("mapResultTriggers - afState changed from %s to %s",
|
||||
afStateToString(mAfStatePrevious), afStateToString(newAfState)));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ import static android.hardware.camera2.legacy.ParameterUtils.*;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyMetadataMapper {
|
||||
private static final String TAG = "LegacyMetadataMapper";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final long NS_PER_MS = 1000000;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class LegacyMetadataMapper {
|
||||
params.unflatten(parameters);
|
||||
mapCharacteristicsFromParameters(m, params);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "createCharacteristics metadata:");
|
||||
Log.v(TAG, "--------------------------------------------------- (start)");
|
||||
m.dumpToLog();
|
||||
@@ -284,7 +284,7 @@ public class LegacyMetadataMapper {
|
||||
Camera.Size maxJpegSize = SizeAreaComparator.findLargestByArea(jpegSizes);
|
||||
float jpegAspectRatio = maxJpegSize.width * 1.0f / maxJpegSize.height;
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, String.format("mapScalerStreamConfigs - largest JPEG area %dx%d, AR=%f",
|
||||
maxJpegSize.width, maxJpegSize.height, jpegAspectRatio));
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class LegacyMetadataMapper {
|
||||
PREVIEW_ASPECT_RATIO_TOLERANCE) {
|
||||
previewSizes.remove(index); // Assume removing from end is O(1)
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, String.format(
|
||||
"mapScalerStreamConfigs - removed preview size %dx%d, AR=%f "
|
||||
+ "was not the same",
|
||||
@@ -329,7 +329,7 @@ public class LegacyMetadataMapper {
|
||||
for (int format : p.getSupportedPreviewFormats()) {
|
||||
if (ImageFormat.isPublicFormat(format) && format != ImageFormat.NV21) {
|
||||
appendStreamConfig(availableStreamConfigs, format, previewSizes);
|
||||
} else if (VERBOSE) {
|
||||
} else if (DEBUG) {
|
||||
/*
|
||||
* Do not add any formats unknown to us
|
||||
* (since it would fail runtime checks in StreamConfigurationMap)
|
||||
@@ -388,7 +388,7 @@ public class LegacyMetadataMapper {
|
||||
int j = 0;
|
||||
for (String mode : antiBandingModes) {
|
||||
int convertedMode = convertAntiBandingMode(mode);
|
||||
if (VERBOSE && convertedMode == -1) {
|
||||
if (DEBUG && convertedMode == -1) {
|
||||
Log.v(TAG, "Antibanding mode " + ((mode == null) ? "NULL" : mode) +
|
||||
" not supported, skipping...");
|
||||
} else {
|
||||
@@ -525,7 +525,7 @@ public class LegacyMetadataMapper {
|
||||
|
||||
m.set(CONTROL_AF_AVAILABLE_MODES, ArrayUtils.toIntArray(afAvail));
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "mapControlAf - control.afAvailableModes set to " +
|
||||
ListUtils.listToString(afAvail));
|
||||
}
|
||||
@@ -575,7 +575,7 @@ public class LegacyMetadataMapper {
|
||||
|
||||
m.set(CONTROL_AWB_AVAILABLE_MODES, ArrayUtils.toIntArray(awbAvail));
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "mapControlAwb - control.awbAvailableModes set to " +
|
||||
ListUtils.listToString(awbAvail));
|
||||
}
|
||||
@@ -681,7 +681,7 @@ public class LegacyMetadataMapper {
|
||||
* We can tell if the lens is fixed focus;
|
||||
* but if it's not, we can't tell the minimum focus distance, so leave it null then.
|
||||
*/
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "mapLens - focus-mode='" + p.getFocusMode() + "'");
|
||||
}
|
||||
|
||||
@@ -691,11 +691,11 @@ public class LegacyMetadataMapper {
|
||||
*/
|
||||
m.set(LENS_INFO_MINIMUM_FOCUS_DISTANCE, LENS_INFO_MINIMUM_FOCUS_DISTANCE_FIXED_FOCUS);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "mapLens - lens.info.minimumFocusDistance = 0");
|
||||
}
|
||||
} else {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "mapLens - lens.info.minimumFocusDistance is unknown");
|
||||
}
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ public class LegacyMetadataMapper {
|
||||
}
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "createRequestTemplate (templateId=" + templateId + ")," +
|
||||
" afMode=" + afMode + ", minimumFocusDistance=" + minimumFocusDistance);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import static android.hardware.camera2.CaptureRequest.*;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyRequestMapper {
|
||||
private static final String TAG = "LegacyRequestMapper";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/** Default quality for android.jpeg.quality, android.jpeg.thumbnailQuality */
|
||||
private static final byte DEFAULT_JPEG_QUALITY = 85;
|
||||
@@ -75,7 +75,7 @@ public class LegacyRequestMapper {
|
||||
|
||||
if (params.isZoomSupported()) {
|
||||
params.setZoom(zoomData.zoomIndex);
|
||||
} else if (VERBOSE) {
|
||||
} else if (DEBUG) {
|
||||
Log.v(TAG, "convertRequestToMetadata - zoom is not supported");
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class LegacyRequestMapper {
|
||||
params.setAutoExposureLock(aeLock);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertRequestToMetadata - control.aeLock set to " + aeLock);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class LegacyRequestMapper {
|
||||
params.setFocusMode(focusMode);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertRequestToMetadata - control.afMode "
|
||||
+ afMode + " mapped to " + focusMode);
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class LegacyRequestMapper {
|
||||
params.setWhiteBalance(whiteBalanceMode);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertRequestToMetadata - control.awbMode "
|
||||
+ awbMode + " mapped to " + whiteBalanceMode);
|
||||
}
|
||||
@@ -520,7 +520,7 @@ public class LegacyRequestMapper {
|
||||
" regions, ignoring all beyond the first " + maxNumMeteringAreas);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertMeteringRegionsToLegacy - " + regionName + " areas = "
|
||||
+ ParameterUtils.stringFromAreaList(meteringAreaList));
|
||||
}
|
||||
@@ -593,7 +593,7 @@ public class LegacyRequestMapper {
|
||||
p.setFlashMode(flashModeSetting);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"mapAeAndFlashMode - set flash.mode (api1) to " + flashModeSetting
|
||||
+ ", requested (api2) " + flashMode
|
||||
|
||||
@@ -42,7 +42,7 @@ import static android.hardware.camera2.CaptureResult.*;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyResultMapper {
|
||||
private static final String TAG = "LegacyResultMapper";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private LegacyRequest mCachedRequest = null;
|
||||
private CameraMetadataNative mCachedResult = null;
|
||||
@@ -88,7 +88,7 @@ public class LegacyResultMapper {
|
||||
result.set(SENSOR_TIMESTAMP, timestamp);
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "cachedConvertResultMetadata - cached? " + cached +
|
||||
" timestamp = " + timestamp);
|
||||
|
||||
@@ -306,7 +306,7 @@ public class LegacyResultMapper {
|
||||
{
|
||||
boolean lock = p.isAutoExposureLockSupported() ? p.getAutoExposureLock() : false;
|
||||
m.set(CONTROL_AE_LOCK, lock);
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"mapAe - android.control.aeLock = " + lock +
|
||||
", supported = " + p.isAutoExposureLockSupported());
|
||||
@@ -332,7 +332,7 @@ public class LegacyResultMapper {
|
||||
|
||||
// control.aeRegions
|
||||
if (p.getMaxNumMeteringAreas() > 0) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
String meteringAreas = p.get("metering-areas");
|
||||
Log.v(TAG, "mapAe - parameter dump; metering-areas: " + meteringAreas);
|
||||
}
|
||||
@@ -352,7 +352,7 @@ public class LegacyResultMapper {
|
||||
|
||||
// control.afRegions
|
||||
if (p.getMaxNumFocusAreas() > 0) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
String focusAreas = p.get("focus-areas");
|
||||
Log.v(TAG, "mapAe - parameter dump; focus-areas: " + focusAreas);
|
||||
}
|
||||
@@ -392,7 +392,7 @@ public class LegacyResultMapper {
|
||||
}
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"Metering rectangles for " + regionName + ": "
|
||||
+ ListUtils.listToString(meteringRectList));
|
||||
|
||||
@@ -225,7 +225,7 @@ public class ParameterUtils {
|
||||
}
|
||||
|
||||
private static final String TAG = "ParameterUtils";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/** getZoomRatios stores zoom ratios in 1/100 increments, e.x. a zoom of 3.2 is 320 */
|
||||
private static final int ZOOM_RATIO_MULTIPLIER = 100;
|
||||
@@ -398,7 +398,7 @@ public class ParameterUtils {
|
||||
Rect cropRegionAsPreview =
|
||||
shrinkToSameAspectRatioCentered(previewCrop, actualCrop);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "getClosestAvailableZoomCrop - actualCrop = " + actualCrop);
|
||||
Log.v(TAG,
|
||||
"getClosestAvailableZoomCrop - previewCrop = " + previewCrop);
|
||||
@@ -418,7 +418,7 @@ public class ParameterUtils {
|
||||
List<Rect> availablePreviewCropRegions =
|
||||
getAvailablePreviewZoomCropRectangles(params, activeArray, streamSize);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"getClosestAvailableZoomCrop - availableReportedCropRegions = " +
|
||||
ListUtils.listToString(availableReportedCropRegions));
|
||||
@@ -758,7 +758,7 @@ public class ParameterUtils {
|
||||
userCropRegion = activeArraySizeOnly;
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertScalerCropRegion - user crop region was " + userCropRegion);
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ public class ParameterUtils {
|
||||
previewSize, userCropRegion,
|
||||
/*out*/reportedCropRegion, /*out*/previewCropRegion);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "convertScalerCropRegion - zoom calculated to: " +
|
||||
"zoomIndex = " + zoomIdx +
|
||||
", reported crop region = " + reportedCropRegion +
|
||||
@@ -862,7 +862,7 @@ public class ParameterUtils {
|
||||
reportedMetering = reportedMeteringRect.rect;
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, String.format(
|
||||
"convertMeteringRectangleToLegacy - activeArray = %s, meteringRect = %s, " +
|
||||
"previewCrop = %s, meteringArea = %s, previewMetering = %s, " +
|
||||
|
||||
@@ -62,10 +62,9 @@ public class RequestThreadManager {
|
||||
private final int mCameraId;
|
||||
private final RequestHandlerThread mRequestThread;
|
||||
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
// For slightly more spammy messages that will get repeated every frame
|
||||
private static final boolean VERBOSE =
|
||||
Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.VERBOSE);
|
||||
private static final boolean VERBOSE = false;
|
||||
private Camera mCamera;
|
||||
private final CameraCharacteristics mCharacteristics;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.util.List;
|
||||
*/
|
||||
public class SurfaceTextureRenderer {
|
||||
private static final String TAG = SurfaceTextureRenderer.class.getSimpleName();
|
||||
private static final boolean DEBUG = Log.isLoggable(LegacyCameraDevice.DEBUG_PROP, Log.DEBUG);
|
||||
private static final boolean DEBUG = false;
|
||||
private static final int EGL_RECORDABLE_ANDROID = 0x3142; // from EGL/eglext.h
|
||||
private static final int GL_MATRIX_SIZE = 16;
|
||||
private static final int VERTEX_POS_SIZE = 3;
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.ArrayList;
|
||||
public class MarshalQueryableArray<T> implements MarshalQueryable<T> {
|
||||
|
||||
private static final String TAG = MarshalQueryableArray.class.getSimpleName();
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private class MarshalerArray extends Marshaler<T> {
|
||||
private final Class<T> mClass;
|
||||
@@ -81,7 +81,7 @@ public class MarshalQueryableArray<T> implements MarshalQueryable<T> {
|
||||
+ "; but there are " + (remaining % elementSize) + " left over bytes");
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, String.format(
|
||||
"Attempting to unpack array (count = %d, element size = %d, bytes "
|
||||
+ "remaining = %d) for type %s",
|
||||
|
||||
@@ -38,7 +38,7 @@ import static android.hardware.camera2.marshal.MarshalHelpers.*;
|
||||
public class MarshalQueryableEnum<T extends Enum<T>> implements MarshalQueryable<T> {
|
||||
|
||||
private static final String TAG = MarshalQueryableEnum.class.getSimpleName();
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final int UINT8_MIN = 0x0;
|
||||
private static final int UINT8_MAX = (1 << Byte.SIZE) - 1;
|
||||
@@ -110,7 +110,7 @@ public class MarshalQueryableEnum<T extends Enum<T>> implements MarshalQueryable
|
||||
Class<?> typeClass = (Class<?>)managedType.getType();
|
||||
|
||||
if (typeClass.isEnum()) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "possible enum detected for " + typeClass);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class MarshalQueryableEnum<T extends Enum<T>> implements MarshalQueryable
|
||||
"Expected values array to be the same size as the enumTypes values "
|
||||
+ values.length + " for type " + enumType);
|
||||
}
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "Registered enum values for type " + enumType + " values");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MarshalQueryableParcelable<T extends Parcelable>
|
||||
implements MarshalQueryable<T> {
|
||||
|
||||
private static final String TAG = "MarshalParcelable";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final String FIELD_CREATOR = "CREATOR";
|
||||
|
||||
@@ -70,7 +70,7 @@ public class MarshalQueryableParcelable<T extends Parcelable>
|
||||
|
||||
@Override
|
||||
public void marshal(T value, ByteBuffer buffer) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "marshal " + value);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MarshalQueryableParcelable<T extends Parcelable>
|
||||
|
||||
@Override
|
||||
public T unmarshal(ByteBuffer buffer) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "unmarshal, buffer remaining " + buffer.remaining());
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public class MarshalQueryableParcelable<T extends Parcelable>
|
||||
buffer.reset();
|
||||
buffer.position(buffer.position() + actualLength);
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "unmarshal, parcel length was " + actualLength);
|
||||
Log.v(TAG, "unmarshal, value is " + value);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public class MarshalQueryableParcelable<T extends Parcelable>
|
||||
value.writeToParcel(parcel, /*flags*/0);
|
||||
int length = parcel.marshall().length;
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "calculateMarshalSize, length when parceling "
|
||||
+ value + " is " + length);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import static android.hardware.camera2.impl.CameraMetadataNative.*;
|
||||
public class MarshalQueryableString implements MarshalQueryable<String> {
|
||||
|
||||
private static final String TAG = MarshalQueryableString.class.getSimpleName();
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
|
||||
private static final byte NUL = (byte)'\0'; // used as string terminator
|
||||
@@ -72,7 +72,7 @@ public class MarshalQueryableString implements MarshalQueryable<String> {
|
||||
stringLength++;
|
||||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG,
|
||||
"unmarshal - scanned " + stringLength + " characters; found null? "
|
||||
+ foundNull);
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Objects;
|
||||
public class ArrayUtils {
|
||||
|
||||
private static final String TAG = "ArrayUtils";
|
||||
private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/** Return the index of {@code needle} in the {@code array}, or else {@code -1} */
|
||||
public static <T> int getArrayIndex(T[] array, T needle) {
|
||||
@@ -117,7 +117,7 @@ public class ArrayUtils {
|
||||
|
||||
// Guard against unexpected values
|
||||
if (strIndex < 0) {
|
||||
if (VERBOSE) Log.v(TAG, "Ignoring invalid value " + str);
|
||||
if (DEBUG) Log.v(TAG, "Ignoring invalid value " + str);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TaskDrainer<T> {
|
||||
}
|
||||
|
||||
private static final String TAG = "TaskDrainer";
|
||||
private final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private final boolean DEBUG = false;
|
||||
|
||||
private final Handler mHandler;
|
||||
private final DrainListener mListener;
|
||||
@@ -110,7 +110,7 @@ public class TaskDrainer<T> {
|
||||
*/
|
||||
public void taskStarted(T task) {
|
||||
synchronized (mLock) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG + "[" + mName + "]", "taskStarted " + task);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class TaskDrainer<T> {
|
||||
*/
|
||||
public void taskFinished(T task) {
|
||||
synchronized (mLock) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG + "[" + mName + "]", "taskFinished " + task);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class TaskDrainer<T> {
|
||||
public void beginDrain() {
|
||||
synchronized (mLock) {
|
||||
if (!mDraining) {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG + "[" + mName + "]", "beginDrain started");
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public class TaskDrainer<T> {
|
||||
// If all tasks that had started had already finished by now, fire #onDrained
|
||||
checkIfDrainFinished();
|
||||
} else {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG + "[" + mName + "]", "beginDrain ignored");
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ public class TaskDrainer<T> {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (VERBOSE) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG + "[" + mName + "]", "onDrained");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user