diff options
| -rw-r--r-- | res/values/cm_strings.xml | 2 | ||||
| -rw-r--r-- | res/values/config.xml | 2 | ||||
| -rw-r--r-- | res/xml/video_preferences.xml | 9 | ||||
| -rw-r--r-- | src/com/android/camera/CameraSettings.java | 8 | ||||
| -rw-r--r-- | src/com/android/camera/OnScreenIndicators.java | 17 | ||||
| -rw-r--r-- | src/com/android/camera/VideoMenu.java | 5 | ||||
| -rw-r--r-- | src/com/android/camera/VideoModule.java | 13 | ||||
| -rw-r--r-- | src/com/android/camera/VideoUI.java | 1 |
8 files changed, 57 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index e7dc36c01..8b43a29cf 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -88,4 +88,6 @@ <!-- HFR video size --> <string name="pref_video_quality_entry_hfr">WVGA High Frame Rate</string> + <!-- Video HDR default value --> + <string name="pref_camera_video_hdr_default" translatable="false">off</string> </resources> diff --git a/res/values/config.xml b/res/values/config.xml index 94c2e4d1a..8aab5e936 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -52,4 +52,6 @@ <bool name="useContinuosFocusForTouch">false</bool> <!-- A certain beefy device has issues with video snapshots --> <bool name="useVideoSnapshotWorkaround">false</bool> + <!-- Video HDR mode. Aggressively crashes on some hardware --> + <bool name="enableVideoHDR">false</bool> </resources> diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml index 86de6d09a..d2f90e42b 100644 --- a/res/xml/video_preferences.xml +++ b/res/xml/video_preferences.xml @@ -75,4 +75,13 @@ camera:largeIcons="@array/camera_recordlocation_largeicons" camera:entries="@array/pref_camera_recordlocation_entries" camera:entryValues="@array/pref_camera_recordlocation_entryvalues" /> + <IconListPreference + camera:key="pref_camera_video_hdr_key" + camera:defaultValue="@string/pref_camera_video_hdr_default" + camera:title="@string/pref_camera_scenemode_entry_hdr" + camera:entries="@array/pref_camera_hdr_entries" + camera:icons="@array/pref_camera_hdr_icons" + camera:largeIcons="@array/pref_camera_hdr_icons" + camera:labelList="@array/pref_camera_hdr_labels" + camera:entryValues="@array/pref_camera_hdr_entryvalues" /> </PreferenceGroup> diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index ddd2f27a9..b43b87b3b 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -69,6 +69,7 @@ public class CameraSettings { public static final String KEY_VIDEO_FIRST_USE_HINT_SHOWN = "pref_video_first_use_hint_shown_key"; public static final String KEY_PHOTOSPHERE_PICTURESIZE = "pref_photosphere_picturesize_key"; public static final String KEY_STORAGE = "pref_camera_storage_key"; + public static final String KEY_VIDEO_HDR = "pref_camera_video_hdr_key"; public static final String EXPOSURE_DEFAULT_VALUE = "0"; @@ -179,6 +180,7 @@ public class CameraSettings { ListPreference videoEffect = group.findPreference(KEY_VIDEO_EFFECT); ListPreference cameraHdr = group.findPreference(KEY_CAMERA_HDR); ListPreference storage = group.findPreference(KEY_STORAGE); + ListPreference videoHdr = group.findPreference(KEY_VIDEO_HDR); // Since the screen could be loaded from different resources, we need // to check if the preference is available here @@ -238,6 +240,12 @@ public class CameraSettings { || !Util.isCameraHdrSupported(mParameters))) { removePreference(group, cameraHdr.getKey()); } + if (videoHdr != null) { + if (!mContext.getResources().getBoolean(R.bool.enableVideoHDR)) { + removePreference(group, videoHdr.getKey()); + } + filterUnsupportedOptions(group, videoHdr, mParameters.getSupportedVideoHDRModes()); + } if (storage != null) { buildStorage(group, storage); } diff --git a/src/com/android/camera/OnScreenIndicators.java b/src/com/android/camera/OnScreenIndicators.java index 77c8fafc0..8e726026d 100644 --- a/src/com/android/camera/OnScreenIndicators.java +++ b/src/com/android/camera/OnScreenIndicators.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.res.TypedArray; import android.hardware.Camera; import android.hardware.Camera.Parameters; +import android.util.Log; import android.view.View; import android.widget.ImageView; @@ -180,6 +181,22 @@ public class OnScreenIndicators { } /** + * Reuse the scene indicator for video HDR mode. + * + * @param value of video HDR mode + */ + public void updateVideoHDROnScreenIndicator(String value) { + if (mSceneIndicator == null) { + return; + } + if (value != null && "on".equals(value)) { + mSceneIndicator.setImageResource(R.drawable.ic_indicator_sce_hdr); + } else { + mSceneIndicator.setImageResource(R.drawable.ic_indicator_sce_off); + } + } + + /** * Sets the visibility of all indicators. * * @param visibility View.VISIBLE, View.GONE etc. diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java index 31f92248f..83819002d 100644 --- a/src/com/android/camera/VideoMenu.java +++ b/src/com/android/camera/VideoMenu.java @@ -56,6 +56,11 @@ public class VideoMenu extends PieController mPopup = null; mPopupStatus = POPUP_NONE; PieItem item = null; + // hdr + if (group.findPreference(CameraSettings.KEY_VIDEO_HDR) != null) { + item = makeSwitchItem(CameraSettings.KEY_VIDEO_HDR, true); + mRenderer.addItem(item); + } // white balance if (group.findPreference(CameraSettings.KEY_WHITE_BALANCE) != null) { item = makeItem(CameraSettings.KEY_WHITE_BALANCE); diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 9a3619269..88cdd7257 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -1954,6 +1954,19 @@ public class VideoModule implements CameraModule, mParameters.setVideoHighFrameRate(mEnableHFR ? hfrModes.get(hfrModes.size() - 1) : "off"); } + // Set Video HDR. + if (mActivity.getResources().getBoolean(R.bool.enableVideoHDR)) { + String videoHDR = mPreferences.getString( + CameraSettings.KEY_VIDEO_HDR, + mActivity.getString(R.string.pref_camera_video_hdr_default)); + Log.v(TAG, "Video HDR Setting =" + videoHDR); + if (isSupported(videoHDR, mParameters.getSupportedVideoHDRModes())) { + mParameters.setVideoHDRMode(videoHDR); + } else { + mParameters.setVideoHDRMode("off"); + } + } + Util.dumpParameters(mParameters); mActivity.mCameraDevice.setParameters(mParameters); diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 9fc05769f..b649a9a06 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -261,6 +261,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener, } public void updateOnScreenIndicators(Parameters param, ComboPreferences prefs) { + mOnScreenIndicators.updateVideoHDROnScreenIndicator(param.getVideoHDRMode()); mOnScreenIndicators.updateFlashOnScreenIndicator(param.getFlashMode()); boolean location = RecordLocationPreference.get( prefs, mActivity.getContentResolver()); |
