summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Add camera focus move callback.Wu-cheng Li2011-11-291-1/+1
|/ | | | | bug:5534973 Change-Id: Iaadcb2738ad040f94849be30ee531326f6199431
* Fix 5487571: Make sure shutter sound is played when it's enforcedChih-Chung Chang2011-10-201-8/+2
| | | | Change-Id: I0c7adf452217b8308243836b40b1fba8f2029240
* Fix 5468644: Use the proper audio stream type to play sound.Chih-Chung Chang2011-10-171-14/+13
| | | | Change-Id: I80dd37da277b1810959a2dbdd852078b26f70cf5
* Add initialize method to CameraHardwareInterfaceTyler Luu2011-10-071-4/+9
| | | | | | | | | | | | Add intialize() method to CameraHardwareInterface so we can return a proper error value to CameraService if open of camera hardware module fails. b/5405235 Change-Id: I09c627034ddd22a5753c5163392c4fcff301e0b9 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* Merge "Allow shutter/recording sound to be adjusted unless it's forced."Chih-Chung Chang2011-10-071-1/+12
|\
| * Allow shutter/recording sound to be adjusted unless it's forced.Chih-Chung Chang2011-10-071-1/+12
| | | | | | | | Change-Id: I7080d5f50a87f92c8e9395d4cf8f927a6760fa70
* | Allow Camera.setDisplayOrientation to be called when preview is active.Wu-cheng Li2011-10-071-4/+4
|/ | | | | | bug:5422679 Change-Id: I4c936ab00428fc158b5947fe8f10b1028869bbdb
* Add video snapshot camera parameter.Wu-cheng Li2011-09-011-5/+0
| | | | | | | | The API is still hidden. bug:5187868 Change-Id: I59e1b5774ca32be049723d1a0887faa90d8884bb
* Pass camera frame metadata from camera service to Java.Wu-cheng Li2011-08-021-19/+21
| | | | | bug:4460717 Change-Id: I2fae6e1dfca6b8f3a5ee5716fc7817f5417bf657
* connect/disconnect is now called from our EGL wrapperMathias Agopian2011-08-011-4/+4
| | | | | | | | | | | the original connect/disconnect hooks are deprecated and replace by api_connect/api_disconnect. the original hooks are no no-ops. api_connect/api_disconnect is now only called from the android framework. Bug: 5057915 Change-Id: I8ca64cd1acd6cabf915bf54689ec2e5f6dfa495a
* Add frame metadata parameter to camera data_callback.Wu-cheng Li2011-07-291-1/+1
| | | | | bug:4460717 Change-Id: Ib47d7d7df20af8155a719f3dabefe030893bfebc
* Merge "Disconnect the native window in CameraService::Client::disconnect."Wu-cheng Li2011-07-191-11/+12
|\
| * Disconnect the native window in CameraService::Client::disconnect.Wu-cheng Li2011-07-201-11/+12
| | | | | | | | | | bug:5048372 Change-Id: I6886907a672ddf5580b988ca5bc13e3dc26d4385
* | use SurfaceTexture new scaling mode in SFMathias Agopian2011-07-191-0/+4
|/ | | | | | | SF now obeys SurfaceTexture's scaling mode instead of inferring it from the buffer's size Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
* CameraService: (dis)connect from preview windowsJamie Gennis2011-07-141-46/+51
| | | | | | | This change makes CameraService connect and disconnect from preview windows (Surfaces and SurfaceTextures) that get set. Change-Id: I726971688367d5ce0d9aa90c44168037bce33deb
* Add framework support for camcorder zoom.Wu-cheng Li2011-06-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of ICameraRecordingProxy and ICameraRecordingProxyListener is to allow applications using the camera during recording. Camera service allows only one client at a time. Since camcorder application needs to own the camera to do things like zoom, the media recorder cannot access the camera directly during recording. So ICameraRecordingProxy is a proxy of ICamera, which allows the media recorder to start/stop the recording and release recording frames. ICameraRecordingProxyListener is an interface that allows the recorder to receive video frames during recording. ICameraRecordingProxy startRecording() stopRecording() releaseRecordingFrame() ICameraRecordingProxyListener dataCallbackTimestamp() The camcorder app opens the camera and starts the preview. The app passes ICamera and ICameraRecordingProxy to the media recorder by MediaRecorder::setCamera(). The recorder uses ICamera to setup the camera in MediaRecorder::start(). After setup, the recorder disconnects from camera service. The recorder calls ICameraRecordingProxy::startRecording() and passes a ICameraRecordingProxyListener to the app. The app connects back to camera service and starts the recording. The app owns the camera and can do things like zoom. The media recorder receives the video frames from the listener and releases them by ICameraRecordingProxy::releaseRecordingFrame. The recorder calls ICameraRecordingProxy::stopRecording() to stop the recording. The call sequences are as follows: 1. The app: Camera.unlock(). 2. The app: MediaRecorder.setCamera(). 3. Start recording (1) The app: MediaRecorder.start(). (2) The recorder: ICamera.unlock() and ICamera.disconnect(). (3) The recorder: ICameraRecordingProxy.startRecording(). (4) The app: ICamera.reconnect(). (5) The app: ICamera.startRecording(). 4. During recording (1) The recorder: receive frames from ICameraRecordingProxyListener.dataCallbackTimestamp() (2) The recorder: release frames by ICameraRecordingProxy.releaseRecordingFrame(). 5. Stop recording (1) The app: MediaRecorder.stop() (2) The recorder: ICameraRecordingProxy.stopRecording(). (3) The app: ICamera.stopRecording(). bug:2644213 Change-Id: I15269397defc25cbbcae16abc071c8349c123122
* Allow camera to be disabled via Device Policy ManagerWu-cheng Li2011-05-301-0/+8
| | | | | | bug:4185309 Change-Id: I8be89d892b8f540fd05913c93f97b92346a0a282
* frameworks/base: switch CameraService to a HAL moduleIliyan Malchev2011-05-031-21/+49
| | | | | | | | | | | | | | | This patch changes CameraService to load a camera HAL module, instead of linking directly against a library that implements the CameraHardwareInterface class. CameraHardwareInterface no longer defines the API to the camera HAL. Instead, this is now in HAL header hardware/camera.h. We keep CamerHardwareInterface as a class local to CameraService, which wraps around the new HAL calls. In the future, we may remove this class entirely and have CameraService call the HAL methods directly. Change-Id: I5c61ac40078fc0b50bbac5881a556fe6c8837641 Signed-off-by: Iliyan Malchev <malchev@google.com>
* frameworks/base: include system/core header camera.h in Camera.hIliyan Malchev2011-05-031-9/+9
| | | | | | | | | | | | We define struct CameraInfo in this camera/Camera.h, even though an identical struct camera_info is defined in hardware/camera.h (but not in hardware/camera_defs.h). We may not export struct definitions from the HAL into headers which may find their way into the NDK. This commit also renames FRAME_CALLBACK_FLAG_xxx to CAMERA_FRAME_CALLBACK_xxx. Change-Id: I3e2ddd01d61bf5371ff2fc1a397995e0f1ee11f8 Signed-off-by: Iliyan Malchev <malchev@google.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-2/+2
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* remove more unused references to ISurfaceMathias Agopian2011-04-051-11/+3
| | | | Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
* frameworks/base: some camera-interface cleanupIliyan Malchev2011-03-281-18/+2
| | | | | | | | | Methods getNumberOfVideoBuffers() and getVideoBuffer() as well as struct image_rect_struct are no longer used (instead, the necessary information is passed through ANativeWindow.) Change-Id: If4b11446fc9ccbde1f6b45bc70c0d0b8e54376eb Signed-off-by: Iliyan Malchev <malchev@google.com>
* Application-managed callback buffer support for raw imageJames Dong2011-02-221-6/+19
| | | | | | bug - 3292153 Change-Id: I9789f7c5cde3a3889d7375e881181e9152d95fc2
* Add camera service support for SurfaceTexture.Jamie Gennis2011-01-061-23/+45
| | | | | | | This change enables the use of a SurfaceTexture in place of a Surface as the destination of camera preview frames. Change-Id: Ic70d404c8fe261e9d5da6f1de93d6babb5b191cb
* We requires camera hal's implementation should not track the ref count of ↵James Dong2010-12-101-4/+1
| | | | | | | | any outstanding video frames and ignore releaseRecordingFrame() call after it receives disableMsgType(CAMERA_MSG_VIDEO_FRAME). Change-Id: I2ecb9b3b11dab6bf868ccf8effda1b8df5bcde3c
* remove support for PUSH_BUFFER surfaces and overlaysMathias Agopian2010-12-081-97/+10
| | | | | | | the same functionality is now supported through the h/w composer HAL, and YUV support in the GPU. Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
* Don't drop video frames but to release them.James Dong2010-12-061-1/+4
| | | | | | bug - 3259009 Change-Id: Ib7634f10a7fe7b7ce7014b79b07957d194bae1a7
* Revert "Temporary workaround for issue 3187563"Eric Laurent2010-11-241-4/+0
| | | | | | | | | | This reverts commit 065299b58d1c00cd24e442fa192561decf7b1fec. The work around for issue 3187563 is not needed any more since the new kernel DMA driver implementation (commit 7953250be7c9a1c3417e21b20032b571d495d218) fixes the root cause. Change-Id: Ibaac2826b63c8e5825ae2e5cab2fb2f0e51ab7b4
* Temporary workaround for issue 3187563Eric Laurent2010-11-111-0/+4
| | | | | | | | | | The audio HAL does not always handle properly simultaneous input and output stream state changes. This happens in particular when starting video record because output stream starts and stops while input is active. Temporary disable the video record jingle the time the audio HAL issues are solved. Change-Id: I3b923d81af543a335deae9e22d7f396bb5791d91
* Mirror the camera preview if the camera is front-facing.Wu-cheng Li2010-10-251-26/+35
| | | | | bug:3095272 Change-Id: Ib1c1d1edc06a33e9d4d2dcb42bc1dd2c25b1310c
* Camera framework change required for 0-memcpy recordingJames Dong2010-10-191-1/+24
| | | | | | bug - 3042125 Change-Id: I46eb7a10b5394086b353fd73e4503beceeed76f1
* Fix camera display orientation.Wu-cheng Li2010-10-121-1/+11
| | | | | bug:3036262 Change-Id: I6fc3dc381fcfaceba09fd5bd14afb85045b3d676
* resolved conflicts for merge of 191a25e1 to masterWu-cheng Li2010-09-271-5/+13
|\ | | | | | | Change-Id: I6f4940e337a992bf84e50bc1d22432593937499c
| * The old overlay should be destroyed if orientation changes.Wu-cheng Li2010-09-271-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the orientation was wrong after suspend and resume. When the camera app is resumed behide the lock screen, it orinteation is portrait. When users slide to unlock the screen, surfaceChanged is called and the orientation is landscape. The camera app stops the preview, sets the display orientation, and starts the preview. Overlay should be destroyed if the orientation has changed. bug:3031640 Change-Id: I38b527f9ea78c91b538463292152c023383b4695