diff options
author | Weijie Wang <weijiew@codeaurora.org> | 2017-08-17 16:49:51 +0800 |
---|---|---|
committer | Weijie Wang <weijiew@codeaurora.org> | 2017-09-07 16:38:45 +0800 |
commit | 18a8ecb60012335259135a45cbe05d8bf0f93190 (patch) | |
tree | d87760e26c17c49f6f2c65a6a46b363177d2c799 /src/com/android/camera/util/VendorTagUtil.java | |
parent | b59cf61c82d6c4af43a9f76a101b29f2a8b5ac17 (diff) | |
download | android_packages_apps_Snap-18a8ecb60012335259135a45cbe05d8bf0f93190.tar.gz android_packages_apps_Snap-18a8ecb60012335259135a45cbe05d8bf0f93190.tar.bz2 android_packages_apps_Snap-18a8ecb60012335259135a45cbe05d8bf0f93190.zip |
SnapdragonCamera: Support HLG and HDR10
Support HLG and HDR10
Change-Id: I1dd8a40a85e9cc0115515217b4ec75a726b6f41e
Diffstat (limited to 'src/com/android/camera/util/VendorTagUtil.java')
-rw-r--r-- | src/com/android/camera/util/VendorTagUtil.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/com/android/camera/util/VendorTagUtil.java b/src/com/android/camera/util/VendorTagUtil.java index 9c2f6cc1c..fb8aee010 100644 --- a/src/com/android/camera/util/VendorTagUtil.java +++ b/src/com/android/camera/util/VendorTagUtil.java @@ -28,6 +28,8 @@ */ package com.android.camera.util; +import android.hardware.camera2.CameraAccessException; +import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CaptureRequest; import android.util.Log; @@ -52,7 +54,8 @@ public class VendorTagUtil { private static CaptureRequest.Key<Long> ISO_EXP = new CaptureRequest.Key<>("org.codeaurora.qcamera3.iso_exp_priority.use_iso_exp_priority", Long.class); - + private static final CaptureRequest.Key<Byte> HDRVideoMode = + new CaptureRequest.Key<>("org.quic.camera2.streamconfigs.HDRVideoMode", Byte.class); private static boolean isSupported(CaptureRequest.Builder builder, CaptureRequest.Key<?> key) { @@ -62,6 +65,7 @@ public class VendorTagUtil { }catch(IllegalArgumentException exception){ supported = false; Log.d(TAG, "vendor tag " + key.getName() + " is not supported"); + exception.printStackTrace(); } if ( supported ) { Log.d(TAG, "vendor tag " + key.getName() + " is supported"); @@ -131,4 +135,23 @@ public class VendorTagUtil { return isSupported(builder, ISO_EXP); } + public static void setHDRVideoMode(CaptureRequest.Builder builder, byte mode) { + if ( isHDRVideoModeSupported(builder) ) { + builder.set(HDRVideoMode, mode); + } + } + + public static boolean isHDRVideoModeSupported(CaptureRequest.Builder builder) { + return isSupported(builder, HDRVideoMode); + } + + public static boolean isHDRVideoModeSupported(CameraDevice camera) { + try { + CaptureRequest.Builder builder = camera.createCaptureRequest(CameraDevice.TEMPLATE_RECORD); + return isHDRVideoModeSupported(builder); + }catch(CameraAccessException exception) { + exception.printStackTrace(); + return false; + } + } } |