summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.java
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-08-28 14:21:49 +0800
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commitf58e1e92ebfb1bc82a8ebe61b53f1b0db54c4e94 (patch)
tree0e10dbabde692d852bac3edf15b52b8bb8712cbf /src/com/android/camera/VideoUI.java
parentc4d80506754415446b575f566911890c15016953 (diff)
downloadandroid_packages_apps_Snap-f58e1e92ebfb1bc82a8ebe61b53f1b0db54c4e94.tar.gz
android_packages_apps_Snap-f58e1e92ebfb1bc82a8ebe61b53f1b0db54c4e94.tar.bz2
android_packages_apps_Snap-f58e1e92ebfb1bc82a8ebe61b53f1b0db54c4e94.zip
camera: Touch focus support for camcorder
Author: Steve Kondik <shade@chemlab.org> Date: Wed Aug 28 14:21:49 2013 +0800 camera: Touch focus support for camcorder * Available when video snapshots are not supported. * Original from CodeAurora Forum. Change-Id: I232c178430db08e7366aa9f91b4926d07e7c225d Author: Dheeraj CVR <cvr.dheeraj@gmail.com> Date: Sat Apr 19 02:33:46 2014 +0530 Camera2: Prevent autofocus when video snapshot is in progress During video recording if screen is tapped repeatedly, autofocus is started while the snapshot is taken. This would either result in an out of focus snapshot which would also disturb the focus in the recorded video or crash the sensors that can't handle autofocus during snapshot. Change-Id: If2763094f5ab7536e4409469276de54580e803c8 Author: Dheeraj CVR <cvr.dheeraj@gmail.com> Date: Mon Jun 23 22:00:07 2014 +0530 Camera2: Prevent propogating CancelAutoFocus during Video Recording When AutoFocus is started during Video Recording, CancelAutoFocus is called after KEY_FOCUS_TIME seconds. CancelAutoFocus has the side effect of resetting the sensor AF position and will result in instant loss of focus which is not a desired event when AF is manually triggered in case of Video Recording. Change-Id: Icee7f6dfd4ad083c9b383ee2a4df6a34e4668de6 Author: lion0738 <lion0738@naver.com> Date: Sun Jan 10 16:55:01 2016 +0900 Snap: Set parameters before starting preview Old parameters are used when grabbing focus mode. Camera parameters should be set to FocusOverlayManager before starting preview. Change-Id: I908559e1c2003be47b486996b0ec016b78107468 Change-Id: I8be16315ccede388e590e81e93f0dd417ae51c4a
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rwxr-xr-xsrc/com/android/camera/VideoUI.java46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index bf5e4ffc6..4bd38bbbe 100755
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -44,14 +44,17 @@ import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
+import android.view.View.OnLayoutChangeListener;
import com.android.camera.CameraManager.CameraProxy;
import com.android.camera.CameraPreference.OnPreferenceChangedListener;
+import com.android.camera.FocusOverlayManager.FocusUI;
import com.android.camera.PhotoUI.SurfaceTextureSizeChangedListener;
import com.android.camera.ui.AbstractSettingPopup;
import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CameraRootView;
import com.android.camera.ui.FaceView;
+import com.android.camera.ui.FocusIndicator;
import com.android.camera.ui.ListSubMenu;
import com.android.camera.ui.ModuleSwitcher;
import com.android.camera.ui.PieRenderer;
@@ -65,6 +68,7 @@ import com.android.camera.util.CameraUtil;
public class VideoUI implements PieRenderer.PieListener,
PreviewGestures.SingleTapListener,
CameraRootView.MyDisplayListener,
+ FocusUI,
SurfaceHolder.Callback,
PauseButton.OnPauseButtonListener,
CameraManager.CameraFaceDetectionCallback{
@@ -398,7 +402,7 @@ public class VideoUI implements PieRenderer.PieListener,
private void layoutPreview(float ratio) {
FrameLayout.LayoutParams lp = null;
- float scaledTextureWidth, scaledTextureHeight;
+ float scaledTextureWidth = 0.0f, scaledTextureHeight = 0.0f;
int rotation = CameraUtil.getDisplayRotation(mActivity);
if (!CameraUtil.isDefaultToPortrait(mActivity)) {
rotation = (rotation - 90) % 360;
@@ -504,6 +508,10 @@ public class VideoUI implements PieRenderer.PieListener,
}
+ if (scaledTextureWidth > 0 && scaledTextureHeight > 0) {
+ mController.onScreenSizeChanged((int) scaledTextureWidth,
+ (int) scaledTextureHeight);
+ }
}
/**
@@ -1281,4 +1289,40 @@ public class VideoUI implements PieRenderer.PieListener,
mFaceView.clear();
}
}
+
+ // implement focusUI interface
+ private FocusIndicator getFocusIndicator() {
+ return mPieRenderer;
+ }
+
+ @Override
+ public boolean hasFaces() {
+ return false;
+ }
+
+ @Override
+ public void clearFocus() {
+ FocusIndicator indicator = getFocusIndicator();
+ if (indicator != null) indicator.clear();
+ }
+
+ @Override
+ public void setFocusPosition(int x, int y) {
+ mPieRenderer.setFocus(x, y);
+ }
+
+ @Override
+ public void onFocusStarted(){
+ getFocusIndicator().showStart();
+ }
+
+ @Override
+ public void onFocusSucceeded(boolean timeOut) {
+ getFocusIndicator().showSuccess(timeOut);
+ }
+
+ @Override
+ public void onFocusFailed(boolean timeOut) {
+ getFocusIndicator().showFail(timeOut);
+ }
}