summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/device3/Camera3Device.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Camera3Device: Validate template IDChien-Yu Chen2016-03-251-0/+8
| | | | | | | | Validate template ID before creating a default request. Bug: 26866110 Bug: 27568958 Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
* Camera3Device: Bookkeeping reprocess shutters separatelyChien-Yu Chen2015-09-301-12/+24
| | | | | | | | Bookkeeping reprocess shutters separately so regular and reprocess shutters together don't need to come in order. Bug: 24497512 Change-Id: I4aaf22045131e9e2e26bf163f7df9ff4c5cd6259
* CameraService: Use SCHED_FIFO for request queue thread in HFREino-Ville Talvala2015-09-261-0/+16
| | | | | | | | | | - Move SchedulingPolicyService from audioservice to mediautils - When starting up a high speed stream config, set request queue thread to SCHED_FIFO using SchedulingPolicyService Bug: 24227252 Change-Id: I224b59142bd111caf563779f55cddd62385b9bac
* Camera3Device: Clean up next request batch variableChien-Yu Chen2015-09-041-41/+28
| | | | | | | | Make the Vector of next requests a RequestThread member variable to avoid memory allocation in every threadloop. Bug: 23360060 Change-Id: I4f33e5c49f0f4deb1f9f45bada0909da748849e4
* Camera3Device: Support batch requestsChien-Yu Chen2015-09-031-186/+318
| | | | | | | | | | | | | | | | Refactor request threadLoop to three parts: waiting for next batch of requests, preparing HAL requests and output buffers for next batch of requests, and submitting the batch of requests to HAL. Set the batch size to the size of the request list if it's a video recording request in a high speed video configuration. Add a flush lock so that HAL's flush() won't be called while submitting a batch of requests. Bug: 23360060 Change-Id: Icd395b1f955a9b336eec6fa5aff6b17741ce08c7
* Camera3Device: Don't hold mutex during HAL device close.Eino-Ville Talvala2015-08-281-6/+14
| | | | | | | | | The HAL device shutdown will likely need to wait on various events and queues to drain, and holding the mutex will prevent, for example, error notifications from being processed. This can lead to deadlocks. Bug: 23501571 Change-Id: I873ac23ef30545adf533e7839445448573ab5048
* Merge "Add experimental camera session prepare API." into mnc-dr-devRuben Brunk2015-08-171-3/+7
|\
| * Add experimental camera session prepare API.Ruben Brunk2015-08-141-3/+7
| | | | | | | | | | Bug: 18949148 Change-Id: I8f73e68ea2e3acc60d98954106f364d13f439a82
* | Merge "Fix deadlock conditions in Camera3Device." into mnc-devRuben Brunk2015-08-131-20/+43
|\ \ | |/ |/|
| * Fix deadlock conditions in Camera3Device.Ruben Brunk2015-08-121-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Potential deadlock conditions this addresses, include: - Not waking up waiting threads for several situations where the status had been updated. - Not waking up all waiting thread when status had been updated (only one thread was awoken due to use of signal). - Threads clear status transitions before other waiting threads have a chance to examine them. Bug: 22448586 Change-Id: I53ba669d333a83d2bfa1ca3170d34acc6d8fe6e3
* | Merge "Camera3Device: Relax InFlightMap size check" into mnc-devChien-Yu Chen2015-08-131-1/+5
|\ \ | |/ |/|
| * Camera3Device: Relax InFlightMap size checkChien-Yu Chen2015-08-121-1/+5
| | | | | | | | | | | | | | | | Relax InFlightMap size check for high speed configurations to allow more pending capture requests. Bug: 23162274 Change-Id: I955fe9a0754f0daed001f4a2b34ccb50f2465a11
* | Camera: Allocate correctly-sized buffers for DEPTH_POINT_CLOUDEino-Ville Talvala2015-08-111-7/+30
|/ | | | | Bug: 20537722 Change-Id: I9fa2fcdcfd41cd3370732c70414914993d3dc94e
* Camera: Add hidden experimental tearDown method.Eino-Ville Talvala2015-07-161-0/+31
| | | | | Bug: 18949148 Change-Id: Ie86ec7d1ec3db54e1154563b2339a208a935f849
* Camera3-Device: Fix AE lock availableChien-Yu Chen2015-06-301-15/+14
| | | | | | | | | Pass whether AE lock is available when creating the request thread because when the request thread was created, its parent's info was not set yet. Bug: 20494782 Change-Id: I11ed3f99c473955c437e81f3e1d704c15a9ca1a4
* Merge "Camera3: Support AE precapture trigger CANCEL" into mnc-devChien-Yu Chen2015-06-241-6/+87
|\
| * Camera3: Support AE precapture trigger CANCELChien-Yu Chen2015-06-241-6/+87
| | | | | | | | | | | | | | | | Support AE precapture trigger CANCEL for devices <= API version 3.2. Bug: 20494782 Change-Id: I6003ba8057ca4ec9e8dfda47b8411ae6be913d22
* | Camera3Device: Fix high speed configurationChien-Yu Chen2015-06-181-1/+5
|/ | | | | | | | If high speed mode changed, HAL needs to reconfigure the streams even when the stream configurations don't change. Bug: 21900311 Change-Id: I76aee456b3b6d8c8f599a1638dcd38d75553a235
* CameraService: Add consumer name to output stream dumpsysEino-Ville Talvala2015-06-091-1/+1
| | | | | | | | | | Also switch use of ANativeWindow to Surface, to get to the getConsumerName() method where necessary. Surface can always be cast to ANativeWindow, but not the other way around, so it's a better option anyway. Change-Id: Ie5c2d30821c1a754f9e382699ff50b4b328288b3
* Camera3Device: Default-initialize operating mode.Eino-Ville Talvala2015-06-091-1/+2
| | | | | | | | Since configureStreams is only called by CameraDeviceClient, the operation mode could default-initialize to CONSTRAINED_HIGH_SPEED for API1 operation. Change-Id: Ide71af07ca3925db8e450d00def1daeb44d8046a
* Camera1 API: Support SW encoders for new camera HALsEino-Ville Talvala2015-06-081-2/+3
| | | | | | | | | | | | - Support new set video format/dataspace command in camera service - HALv3: Select gralloc usage flags based on format - HALv1: Pass format command directly to HAL layer - Use format/dataspace command in CameraSource - Switch all API1 recording to use metadata mode - Switch all >= HALv2 API1 recording to use kMetadataBufferTypeANWBuffer Bug: 13222807 Change-Id: I2e609b92c65792611bb1dab09e0c41c363ebbc42
* Camera2: implement high speed video APIsZhijun He2015-06-031-2/+7
| | | | | Bug: 21442271 Change-Id: Ia0ae5bbd3e8c81bad293c29987301a2457817d12
* Camera3: fix aborting reprocess requestsChien-Yu Chen2015-06-011-24/+38
| | | | | | | | | | | | Get an input buffer right after camera service takes one reprocess capture request from the request queue to prevent the input buffers getting out of order. When aborting pending reprocess requests in the request queue, also abort the same amount of input buffers. Bug: 21028914 Change-Id: I7cfacecb4c24509f59c983abd587db5a403237bd
* Camera3Device: Do not call cleanUpFailedRequest with mutex heldEino-Ville Talvala2015-05-281-10/+14
| | | | | | | Double-acquiring a non-recursive mutex tends to work poorly. Bug: 21498811 Change-Id: I1d59959fca69c97684522195808019797f7a6a7d
* Camera3Device: Close hole in prepare in-use stream checkEino-Ville Talvala2015-05-271-0/+18
| | | | | | | | | | | | | There's a narrow window in which a capture request is neither in the request queue or handed off to the HAL, which can be expanded to some size if buffers have to be allocated. During this window, the prepare() method will not correctly notice that a stream should be considered in use. Add a member to contain the current request being processed, and check against it in prepare as well. Change-Id: I3a198d617f5feee0a3332af4b4439f24eda28ea3
* Camera: Cleanup to prepare() implementationEino-Ville Talvala2015-05-131-4/+4
| | | | | | | | | - Mutexes _might_ be a good idea - Don't be surprised by behavior that's expected - Use the existing logging macros Bug: 20537148 Change-Id: Ie62985a786d7e6645b4e4fe019dd98b02891a1f7
* Merge "Camera: allow non-supported template"Yin-Chia Yeh2015-04-151-3/+3
|\
| * Camera: allow non-supported templateYin-Chia Yeh2015-04-141-3/+3
| | | | | | | | | | Bug: 19395059 Change-Id: I42bbd99fef6055173062266c1a490311105c6814
* | Camera2: Add prepare for output streamsEino-Ville Talvala2015-04-151-4/+196
| | | | | | | | | | | | | | | | | | The prepare call asynchronously pre-allocates buffers for a given output stream, and then fires the onPrepared callback. Not implemented for Camera2Device or used in Camera2Client. Change-Id: I1cccdfff846dd6985133c591dbdceed823929ade
* | camera2: add reprocess supportChien-Yu Chen2015-04-131-9/+58
|/ | | | | | | Add support to create input stream, submit reprocess capture requests, and receive reprocess capture results. Change-Id: Iee2d4313f3d52616a484eaea7a28f5ef9d8a674b
* Camera: plumbing rotation field throughYin-Chia Yeh2015-03-181-5/+5
| | | | Change-Id: I0f4343a0bfa7bf09ba887c78a1da1c08daa35333
* Camera: Wire up dataSpace, clean up ICameraDeviceUserEino-Ville Talvala2015-03-061-5/+6
| | | | | | | - Remove unused arguments from ICameraDeviceUser::createStream - Add dataSpace as a stream parameter, plumb it through everything Change-Id: I608cafe694785d1c512276e71b2016f8ac3b0ccb
* camera: implement flashlight for HAL v1 devicesChien-Yu Chen2015-03-031-2/+2
| | | | | | | | | Implement flashlight for HAL v1 devices and remove CameraHardwareInterface's dependency on CameraService to avoid circular dependency. Bug: 2682206 Change-Id: Id5bbccef085b607a6189763fd7fbe2e3f26868c8
* CameraService: intercept Camera moduleYin-Chia Yeh2015-02-031-5/+4
| | | | | | | | Wrap camera module returned from HAL so get_camera_info returns static_camera_characteristics processed by framework, which generates keys added after HAL3.2 is released. Change-Id: Ief423a1571cf06c7ef80b98b403a33969baf95f6
* Camera: make sure jpeg buffer size isn't too smallYin-Chia Yeh2015-01-201-4/+3
| | | | | | | | Assuming the jpeg header can take up to 256KB, make sure we always allocate enough size for the image data. Bug: 18962703 Change-Id: I08eb3d198d12f71f3ab7266324e80fe7410bdc89
* Camera3Device: support shutter after resultChien-Yu Chen2014-12-091-136/+190
| | | | | | | | | | | | | Move the code to remove in-flight requests from processCaptureResult to a separate function so it can be called when the framework receives a result or a shutter event. An in-flight request will only be removed when both results and the shutter event arrive in the case of a successful request. Also send out results only after the shutter event receives. Bug: 18135776 Change-Id: I340db1a495c711b0913784d43fd0f144871e4420
* camera: fix frame deletion logic in mInFlightMapRuchit Sharma2014-11-251-2/+6
| | | | | | | | | | | For per-frame error notifications, camera3.h requirements state that all the buffer handles for a failed frame capture must be returned via process_capture_result() call(s). Hence, Camera3Device needs to ensure that the frame entry is not deleted from mInFlightMap until all buffers for that frame have been returned by HAL. Bug: 17757940 Change-Id: I2579ca7980d2fd67d53abc530e2706538f7d3d3a
* Merge "Camera3Device: Treat failure to idle as an error" into lmp-devEino-Ville Talvala2014-09-151-0/+4
|\
| * Camera3Device: Treat failure to idle as an errorEino-Ville Talvala2014-09-141-0/+4
| | | | | | | | | | Bug: 16899526 Change-Id: Ia995aac6360c9c41ed654af5a7052480f23903d8
* | Camera3: Update ZSL post-processing tagsZhijun He2014-09-141-0/+6
|/ | | | | | | | | Update ZSL processing tags according the still capture template Also cache the request template to avoid extra cost of querying into HAL every time. Bug: 17463102 Change-Id: I2eeffefb0a4131c99a85dd3e4484cc6f0f025efa
* Camera2: reconfigure video snapshot size if neededYin-Chia Yeh2014-09-081-0/+8
| | | | | | | | When recording fails to start due to stream configuration failed, try configure stream again by setting jpeg stream to video size. Bug: 16162133 Change-Id: Ib20271e787ae07719ce419f0b15c7f86434f7ebb
* CameraService: Create a dummy stream when 0 streams are requested.Eino-Ville Talvala2014-08-281-1/+75
| | | | | | | | | | | A workaround for a camera device HAL v3.2 or older specification hole - it's not acceptable to configure_streams with 0 output streams. However, we allow for this at the public API level, to allow an application to release all output streams. So in this case, create a dummy stream that doesn't actually do anything as a placeholder. Bug: 17220694 Change-Id: Ib25242ffc2c9f2b2f619fd5fe6d652266579da85
* CameraService: Correct API2 error handlingEino-Ville Talvala2014-08-271-81/+205
| | | | | | | | | | | | | | - Add more error codes to the binder camera2 callbacks - Translate HAL errors to callback errors - When flushing, report failures for queued requests - Treat stream config failure as nonfatal - Send request errors when buffers aren't available for captures Bug: 15524101 Bug: 14448494 Bug: 11272459 Bug: 17160301 Change-Id: I81aa54e805a9cce1cb8a6a9374549daa7666deb2
* Merge "Camera: fix triggerId logic" into lmp-devYin-Chia Yeh2014-08-221-2/+11
|\
| * Camera: fix triggerId logicYin-Chia Yeh2014-08-211-2/+11
| | | | | | | | | | | | | | | | | | Fix missing triggerId introduced by previous cleanup change. bug 17108154 bug 17053130 Change-Id: Ifda55d5fbe992d98f335a8427aa256d78a856586
* | camera: Configure streams immediately when API2 does configurationIgor Murashkin2014-08-201-0/+9
|/ | | | | | | | | This makes the configuration more eager (no more waiting until the first request) and also allows any errors to immediately be sent back to the client. Bug: 16629195 Change-Id: I0c365bc8f760466916dcc089217a43c43f9f4c9d
* Camera2/3: Cleanup the jpeg buffer size calcaulation logicZhijun He2014-08-111-7/+4
| | | | | | | | | - Only one place calculating the jpeg size-the device layer, Camera2Device and Camera3Device. - Remove size argument for CameraDeviceBase and cleanup related code. Bug: 14327010 Change-Id: I45d2ab4859ee0cc9273e579254f0569108c748f1
* CameraService: Clean up availability listeners and HAL error codesEino-Ville Talvala2014-07-281-3/+6
| | | | | | | | | | | - Refactor where availability listeners are called to centralize behavior, ensuring that all client creation/destruction invokes the listeners - Clean up some of the client hierarchy - Filter error codes from key HAL calls to ensure proper reporting Bug: 16514157 Bug: 16483222 Change-Id: I59875a865b6a508b47423946c78862da8df34cd1
* Camera3: tear down Camera3 streams when they are deleted.Zhijun He2014-07-241-0/+3
| | | | | | | | | Also override the disconnectLocked method in Camera3ZslStream to make sure the Camera3ZslStream specific buffer queue is cleaned up properly. Also revert 0be123df1897fd3fe1b7ba30f24d8ae4c91b4dc7, as it was not the right fix. Change-Id: I89bdcb2e206379ae1f2602421e7fdbcde9a31399
* Camera3: only append partial result to partial result collectionZhijun He2014-07-221-2/+3
| | | | | | Otherwise, the metadata entries will be duplicated. Change-Id: If0cd96e09960fdf746a70913d380e9036745a944