summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorApurva Rajguru <arajguru@codeaurora.org>2014-07-23 16:35:54 -0700
committerSusmitha Gummalla <vgummall@codeaurora.org>2014-09-03 14:15:08 -0700
commite07e72ac2bbe4dc0160b5feff6084e31a98ea8e4 (patch)
treed9c21e511509f39f8dcb97a82f74cdb14feeed13
parentdebbc5ad3c08db8f7c0a35a9d39dc11d95bca8c2 (diff)
downloadandroid_packages_apps_Snap-e07e72ac2bbe4dc0160b5feff6084e31a98ea8e4.tar.gz
android_packages_apps_Snap-e07e72ac2bbe4dc0160b5feff6084e31a98ea8e4.tar.bz2
android_packages_apps_Snap-e07e72ac2bbe4dc0160b5feff6084e31a98ea8e4.zip
Camera: Add support for video rotation
Adding menu items for video rotation. Change-Id: Ic684dd279f6c2f867e607ba6fbe3919db67b96f8
-rwxr-xr-xres/values/arrays.xml22
-rw-r--r--res/values/qcomstrings.xml14
-rwxr-xr-xres/values/strings.xml7
-rw-r--r--res/xml/video_preferences.xml6
-rw-r--r--src/com/android/camera/CameraSettings.java7
-rw-r--r--src/com/android/camera/VideoMenu.java1
-rwxr-xr-xsrc/com/android/camera/VideoModule.java8
7 files changed, 65 insertions, 0 deletions
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index fce85b8a3..d1baeaeb5 100755
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -597,4 +597,26 @@
<item>@string/pref_camera_countdown_label_fifteen</item>
</string-array>
+ <!-- VideoCamera Preferences video rotations entry-->
+ <string-array name="pref_camera_video_rotation_entries" translatable="false">
+ <item>@string/pref_camera_video_rotation_entry_0</item>
+ <item>@string/pref_camera_video_rotation_entry_90</item>
+ <item>@string/pref_camera_video_rotation_entry_180</item>
+ <item>@string/pref_camera_video_rotation_entry_270</item>
+ </string-array>
+
+ <string-array name="pref_camera_video_rotation_labels" translatable="false">
+ <item>@string/pref_camera_video_rotation_label_0</item>
+ <item>@string/pref_camera_video_rotation_label_90</item>
+ <item>@string/pref_camera_video_rotation_label_180</item>
+ <item>@string/pref_camera_video_rotation_label_270</item>
+ </string-array>
+
+ <string-array name="pref_camera_video_rotation_entryvalues" translatable="false">
+ <item>0</item>
+ <item>90</item>
+ <item>180</item>
+ <item>270</item>
+ </string-array>
+
</resources>
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index 70ce6e1b6..c9bbaaadd 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -702,5 +702,19 @@
<string name="pref_hdr_mode_value_sensor">hdr-mode-sensor</string>
<string name="pref_hdr_mode_value_multi_frame">hdr-mode-multiframe</string>
+ <!--Default video rotation setting-->
+ <string name="pref_camera_video_rotation_default" translatable="false">0</string>
+
+ <!--Settings screen, video rotation title-->
+ <string name="pref_camera_video_rotation_title">Video Rotation</string>
+
+ <!--Menu, video rotation label-->
+ <string name="pref_camera_video_rotation_label">VIDEO ROTATION</string>
+
+ <!-- Settings screen, Video rotation dialog radio button choices -->
+ <string name="pref_camera_video_rotation_entry_0">0</string>
+ <string name="pref_camera_video_rotation_entry_90">90</string>
+ <string name="pref_camera_video_rotation_entry_180">180</string>
+ <string name="pref_camera_video_rotation_entry_270">270</string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b105cfdbd..27f3b6488 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -695,4 +695,11 @@ CHAR LIMIT = NONE] -->
<!-- String shown when setting the homepage wallpaper in the background [CHAR LIMIT=NONE] -->
<string name="setting_wallpaper">Setting wallpaper</string>
+
+
+ <!-- Menu, Video rotation labels [CHAR LIMIT=50] -->
+ <string name="pref_camera_video_rotation_label_0">0</string>
+ <string name="pref_camera_video_rotation_label_90">90</string>
+ <string name="pref_camera_video_rotation_label_180">180</string>
+ <string name="pref_camera_video_rotation_label_270">270</string>
</resources>
diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml
index 6b107a534..2bb99d992 100644
--- a/res/xml/video_preferences.xml
+++ b/res/xml/video_preferences.xml
@@ -132,4 +132,10 @@
camera:title="@string/pref_camera_savepath_title"
camera:entries="@array/pref_camera_savepath_entries"
camera:entryValues="@array/pref_camera_savepath_entryvalues" />
+ <ListPreference
+ camera:key="pref_camera_video_rotation_key"
+ camera:defaultValue="@string/pref_camera_video_rotation_default"
+ camera:title="@string/pref_camera_video_rotation_title"
+ camera:entries="@array/pref_camera_video_rotation_entries"
+ camera:entryValues="@array/pref_camera_video_rotation_entryvalues" />
</PreferenceGroup>
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 2803dbe1b..c0c8a4092 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -149,6 +149,7 @@ public class CameraSettings {
public static final String FLIP_MODE_VH = "flip-vh";
private static final String KEY_QC_PICTURE_FORMAT = "picture-format-values";
+ public static final String KEY_VIDEO_ROTATION = "pref_camera_video_rotation_key";
private static final String VIDEO_QUALITY_HIGH = "high";
private static final String VIDEO_QUALITY_MMS = "mms";
private static final String VIDEO_QUALITY_YOUTUBE = "youtube";
@@ -384,6 +385,7 @@ public class CameraSettings {
filterUnsupportedOptions(group,
hdr_mode, getSupportedHDRModes(mParameters));
}
+ ListPreference videoRotation = group.findPreference(KEY_VIDEO_ROTATION);
if (touchAfAec != null) {
filterUnsupportedOptions(group,
@@ -469,6 +471,11 @@ public class CameraSettings {
if (longShot!= null && !isLongshotSupported(mParameters)) {
removePreference(group, longShot.getKey());
}
+
+ if (videoRotation != null) {
+ filterUnsupportedOptions(group,
+ videoRotation, mParameters.getSupportedVideoRotationValues());
+ }
}
private void initPreference(PreferenceGroup group) {
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index ae6d67072..85e77dda7 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -83,6 +83,7 @@ public class VideoMenu extends PieController
CameraSettings.KEY_WHITE_BALANCE,
CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE,
CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE,
+ CameraSettings.KEY_VIDEO_ROTATION
};
PieItem item1 = makeItem(R.drawable.ic_settings_holo_light_01);
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 679f89557..30144407c 100755
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2143,6 +2143,14 @@ public class VideoModule implements CameraModule,
mUI.overrideSettings(CameraSettings.KEY_DIS,"disable");
}
}
+ //setting video rotation
+ String videoRotation = mPreferences.getString(
+ CameraSettings.KEY_VIDEO_ROTATION,
+ mActivity.getString(R.string.pref_camera_video_rotation_default));
+ if (isSupported(videoRotation, mParameters.getSupportedVideoRotationValues())) {
+ mParameters.setVideoRotation(videoRotation);
+ }
+
}
@SuppressWarnings("deprecation")
private void setCameraParameters() {