diff options
author | junjiez <junjiez@codeaurora.org> | 2017-11-23 20:11:16 -0800 |
---|---|---|
committer | junjiez <junjiez@codeaurora.org> | 2017-11-24 12:14:03 +0800 |
commit | eeefe8bb8f841deb35ea7b9bbdff41685d2e818d (patch) | |
tree | 71c4dafad904024bf9c81328d57d7d0d31673095 /src | |
parent | 6c8f72000ecd034790003fddfa80481053482e0f (diff) | |
download | android_packages_apps_Snap-eeefe8bb8f841deb35ea7b9bbdff41685d2e818d.tar.gz android_packages_apps_Snap-eeefe8bb8f841deb35ea7b9bbdff41685d2e818d.tar.bz2 android_packages_apps_Snap-eeefe8bb8f841deb35ea7b9bbdff41685d2e818d.zip |
Revert "SnapdragonCamera:Fix recording audio leg"
This reverts commit 0becd1cfcc341d0d96b1fb1ff436eeda8bd54cb9.
Change-Id: Ib66d0f96cbb09d601320bebf6edf2f53c8fbe3b5
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 70 |
1 files changed, 24 insertions, 46 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 88d967e98..900154cd4 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -393,7 +393,6 @@ public class CaptureModule implements CameraModule, PhotoController, private boolean mHighSpeedRecordingMode = false; //HFR private int mHighSpeedCaptureRate; private CaptureRequest.Builder mVideoRequestBuilder; - private boolean mMediaRecorderReady = false; private static final int STATS_DATA = 768; public static int statsdata[] = new int[STATS_DATA]; @@ -3159,7 +3158,6 @@ public class CaptureModule implements CameraModule, PhotoController, mStartRecPending = true; mIsRecordingVideo = true; mMediaRecorderPausing = false; - mMediaRecorderReady = false; mActivity.updateStorageSpaceAndHint(); if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) { @@ -3171,7 +3169,31 @@ 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; + mIsRecordingVideo = false; + return false; + } + if (mMediaRecorder == null) { + Log.e(TAG, "Fail to initialize media recorder"); + mStartRecPending = false; + mIsRecordingVideo = false; + return false; + } + requestAudioFocus(); mUI.clearFocus(); mUI.hideUIwhileRecording(); mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, mCameraId[cameraId]); @@ -3241,12 +3263,6 @@ public class CaptureModule implements CameraModule, PhotoController, + e.getMessage()); e.printStackTrace(); } - if (!startMediaRecorder()) { - mMediaRecorderReady = false; - return; - } else { - mMediaRecorderReady = true; - } mUI.clearFocus(); mUI.resetPauseButton(); mRecordingTotalTime = 0L; @@ -3282,13 +3298,6 @@ public class CaptureModule implements CameraModule, PhotoController, } catch (IllegalStateException e) { e.printStackTrace(); } - if (!startMediaRecorder()) { - mMediaRecorderReady = false; - return; - } else { - mMediaRecorderReady = true; - } - mUI.clearFocus(); mUI.resetPauseButton(); mRecordingTotalTime = 0L; @@ -3309,41 +3318,10 @@ public class CaptureModule implements CameraModule, PhotoController, } catch (IOException e) { e.printStackTrace(); } - if (!mMediaRecorderReady) - return false; mStartRecPending = false; return true; } - private boolean startMediaRecorder() { - 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; - mIsRecordingVideo = false; - return false; - } - if (mMediaRecorder == null) { - Log.e(TAG, "Fail to initialize media recorder"); - mStartRecPending = false; - mIsRecordingVideo = false; - return false; - } - - requestAudioFocus(); - return true; - } - private void updateTimeLapseSetting() { String value = mSettingsManager.getValue(SettingsManager .KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL); |