summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CaptureModule.java35
-rw-r--r--[-rwxr-xr-x]src/com/android/camera/ui/Camera2FaceView.java2
-rw-r--r--[-rwxr-xr-x]src/com/android/camera/ui/FaceView.java7
3 files changed, 19 insertions, 25 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index d61163919..6b9c6869e 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -3116,7 +3116,6 @@ public class CaptureModule implements CameraModule, PhotoController,
mStartRecPending = true;
mIsRecordingVideo = true;
mMediaRecorderPausing = false;
- mUI.hideUIwhileRecording();
mActivity.updateStorageSpaceAndHint();
if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) {
@@ -3128,6 +3127,17 @@ public class CaptureModule implements CameraModule, PhotoController,
try {
setUpMediaRecorder(cameraId);
+ try {
+ mMediaRecorder.start(); // Recording is now started
+ } catch (RuntimeException e) {
+ Toast.makeText(mActivity,"Could not start media recorder.\n " +
+ "Can't start video recording.", Toast.LENGTH_LONG).show();
+ releaseMediaRecorder();
+ releaseAudioFocus();
+ mStartRecPending = false;
+ mIsRecordingVideo = false;
+ return false;
+ }
if (mUnsupportedResolution == true ) {
Log.v(TAG, "Unsupported Resolution according to target");
mStartRecPending = false;
@@ -3143,6 +3153,7 @@ public class CaptureModule implements CameraModule, PhotoController,
requestAudioFocus();
mUI.clearFocus();
+ mUI.hideUIwhileRecording();
mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, mCameraId[cameraId]);
mState[cameraId] = STATE_PREVIEW;
mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE;
@@ -3210,17 +3221,6 @@ public class CaptureModule implements CameraModule, PhotoController,
+ e.getMessage());
e.printStackTrace();
}
- try {
- mMediaRecorder.start(); // Recording is now started
- } catch (RuntimeException e) {
- Toast.makeText(mActivity,"Could not start media recorder.\n " +
- "Can't start video recording.", Toast.LENGTH_LONG).show();
- releaseMediaRecorder();
- releaseAudioFocus();
- mStartRecPending = false;
- mIsRecordingVideo = false;
- return;
- }
mUI.clearFocus();
mUI.resetPauseButton();
mRecordingTotalTime = 0L;
@@ -3255,17 +3255,6 @@ public class CaptureModule implements CameraModule, PhotoController,
} catch (IllegalStateException e) {
e.printStackTrace();
}
- try {
- mMediaRecorder.start(); // Recording is now started
- } catch (RuntimeException e) {
- Toast.makeText(mActivity,"Could not start media recorder.\n " +
- "Can't start video recording.", Toast.LENGTH_LONG).show();
- releaseMediaRecorder();
- releaseAudioFocus();
- mStartRecPending = false;
- mIsRecordingVideo = false;
- return;
- }
mUI.clearFocus();
mUI.resetPauseButton();
mRecordingTotalTime = 0L;
diff --git a/src/com/android/camera/ui/Camera2FaceView.java b/src/com/android/camera/ui/Camera2FaceView.java
index 3b6d10541..81be61f81 100755..100644
--- a/src/com/android/camera/ui/Camera2FaceView.java
+++ b/src/com/android/camera/ui/Camera2FaceView.java
@@ -151,7 +151,9 @@ public class Camera2FaceView extends FaceView {
faceBound.offset(-mCameraBound.left, -mCameraBound.top);
mRect.set(faceBound);
translateMatrix.mapRect(mRect);
+ if (LOGV) CameraUtil.dumpRect(mRect, "Original rect");
mMatrix.mapRect(mRect);
+ if (LOGV) CameraUtil.dumpRect(mRect, "Transformed rect");
mPaint.setColor(mColor);
mRect.offset(dx, dy);
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java
index b617891e5..04b3664eb 100755..100644
--- a/src/com/android/camera/ui/FaceView.java
+++ b/src/com/android/camera/ui/FaceView.java
@@ -33,14 +33,17 @@ import android.view.View;
import com.android.camera.PhotoUI;
import com.android.camera.util.CameraUtil;
+import com.android.camera.util.PersistUtil;
import org.codeaurora.snapcam.R;
import org.codeaurora.snapcam.wrapper.ExtendedFaceWrapper;
public class FaceView extends View
implements FocusIndicator, Rotatable,
PhotoUI.SurfaceTextureSizeChangedListener {
- protected static final String TAG = "CAM FaceView";
- protected final boolean LOGV = false;
+ protected static final String TAG = "CAM_FaceView";
+ protected final boolean LOGV =
+ (PersistUtil.getCamera2Debug() == PersistUtil.CAMERA2_DEBUG_DUMP_LOG) ||
+ (PersistUtil.getCamera2Debug() == PersistUtil.CAMERA2_DEBUG_DUMP_ALL);
// The value for android.hardware.Camera.setDisplayOrientation.
protected int mDisplayOrientation;
// The orientation compensation for the face indicator to make it look