summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values-zh-rCN/strings.xml4
-rw-r--r--res/values/qcomarrays.xml2
-rw-r--r--res/values/qcomstrings.xml4
-rw-r--r--src/com/android/camera/VideoModule.java20
-rw-r--r--src/com/android/camera/util/CameraUtil.java10
5 files changed, 31 insertions, 9 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 42a59a262..fafdef192 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -398,6 +398,7 @@
<string name="pref_camera_video_duration_entry_mms">"30 秒(MMS)"</string>
<string name="pref_camera_video_duration_entry_10">"10 分钟"</string>
<string name="pref_camera_video_duration_entry_30">"30 分钟"</string>
+ <string name="pref_camera_video_duration_entry_nolimit">"无限制"</string>
<!-- Settings screen, Select hfr title -->
<string name="pref_camera_hfr_title">"视频高帧率"</string>
@@ -514,6 +515,9 @@
<string name="pref_camera_auto_hdr_entry_enable">开</string>
<string name="pref_camera_auto_hdr_entry_disable">关</string>
+ <!-- The message is shown in toast when click showOnMap Menu and there is no map app -->
+ <string name="map_activity_not_found_err">没有地图应用显示地理位置信息</string>
+
<!-- toast about switch storage -->
<string name="on_switch_save_path_to_sdcard">内部存储空间不足,已切换存储到SD卡</string>
</resources>
diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml
index abe13a117..73c34bd39 100644
--- a/res/values/qcomarrays.xml
+++ b/res/values/qcomarrays.xml
@@ -531,6 +531,7 @@
<item>@string/pref_camera_video_duration_entry_mms</item>
<item>@string/pref_camera_video_duration_entry_10</item>
<item>@string/pref_camera_video_duration_entry_30</item>
+ <item>@string/pref_camera_video_duration_entry_nolimit</item>
</string-array>
<!-- The numbers are in minutes, except -1 means the duration suitable for mms. -->
@@ -538,6 +539,7 @@
<item>-1</item>
<item>10</item>
<item>30</item>
+ <item>0</item>
</string-array>
<!-- Camera Preferences Skin Tone Enhancement dialog box entries -->
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index c76f5c658..a3cb048ba 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -97,6 +97,7 @@
<string name="pref_camera_video_duration_entry_mms">30 seconds(MMS)</string>
<string name="pref_camera_video_duration_entry_10">10 minutes</string>
<string name="pref_camera_video_duration_entry_30">30 minutes</string>
+ <string name="pref_camera_video_duration_entry_nolimit">no limit</string>
<!-- Default Skin Tone Enhancement setting. Do not translate. -->
<string name="pref_camera_skinToneEnhancement_default">disable</string>
@@ -850,6 +851,9 @@
<string name="pref_camera_video_rotation_entry_180">180</string>
<string name="pref_camera_video_rotation_entry_270">270</string>
+ <!-- The message is shown in toast when click showOnMap Menu and there is no map app -->
+ <string name="map_activity_not_found_err">There is no map app for show location.</string>
+
<!-- Continous shot enable message -->
<string name="longshot_enable_message">
Advance features are not supported in continuous shot mode</string>
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index e66d529b3..ae429dd2d 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -177,6 +177,7 @@ public class VideoModule implements CameraModule,
private CameraProxy mCameraDevice;
private static final String KEY_PREVIEW_FORMAT = "preview-format";
private static final String FORMAT_NV12_VENUS = "nv12-venus";
+ private static final String FORMAT_NV21 = "yuv420sp";
private static final String PERSIST_CAMERA_CPP_DUPLICATION =
"persist.camera.cpp.duplication";
@@ -909,10 +910,7 @@ public class VideoModule implements CameraModule,
return;
}
mParameters = mCameraDevice.getParameters();
- boolean isDuplicationEnabled =
- SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, false);
- if (mParameters.getSupportedVideoSizes() == null || ((is1080pEnabled() ||
- is720pEnabled()) && isDuplicationEnabled) ||
+ if (mParameters.getSupportedVideoSizes() == null ||
isHFREnabled(mProfile.videoFrameWidth, mProfile.videoFrameHeight)) {
mDesiredPreviewWidth = mProfile.videoFrameWidth;
mDesiredPreviewHeight = mProfile.videoFrameHeight;
@@ -2070,11 +2068,19 @@ public class VideoModule implements CameraModule,
Log.v(TAG, "preview format set to YV12");
mParameters.setPreviewFormat (ImageFormat.YV12);
}
+
+ // Set NV12_VENUS for preview stream, when both the below conditions are met
+ // 1. setprop "persist.camera.cpp.duplication" is enabled(Default value is enabled)
+ // 2. If both preview & video resolution are exactly same
boolean isDuplicationEnabled =
- SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, false);
- if ((is1080pEnabled() || is720pEnabled()) && isDuplicationEnabled) {
- Log.v(TAG, "1080p or 720p enabled, preview format set to NV12_VENUS");
+ SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, true);
+ if (isDuplicationEnabled && (mDesiredPreviewWidth == mProfile.videoFrameWidth) &&
+ (mDesiredPreviewHeight == mProfile.videoFrameHeight)) {
+ Log.v(TAG, "Preview is same as Video resolution, So preview format set to NV12_VENUS");
mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV12_VENUS);
+ } else {
+ mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV21);
+ Log.v(TAG, "preview format set to NV21");
}
// Set High Frame Rate.
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index a80db9f09..60d4f065c 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -1035,8 +1035,14 @@ public class CameraUtil {
// Use the "geo intent" if no GMM is installed
Log.e(TAG, "GMM activity not found!", e);
String url = String.format(Locale.ENGLISH, "geo:%f,%f", latLong[0], latLong[1]);
- Intent mapsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- activity.startActivity(mapsIntent);
+ try {
+ Intent mapsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ activity.startActivity(mapsIntent);
+ } catch (ActivityNotFoundException ex) {
+ Log.e(TAG, "Map view activity not found!", ex);
+ Toast.makeText(activity, activity.getString(R.string.map_activity_not_found_err),
+ Toast.LENGTH_SHORT).show();
+ }
}
}