summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2017-12-21 16:30:30 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-25 23:26:01 -0800
commitd6a9e6e2047205fd3b94f16612b7a41dbbcfae5a (patch)
treeddc8879198e443388b6444c2ef32b0644aeb07f7 /src
parentdba67f45c84998842a628ece013bc127d5f80b04 (diff)
downloadandroid_packages_apps_Snap-d6a9e6e2047205fd3b94f16612b7a41dbbcfae5a.tar.gz
android_packages_apps_Snap-d6a9e6e2047205fd3b94f16612b7a41dbbcfae5a.tar.bz2
android_packages_apps_Snap-d6a9e6e2047205fd3b94f16612b7a41dbbcfae5a.zip
SnapdragonCamera:Fix mediaRecorder state
MediaRecorder will start after session is configured, need to stop or pause it after it has started. Change-Id: Ie42fcf0ba6c7859341cdba28f938d5d19754e6f7 CRs-Fixed:2143644
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 1b0b519b1..41a6edb59 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -3256,7 +3256,6 @@ public class CaptureModule implements CameraModule, PhotoController,
}
Log.d(TAG, "StartRecordingVideo " + cameraId);
mStartRecPending = true;
- mIsRecordingVideo = true;
mMediaRecorderPausing = false;
checkAndPlayRecordSound(cameraId, true);
@@ -3421,13 +3420,14 @@ public class CaptureModule implements CameraModule, PhotoController,
mFrameProcessor.setVideoOutputSurface(null);
restartSession(true);
}
- mStartRecPending = false;
return true;
}
private boolean startMediaRecorder() {
try {
mMediaRecorder.start(); // Recording is now started
+ mIsRecordingVideo = true;
+ mStartRecPending = false;
Log.d(TAG, "StartRecordingVideo done.");
} catch (RuntimeException e) {
Toast.makeText(mActivity,"Could not start media recorder.\n " +
@@ -3645,10 +3645,14 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public void onButtonPause() {
+ if (!isRecorderReady())
+ return;
pauseVideoRecording();
}
public void onButtonContinue() {
+ if (!isRecorderReady())
+ return;
resumeVideoRecording();
}