summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* am 4f53fe74: Merge "CameraService: deadlock fix"Eino-Ville Talvala2014-03-251-0/+1
|\ | | | | | | | | * commit '4f53fe74051026e6635ba5bdbed4f1898cb66028': CameraService: deadlock fix
| * CameraService: deadlock fixKalle Lampila2014-03-251-0/+1
| | | | | | | | | | | | | | Release lock before return from CameraService::dump() Change-Id: Ia20b0921fc675a284f3b7f8d26e0e3596b5a8774 Signed-off-by: Kalle Lampila <kallex.lampila@intel.com>
* | resolved conflicts for merge of 3d7c5002 to klp-dev-plus-aospColin Cross2014-03-211-1/+1
|\ \ | |/ | | | | Change-Id: I19e1a26bd0226119c4fe2920bf6a09aaeff315d9
| * libcameraservice: fix 64-bit print format warningsColin Cross2014-03-211-1/+1
| | | | | | | | | | | | | | Use PRId64 from inttypes.h to print nsecs_t (int64_t) Use %zu to print size_t Change-Id: I135620e0388db33587a8a7da393b48a45cb7275a
* | am bd3e2e03: camera2: Fix segfault when using null availability listenerIgor Murashkin2014-03-171-0/+10
|\ \ | |/ |/| | | | | * commit 'bd3e2e03f3ab686c52982a9e50cae853128172cf': camera2: Fix segfault when using null availability listener
| * camera2: Fix segfault when using null availability listenerIgor Murashkin2014-03-171-0/+10
| | | | | | | | | | | | | | | | ICameraService::addListener / removeListener will now return BAD_VALUE if a null listener is used. Bug: 12891434 Change-Id: I9764110094d8fd42e22fcc8df3ef0e73c1b070e7
* | Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-2/+2
|/ | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* camera: Collect stack traces when bad things happen, print with dumpsysIgor Murashkin2013-10-291-0/+5
| | | | | Bug: 11324229 Change-Id: Ic920e170a8f5a389fc139bbf5416c0e3186c7fb6
* Camera: only return static metadata for HAL3 deviceZhijun He2013-10-011-0/+6
| | | | | | | This effectively disables the camera2 APIs for HAL2.x or lower HAL device. Bug: 10360518 Change-Id: I0f374ac533468c6181f5672c75088b7144b9c53d
* Camera: Implement getCameraCharacteristicsZhijun He2013-09-251-0/+37
| | | | | | Bug: 10904541 Bug: 10360518 Change-Id: Ie9ca6b3b0b5f2fe529e6b0decc193096e770a017
* Fix CameraService error flag when running HAL1 with API2.Ruben Brunk2013-09-041-2/+2
| | | | | | Bug: 10620944 Change-Id: I44c0d09a3d313ae8f724fbe61fa5f36cf5b38b6d
* Refactor CameraService to handle errors properly.Ruben Brunk2013-08-161-56/+65
| | | | | | | | Bug: 10361136 -Connect calls now return status_t error flags. Change-Id: Idca453b111e5df31327f6c99ebe853bb2e332b95
* Camera: Rename new API to camera2, rearrange camera serviceEino-Ville Talvala2013-07-301-4/+4
| | | | | | | | | | | - Support API rename from photography to camera2 - Reorganize camera service files - API support files to api1/, api2/, api_pro/ - HAL device support files into device{1,2,3}/ - Common files into common/ - Camera service remains at top-level Change-Id: Ie474c12536f543832fba0a2dc936ac4fd39fe6a9
* Camera: ProCamera connect need support HAL3 deviceZhijun He2013-07-221-0/+1
| | | | Change-Id: Iae7e5f9e6387f61f1c4bbb91f75803fc1fdf2668
* Make android.hardware.photography.Camera work on HAL3+ devicesIgor Murashkin2013-06-201-0/+3
| | | | | Bug: 9213377 Change-Id: I5b2eeab28985f53dfcb7b8e3029930f5adcd74f5
* Initial implementation of android.hardware.photography.CameraDevice (service)Igor Murashkin2013-06-201-19/+106
| | | | | | | | | | | * Verified preview streaming requests * Other things *should* work but unverified / unimplemented in client side Missing: * CameraService needs to return static camera info metadata Bug: 9213377 Change-Id: I71568560fcf18d0e2b408ed1c4d0066647314868
* Camera: Hotplug - conditionally transition to PRESENT when clients disconnectIgor Murashkin2013-05-021-7/+30
| | | | | | | | | Fixes an issue where a client could unconditionally transition to PRESENT after a client disconnects, even though the underlying HAL status was actually NOT_PRESENT or ENUMERATING. Bug: 8780114 Change-Id: I68adb5fc819eec3b046ddcb2507b84bedc999a0f
* Camera2: Fix deadlock on shutdown due to client getting killed.Eino-Ville Talvala2013-04-261-0/+4
| | | | | | | | | | | | | | When the binder connection dies and is the only holder of a strong pointer to the Camera2Client, disconnect is called from the destructor. At this point, all weak pointers to Camera2Client are no longer promotable, and lots of cleanup code paths are broken as a result. Rework all such code paths to not need the client pointer, and to discard image buffers that arrive during shutdown. Bug: 8696047 Change-Id: Ic0672ecde7c1baaf65079f925a45bd5be45f1fb3
* Camera: Add hotplug support (for fixed # of cameras)Igor Murashkin2013-03-261-3/+131
| | | | | | | * Minor: also change addListener to fire the current status upon subscription * Minor: STATUS_AVAILABLE is now an alias for STATUS_PRESENT and deprecated Change-Id: I254608a7332095e3ef201ffea64cff156cfc1b3e
* ProCamera: Fix rare deadlock when client destructs inside the connect callIgor Murashkin2013-03-131-77/+87
| | | | | Bug: 8337737 Change-Id: Ia6fca4365fa20fdbfd6a1ec8d047639a002f2aba
* Camera: Make ProCamera connect take the same paths as Camera connectIgor Murashkin2013-03-111-127/+88
| | | | | | | | * ProCamera uses the app ops manager * Refactored connect calls to be as common as possible * Removed some useless not implemented function calls in ProClient Change-Id: I5dab30d20f0c202a494a07b2cfe4c1fa04a2a076
* CameraService: Refactor Camera2Client to share a base with ProCameraClientIgor Murashkin2013-03-111-6/+8
| | | | Change-Id: I249e2a0fc47ae84f29c9d9c4a223fba13da3ee66
* Camera: Drop ProCamera connections when a Camera connection happensIgor Murashkin2013-02-281-1/+125
| | | | | | | * Also adds an ICameraServiceListener with available/not available statuses Bug: 8291653 Change-Id: I24680f1a2dc109510caf451cf7c7bd180b670d84
* Camera: Start of support for version 3.0 of camera device HALEino-Ville Talvala2013-02-271-1/+3
| | | | | | | - Refactor common CameraDevice interface out of Camera2Device - Initial skeleton only for Camera3Device Change-Id: I097cc76e2ad102a51712ac114235163245f5482c
* camera_client: refactor Camera/ProCamera commonalities into BasicCameraIgor Murashkin2013-02-261-1/+5
| | | | Change-Id: Ie10a4094522d49683657665fe94ab0b7ccd280e9
* CameraService and Stagefright: Support AppOpsEino-Ville Talvala2013-02-251-28/+143
| | | | | | | | | | | | | Camera: - Signal to AppOpsService when camera usage starts and stops - Listen to permissions revocations and act on them - Currently just kill camera connection when permissions lost Stagefright: - Pass on client name, UID to camera as needed Bug: 8181262 Change-Id: I9e33c9d05e9daa77dbb2d795045d08eb887ec8f0
* Camera: ProCamera2Client - add createStream (service is stubbed) and unit testIgor Murashkin2013-02-221-1/+3
| | | | Change-Id: I1ae7ba9b24f5883c214c19a7ed0eaf0c802d69c1
* Camera: Add ProCamera private binder interface for an API2-light functionalityIgor Murashkin2013-02-221-29/+267
| | | | Change-Id: I2af7a807c99df75ea659e6e6acc9c4fca6a56274
* Camera: Add unit test infrastructure for libcameraclientIgor Murashkin2013-02-221-0/+1
| | | | Change-Id: I957538663ae8332d26f3640c63a75efc79f4ac5c
* CameraService: Log camera module nameAlex Ray2013-02-201-0/+1
| | | | | | | | Explicitly logs camera module loaded. This is useful on systems with multiple camera modules installed. Also this make the camera service match audioflinger, which logs hardware module names as well. Change-Id: I280bf12df2d517f936916b8ba3cb662e671d0216
* Refactoring: Rename SurfaceTextureClient to SurfaceMathias Agopian2013-02-151-1/+0
| | | | Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
* Camera2: Always disconnect in the client destructorIgor Murashkin2012-10-081-0/+4
| | | | | | | | | | | If Camera2Client failed to initialize, it would skip disconnect step, and thus the camera would be forever marked as busy. By always calling disconnect it will always call free. It also adds a new guarantee that Client::disconnect is idempotent Bug: 7298182 Change-Id: Ic9876f1665b7d9b3c0da692880f63f165e3f4fa5
* Camera2: Don't promote weak IBinder ptrs to strong onesIgor Murashkin2012-10-051-10/+12
| | | | | | | | | The Binder driver does not support promoting weak pointers into strong pointers. Occassionally the system would lock up when trying to do this (when closing the camera app). Bug: 7289040 Change-Id: I8bc0b5c48616bf0b7f4eed1878ad4994ee635871
* Camera2: Handle client processes dying by closing camera resourcesIgor Murashkin2012-10-031-15/+77
| | | | | | | | | CameraService now subscribes to binder death notifications for each client, and disconnects the client if the death happened without cleanly shutting down the client first. Bug: 7258314 Change-Id: I7803836b589fd8f0dfe00f6c28a707b82012e751
* Camera2: Improve formatting of debugging dumpEino-Ville Talvala2012-07-311-1/+2
| | | | | Bug: 6243944 Change-Id: Id8730357f3adcd96923132f9f702e296e0dfd357
* CameraService: Add more information to service dump.Eino-Ville Talvala2012-07-171-4/+57
| | | | | | | | | Add dumpsys information even when there's no active client. Including: - Camera module version / name / author - Number of camera devices - Static information for each device Change-Id: Ib97e325f6be5f989b342d24f1ae17aa9e796f8ed
* Add basic Camera2Client dump, minor fixes to CameraService dump.Eino-Ville Talvala2012-05-311-13/+7
| | | | | Bug: 6243944 Change-Id: I52caaa6146050c38976768e99b0eeea1d13a3f51
* Camera service: Initialization for camera2 clients and devicesEino-Ville Talvala2012-05-291-24/+10
| | | | | | | | | | | - Refactor initialization code to hide device type from CameraService - Add metadata queue class to Camera2Device - Initialization of Camera2Device, Camera2Client - Conversion from HAL2 device static metadata to camera API parameters. Bug: 6243944 Change-Id: I524145b45438e906d8493dae202704ce8f090aeb
* Camera service: Add skeleton support for camera2 devices.Eino-Ville Talvala2012-05-171-5/+34
| | | | | | | | | | | | - Add Camera2Client, which maps the current android.hardware.Camera API to the new camera2 semantics - Add Camera2Device, a C++ wrapper for the HAL camera 2 device No functionality besides create/destroy; all client methods return error or null. Bug: 6243944 Change-Id: I6bd5136fa1efd8279b8cd2d9847d9b0bb2862294
* Break out CameraClient from CameraService.Eino-Ville Talvala2012-05-161-883/+8
| | | | | | | | | | | | | | To allow for different low-level implementations of the current camera API, the Client class inside CameraService has to be inheritable. This change breaks it up into the common section accessed by the camera service, and the full implementation for camera device HAL version 1. The full implementation is moved out to CameraClient.h/.cpp. There are no functionality changes, just code reorganization. Bug: 6243944 Change-Id: I8a79b31a3ae3617198dc6bb5576a9f2e2d9c95de
* Remove new camera connect API.Wu-cheng Li2012-04-191-112/+29
| | | | | | | | Applications are not resumed under the lock screen now. This API is not needed anymore. bug:5584464 Change-Id: I115daf6b647348617ec0fc05b626878c945b9b29
* Fix deadlock in camera destruction after client app's crashKeun young Park2012-03-281-15/+47
| | | | | | | | | | | | | | | | | | | | | | | * why deadlock happened: when an app (CTS camera test) crashes while using camera, its binder is closed and reference counter is decreased. If camera is inside callback, sp<Client> inside callback will hold the Client instance, and Client instance is destroyed when the callback ends as sp<Client> to hold it no longer exists. The destructor of Client instance tries to clean up camera H/W which tries to stop threads created by camera HAL including the thread context where the callback is running. This causes deadlock where the callback thread itself is waiting for itself to terminate. Note that the deadlock will not happen if camera callback is not active. In that case, closing of binder will force the destruction of Client instance, and the destruction happens in binder thread. * Fix: Forces Client descruction in binder thread - remove sp<Client> from callbacks to prevent destruction in callback context - add client lock to allow callback to use raw pointer safely. This prevents the destructor from deleting the instance while callback is using it. - add status change inside destructor with client lock to safely destroy Client Bug: 6214383 Change-Id: Ic6d6396d4d95ce9e72a16ec2480ae65c100fe806
* Add a new camera open API that allows taking the ownership.Wu-cheng Li2012-03-151-32/+117
| | | | | | | | | | | | | | The purpose is to let face unlock always get the camera successfully. What happened was the camera applications may have opened the camera in onResume under the lock screen. This API lets face unlock take the camera from the camera application. A new permission will be added, so other applicatoins won't be able to take the camera from the face unlock. bug:5584464 Change-Id: Ib3d9dcbc2161815b68db42327dc01148453704c6
* fix libgui header locationMathias Agopian2012-02-271-1/+1
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-22/+22
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* am 4bc873e6: am 7944704e: Merge "Switch camera sounds to always use the ↵Eino-Ville Talvala2012-01-061-11/+1
|\ | | | | | | | | | | | | system enforced audio stream." into ics-mr1 * commit '4bc873e6ff73200af866f8c9efca66ad8ed23682': Switch camera sounds to always use the system enforced audio stream.
| * Switch camera sounds to always use the system enforced audio stream.Eino-Ville Talvala2012-01-061-11/+1
| | | | | | | | | | | | | | | | | | | | Instead of picking between the music stream and the enforced audio stream, change the camera service to always play sounds through enforced system stream. Also update the currently-hidden CameraSound API to match. Bug: 5778365 Change-Id: I3cc64b1d1ff567dbac8020a665d5b19846197ff3
* | Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-7/+7
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* | Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-2/+2
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-2/+2
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298