summaryrefslogtreecommitdiffstats
path: root/services/camera
Commit message (Collapse)AuthorAgeFilesLines
* Fix deadlock in camera destruction after client app's crashKeun young Park2012-03-282-18/+60
| | | | | | | | | | | | | | | | | | | | | | | * 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
* AV Android make files changesJames Dong2012-03-281-1/+1
| | | | | | | o plus a few file relocation: ActivityManager.cpp/h, SoundPool.h, etc o remove some runtime dependencies to libandroid, libandroid_runtime, etc Change-Id: I047a47c5fb361dd5cf85cd98798c39f629a75d10
* Add libmedia_nativeGlenn Kasten2012-03-161-0/+1
| | | | Change-Id: Ib8cff8abd73723b793f08da99ad59549f219e0e7
* Add a new camera open API that allows taking the ownership.Wu-cheng Li2012-03-152-34/+130
| | | | | | | | | | | | | | 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-273-3/+1
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* remove dependency on android_native{s_priv|buffer}.hMathias Agopian2012-02-241-1/+0
| | | | Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
* Add ANativeWindow timestamp support to camera service.Eino-Ville Talvala2012-01-101-0/+7
| | | | | | | | This allows the camera HAL to set ANativeWindow timestamps, which are used by SurfaceTexture. Bug-Id: 5081132 Change-Id: I123ea4c9d1824fb72146fad81ad03d1491e0a7f8
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-084-31/+31
| | | | | | | 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-062-12/+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-062-12/+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-042-4/+4
| | | | | | | | | | | | | | 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-033-7/+7
| | | | | | | | | | | | | | 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
* | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-262-27/+27
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* 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-172-14/+16
| | | | Change-Id: I80dd37da277b1810959a2dbdd852078b26f70cf5
* Add initialize method to CameraHardwareInterfaceTyler Luu2011-10-072-14/+28
| | | | | | | | | | | | 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-022-22/+28
| | | | | 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-294-6/+9
| | | | | bug:4460717 Change-Id: Ib47d7d7df20af8155a719f3dabefe030893bfebc
* libcameraservice: call put_parameters on camera HALIliyan Malchev2011-07-271-1/+4
| | | | | Change-Id: I492d1034ade50f9e157141debaa9783a90a04a91 Signed-off-by: Iliyan Malchev <malchev@google.com>
* 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
* Merge "CameraService: (dis)connect from preview windows"Jamie Gennis2011-07-182-46/+55
|\
| * CameraService: (dis)connect from preview windowsJamie Gennis2011-07-142-46/+55
| | | | | | | | | | | | | | This change makes CameraService connect and disconnect from preview windows (Surfaces and SurfaceTextures) that get set. Change-Id: I726971688367d5ce0d9aa90c44168037bce33deb
* | get rid of overlay HALMathias Agopian2011-07-121-10/+0
| | | | | | | | Change-Id: I461f633d172ab10e05326ef10544c67dea664c0e
* | Eliminate single-process mode.Jeff Brown2011-07-081-8/+1
|/ | | | | | Bug: 5010576 Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
* CameraService: Decouple dequeue and lockSundar Raman2011-06-271-7/+11
| | | | | | | | Decouple lockBuffer from dequeueBuffer. Add lock_buffer to preview_stream_ops, so HALs will be fully in charge of managing buffers. Change-Id: I7b53487d618bdf08ba904c5a0f41af462a7ca773 Signed-off-by: Iliyan Malchev <malchev@google.com>
* 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
* Merge "Allow camera to be disabled via Device Policy Manager"Wu-cheng Li2011-06-161-0/+8
|\
| * Allow camera to be disabled via Device Policy ManagerWu-cheng Li2011-05-301-0/+8
| | | | | | | | | | | | bug:4185309 Change-Id: I8be89d892b8f540fd05913c93f97b92346a0a282
* | CameraService: return stide when dequeueing a bufferIliyan Malchev2011-06-111-2/+4
| | | | | | | | | | Change-Id: I11c7f0b57f7d619cdc392b2d34c538ae898de7ac Signed-off-by: Iliyan Malchev <malchev@google.com>
* | frameworks/base: updates for camera HAL memory managementIliyan Malchev2011-06-071-18/+70
|/ | | | | | | | | | | | | | | -- when the camera HAL allocates memory -- it requests is as N buffers by S bytes each -- it may specify a file descriptor to get mmapped; if -1, then we use ashmem -- when issuing data and data-timestamp callbacks, the camera HAL specifies a buffer index -- range checking is performed on the buffer indices -- memory requested by a camera HAL is not incStrong'ed, and needs to be expliciftly released by the camera HAL (by calling the release method on the camera_memory_t handle) Change-Id: I0f09603aa786c238590e7288388ab673787e6032 Signed-off-by: Iliyan Malchev <malchev@google.com>
* frameworks/base: android_native_buffer_t -> ANativeWindowBufferIliyan Malchev2011-05-031-7/+7
| | | | | Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417 Signed-off-by: Iliyan Malchev <malchev@google.com>
* frameworks/base: switch CameraService to a HAL moduleIliyan Malchev2011-05-034-67/+675
| | | | | | | | | | | | | | | 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-032-13/+13
| | | | | | | | | | | | 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-052-17/+3
| | | | Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
* frameworks/base: some camera-interface cleanupIliyan Malchev2011-03-282-21/+3
| | | | | | | | | 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>
* merge libsurfaceflinger_client into libguiMathias Agopian2011-03-252-2/+1
| | | | | | | | | | | | this is the first step in unifying surfacetexture and surface. for this reason the header files were not moved, as most of them will eventually go away. NOTE: currently we keep libsurfaceflinger_client.so as an empty library to workaround prebuilt binaries wrongly linking against it. Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
* Fix missing AOSP copyright headers for more filesJames Dong2011-03-172-0/+32
| | | | | | | | | | o Update the copyright date on InputDispatcher_test.cpp and InputReader_test.cpp because these two files were moved from other places to the current location, and were actually created in 2010. bug - 4119349 Change-Id: Ic93b81ddafb58e9e72a2e9e02ca3d9f173d6dca7
* Application-managed callback buffer support for raw imageJames Dong2011-02-222-7/+20
| | | | | | bug - 3292153 Change-Id: I9789f7c5cde3a3889d7375e881181e9152d95fc2
* Add camera service support for SurfaceTexture.Jamie Gennis2011-01-063-25/+50
| | | | | | | 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