青岛官网seo方法,做网站优化推广的好处,同学录网站建设,怎么做网页小猪佩奇最近遇到一个问题#xff0c;相机更换了摄像头后#xff0c;发现人像角度顺时针旋转了90度#xff0c;待人像角度正常后#xff0c;发现 预览时图像有挤压变形#xff0c;最终解决。在此记录 一人像角度的修改
先放示意图 设备预览人像角度如图1所示#xff0c;顺时针旋… 最近遇到一个问题相机更换了摄像头后发现人像角度顺时针旋转了90度待人像角度正常后发现 预览时图像有挤压变形最终解决。在此记录 一人像角度的修改
先放示意图 设备预览人像角度如图1所示顺时针旋转了90正常效果如图2 修改如下
//文件路径 /device/sprd/qogirn6l/ums9158_1h10/ums9158_1h10/module/camera/sensor_config.xml
Date: Wed Nov 27 18:02:01 2024 0800修复顺时针旋转90度摄像头预览Change-Id: Ife0a46fe32ffd2c213d0ba0ab1eba07be50c8055diff --git a/ums9158_1h10/module/camera/sensor_config.xml b/ums9158_1h10/module/camera/sensor_config.xm
l
index 20031a4..60aa732 100755
--- a/ums9158_1h10/module/camera/sensor_config.xmlb/ums9158_1h10/module/camera/sensor_config.xml-6,7 6,7 SlotId0/SlotIdSensorNameov8858_ft18/SensorNameFacingBACK/Facing
- Orientation270/OrientationOrientation180/Orientation^MResource_cost100/Resource_costTuningParameterTuningNameov8858_main_ft18/TuningName 如上修改可以相机后摄像头预览时人像角度前摄也应该在改文件中找front选项和对应项目名称
二相机预览时图像挤压变形
步骤一完成后图像角度正常了但是内容挤压变形了。效果如下所示 图1 图2
如上图左侧图1时被挤压时效果右图2是修改后正常效果。
刚开始以为问题再驱动层和同事沟通后发现应该在应用层相机设置里个比例设置默认全屏模式只是比例有问题。然后看源码角度不对的时候无挤压旋转后有挤压说明比例反了设备屏幕宽高比做此判断如下修改
~~思路默认只是角度不对但是没有挤压说明原有的比例和屏幕比例一致所以正常
旋转了角度图像比例和屏幕比例不一致导致挤压根据源码将其比例反过来就可以了~~。
-----------------------------------20241129 update--------------------------
比例不对这个判断是对的。将宽高比换下经过测试也是不对的。屏幕是长x款 是640x480 比例为43.旋转后还是又拉长的。只能使用11.上面的图2 效果图也是11比例而不是全屏。修改是是删除其他比例选项只保留11选项。
-----------------------update end-----------------------
可以在设置中选择11比例图像正常说明 比例问题
vendor/sprd/platform/packages/apps/DreamCamera2/src/com/android/camera/settings$ git diff
diff --git a/src/com/android/camera/settings/ResolutionUtil.java b/src/com/android/camera/settings/ResolutionUtil.java
index 432e28d0..cbe823ff 100644
--- a/src/com/android/camera/settings/ResolutionUtil.javab/src/com/android/camera/settings/ResolutionUtil.java-39,6 39,8 import java.util.HashSet;import java.util.LinkedList;import java.util.List;import java.util.Set;
import com.android.camera.debug.Log;
import javax.annotation.Nonnull;import javax.annotation.ParametersAreNonnullByDefault;-52,6 54,9 import javax.annotation.ParametersAreNonnullByDefault;* user with so many options.*/public class ResolutionUtil {private static final Log.Tag TAG new Log.Tag(ResolutionUtil);
/*** Different aspect ratio constants.*/-75,14 80,20 public class ResolutionUtil {Point point new Point();Display d activity.getWindowManager().getDefaultDisplay();d.getRealSize(point);mFullScreenSize point.x point.y ? new Size(point.x, point.y) : new Size(point.y, point.x); Log.e(TAG, setDesiredAspectRatio, point.x: point.x,point.y: point.y);Log.e(TAG, setDesiredAspectRatio, mFullScreenSize: mFullScreenSize);// sDesiredAspectRatioSizes.add(new Size(4,3));//sDesiredAspectRatioSizes.add(mFullScreenSize);sDesiredAspectRatioSizes.add(new Size(1,1));// sDesiredAspectRatios.add(4.0f / 3.0f); Log.e(TAG, setDesiredAspectRatio, mFullScreenSize.width(): mFullScreenSize.width() ,mFullScreenSize.height(): mFullScreenSize.height());Log.e(TAG, setDesiredAspectRatio, mFullScreenSize.width() / (float) mFullScreenSize.height() mFullScreenSize.width() / (float) mFullScreenSize.height());// sDesiredAspectRatios.add(mFullScreenSize.width() / (float) mFullScreenSize.height());sDesiredAspectRatios.add(1.0f / 1.0f);settled true;}测试通过over
ps怎么判断当前的应用在项目中那个路径可以看我的历史文章
[转]Android寻找某个包在aosp下的路径