diff options
author | Sasha Levitskiy <sanek@google.com> | 2014-04-21 17:20:17 -0700 |
---|---|---|
committer | Sasha Levitskiy <sanek@google.com> | 2014-04-23 11:54:24 -0700 |
commit | a82f456c387cb6ff6c5aab7c930a7a61c36ed8ba (patch) | |
tree | b7a2eeac4ed159ee5f6129d9cbeabc69a1c72148 /modules/camera/ExampleCamera.cpp | |
parent | 449ebdd70fa8df58b03a9bd38deed2e53cb512a0 (diff) | |
download | hardware_libhardware-a82f456c387cb6ff6c5aab7c930a7a61c36ed8ba.zip hardware_libhardware-a82f456c387cb6ff6c5aab7c930a7a61c36ed8ba.tar.gz hardware_libhardware-a82f456c387cb6ff6c5aab7c930a7a61c36ed8ba.tar.bz2 |
Camera: HAL: 64-bit warning fixit.
Change-Id: Iecc3e1846fbf63c51952d115e1f167cf32135b18
Signed-off-by: Sasha Levitskiy <sanek@google.com>
Diffstat (limited to 'modules/camera/ExampleCamera.cpp')
-rw-r--r-- | modules/camera/ExampleCamera.cpp | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/modules/camera/ExampleCamera.cpp b/modules/camera/ExampleCamera.cpp index a275190..ca28b99 100644 --- a/modules/camera/ExampleCamera.cpp +++ b/modules/camera/ExampleCamera.cpp @@ -184,25 +184,37 @@ int ExampleCamera::initDevice() // Create standard settings templates from copies of base metadata // TODO: use vendor tags in base metadata - if (res = base.add1UInt8(ANDROID_CONTROL_MODE, ANDROID_CONTROL_MODE_OFF)) + res = base.add1UInt8(ANDROID_CONTROL_MODE, ANDROID_CONTROL_MODE_OFF); + if (res) return res; // Use base settings to create all other templates and set them - if (res = setPreviewTemplate(base)) return res; - if (res = setStillTemplate(base)) return res; - if (res = setRecordTemplate(base)) return res; - if (res = setSnapshotTemplate(base)) return res; - if (res = setZslTemplate(base)) return res; + res = setPreviewTemplate(base); + if (res) + return res; + res = setStillTemplate(base); + if (res) + return res; + res = setRecordTemplate(base); + if (res) + return res; + res = setSnapshotTemplate(base); + if (res) + return res; + res = setZslTemplate(base); + if (res) + return res; return 0; } int ExampleCamera::setPreviewTemplate(Metadata m) { - int res; // Setup default preview controls - if (res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW)) + int res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW); + + if (res) return res; // TODO: set fast auto-focus, auto-whitebalance, auto-exposure, auto flash return setTemplate(CAMERA3_TEMPLATE_PREVIEW, m.get()); @@ -210,10 +222,10 @@ int ExampleCamera::setPreviewTemplate(Metadata m) int ExampleCamera::setStillTemplate(Metadata m) { - int res; + int res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE); // Setup default still capture controls - if (res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE)) + if (res) return res; // TODO: set fast auto-focus, auto-whitebalance, auto-exposure, auto flash return setTemplate(CAMERA3_TEMPLATE_STILL_CAPTURE, m.get()); @@ -221,10 +233,10 @@ int ExampleCamera::setStillTemplate(Metadata m) int ExampleCamera::setRecordTemplate(Metadata m) { - int res; + int res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD); // Setup default video record controls - if (res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD)) + if (res) return res; // TODO: set slow auto-focus, auto-whitebalance, auto-exposure, flash off return setTemplate(CAMERA3_TEMPLATE_VIDEO_RECORD, m.get()); @@ -232,21 +244,21 @@ int ExampleCamera::setRecordTemplate(Metadata m) int ExampleCamera::setSnapshotTemplate(Metadata m) { - int res; + int res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT); // Setup default video snapshot controls - if (res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT)) + if (res) return res; - // TODO: set slow auto-focus, auto-whitebalance, auto-exposure, flash off + // TODO: set slow auto-focus, auto-whitebalance, auto-exposure, flash off return setTemplate(CAMERA3_TEMPLATE_VIDEO_SNAPSHOT, m.get()); } int ExampleCamera::setZslTemplate(Metadata m) { - int res; + int res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG); // Setup default zero shutter lag controls - if (res = m.add1UInt8(ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG)) + if (res) return res; // TODO: set reprocessing parameters for zsl input queue return setTemplate(CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG, m.get()); |