diff options
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 35 |
1 files changed, 12 insertions, 23 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; |