summaryrefslogtreecommitdiffstats
path: root/camera
Commit message (Collapse)AuthorAgeFilesLines
* CameraHal: Fix preview not starting after surface is abdandonedTyler Luu2011-12-052-6/+13
| | | | | | | | | | | | | | | | If an application gets backgrounded (HOME key) without stopping preview and releasing camera, preview would previously not restart when application is resumed. ANativeWindowDisplayAdapter would detect that the preview surface was abandoned and stop sending buffers to CameraAdapter. We were previously not doing anything when CameraService called setPreviewWindow when a display adapter was already created. To fix this issue, we need to send the preview window and restart preview. Change-Id: I36089b0046f9861897d32c50b52128a41e2de2a5 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Prevent deadlock in AppCallbackNotifier::stop()Tyler Luu2011-12-022-25/+51
| | | | | | | | | | | | | | | | | | There is a small chance that a stopPreview call can come from CameraService right around the same time Encoder thread will send a data callback for the video snapshot. Currently, we are waiting for the encoder thread to join in AppCallbackNofier:: stop(), so we could deadlock if CameraService locks in lockIfMessageWanted for the video snapshot. Instead of waiting for Encoder thread to join, we can make cancel() block until Encoder thread is done canceling the encode. After cancel() returns, we can free up the cookies that we passed to it, so Encoder thread does not need to call the callback function to AppCallbackNotifier. Change-Id: Ib453d49d91077925b143c812d43a7d1b782c181c Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Exit Appcallback thread immediately.Akwasi Boateng2011-12-011-1/+2
| | | | | | | | | Allow appcallback thread to exit immediately when exit command is processed. Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: I83db309cf973e1ce9494c855430897a0c41704d8
* CameraHAL: Fixes a couple of corner cases with AF and captureAkwasi Boateng2011-12-012-11/+15
| | | | | | | | | | | | | | | | - On some occasions during monkey tests, both the AF callback and the shutter callback can be delayed just enough to encounter the OMX component in loaded state. Usually this happens when the camera is getting closed and this scenario should be properly handled by exiting immediately without trying to trigger any callbacks to the client. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ia18faf471a8e10579b09973178d73e69e782c63c Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Handling OMX initializationAkwasi Boateng2011-12-012-39/+40
| | | | | | | | | | | | | Additional mOmxInitialized flag has been added to track whether OMX has been succesfully initialized to prevent duplicate OMX_DeInit() in OMXCameraAdapter destructor. Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: I269c5ac9d5de3f3e9088a11a3bea7127c1bd79de
* CameraHAL: Avoids a possible deadlock in AppCallbackNotifierAkwasi Boateng2011-12-011-1/+1
| | | | | | | | | | | | | | | | | | | - 'disableMsgType()' was querying CameraHal for enabled message types through 'msgTypeEnabled()'. This method will lock 'mLock' in CameraHal. On the other hand 'takePicture()' inside CameraHal will also lock 'mLock' before execution. If preview callbacks are enabled before image capture, then 'takePicture()' will call AppCallbackNotifier's 'disableMsgType()', which will try to lock 'mLock' again. Solution, a query to CameraHal for enabled message types is not needed inside 'disableMsgType()' because the passed argument 'msgType' already contains all the needed information. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ia4b7634ce21b8243f08d9124823c77e6bde84a8d
* CameraHAL: Small fix in FD error handlingAkwasi Boateng2011-12-011-1/+1
| | | | | | | | | | | | | - 'detectFaces()' should return immediately if there is a mismatch in the 'platformPrivate' size. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib4237acdec7fa08dd4b06529e358003783dccf0a
* CameraHAL: Fixes a small crop issueAkwasi Boateng2011-12-011-4/+4
| | | | | | | | | | | | | | | | - The offset variables 'mXOff' and 'mYOff' in ANativeDisplayAdapter are always initialized to zero. If the offset of the incoming preview buffer is zero and the viewable preview resolution is smaller than the actual preview buffer resolution, then the crop will not get configured properly. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib321f17566d253dd65dc4c6d20bf748a9a4c614b
* CameraHAL: Removes a possible resource leak inside MemoryManagerAkwasi Boateng2011-12-012-8/+14
| | | | | | | | | | | | | - 'mIonFd' doesn't get properly closed in each error case involving buffer allocation Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Jean Johnson <a0271255@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib893e832712e3ea4a3711153453f7a2aa873d0ee
* CameraHAL: Fixed line endings and file attributesAkwasi Boateng2011-12-017-1149/+1149
| | | | | | | | | | | | Replaced line endings to UNIX in CameraHAL-related sources. No code changes. Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Jean Johnson <a0271255@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Id32c429fe7527342cfa2a7b9b1724e5f088dbd3f
* am 67496a60: am 3ffd5d43: Merge changes I0878a9f8,I1011252e into ics-mr1Iliyan Malchev2011-11-307-9/+37
|\ | | | | | | | | | | * commit '67496a60c60076166f6856431f68024a9412c067': CameraHAL: Perform focus even if CAF has failed CameraHAL: Enable LDCNSF for Video snapshot
| * CameraHAL: Perform focus even if CAF has failedMilen Mitkov2011-11-301-1/+10
| | | | | | | | | | | | | | | | | | | | Fixes b/5534973 Used to force focus if CAF has failed (before capture). CAF's state is 'failed' even if a scene change is detected only. Change-Id: I0878a9f862b7800b566e578efdfa62baec7e5889 Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
| * CameraHAL: Enable LDCNSF for Video snapshotMilen Mitkov2011-11-306-8/+27
| | | | | | | | | | | | | | | | | | Enables LDCNSF for Video snapshot, also adds start_offset and right_crop fields to the JPEG encoder wrapper, because the image with LDCNSF has artifacts on top and right. Change-Id: I1011252e3f8068083f9d057b7763b7f79c59a75d Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
* | CameraHal: Add more Exif data for video snapshotTyler Luu2011-11-227-37/+220
| | | | | | | | | | | | | | | | | | | | | | | | Fixes b/5582076. Requires changes to Ducati and external/jhead. 1. Add API to get and set ancillary data metadata so we can use the values to fill in Exif data. 2. Add support for additional tags. Change-Id: I537e683839c59e92a4a20ff62653b6d46e303f53 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am 089c480c: am d31eec66: am 0bb54549: Ignore camera.flash_off system ↵James Dong2011-11-181-2/+8
|\ \ | |/ | | | | | | | | | | property for user build * commit '089c480c4e657653673854f0e3d92faa0fec75a5': Ignore camera.flash_off system property for user build
| * am 0bb54549: Ignore camera.flash_off system property for user buildJames Dong2011-11-181-2/+8
| |\ | | | | | | | | | | | | * commit '0bb5454945320db77ff426baf9c0c34631c373ab': Ignore camera.flash_off system property for user build
| | * Ignore camera.flash_off system property for user buildJames Dong2011-11-171-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | This system property is meant for testing only and should be ignored for user build. Change-Id: I553b68d62f41012766d7d208451a178a733d151e related-to-bug: 5617451
* | | am 8d18af6d: am e4639448: CameraHAL: clean up logsIliyan Malchev2011-11-176-14/+16
|\ \ \ | |/ / | | | | | | | | | * commit '8d18af6dfd68f047c2bcf82fe88eeeb623eafa0c': CameraHAL: clean up logs
| * | CameraHAL: clean up logsIliyan Malchev2011-11-176-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- introduce CAMHAL_LOGI so that we don't have to dump informational messages as LOGE -- convert some verbose messages to CAMHAL_LOGDB -- convert most frequent non-error log messages to CAMHAL_LOGI Change-Id: I8afc24aa17da2c157b7b37300a79b4cde81f87e5 Signed-off-by: Iliyan Malchev <malchev@google.com>
* | | am 205f5527: am 78dac813: CameraHAL: Do not return error if AF failsIliyan Malchev2011-11-172-15/+24
|\ \ \ | |/ / | | | | | | | | | * commit '205f5527e88ea9b108e3d84050a43e310632b0e3': CameraHAL: Do not return error if AF fails
| * | CameraHAL: Do not return error if AF failsIliyan Malchev2011-11-172-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes b/5612881 Some third-party apps do not handle errors thrown by the camera HAL when they try to invoke autoFocus while AF is in progress. The Barcode Scanner, in particular, will quit in this case without releasing the Camera handle, wreaking all sorts of power-management havoc. Even though CTS does not mandate it, previous versions of Android and other camera HAL implementations simply return success in this case. This patch makes this HAL conform to this behavior. Change-Id: I758e2de7f84b61043267f052169068b64d75d0d1 Signed-off-by: Sundar Raman <sunds@ti.com>
* | | am b5375cf2: am 05ea07df: CameraHal: Use Different Timeout for Video ModeTyler Luu2011-11-171-3/+7
|\ \ \ | |/ / | | | | | | | | | * commit 'b5375cf2e7f917556b377be4ec0974f7c62dbe0d': CameraHal: Use Different Timeout for Video Mode
| * | CameraHal: Use Different Timeout for Video ModeTyler Luu2011-11-161-3/+7
| |/ | | | | | | | | | | | | | | | | | | Select AF timeout based on whether or not we are in video mode. b/5492725 Change-Id: I2fa722e6a3a7c149488ddb29ce44262914d19e38 Signed-off-by: Tyler Luu <tluu@ti.com>
* | am 499aad98: am 53613f8e: am 6014a8f2: When camera.flash_off is 1, disable ↵James Dong2011-11-161-1/+24
|\ \ | |/ | | | | | | | | | | camera flash. This is for testing purpose only * commit '499aad98956ba1ab16c6bc6540cd19ee1bad189e': When camera.flash_off is 1, disable camera flash. This is for testing purpose only
| * When camera.flash_off is 1, disable camera flash.James Dong2011-11-151-1/+24
| | | | | | | | | | | | | | This is for testing purpose only Change-Id: Idf0a6d5d52daeb4b5ff7576d0119868bdeff40eb related-to-bug: 5617451
* | am bf97da4d: am a3be7d18: am cb1183d6: videosnapshot memory corruption fixes.Akwasi Boateng2011-11-112-2/+8
|\ \ | |/ | | | | | | * commit 'bf97da4dfacdb7d8a5555d6aef166d782f6d0e05': videosnapshot memory corruption fixes.
| * videosnapshot memory corruption fixes.Akwasi Boateng2011-11-112-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | 1. Fixes memory corruption of dst buffer in nv21_to_yuv() convertion 2. Free malloced row_tmp buffer 3. Free params string in Appcallback Change-Id: I2179f1158f6e72cca0f7e5c815b1cb576bfa925e Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> related-to-bug: 5601247
| * Revert "CameraHAL: Fix preview not starting after surface is abdandoned"James Dong2011-11-101-5/+4
| | | | | | | | | | | | | | This reverts commit cbaa66464ff86bddf40e3c8de8db44473ff27de9. we need to revert this change since this leads to a stop ship problem where we can only take a single picture.
* | am c24cc17f: am eb1fc89d: Revert "CameraHAL: Fix preview not starting after ↵James Dong2011-11-111-5/+4
|\ \ | | | | | | | | | | | | | | | | | | surface is abdandoned" * commit 'c24cc17f3b7483bd0ff31546eae223943bdaf595': Revert "CameraHAL: Fix preview not starting after surface is abdandoned"
| * | Revert "CameraHAL: Fix preview not starting after surface is abdandoned"James Dong2011-11-111-5/+4
| |/ | | | | | | | | | | | | This reverts commit cbaa66464ff86bddf40e3c8de8db44473ff27de9. we need to revert this change since this leads to a stop ship problem where we can only take a single picture.
* | am 8a2c7a2d: am 8eedae16: am 50f5c8a3: CameraHal: WA for green thumbnail for ↵Tyler Luu2011-11-101-1/+5
|\ \ | |/ | | | | | | | | | | video snapshot * commit '8a2c7a2d44408aea33beef1775c7b925211d1aae': CameraHal: WA for green thumbnail for video snapshot
| * CameraHal: WA for green thumbnail for video snapshotTyler Luu2011-11-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | WA for regression introduced with: 'cf0a61f135: CameraHAL: Use Ancillary data to check for snapshot" Video snapshot postview frames are not currently being tagged with the ancillary data. Let this check pass through when in video mode. Change-Id: I9b3aacb902d15f1cd7f993f6664976299fcb0427 Signed-off-by: Tyler Luu <tluu@ti.com>
* | am 334dd8a9: am c5831812: am cbaa6646: CameraHAL: Fix preview not starting ↵Tyler Luu2011-11-101-4/+5
|\ \ | |/ | | | | | | | | | | after surface is abdandoned * commit '334dd8a961fcfe53c083b2b8a0e7041065704a7d': CameraHAL: Fix preview not starting after surface is abdandoned
| * CameraHAL: Fix preview not starting after surface is abdandonedTyler Luu2011-11-101-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 3/3 for b/5593964. (I'm bundling this fix with b/5573610 because it is preview-related, though strictly speaking not part of b/b/5573610. It has been with us since the beginning.) If an application gets backgrounded (HOME key) without stopping preview and releasing camera, preview would previously not restart when application is resumed. ANativeWindowDisplayAdapter would detect that the preview surface was abandoned and stop sending buffers to CameraAdapter. We were previously not doing anything when CameraService called setPreviewWindow when a display adapter was already created. To fix this issue, we need to send the preview window and restart preview. Change-Id: I36089b0046f9861897d32c50b52128a41e2de2a5 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am fef08387: am 7e51020e: am f9df3ee5: CameraHAL: Clear events queue fix, ↵Sundar Raman2011-11-103-6/+30
|\ \ | |/ | | | | | | | | | | clear command queue on exit * commit 'fef083876a27ebab9451c0151ce6fbaae0f66ccf': CameraHAL: Clear events queue fix, clear command queue on exit
| * CameraHAL: Clear events queue fix, clear command queue on exitSundar Raman2011-11-103-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 2/3 for b/5593964. 1. The events queue wasn't being cleared correctly inside OMXCameraAdapter as some items were being removed while the index was being formulated based on the original size 2. The command queue should be cleared before posting the EXIT message for the OMX adapter threads so as not to process those messages since we are exiting Change-Id: I0a5eaceb3d1504fee05b064ebb5fe888e129ad44 Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am d3278ddd: am 977fc7e4: am 3ec18006: CameraHAL: Fixes for ANR and a ↵Sundar Raman2011-11-105-37/+42
|\ \ | |/ | | | | | | | | | | setParameter issue * commit 'd3278ddd57085e8d7f261defbdfaed4d5bbea167': CameraHAL: Fixes for ANR and a setParameter issue
| * CameraHAL: Fixes for ANR and a setParameter issueSundar Raman2011-11-105-37/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 1/3 for b/5593964. 1. Ensure we don't race with stopImageCapture when stopPreview is called 2. Signal the shutter callback correctly 3. Do not crash the media server if focus APIs and image capture returns error Still go ahead and perform de-init 4. Replace setParameter from CameraHAl to AppCallbackNotifier with getParameter when needed. Change-Id: I2b2745827d227a8d7927ce1611a84c29129e8891 Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am c087cd70: am 69077c25: am 2136042f: CameraHAL: Setting focus mode ↵Milen Mitkov2011-11-102-6/+38
|\ \ | |/ | | | | | | | | | | shouldnt start focus scanning * commit 'c087cd70cfa6dcbcdbafaa5f85a48a585263068c': CameraHAL: Setting focus mode shouldnt start focus scanning
| * CameraHAL: Setting focus mode shouldnt start focus scanningMilen Mitkov2011-11-092-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the fix for b/5591797. Use the new index OMX_TI_IndexAutofocusEnable to control the AF algorithm when it should start scanning. Until now, setting the focus to almost any mode caused (unwanted) scanning. Also, "Infinity" focus should actually have the ability to perform scanning. Change-Id: Iaa0f46a17d63acdd8f43b4b2b011f68fc7506165 Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am a7c06115: am efa626c4: am 956c27e3: CameraHal: Apply3aSettings at start ↵Vladislav Hristov2011-11-101-0/+1
|\ \ | |/ | | | | | | | | | | preview * commit 'a7c06115a023e4160d2ef922fc0930098642293c': CameraHal: Apply3aSettings at start preview
| * CameraHal: Apply3aSettings at start previewVladislav Hristov2011-11-091-0/+1
| | | | | | | | | | | | | | | | Fixes b/5515136. Change-Id: I3b462b337f42be7ebe07642f5298f45bb1431daa Signed-off-by: Vladislav Hristov <vhristov@mm-sol.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am 3c86a542: am fe3c9139: CameraHal: Wait for frame before stopping previewTyler Luu2011-11-071-0/+14
|\ \ | |/ | | | | | | * commit '3c86a5424fa4a0099d66172ff8b0a00eda9fd528': CameraHal: Wait for frame before stopping preview
| * CameraHal: Wait for frame before stopping previewTyler Luu2011-11-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | Fix 3/3 for b/5472396. We should wait for the first frame to come before trying to stopPreview. If not, we might put OMXCamera in a bad state i.e (IDLE->LOADED timeout). Seeing this a lot after a capture Change-Id: I4ac6cc4f12bdc0d4d73e065b7c53caf8a440a43c Signed-off-by: Tyler Luu <tluu@ti.com>
* | am 2a7d690c: am fc8ab094: CameraHal: Clean-up if mCaptureSem times outTyler Luu2011-11-071-11/+1
|\ \ | |/ | | | | | | * commit '2a7d690c1acd0f61fbd95a532c9703a4cd0af83a': CameraHal: Clean-up if mCaptureSem times out
| * CameraHal: Clean-up if mCaptureSem times outTyler Luu2011-11-071-11/+1
| | | | | | | | | | | | | | | | | | | | Fix 2/3 for b/5472396. In stopImageCapture, continue cleaning up even if mCaptureSem times out. Change-Id: Idf65a488b2ce55a9d451a899df0bc76f6480647b Signed-off-by: Tyler Luu <tluu@ti.com>
* | am 5184e1e1: am a58c483d: CameraHal: Add function to rollback state machineTyler Luu2011-11-074-22/+91
|\ \ | |/ | | | | | | * commit '5184e1e128919716e8090d02a7abffa97cb74af0': CameraHal: Add function to rollback state machine
| * CameraHal: Add function to rollback state machineTyler Luu2011-11-074-22/+91
| | | | | | | | | | | | | | | | | | | | | | | | Fix 1/3 for b/5472396. Adding a function to rollback the state machine to INTITIALIZED_STATE from any given current state. With this function, we can better manage the different states that CameraAdapter could be in when stopPreview is called. Change-Id: I0a456738e8575873b5ac6fb2a31395dab54ef6f7 Signed-off-by: Tyler Luu <tluu@ti.com>
* | am dfffc837: am d9949c1e: CameraHal: Add 2592x1728 and 2592x1458 image ↵Gilles-Arnaud Bleu-Laine2011-11-051-0/+2
|\ \ | |/ | | | | | | | | | | capture resolutions * commit 'dfffc83746802d0c582772976103403ec5c58059': CameraHal: Add 2592x1728 and 2592x1458 image capture resolutions
| * CameraHal: Add 2592x1728 and 2592x1458 image capture resolutionsGilles-Arnaud Bleu-Laine2011-11-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the fix for b/5546023 Adding new resolution to support 16:9 and 3:2 aspect ratio. Note: This allows to keep same aspect ratio between video preview and video snapshot. This change requires a matching Ducati update. For the power savings to take effect, the new resolution must actually be used by the application. Change-Id: I87d5f3155856b0c2c83763349843628eeadfacfc Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>