android 9.0 平板项目,修改相机横屏显示

news/2024/11/23 5:26:56/

 

android 9.0 P 版本修改相机全屏显示,移植老项目相机模糊问题

diff --git a/packages/apps/SnapdragonCamera/AndroidManifest.xml b/packages/apps/SnapdragonCamera/AndroidManifest.xml
index 4307577..f4c98af 100755
--- a/packages/apps/SnapdragonCamera/AndroidManifest.xml
+++ b/packages/apps/SnapdragonCamera/AndroidManifest.xml
@@ -50,7 +50,7 @@android:label="@string/snapcam_app_name"android:launchMode="singleTask"android:logo="@mipmap/ic_launcher_gallery"
-            android:screenOrientation="portrait"
+            android:screenOrientation="landscape"android:taskAffinity="com.android.camera.CameraActivity"android:theme="@style/Theme.Camera"android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
@@ -146,7 +146,7 @@android:label="@string/snapcam_app_name"android:launchMode="singleInstance"android:logo="@mipmap/ic_launcher_gallery"
-            android:screenOrientation="portrait"
+            android:screenOrientation="landscape"android:taskAffinity="com.android.camera.SecureCameraActivity"android:theme="@style/Theme.Camera"android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >
diff --git a/packages/apps/SnapdragonCamera/res/values-zh-rCN/strings.xml b/packages/apps/SnapdragonCamera/res/values-zh-rCN/strings.xml
old mode 100644
new mode 100755
index 9b8290f..f514d9c
--- a/packages/apps/SnapdragonCamera/res/values-zh-rCN/strings.xml
+++ b/packages/apps/SnapdragonCamera/res/values-zh-rCN/strings.xml
@@ -464,9 +464,9 @@<string name="pref_camera_contrast_entry_level10">"等级 10"</string><!-- Settings screen, Multiple levels entries -->
-    <string name="pref_camera_sharpness_entry_level0">等级 0</string>
+    <string name="pref_camera_sharpness_entry_level0">等级 0(默认)</string><string name="pref_camera_sharpness_entry_level1">等级 1</string>
-    <string name="pref_camera_sharpness_entry_level2">等级 2(默认)</string>
+    <string name="pref_camera_sharpness_entry_level2">等级 2</string><string name="pref_camera_sharpness_entry_level3">等级 3</string><string name="pref_camera_sharpness_entry_level4">等级 4</string><string name="pref_camera_sharpness_entry_level5">等级 5</string>
diff --git a/packages/apps/SnapdragonCamera/res/values/qcomstrings.xml b/packages/apps/SnapdragonCamera/res/values/qcomstrings.xml
index ce27909..8e29e1f 100755
--- a/packages/apps/SnapdragonCamera/res/values/qcomstrings.xml
+++ b/packages/apps/SnapdragonCamera/res/values/qcomstrings.xml
@@ -278,7 +278,7 @@<string name="pref_camera_video_cds_title">Video CDS mode</string><!-- Default cds mode setting-->
-    <string name="pref_camera_cds_default" translatable="false">off</string>
+    <string name="pref_camera_cds_default" translatable="false">on</string><!-- Default video cds mode setting--><string name="pref_camera_video_cds_default" translatable="false">off</string>
@@ -488,7 +488,7 @@<string name="pref_camera_antibanding_title">Anti Banding</string><!-- Default Anti Banding setting. -->
-     <string name="pref_camera_antibanding_default">off</string>
+     <string name="pref_camera_antibanding_default">50hz</string><!-- Settings screen, Anti Banding entries --><string name="pref_camera_antibanding_entry_0">Off</string>
@@ -554,9 +554,9 @@<string name="pref_camera_facerc_entry_on">On</string><!-- Settings screen, Multiple levels entries -->
-    <string name="pref_camera_sharpness_entry_level0">Level 0</string>
+    <string name="pref_camera_sharpness_entry_level0">Level 0(Default)</string><string name="pref_camera_sharpness_entry_level1">Level 1</string>
-    <string name="pref_camera_sharpness_entry_level2">Level 2(Default)</string>
+    <string name="pref_camera_sharpness_entry_level2">Level 2</string><string name="pref_camera_sharpness_entry_level3">Level 3</string><string name="pref_camera_sharpness_entry_level4">Level 4</string><string name="pref_camera_sharpness_entry_level5">Level 5</string>
@@ -589,7 +589,7 @@<string name="pref_camera_saturation_entry_level10">Level 10</string><!-- Default sharpness setting. Do not translate. -->
-    <string name="pref_camera_sharpness_default">2</string>
+    <string name="pref_camera_sharpness_default">0</string><!-- Settings screen, Select sharpness title --><string name="pref_camera_sharpness_title">Sharpness</string>
diff --git a/packages/apps/SnapdragonCamera/src/com/android/camera/PhotoModule.java b/packages/apps/SnapdragonCamera/src/com/android/camera/PhotoModule.java
index b814569..b75d4e6 100755
--- a/packages/apps/SnapdragonCamera/src/com/android/camera/PhotoModule.java
+++ b/packages/apps/SnapdragonCamera/src/com/android/camera/PhotoModule.java
@@ -4108,13 +4108,21 @@ public class PhotoModuleSize optimalSize = CameraUtil.getOptimalPreviewSize(mActivity, sizes,(double) size.width / size.height);+        for(int i = 0;i < sizes.size(); i ++){
+        //    System.out.println(sizes.get(i));
+            Log.d(TAG, "updateCameraParametersPreference  4113  preview size = "
+                    + optimalSize.width + ", " + optimalSize.height);
+        }
+        optimalSize.width = 1920;
+        optimalSize.height = 1080;
+Point previewSize = PersistUtil.getCameraPreviewSize();if (previewSize != null) {optimalSize.width = previewSize.x;optimalSize.height = previewSize.y;}-        Log.d(TAG, "updateCameraParametersPreference final preview size = "
+        Log.d(TAG, "updateCameraParametersPreference  112 final 00000 preview size = "+ optimalSize.width + ", " + optimalSize.height);Size original = mParameters.getPreviewSize();
diff --git a/packages/apps/SnapdragonCamera/src/com/android/camera/VideoModule.java b/packages/apps/SnapdragonCamera/src/com/android/camera/VideoModule.java
index 299eac8..57f2f9a 100755
--- a/packages/apps/SnapdragonCamera/src/com/android/camera/VideoModule.java
+++ b/packages/apps/SnapdragonCamera/src/com/android/camera/VideoModule.java
@@ -111,6 +111,7 @@ public class VideoModule implements CameraModule,private static final long SDCARD_SIZE_LIMIT = 4000 * 1024 * 1024;private static final long SHUTTER_BUTTON_TIMEOUT = 0L; // 0ms
+	private static final int MAX_SHARPNESS_LEVEL = 6;/*** An unpublished intent flag requesting to start recording straight away
@@ -1246,6 +1247,27 @@ public class VideoModule implements CameraModule,if (mPreviewing == true) {stopPreview();}
+	    //add by delin
+	   Parameters parameters = mCameraDevice.getParameters();	
+	   String sharpnessStr = mPreferences.getString(
+			   CameraSettings.KEY_SHARPNESS,
+			   mActivity.getString(R.string.pref_camera_sharpness_default));
+	   int sharpness = Integer.parseInt(sharpnessStr) *
+			   (parameters.getMaxSharpness()/MAX_SHARPNESS_LEVEL);
+	   Log.v(TAG, "Sharpness value =" + sharpness);
+	   if((0 <= sharpness) && (sharpness <= parameters.getMaxSharpness())){
+		   Log.v(TAG, "parameters.setSharpness");
+		   parameters.setSharpness(sharpness);
+	   }	
+	// Set anti banding parameter.
+	String antiBanding = mPreferences.getString(
+			 CameraSettings.KEY_ANTIBANDING,
+			 mActivity.getString(R.string.pref_camera_antibanding_default));
+	Log.v(TAG, "antiBanding value =" + antiBanding);
+	if (CameraUtil.isSupported(antiBanding, parameters.getSupportedAntibanding())) {		 
+	Log.v(TAG, "setAntibanding antiBanding value =" + antiBanding);
+		parameters.setAntibanding(antiBanding);
+	}setDisplayOrientation();mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation);
@@ -2392,9 +2414,9 @@ public class VideoModule implements CameraModule,mParameters.setAntibanding(Parameters.ANTIBANDING_AUTO);}} else {
-            if (isSupported(mDefaultAntibanding, mParameters.getSupportedAntibanding())) {
+            /*if (isSupported(mDefaultAntibanding, mParameters.getSupportedAntibanding())) {mParameters.setAntibanding(mDefaultAntibanding);
-            }
+            }*/}Log.d(TAG, "antiBanding value = " + mParameters.getAntibanding());diff --git a/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaModule.java b/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaModule.java
old mode 100644
new mode 100755
index 0aab8f8..1cfb694
--- a/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaModule.java
@@ -70,7 +70,7 @@ public class WideAnglePanoramaModulepublic static final int DEFAULT_SWEEP_ANGLE = 160;public static final int DEFAULT_BLEND_MODE = Mosaic.BLENDTYPE_HORIZONTAL;
-    public static final int DEFAULT_CAPTURE_PIXELS = 960 * 720;
+    public static final int DEFAULT_CAPTURE_PIXELS =1280 * 960;private static final int MSG_LOW_RES_FINAL_MOSAIC_READY = 1;private static final int MSG_GENERATE_FINAL_MOSAIC_ERROR = 2;
@@ -86,7 +86,7 @@ public class WideAnglePanoramaModuleprivate static final int PREVIEW_ACTIVE = 1;public static final int CAPTURE_STATE_VIEWFINDER = 0;public static final int CAPTURE_STATE_MOSAIC = 1;
-
+    private static final int MAX_SHARPNESS_LEVEL = 6;// The unit of speed is degrees per frame.private static final float PANNING_SPEED_THRESHOLD = 2.5f;private static final boolean DEBUG = false;
@@ -439,6 +439,7 @@ public class WideAnglePanoramaModulemCameraPreviewHeight = h;pixelsDiff = d;hasFound = true;
+                break;}}return hasFound;
@@ -474,7 +475,27 @@ public class WideAnglePanoramaModule}parameters.set(CameraUtil.RECORDING_HINT, CameraUtil.FALSE);
+//add by delin
+        String sharpnessStr = mPreferences.getString(
+                CameraSettings.KEY_SHARPNESS,
+                mActivity.getString(R.string.pref_camera_sharpness_default));
+        int sharpness = Integer.parseInt(sharpnessStr) *
+                (parameters.getMaxSharpness()/MAX_SHARPNESS_LEVEL);
+        Log.v(TAG, "Sharpness value =" + sharpness);
+        if((0 <= sharpness) && (sharpness <= parameters.getMaxSharpness())){
+            Log.v(TAG, "parameters.setSharpness");
+            parameters.setSharpness(sharpness);
+        }+        // Set anti banding parameter.
+        String antiBanding = mPreferences.getString(
+                CameraSettings.KEY_ANTIBANDING,
+                mActivity.getString(R.string.pref_camera_antibanding_default));
+        Log.v(TAG, "antiBanding value =" + antiBanding);
+        if (CameraUtil.isSupported(antiBanding, parameters.getSupportedAntibanding())) {
+            Log.v(TAG, "setAntibanding antiBanding value =" + antiBanding);
+            parameters.setAntibanding(antiBanding);
+        }mHorizontalViewAngle = parameters.getHorizontalViewAngle();mVerticalViewAngle =  parameters.getVerticalViewAngle();}
@@ -1133,7 +1154,7 @@ public class WideAnglePanoramaModule// as Panoroma will add 90 degree rotation compensation during// postprocessing, we need to consider both camera mount angle and// this compensation angle
-            mCameraDevice.setDisplayOrientation(0);
+            mCameraDevice.setDisplayOrientation(270);if (mCameraTexture != null)mCameraTexture.setOnFrameAvailableListener(this);
diff --git a/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaUI.java b/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaUI.java
index 74ba2c3..c360378 100755
--- a/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/packages/apps/SnapdragonCamera/src/com/android/camera/WideAnglePanoramaUI.java
@@ -384,7 +384,8 @@ public class WideAnglePanoramaUI implementsint w = width;int h = height;-        h = w * 4 / 3;
+      //  h = w * 4 / 3;
+        w = h * 4 / 3;yOffset = (height - h) / 2;FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(w, h);

 


http://www.ppmy.cn/news/210216.html

相关文章

Android刷机Windows10,蓝魔i9s Win10+Android双系统的刷机教程及固件下载

本篇文章转载于蓝魔社区里的大神 Net 。在此感谢!! 写在最前面:刷机有风险,操作需谨慎! 本方法原理上适用任何双启动平板,适用所有win10系统,包括以后的win10正式版! 本人i9s测试没问题,希望其他机友测试反馈一下,建议先看下方PS说明再刷机。 前提:i9s已经是双系统,…

魔百盒之小型家庭NAS

前言 前几天海鲜市场26淘了一个盒子&#xff0c;到手看了看型号是CM211-1&#xff0c;CH代工&#xff0c;SoC应该是晶晨的S905L3B&#xff0c;网上也有说是S905L、S905L3什么的&#xff0c;拆开盒子主芯片贴着散热片看不到&#xff0c;也不想拆了&#xff0c;wifi芯片是UWE5621…

蓝魔i11pro运行linux,蓝魔i11 pro的彪悍 我来给你解释一下

谁说一定要用水果牌的平板才能显得高大上&#xff1f;对于这个观点我个人就不同意了&#xff0c;因为市场上的好平板还有很多&#xff0c;尤其是能够同时支持Android和Windows 8.1双系统的产品&#xff0c;他们都要比苹果iPad有优势。这样说&#xff0c;可能果粉们会反驳&#…

蓝魔i100pro刷linux,双系统新旗舰 蓝魔i100 Pro首发评测

1全面的平板 价格略高 刚刚拿到蓝魔i100 Pro双系统时,这款机器给我的第一印象非常不错,金属机身、边缘曼妙的弧度以及精细的倒角腰线,使其外观设计不输于国际大厂。话说这两年,国产手机以及平板一直在努力摆脱廉价低质的形象而朝着更高端的路线去走,蓝魔也不例外,那么这样…

android刷windows教程视频,蓝魔i9s安卓版刷Windows 8.1系统固件视频教程

本文介绍的蓝魔I9s安卓版刷windows 8.1系统固件的方法主要来自蓝魔贴吧“蓝魔i9s Windows8 with Bing固件”一文,不过因为视频也是第一次刷机制作,在中途出了点问题,刷机后面部分有所修改,建议大家先看完视频,然后准备好了再操作。而WIN8刷回安卓,贴吧有文章了,还没时间…

魔百盒M201-D-S905L芯片_免拆_卡刷固件包及教程

魔百盒M201-D-S905L芯片_免拆_卡刷固件包及教程 固件特点&#xff1a; 1、适用于九联魔百盒M201-D&#xff1b; 2、开放原厂固件屏蔽的市场安装和u盘安装apk&#xff1b; 3、修改dns&#xff0c;三网通用&#xff1b; 4、大量精简内置的没用的软件&#xff0c;运行速度提升…

蓝魔i11pro运行linux,不仅仅是变大了 蓝魔i11pro新玩法

在以前&#xff0c;很多人都觉得平板电脑是更像是一个玩具&#xff0c;功能偏娱乐&#xff0c;不外乎打打游戏&#xff0c;看看电影。不过随着平板电脑的普及度提高&#xff0c;产品逐步多样化&#xff0c;我们开始习惯把更多重要的事情交给平板来完成。而且在教育、餐饮、银行…

win8 android 双系统平板,推出Win8/安卓双系统平板 蓝魔的一次积极尝试

【PConline 资讯】提起Windows8/Android双系统平板&#xff0c;相信了解IT行业的人不是第一次听说。最早出现这一双系统相关概念是在2013年6月&#xff0c;三星发布AtivQ&#xff0c;一款Win8混合笔记本电脑&#xff0c;你在主屏上点击一个应用&#xff0c;就会出现一个全屏的A…