summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2016-11-15 07:01:52 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-15 07:01:52 -0800
commit82e338ef06e5eb58f567fc9eabc78cb73620a057 (patch)
tree6d715c5eff22806fc73311b1095a1ba640f95b65 /src/com/android/camera/CaptureModule.java
parent84d18757b33d00a9e69695eb5d8e6741060c8de1 (diff)
parent42310c1395c0a132430e4e31c702861d8b41dc11 (diff)
downloadandroid_packages_apps_Snap-82e338ef06e5eb58f567fc9eabc78cb73620a057.tar.gz
android_packages_apps_Snap-82e338ef06e5eb58f567fc9eabc78cb73620a057.tar.bz2
android_packages_apps_Snap-82e338ef06e5eb58f567fc9eabc78cb73620a057.zip
Merge "SnapdragonCamera: Update preview UI when recording rest time was zero" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 6e30abaa2..e10847bab 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -114,7 +114,8 @@ import java.lang.reflect.Method;
public class CaptureModule implements CameraModule, PhotoController,
MediaSaveService.Listener, ClearSightImageProcessor.Callback,
SettingsManager.Listener, LocationManager.Listener,
- CountDownView.OnCountDownFinishedListener {
+ CountDownView.OnCountDownFinishedListener,
+ MediaRecorder.OnInfoListener{
public static final int DUAL_MODE = 0;
public static final int BAYER_MODE = 1;
public static final int MONO_MODE = 2;
@@ -2806,6 +2807,7 @@ public class CaptureModule implements CameraModule, PhotoController,
closePreviewSession();
mMediaRecorder.stop();
mMediaRecorder.reset();
+ mMediaRecorder.setOnInfoListener(null);
saveVideo();
mUI.showRecordingUI(false, false);
mUI.enableShutter(true);
@@ -2976,6 +2978,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mMediaRecorder.setOrientationHint(rotation);
}
mMediaRecorder.prepare();
+ mMediaRecorder.setOnInfoListener(this);
}
public void onVideoButtonClick() {
@@ -3794,6 +3797,23 @@ public class CaptureModule implements CameraModule, PhotoController,
enableRecordingLocation(false);
}
+ // from MediaRecorder.OnInfoListener
+ @Override
+ public void onInfo(MediaRecorder mr, int what, int extra) {
+ if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
+ if (mIsRecordingVideo) {
+ stopRecordingVideo(getMainCameraId());
+ }
+ } else if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED) {
+ if (mIsRecordingVideo) {
+ stopRecordingVideo(getMainCameraId());
+ }
+ // Show the toast.
+ RotateTextToast.makeText(mActivity, R.string.video_reach_size_limit,
+ Toast.LENGTH_LONG).show();
+ }
+ }
+
private byte[] getJpegData(Image image) {
ByteBuffer buffer = image.getPlanes()[0].getBuffer();
byte[] bytes = new byte[buffer.remaining()];