summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
Commit message (Collapse)AuthorAgeFilesLines
* Protect against multiple shutter callbacks per frame in longshot mode.Danny Baumann2016-03-281-0/+8
| | | | | | | | | | Some devices send multiple shutter callbacks for one captured frame in longshot mode. As this causes mismatch between the calculated number of captured frames and the calculated number of JPEGs received for those, which in turn leads to longshot mode never being ended properly, protect against that scenario by discarding all but the first callback. Change-Id: I0c3a270f664a0cd16354fb0a13c5941a52001650
* Snap: Do not crash when cur-focus-scale is nullLuK13372016-03-091-2/+10
| | | | | | | * Some cameras simply don't set this parameter. * Also set cur-focus-diopter to 0 if it's null. Change-Id: Ib1049012de9a58279560c14ed77f83f52c07fe30
* Snap: fix camera hang on LGE G4 when flash got usedcodeworkx2016-02-211-3/+10
| | | | Change-Id: I23e53333a0bbe2a12e64e87ec8594aeaa503e9fc
* camera: Keep touch focus intact during back-to-back ZSL shotsSteve Kondik2016-02-201-2/+2
| | | | | | | | * If ZSL is enabled, we should not resetTouchFocus between shots. * Instead, re-kick the timer for each shot. If I set a focus point, I want that point to stick while I take a succession of shots. Change-Id: I407bb1e248cc902355d0294f47b071cc8a32fac3
* SnapdragonCamera: Implementing SelfieFlash featureCamera Software Integration2016-02-171-1/+44
| | | | | | | Introducing SelfieFlash feature. Change-Id: I7b73d9db585038640b715092b01e037538ef68aa CRs-Fixed: 937232
* SnapdragonCamera: Updating preview size againCamera Software Integration2016-02-161-0/+5
| | | | | | | | On layout change, need to call preview size change again as it's not guaranteed it's called first always. Change-Id: I8a687fbf162924f36f2ff7be2a3ba1c6304b27f6 CRs-Fixed: 893423
* SnapdragonCamera: Fix NULL pointer exceptionJay Wang2016-02-111-1/+2
| | | | | | | | | There is a corner case that onShutterButtonClick() is called before camera device is configured. The change will make sure the camera device exists before continuing the operation. Change-Id: I2212572ea5c6073c3f62bdd38e83716b2427c87d CRs-Fixed: 962579
* Snap: Fix crash when set infinite touch-focus durationMichael Bestas2016-02-101-1/+1
| | | | | | | * java.lang.Integer.valueOf(string) method can't parse hexadecimal values Change-Id: I42706db72fc9c1093a7aa16440af449f731e5176
* SnapdragonCamera: Set camera parameters before restarting previewSultanxda2016-02-071-0/+1
| | | | | | | | | Ensure that all of the updated camera parameters are propagated to the camera HAL prior to restarting the preview. This fixes the split-exposure observed when turning ZSL off and on without exiting the app. Change-Id: I392549ae7cc75b150e01cf8b635d2e3f1ad6ffb9 Signed-off-by: Sultanxda <sultanxda@gmail.com>
* SnapdragonCamera: Unlock AE/AWB after taking a photo with ZSLSultanxda2016-02-071-0/+1
| | | | | | | | | The exposure and white balance get stuck after taking photos with ZSL. Always unlock the exposure and white balance after taking photos with ZSL. Change-Id: Ia34a54522048fdd619f44ac1f6d2924ce2c3fc6a
* SnapdragonCamera: Add focus-mode option to camcorderSultanxda2016-02-071-14/+14
| | | | | | | User can now control the focus mode used while recording video. Change-Id: I340c01a3f88314de67ca024279672276eff453ed Signed-off-by: Sultanxda <sultanxda@gmail.com>
* Snap: Restore flash mode settingCamera Software Integration2016-01-241-8/+33
| | | | | | | | | | | After user changes the scene mode back to "AUTO", making sure the flash mode is restored back to the correct value. Previously, the flash mode is forced to "OFF" if the scene mode is changed from others to "AUTO". Change-Id: I648ecc6945abb108c7bafa00c8e3e6d0cdd8f086 CRs-fixed: 927985 Signed-off-by: Zdrowy Gosciu <ZdrowyGosciu+GITHUB@gmail.com>
* Snap: do not restart preview during longshotscodeworkx2016-01-221-8/+9
| | | | Change-Id: I6ad439dc0be7c6e0d13ac7c22aacdc0ad559d051
* Fix up layout of auto HDR notice and histogram view.Danny Baumann2016-01-201-240/+30
| | | | Change-Id: I61f93c68b52d81c5e19919a5b0b894cf51dd35c4
* Remove unused menu indicators code.Danny Baumann2016-01-201-6/+0
| | | | Change-Id: I0ce48da277a532b46fdde15027f636de4d7585b7
* Snap: Don't enable ZSL when disabling HDRGabriele M2016-01-201-1/+2
| | | | | | | Instead, restore the default value. This prevents issues on devices that don't support ZSL. Change-Id: I9c456cd6503df29800e2bc7ccaa691cb3fb42681
* Revert "Camera: Propagate power mode selection from UI to lower layers."Ricardo Cerqueira2016-01-161-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5302d2e099de0ae1c3cb4a9cda993fe28b0e8c46, runtime power-mode changes are causing stability issues in camcorder Change-Id: I118f7c47bea2d07296dc18ed8a3a790eef592ca2 Revert "SnapdragonCamera: Disable LPM if DIS/Flip are enabled." This reverts commit 6cd860119a45b4a44d3e1314981862d9dac47955. Revert "SnapdragonCamera: Set low power mode by default." This reverts commit d4fccc04331a6a5a7038a542f7d17ecefa4ac95a. Revert "SnapdragonCamera: Enable low power mode in Camera." This reverts commit 195fccbe69e92b0312822aa762bb53d301c0f56f. Change-Id: I623626e60efc850fe182e54d9e9997ca41275579 [mikeioannina]: Remove the now obsolete power mode setting and unhide the video snapshot size setting Change-Id: I118f7c47bea2d07296dc18ed8a3a790eef592ca2
* Drop new focus indicator into Camera2.Paul Rohde2016-01-151-19/+2
| | | | | | | * Create a new custom focus view that interacts with physical lens diopter changes. * Replace all occurances of the old focus indicator with the new one. Change-Id: Ia02646ce4d1eb059ecb8a1dfccc15dfc9c167e1b
* SnapdragonCamera: Hide all camera setting when countdown timer startslikaid2016-01-141-0/+1
| | | | | | | | | | | | Camera setting including module switcher scene mode filter mode and front/back camera switcher should not be used during countdown timer, since it may cause unexpected concurrent errors. Hide all the camera settings when countdown timer starts, show them again after countdown. Change-Id: I79c2add63c61d304fe0948e1c9fefe3a8c1a6fee CRs-Fixed: 900086
* SnapdragonCamera: Set color effect as none when turn HDR onlikaid2016-01-141-3/+11
| | | | | | | | | | Some color effects has special tone, if do HDR for specific color effects like Negative, we'll get unreasonable pictures. Disable the color effect when HDR on and set it as none effect. Change-Id: I8dca19b081504abaa85728b6d67b85699a184abb CRs-Fixed: 894360
* SnapdragonCamera: fix crash taking Macro+ from MMSLikai Ding2016-01-141-1/+4
| | | | | | | | For capture intent, preview stops as soon as first jpeg callback arrives, but Macro+ has 7 callbacks. Make preview stop after all jpeg callbacks. Change-Id: Id29cc745aa2030edb60bc15da10d9123fa95bfd0
* SnapdragonCamera: fix NumberFormatException when input value invalidelikaid2016-01-141-6/+33
| | | | | | | | | | NumberFormatException occurred when converted the invalid input values, for example, user only input "." for some float values. Catch the NumberFormatException and show invalid input toast. Change-Id: Ie10b204950d43cca22a06532f04b9569fa545cbb CRs-Fixed: 862960
* Snap: Remove touch AF/AEC optionSteve Kondik2016-01-141-48/+11
| | | | | | | * Drop the use of the touchaf-aec parameter entirely. No camera needs this anymore. Change-Id: I83154a75e5375901dc6c0fc93aef23637cfdf425
* Snap: Support for HTC's HDR modeSteve Kondik2016-01-131-10/+2
| | | | | | | | | | * HDR was never actually working on CM because we did not instruct the camera to take all exposures. The HAL tells us that we'll get one JPEG, but we should snap 3 times. We handle this behavior in the framework now, but we should honor the num-jpegs-per-shutter value in the JPEG callback. Change-Id: I7124bf08985ae23b21ac4e294fb889ac4106946b
* Snap: special handling of hdr-mode parameter for lge devicescodeworkx2016-01-111-17/+39
| | | | Change-Id: Iefee1f15f5649c2f93c59fcbdedcf953e9e0bc54
* Don't do touch-to-focus for touches outside of the preview.Danny Baumann2016-01-111-6/+0
| | | | | | | | | | Issue was twofold: - Preview size was updated from the root view instead of the preview surface view. As the preview rect is already correctly updated from the surface view, remove the redundant size update code. - Touches outside of the preview rect weren't discarded properly. Change-Id: I1c9a4398aa51a828b5362fcd7bcd5a7a7e4691db
* Move mApplicationContext to init()LuK13372016-01-111-2/+1
| | | | | | | | | | | | | | Fixes following NPE: 01-11 17:36:42.607 4329 4391 E AndroidRuntime: FATAL EXCEPTION: Thread-235 01-11 17:36:42.607 4329 4391 E AndroidRuntime: Process: org.cyanogenmod.snap, PID: 4329 01-11 17:36:42.607 4329 4391 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.updateCameraParametersPreference(PhotoModule.java:3492) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.setCameraParameters(PhotoModule.java:3714) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.startPreview(PhotoModule.java:2715) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.-wrap14(PhotoModule.java) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule$OpenCameraThread.run(PhotoModule.java:265) Change-Id: I6ca0dfe402cab46dd7b6f102921062f3c7ec8d43
* Snap: support setting default preview resolution via overlaycodeworkx2016-01-101-43/+13
| | | | Change-Id: I14c17aec6e5d582cc1f884eba40868a58cab1d03
* Snap: Fix NPE if mCameraDevice == nullBjörn Fries2016-01-111-2/+1
| | | | Change-Id: I27ee6f3b6b6bec95661741a0907708e6ebd79752
* Snap: support usage of preview size 2560x1440 via system propcodeworkx2016-01-101-0/+7
| | | | Change-Id: I52b0f7aab55d0a001fc1149fbd82c8188f57be9d
* Snap: initial materializationjrizzoli2016-01-091-9/+7
| | | | | | | Just for initial ship Change-Id: I8d6c0d71d1b94e6eb2f43ab962fb92de0e6c7093 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
* SnapdragonCamera: Restart preview in a corner caseSuman Mukherjee2016-01-081-0/+3
| | | | | | | | | | | Issue: If user sets feature.restart flag as 1, turn off ZSL,HDR 1x and capture an image with HDR, then after capture preview is not getting restarted. Fix: Set the needRestartPreview flag based on above condition. Change-Id: I4e2c9db20d5148de2b6b63288dc0d3eb75ee5a9c
* Read camera state from HAL instead of local state variable.Santhosh Kumar H E2016-01-081-1/+2
| | | | | | | | | | | | | Camera open thread opens the hardware and triggers preview. State of preview is updated over a handler message to UI thred. In between this surface window re-creation happens in UI thread. To set new window to HAL, preview should be in stopped state. Since state updation hasn't completed yet, UI thread reads old state and sets window while HAL is in previewing state. This lead to crash. To avoid the error read the camera state from HAL through framework API rather local state variable. Change-Id: Ieee86edc601f43b85773392a9a44853b4a56cde8
* Update camera state immediately after start preview.Santhosh Kumar H E2016-01-081-2/+21
| | | | | | | | | | | | | | When user delete all the images in gallery to come back to camera, surface view gets created, destroyed and recreated. Since camera state is updated over handler message after start preview, by the time handler thread updates the state background thread would have stopped the preview. So during surface recreation, state variable is read wrong and it doesn't allow start preview. This change makes sure state variable is updated immediately after start preview and only UI updation is moved to main thread through handler message. Change-Id: I289814821d5c3652b06301d1d4a854e9e40670b6
* SnapdragonCamera: fix screen flash on resumingLikai Ding2016-01-081-1/+7
| | | | | | | | | Currently preview cover will be hidden shortly after preview started, but if the actual first frame comes late, the main screen will flash. Register a oneshot preview callback to hide preview cover. CRs-Fixed: 881290 Change-Id: I5d93e57f0b9aa338c6b34461d5e3ee31806b6706
* Snap: fix typo in PhotoModulecodeworkx2016-01-091-1/+0
| | | | Change-Id: Ied37999553d04dcc970da23ccce4dd7c9abf3b48
* Snap: 100 chars!codeworkx2016-01-081-1/+2
| | | | Change-Id: Ia48f48fcd8b8546ca68969198a60f568bae805d6
* Snap: restart preview when shutter-speed gets disabledcodeworkx2016-01-081-1/+13
| | | | Change-Id: I3884b23f1c855cfffeb20ca6e2a760732370d772
* SnapdragonCamera: Query camcorder profiles before usageSai Kumar Sanagavarapu2016-01-071-1/+2
| | | | | | | | 1. Use generic camcorder profile query mechanism instead of hardcoding profile enums in app. 2. Fix NPE during startpreview if mFocusManager is null. Change-Id: I7bfc00f68f512c3029ca8ba75863583f1b376094
* SnapdragonCamera: Correct AutoHDR callback data size checkEmilian Peev2016-01-071-1/+1
| | | | | | | | | | | | | | | | | | Currently the AutoHDR functionality which handles metadata callbacks always assumes that the length of the callback data buffer will be equal to 12 bytes. It will always try to read and convert 3 32-bit integers. The check before this processing is incorrect as it allows buffers which are less than 12 bytes to be processed as well. This can lead to array out of bounds exceptions, which are also possible during FD snapshot metadata callbacks that don't contain any faces. In this particular scenario the metadata callback buffer size will be 8 bytes. Change-Id: I4094aaa56aa4135d2d806861353d49c8d7f9985c CRs-Fixed: 799110
* Camera: Avoid 'takePicture()' in preview ready stateEmilian Peev2016-01-071-1/+4
| | | | | | | | | | | | | Depending on timing 'takePicture()' could be triggered while the preview surface holder is still not available. The camera preview in such scenario can be started but will not run without a valid surface holder. Triggering snapshot in this case is not allowed and can lead to runtime exception. CRs-Fixed: 769441 Change-Id: I6c4f013e9ca8b5903abbfe69394dc0871669d7c2
* Snapdragon Camera: Unlock AE&AWB before snapshotEmilian Peev2016-01-071-6/+7
| | | | | | | | | | | | | | Currently the application contains logic which will lock AE&AWB before snapshot if AF didn't get triggered. Unlocking happens during image capture though and will get ignored because the camera state is already set to 'SNAPSHOT_IN_PROGRESS". This sequence of events can have side effects w.r.t. flash. To avoid this AE&AWB should always be unlocked before snapshot. Change-Id: Ie72bb7f5721419e448b2d1976f5873327dd3ada4
* Snapdragon Camera: Unlock AE&AWB during longshotEmilian Peev2016-01-071-0/+7
| | | | | | | | | Both AWB&AE are currently locked during longshot. This can have side effects for cases which utilize torch flash. CRs-Fixed: 770028 Change-Id: Ie6b547d2863c8fb1ff0b9124082a6fb6144cbac9
* Snapdragon Camera: Avoid null pointer exception during shutter focusEmilian Peev2016-01-071-2/+4
| | | | | | | | | An additional check needs to be added for the focus manager initialization during handling of the shutter button focus event. Change-Id: Icc12bd47b52af36e2ec5c1415d1147ba925a585b CRs-Fixed: 766843
* Snapdragon Camera: Override flash mode to off during non-auto sceneEmilian Peev2016-01-071-5/+4
| | | | | | | | | | | Currently the flash mode on application side will be set to 'auto' during scenes different from 'auto'. Due to the manual white balance modes used in these scenes it makes more sense to actually have flash mode set to off. Change-Id: Ief40a76de2f6481eb27b0e47e28ac8b4573429df CRs-Fixed: 765000
* Snap: add support for mw_continuous-picture focus modecodeworkx2016-01-071-12/+26
| | | | Change-Id: If165370b52d7454c69e2cdeb9d837d049010b0e8
* Snap: add support for shutter speedcodeworkx2016-01-061-0/+9
| | | | Change-Id: Id3393280c7c1c2f292d71587ba099e8dbafd1340
* add options to restart preview onPictureTakencodeworkx2016-01-051-0/+17
| | | | Change-Id: I7ce9d6f2323e367743e6d4c9662b846d3052f2a4
* add support for luminance-condition parametercodeworkx2016-01-051-0/+12
| | | | Change-Id: Idf845a5f55abf9b72f61ac4bac59ee2258043482
* add support for non-standard iso keys and valuescodeworkx2016-01-051-7/+7
| | | | Change-Id: I3a948495cdf84dae3c1734d50ff91b4a5d3d9fc0