summaryrefslogtreecommitdiffstats
path: root/camera
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-10.0.0_r37' into ↵Kevin F. Haggerty2020-06-013-0/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging/lineage-17.1_merge-android-10.0.0_r37 Android 10.0.0 Release 37 (QQ3A.200605.001) * tag 'android-10.0.0_r37': (47 commits) RESTRICT AUTOMERGE: Camera: fix use after free in sensor timestamp keep tx3g{Buffer,Size,Filled} in sync Fix race condition in AudioTrack::releaseBuffer() Fix race condition in AudioRecord::releaseBuffer() rtsp: fix integer overflow caused by malformed packets IDrm: fix uninitialized variable in GET_OFFLINE_LICENSE_STATE audio policy: fix disordered sequence while changing device RESTRICT AUTOMERGE: Camera: fix use after free in sensor timestamp RESTRICT AUTOMERGE: Camera: fix use after free in sensor timestamp BnCrypto: fix use-before-init in CREATE_PLUGIN Camera: Add onCameraOpened/onCameraClosed callbacks [DO NOT MERGE] Fix Heap use after free in clearkey getSecureStops Check if calling uid is system uid for setAllowedPolicyCapture. clearkey default: parsePssh securely RESTRICT AUTOMERGE CCodec: make config consistent before/after flush Reduce the latecy of encoding 1st frame [media][sfplugin] fix -Wdangling-gsl [DO NOT MERGE] Fix uninitialized data in IHDCP decrypt OpusHeader: Fix integer overflow in GetOpusHeaderBuffers MPEG4Extractor: check the default sample info before checking the validity of sample size. ... Change-Id: Ibb33de8b4828ed99095af7d629ffc290c188e10d
| * Camera: Add onCameraOpened/onCameraClosed callbacksShuzhen Wang2020-03-103-0/+25
| | | | | | | | | | | | | | | | | | | | | | The onCameraOpened/onCameraClosed callbacks are used to notify camera service client with [] permission that a certain camera device has been opened/closed. Test: Manually check callbacks are received in SystemUI app Bug: 150540299 Change-Id: If6f3624c43927c30afef7df0a780eafe3ae4c527 Merged-In: If6f3624c43927c30afef7df0a780eafe3ae4c527
* | Merge tag 'android-10.0.0_r31' into lineage-17.1-android-10.0.0_r31Luca Stefani2020-03-076-47/+27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android 10.0.0 release 31 * tag 'android-10.0.0_r31': (28 commits) Revert "DO NOT MERGE Set module versions to 299900000 Dev branch..." AudioFlinger: Clear effect_uuid_t in case of short read Check actual read bytes for TS packets RESTRICT AUTOMERGE Harden Clearkey releaseSecureStops implementation. RESTRICT AUTOMERGE Fix Heap buffer overflow in clearkey releaseSecureStops camera2 ndk: Allow nullptr for ACameraCaptureSession_captureCallbacks.onClosed. Added usage to init call for audiostream registration. Camera: Handle onBuffersDiscarded callback camera2ndk: ~ACameraCaptureSession shouldn't hold device lock in ACameraDevice_close(). Camera: Check consumer interface before disconnecting do not send max pts gap to full-frame image encoders C2SoftMpeg4Enc: Handle yStride not equal to aligned width vpxdec: handle non-display frames Fix secondary output under&over run Camera: Heic: Wait for output TS before dequeuing output buffers Camera: Heic: Handle out-of-order buffer outputs Camera: Heic: Wait for first output tile callback before muxer start g711 channel count limits aacenc: fix possible shift in remainder bufferpool@2.0 tune eviction params ... Change-Id: Ifa70e0e7345d25ad0b78d2e25ef1a85dbd93eadf
| * camera2 ndk: Allow nullptr for ACameraCaptureSession_captureCallbacks.onClosed.Jayant Chowdhary2019-12-162-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 134680093 Bug: 146357162 Test: AImageReaderVendorTest Merged-In: I8d365b434c257e949496d9495d0fa31a18a2e068 Change-Id: I8d365b434c257e949496d9495d0fa31a18a2e068 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com> (cherry picked from commit 9da975d887ef8d63970e4b11dc9f2c0e0da92705)
| * camera2ndk: ~ACameraCaptureSession shouldn't hold device lock in ↵Jayant Chowdhary2019-12-094-32/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACameraDevice_close(). We call disconnectLocked before stopping CameraDevice's looper, in order to avoid this situation: 1) Its possible that an OnResultReceived callback is received, and posts an AMessage with sp<ACameraCaptureSession> on CameraDevice's looper. 2) Before the looper message is processsed, ACameraDevice_close() is called by the client, which results in the looper being stopped and cleared with device lock held. 3) When the looper is getting cleared, the AMessage containg the ACameraCaptureSession pointer is destructed leading to ~ACameraCaptureSession running without knowing that the device is being closed, as a result it tries to hold device lock, resulting in a deadlock. Bug: 141603005 Test: CTS native tests Test: use camera2 vndk client for extended periods of time Change-Id: Ia0d47fc2975981055cd1f2103c1cbe8d76642fe4 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com> (cherry picked from commit a8bf1c6e6d210833070152adf130f4d988fc255e)
* | camera: Allow devices to load custom CameraParameter codeRashed Abdel-Tawab2019-12-112-1/+84
| | | | | | | | | | | | | | | | | | | | * Some devices need additional code to load their cameras. Add a hook for extra classes and symbols to be included. Originally implemented in Android.mk at 38b27bf2e5079441358288402b38865ba7c1d9d6 Credit to Ethan Chen for original Android.mk implementation Change-Id: Iec667af2f0bfdb41f14df342cb128908244d7af0
* | Camera: Add support for preview frame fdSusmitha Gummalla2019-12-111-3/+12
| | | | | | | | | | | | | | -Add support for receiving dataCallback with fd/buffer as frame buffer CRs-fixed: 654901 Change-Id: I5c16e560f1e209a6ab4afa4f3437602b02992b9b
* | camera: include: Don't override possible overlayed headerBruno Martins2019-12-111-1/+1
| | | | | | | | | | | | | | | | | | * If targets define a specific header path, then let it be the case and don't override it to avoid mismatched headers in the modules. * This only became an issue since O due to moved camera headers (commit e2b43843fd12783188edd2c54188ea8d26864788). Change-Id: I6bf7d1da7448d71f7821d40501db971f837781db
* | camera: Don't segfault if we get a NULL parameterSteve Kondik2019-12-111-0/+3
|/ | | | | | * Values end up NULL on some drivers, don't crash. Change-Id: Ic897dbd4629cf3af98c85f93be202c382dde806b
* Camera: Delay pingCameraServiceProxy to end of onFirstRefShuzhen Wang2019-09-201-0/+1
| | | | | | | | | | | | The cameraservice is only registered to service manager after onFirstRef is returned. To reduce the probability of getBinderService() call returning null, move pingCameraServiceProxy to end of onFirstRef(). Also add debug messages in onFirstRef and main() for better diagnoses. Test: Camera CTS Bug: 140414594 Change-Id: I52defd1c138ade57ebc5181c42aff30921fbeaeb
* Merge "Camera: Clarify manual capture behavior for logical camera" into qt-devShuzhen Wang2019-06-281-9/+9
|\ | | | | | | | | | | am: 2655a0d0fc Change-Id: Iaf3864b08fb90db90e77a9ec1e6dca54ad7475a2
| * Camera: Clarify manual capture behavior for logical cameraShuzhen Wang2019-06-271-9/+9
| | | | | | | | | | | | Test: Build and read docs Bug: 136098496 Change-Id: I2d62c383798b86c3fa4f7bcb9d55cd990a6d1718
| * Merge "camera2 ndk/vndk: cleanup->stop CameraDevice's looper in ↵Jayant Chowdhary2019-06-254-14/+40
| |\ | | | | | | | | | ~ACameraDevice()" into qt-dev
| | * camera2 ndk/vndk: cleanup->stop CameraDevice's looper in ~ACameraDevice()Jayant Chowdhary2019-06-244-14/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible that the following sequence happens: 1) hwbinder / binder thread T1: onResultReceived() starts -> promotes wp<CameraDevice> to sp<>; 2) Some other app thread T2 : ACameraDevice_close() -> delete ACameraDevice -> doesn't result in CameraDevice's destructor running since mCameraDevice has another live reference, app destroys some object O1. 3) T3 (callback looper thread): callback is received since looper is still running which accesses dead app object O1 -> results in undefined behavior. 4) T1: onResultReceived completes and CameraDevice is destructed We need to stop CameraDevice's looper thread (that waits for all callbacks queued to complete) in ~ACameraDevice() so we receive no callbacks after ACameraDevice is closed. Bug: 135641415 Test: CTS native tests: no new failures Test: AImageReaderVendorTest; enroll; while(1) auth; Change-Id: Ia24de753f6ee409d941fff39616f09df2164880a Merged-In: Ia24de753f6ee409d941fff39616f09df2164880a Signed-off-by: Jayant Chowdhary <jchowdhary@google.com> (cherry picked from commit 174084011ca8b593a8cf35412928517b9e864be9) Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* | | camera2 ndk/vndk: cleanup->stop CameraDevice's looper in ~ACameraDevice()Jayant Chowdhary2019-06-214-20/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible that the following sequence happens: 1) hwbinder / binder thread T1: onResultReceived() starts -> promotes wp<CameraDevice> to sp<>; 2) Some other app thread T2 : ACameraDevice_close() -> delete ACameraDevice -> doesn't result in CameraDevice's destructor running since mCameraDevice has another live reference, app destroys some object O1. 3) T3 (callback looper thread): callback is received since looper is still running which accesses dead app object O1 -> results in undefined behavior. 4) T1: onResultReceived completes and CameraDevice is destructed We need to stop CameraDevice's looper thread (that waits for all callbacks queued to complete) in ~ACameraDevice() so we receive no callbacks after ACameraDevice is closed. Bug: 135641415 Test: CTS native tests: no new failures Test: AImageReaderVendorTest; enroll; while(1) auth; Change-Id: Ia24de753f6ee409d941fff39616f09df2164880a Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* | | libcamera2ndk_vendor: stop looper thread on ~ACameraDevice()Jayant Chowdhary2019-06-202-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 135641415 Test: enroll; while(1) auth; Change-Id: I59c522a0e8827c5990926f0cf7c7960e1cea2e5e Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* | | Merge "libhidltransport users user libhidlbase" into qt-devSteven Moreland2019-06-141-0/+1
|\| | | | | | | | | | | | | | | | | am: 63655808d7 Change-Id: I7268c440ca81310139955d0df202d61a52c9f0ea
| * | libhidltransport users user libhidlbaseSteven Moreland2019-06-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libhidltransport symbols are being moved into libhidlbase in order to optimize linking/memory usage. libhidltransport will no longer be required in the future (however removing references to it will come separately). Bug: 134961554 Test: boot Change-Id: Ie8b9b03a53ae1f5672ce2565550768b4bcd321ee
* | | AImageReaderVendorTest: Tolerate failures for ↵Jayant Chowdhary2019-06-121-28/+55
|/ / | | | | | | | | | | | | | | | | | | | | | | ACameraDevice_isSessionConfigurationSupported. Bug: 134683975 Test: AImageReaderVendorTest on multiple devices supporting physical different stream combinations. Change-Id: I6aabd024b7092d4ecf60f8e0adbd0a2bf799cd25 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* / libcamera2ndk_vendor: Don't retrieve value from failed HIDL calls.Jayant Chowdhary2019-06-051-49/+27
|/ | | | | | | | | Bug: 134424054 Test: AImageReaderVendorTest; use libcamera2ndk_vendor client on device. Change-Id: Id6ebfc7c37af8d814a1bedfffdde14a8397591a5 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* camera: make libcamera2ndk_vendor vendor onlyZhijun He2019-05-131-1/+1
| | | | | | Test: build and CGA Bug: 132625347 Change-Id: I7c8676c7ffcc64cc280ce3d7250f94b96eb1de00
* libcamera2ndk_vendor: Add missing physicalCameraSettings metadata in saved ↵Jayant Chowdhary2019-05-091-7/+19
| | | | | | | | | | | | cached CaptureRequest metadata. Bug: 131925326 Test: AImageReaderVendorTest; test using vendor process using libcamera2ndk_vendor Change-Id: Ie86ec7f070e985121cdc89367bb0d4b227b41985 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* libcamera2ndk_vendor: Fix potential use after free of camera_metadata_tJayant Chowdhary2019-05-093-13/+14
| | | | | | | | | | | Bug: 131566406 Test: Use libcamera2ndk_vendor multiple times without seeing logs / assertions indicating null metadata / corrupted metadata in allocateACaptureRequest. Change-Id: I2154a83bb97a4dd945f15328769b811e9485a0ac Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* camera2 vndk: Add ACameraMananger_getTagFromName.Jayant Chowdhary2019-04-246-0/+71
| | | | | | | | | | | | | | | In some situations, clients of the vndk might need to be able to query tags at runtime, based on tag names. For example, when client hals are de-coupled from the camera HAL. Bug: 131093919 Test: AImageReaderVendorTest Test: Modify AImageReaderVendorTest to retrieve vendor tags given their names, using ACameraMetadata_getTagFromName Change-Id: I1cdec5b154037185e99d29be2c6890e4fdc4a32a Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* Merge "Camera: Relax BURST_CAPTURE requirement" into qt-devTreeHugger Robot2019-04-241-7/+8
|\
| * Camera: Relax BURST_CAPTURE requirementShuzhen Wang2019-04-221-7/+8
| | | | | | | | | | | | | | | | | | Allow resolutions larger or equal to 24 megapixels to stream at 10fps to meet BURST_CAPTURE requirement. Test: Build Bug: 129693371 Change-Id: I8f53b6a6f725e11d9deb1505d9d63d142e971006
* | camera2 vndk: Don't try to retrieve ACameraDevice in CallbackHandler.Jayant Chowdhary2019-04-192-8/+12
|/ | | | | | | | | | | | | Its possible that the device is closing, however, it hasn't stopped its looper yet. In that case, if we receive a callback, we'll receive a null ACameraDevice. Cache the camera id during CallbackHandler's construction instead, like the ndk does. Bug: 130910407 Test: AImageReaderVendorTest Change-Id: Ia7cd40ff1ce4fe52abb5528c68e3557523a5367d Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* Merge "Camera: Clarify multi-camera RAW and FOV behaviors" into qt-devTreeHugger Robot2019-04-171-0/+18
|\
| * Camera: Clarify multi-camera RAW and FOV behaviorsShuzhen Wang2019-04-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - RAW capability can exist for multi-camera even if physical cameras are of different sizes/capabilities. - FOV for all processes streams must be the same regardless of logical or physical streams. - All metadata tags related to pixelArray/preCorrectionActiveArray/activeArray needs to be mapped properly by the camera HAL. - Do distortion correction mapping for physical subcamera as well. Test: Build and read docs, camera CTS, ITS. Bug: 118906351 Bug: 126220135 Change-Id: I29a61fc3a603561c1d74dc2261600ce4cd3d34cd
* | Merge "Camera: Document LEGACY devices not being allowed on new devices" ↵Eino-Ville Talvala2019-04-121-0/+1
|\ \ | |/ |/| | | into qt-dev
| * Camera: Document LEGACY devices not being allowed on new devicesEino-Ville Talvala2019-04-111-0/+1
| | | | | | | | | | | | Bug: 130315905 Test: Builds Change-Id: Ia1380344ba73216eaf078f2480ce278e99c03820
* | Merge "camera2 ndk: Move check for ndk support for capabilities from a ↵Jayant Chowdhary2019-04-052-13/+5
|\ \ | | | | | | | | | white-list to a black-list." into qt-dev
| * | camera2 ndk: Move check for ndk support for capabilities from a white-list ↵Jayant Chowdhary2019-04-042-13/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | to a black-list. Bug: 129979644 Test: Fake SECURE_IMAGE_DATA by updating camera characteristics in cameraserver; Retrieve capabilities in AImageReader test and confirm that SECURE_IMAGE_DATA is supported Test: AImageReaderVendorTest Change-Id: Ia105969ce1df52408e6b7663a658d89f47cd90c2 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* / Camera NDK: document not all cameras are supportedYin-Chia Yeh2019-04-041-0/+5
|/ | | | | | | | | Test: check html output of: frameworks/native/doc/make website (with a tweak in Doxyfile to add "__ANDROID__API__=24" to PREDEFINED) Bug: 120916880 Change-Id: Idf93a13b9bbe2974fa4256de1f3ca67b7eee1bb6
* Merge "Camera: add QCIF resolution exception" into pi-devYin-Chia Yeh2019-04-042-1/+15
|\ | | | | | | | | | | am: b94a3d3e54 Change-Id: I53511f3350360c8b75aaa7c3f481235beadb09b9
| * Camera: add QCIF resolution exceptionYin-Chia Yeh2019-04-012-1/+15
| | | | | | | | | | | | | | Test: checkbuild Bug: 120158047 Bug: 122461651 Change-Id: Ic7ed2e3a93278fbc95e7c6edd7eb6c35a38e1f4d
* | Merge "Camera: Relax logical camera stream combination requirement"TreeHugger Robot2019-04-031-26/+19
|\ \
| * | Camera: Relax logical camera stream combination requirementShuzhen Wang2019-03-261-26/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logical camera now doesn't mandate concurrent physical streams combination. Instead, require is_stream_combination_required to query whether such a combination is supported by HAL. Test: Camera CTS, ITS Bug: 119325664 Change-Id: I8ea7abc6fe1e34e687e86dcd1e7529d030bcc71a
* | | Merge "camera2 vndk: Initialize uninitialized members of OutputConfiguration ↵Jayant Chowdhary2019-04-022-2/+9
|\ \ \ | | | | | | | | | | | | in wrapper constructor."
| * | | camera2 vndk: Initialize uninitialized members of OutputConfiguration in ↵Jayant Chowdhary2019-03-282-2/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | wrapper constructor. Test: AImageReaderVendorTest Change-Id: Ia612e68680c307c8a1b635893173a2fcd0f3d213 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* | | Merge "Remove subdirs from Android.bp"TreeHugger Robot2019-04-011-2/+0
|\ \ \
| * | | Remove subdirs from Android.bpPawin Vongmasa2019-03-281-2/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | subdirs is meaningless now. Test: Builds Bug: 129513796 Change-Id: I60130e38b5924b73c5520d884868dd580f5345bf
* | | Merge "Camera: Include the physical camera device during errors"TreeHugger Robot2019-04-018-11/+198
|\ \ \ | |/ / |/| |
| * | Camera: Include the physical camera device during errorsEmilian Peev2019-03-228-11/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The physical camera device ID must be present as part of the capture result extras in case of corresponding result failure notification. Bug: 128835627 Test: Camera CTS, AImageReaderVendorTest --gtest_filter=AImageReaderVendorTest.LogicalCameraPhysicalStream Change-Id: I042af8bd85eaadd389b059c2833f352ceb2f40fc
* | | Camera: Add isSessionConfigurationSupported in NDK/VNDKShuzhen Wang2019-03-209-1/+172
| | | | | | | | | | | | | | | | | | Test: NativeCameraDeviceTest and AImageReaderVendorTest Bug: 128933069 Change-Id: I26ca4c0ca12f7bd1b872c2f33e8fa63a056ae068
* | | Camera: Add low latency snapshot use case idEmilian Peev2019-03-151-9/+23
|/ / | | | | | | | | | | | | | | | | | | Additionally initializey the stream id to invalid negative value in case the Hal tries to verify it during stream combination queries. Bug: 128450197 Test: Camera CTS Change-Id: Ife058e22ef72ee84be82799ed397ca49cd8ea99f
* | Merge "Camera: Add NDK support for camera permission update callbacks"TreeHugger Robot2019-03-126-5/+236
|\ \
| * | Camera: Add NDK support for camera permission update callbacksEmilian Peev2019-03-086-5/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | Camera NDK clients must receive notifications about access permission changes. Bug: 121379978 Test: Camera CTS Change-Id: I66866ee3bbf7d45619995f036f19af50e812c236
* | | Merge "camera2 ndk: Add some null checks before dereferencing ↵Jayant Chowdhary2019-03-121-3/+9
|\ \ \ | | | | | | | | | | | | captureSequenceId."
| * | | camera2 ndk: Add some null checks before dereferencing captureSequenceId.Jayant Chowdhary2019-03-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: AImageReaderVendorTest Change-Id: Icdb11569305cdbf4e4f9c791b306292e46395271 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>