diff options
author | Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org> | 2013-12-26 12:38:20 -0800 |
---|---|---|
committer | Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org> | 2014-01-02 11:48:08 -0800 |
commit | 2c309499e60120ec513f51bfab02e7d54237af0a (patch) | |
tree | 3361a4d55d53475682b6519d038543bf854fffd8 /src/com/android/camera/VideoModule.java | |
parent | 8f2f71efa7ed4e8f8f7a82bcf10c3b70341f918c (diff) | |
download | android_packages_apps_Snap-2c309499e60120ec513f51bfab02e7d54237af0a.tar.gz android_packages_apps_Snap-2c309499e60120ec513f51bfab02e7d54237af0a.tar.bz2 android_packages_apps_Snap-2c309499e60120ec513f51bfab02e7d54237af0a.zip |
Camera: Add support for 4K camcorder
In case 4k is enabled,
(a) set the preview resoultion same as video resolution.
(b) set the preview format same as video format.
Change-Id: Iebc4c7d47ddca6e03a72f3af7b4660e93c9a1b8e
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index a87786a29..b7145f4b7 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -164,7 +164,8 @@ public class VideoModule implements CameraModule, private LocationManager mLocationManager; private OrientationManager mOrientationManager; - + private static final String KEY_PREVIEW_FORMAT = "preview-format"; + private static final String QC_FORMAT_NV12_VENUS = "nv12-venus"; private int mPendingSwitchCameraId; private final Handler mHandler = new MainHandler(); private VideoUI mUI; @@ -763,13 +764,22 @@ public class VideoModule implements CameraModule, mPreferenceRead = true; } + private boolean is4KEnabled() { + if (mProfile.quality == CamcorderProfile.QUALITY_4kUHD || + mProfile.quality == CamcorderProfile.QUALITY_4kDCI) { + return true; + } else { + return false; + } + } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void getDesiredPreviewSize() { if (mCameraDevice == null) { return; } mParameters = mCameraDevice.getParameters(); - if (mParameters.getSupportedVideoSizes() == null) { + if (mParameters.getSupportedVideoSizes() == null || is4KEnabled()) { mDesiredPreviewWidth = mProfile.videoFrameWidth; mDesiredPreviewHeight = mProfile.videoFrameHeight; } else { // Driver supports separates outputs for preview and video. @@ -1740,7 +1750,11 @@ public class VideoModule implements CameraModule, Log.v(TAG, "preview format set to YV12"); mParameters.setPreviewFormat (ImageFormat.YV12); } - + // if 4K recoding is enabled, set preview format to NV12_VENUS + if (is4KEnabled()) { + Log.v(TAG, "4K enabled, preview format set to NV12_VENUS"); + mParameters.set(KEY_PREVIEW_FORMAT, QC_FORMAT_NV12_VENUS); + } // Set High Frame Rate. String HighFrameRate = mPreferences.getString( CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE, |