summaryrefslogtreecommitdiff
path: root/devices
AgeCommit message (Collapse)Author
2020-06-23Allow getConcurrentStreamingCameraIds to advertise depth only cameras.Jayant Chowdhary
Also fix SupportsMandatoryStreamCombination check Bug: 159247271 Test: atest ConcurrentCameraTest.java Change-Id: I5cb1ee3a7b9106c29ad9558ab8f4f2b68e946efb Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-05-22Merge "EmulatedCamera: Do not send ERROR_BUFFER in case of ERROR_REQUEST" ↵TreeHugger Robot
into rvc-dev
2020-05-21EmulatedCamera: Do not send ERROR_BUFFER in case of ERROR_REQUESTShuzhen Wang
Per HAL spec, in case the request is marked as ERROR_REQUEST, do not send ERROR_BUFFER. Test: Camera CTS Bug: 155353799 Change-Id: I9b6bdca4ada611f3d41fec654849409de78f1f73
2020-05-15EmulatedCamera: Avoid event queue setup in scene constructorEmilian Peev
The sensor event manager can in theory trigger event callbacks at any time after the event queue initialization. If an event is triggered before the scene strong pointer is incremented by the emulated sensor, then the event handler will promote its weak pointer and be able to release the emulated scene instance. This code path will eventually result in instability within the reference counting logic which does not expect to receive and work with an invalid scene instance. Avoid this possibility by removing the event queue initialization from the scene constructor. Bug: 156682736 Test: Camera CTS Change-Id: I2637504ca58d6ac84628444f31dacca971558a51
2020-05-14Adds libgralloctypes to libgooglecamerahwl_implJason Macnak
... which is a new dependency of android.hardware.camera.common@1.0-helper. Bug: b/146515640 Test: m Change-Id: Id59636314acb68c6135b87899e174cf39e1d699a
2020-05-14Merge "Update emulated camera to use gralloc lock w/ region" into rvc-devJason Macnak
2020-05-13Merge "Import gralloc buffers before use in EmulatedCamera" into rvc-devJason Macnak
2020-05-13Merge "Lock gralloc buffers with SW_READ/SW_WRITE usage" into rvc-devJason Macnak
2020-05-13Update emulated camera to use gralloc lock w/ regionJason Macnak
Gralloc buffers should be locked using proper regions. Prior to this change, the emulated camera would try to lock 2D Y16 buffers using a [total-byte-size,1] rectangle. Cuttlefish's existing gralloc implementation does not perform any validation on the supplied region. Cuttlefish is updating its gralloc implementation to gralloc 4.0 on Minigbm which will start performing more validation including validation the lock access region. Bug: b/146515640 Test: cts -m CtsCameraTestCases Change-Id: I35bc2c83d3ebbb59283122e1df6b87436427f974
2020-05-13Lock gralloc buffers with SW_READ/SW_WRITE usageJason Macnak
EmulatedCameraDeviceSessionHwlImpl::ConfigurePipeline will default some buffers to GRALLOC_USAGE_HW_CAMERA_[READ|WRITE]. This worked with existing Cuttlefish gralloc which ignored usage flags and just always mmap'ed with PROT_READ|PROT_WRITE. With upgrading Cuttlefish to Gralloc4 on Minigbm, the lack of SW_READ|SW_WRITE will result in nothing being mmap'ed and a nullptr will be returned from lock. Bug: b/146515640 Test: cts -m CtsCameraTestCases Change-Id: If308dc3037bb57becb7c44f997256ad65330c682
2020-05-13Import gralloc buffers before use in EmulatedCameraJason Macnak
From mapper documentation: " A raw buffer handle must not be used to access the underlying graphics buffer. It must be imported to create an imported handle first. " Without this change, attempts to lock the stream buffers fail when using Minigbm on Gralloc4 as the buffers were never imported and Minigbm doesn't have some state initialized for each buffer. This worked previously because existing Cuttlefish gralloc didn't check or enforce this requirement. Bug: b/146515640 Test: cts -m CtsCameraTestCases Change-Id: I0f71e02833399af0719c88755b13069272b60431
2020-05-13Fix CaptureDepth stride usageJason Macnak
CaptureDepth should convert the img uint8_t* to uint16_t* after applying the stride offset to avoid doubling the amount offset. Bug: b/146515640 Test: cts -m CtsCameraTestCases -t testDepth16 Change-Id: Ic2f47341b6545b1af0285a9dedcb522944bf698a
2020-05-11EmulatedCamera: Pass dedicated sensor handler to sensor managerEmilian Peev
Passing a direct 'EmulatedScene' reference to sensor manager can extend its lifetime and prevent 'EmulatedSensor' from releasing the sensor event queue resources. Avoid this by using a dedicated sensor event handler which will not interfere with the scene lifetime. Additionally correct possible invalid access during sensor start up. Bug: 156290263 Test: Camera CTS Change-Id: I32c178650584bc51468ebc663edc57c0ce6761d2
2020-05-05camera: add zoom ratio mapper in HWLtimothywang
The vendor tags of extend face detect mode are defined in HWL and can not be accessed in GCH. Add zoom ratio mapper in HWL to support extend face detect mode coordinate conversion. Test: GCA, DevCam Bug: 153631046 Bug: 153199477 Bug: 154842399 Change-Id: I91edaab7c971917233f02d6604bbe782e6de567d Merged-In: I91edaab7c971917233f02d6604bbe782e6de567d
2020-04-28Merge "EmulatedCamera: Emulate sensor orientation" into rvc-devTreeHugger Robot
2020-04-11Merge "EmulatedCamera: Test bokehMode with zoomRatioRange of [2.0, 2.0]" ↵TreeHugger Robot
into rvc-dev
2020-04-10EmulatedCamera: Emulate sensor orientationEmilian Peev
The physical camera device orientation must be emulated by deducing the device screen rotation and rotating the emulated scene according to the sensor orientation and facing. Bug: 143493212 Test: Manual using Android Emulator sensor support, Camera CTS Change-Id: Iebd2c544c702c10ae92add3486b9f083aafe71df
2020-04-08EmulatedCamera: Emulate edge enhancement modeEmilian Peev
Disable high-speed yuv processing in case clients request high quality edge enhancement. Bug: 143493216 Test: Manual using camera application, Camera CTS Change-Id: Id7c1fe1e708989fe7bed430ae1e6ffdcd4498c49
2020-04-08EmulatedCamera: Emulate video stabilizationEmilian Peev
Control scene handshake by using the video stabilization parameters. Bug: 143493216 Test: Manual using TestingCamera, Camera CTS Change-Id: I5b91c2f6dd46a13becb4cca470f782543f0b0534
2020-04-06EmulatedCamera: Test bokehMode with zoomRatioRange of [2.0, 2.0]Shuzhen Wang
Test: Camera CTS Bug: 153377715 Change-Id: I3082cc5f9a35c354c381eb26ab56c7c5e1e72002
2020-03-23Merge "EmulatedCamera: Ignore unavailable physical devices" into rvc-devTreeHugger Robot
2020-03-20EmulatedCamera: Ignore unavailable physical devicesEmilian Peev
The logical camera state must not depend on physical devices that were flagged as not present. Bug: 148823889 Test: Camera CTS Change-Id: I7b49e5aa07dd6dd003df754bf307d959948f9439
2020-03-19EmulatedCamera: Migrate BOKEH_MODE to extended scene modeShuzhen Wang
Migrate BOKEH_MODE_STILL_CAPTURE and BOKEH_MODE_CONTINUOUS to be 2 enums of CONTROL_EXTENDED_SCENE_MODE. Test: Camera VTS and CTS Bug: 151109028 Change-Id: I0b122f1b64c27a226d02bb2b85ec28416e12de5e
2020-02-03EmulatedCamera: Add minimal rotateAndCrop support for physical cameraEmilian Peev
A third hidden physical camera added recently is missing rotate and crop capability. This can result in logical camera failures during request processing. Bug: 148820498 Test: atest cts/tests/camera/src/android/hardware/camera2/cts/FastBasicsTest.java Change-Id: Idc990ab0c6c6a002f43019e205723e8a7b271e2f
2020-02-03Merge changes from topic "CameraProvider26"TreeHugger Robot
* changes: EmulatedCamera impl for concurrent streaming query apis. GCH : Add apis and skeleton impl for querying concurrent camera streaming support. camera HAL provider 2.6: Add methods to query concurrent streaming support. EmulatedCamera: Add an unavailable physical camera GCH: Uprev camera provider to 2.6 hwl interface GCH: Uprev camera provider to 2.6 hidl interface
2020-02-03EmulatedCamera impl for concurrent streaming query apis.Jayant Chowdhary
Bug: 77960042 Test: builds Test: CTS ConcurrentCameraTest Change-Id: I9a8cbf6f6810e998a095d1758b253d8b6684141c Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-01-31EmulatedCamera: Add minimal support for rotate and crop on front cameraEmilian Peev
Enable minimal rotate and crop result reporting for the front camera. Bug: 148666803 Test: Camera CTS Change-Id: Ic28d80ab4506e85f16d3153de3d966ffafb43079
2020-01-29EmulatedCamera: Add an unavailable physical cameraShuzhen Wang
This is used to simulate a foldable logical multi-camera with one of its physical cameras unavailable to use. Test: Cuttlefish Camera CTS Bug: 148181647 Change-Id: Ic843cccc4a6784d54e4a5ef0c87de9efcee140e5
2020-01-24Merge "Emulator camera: Add ROTATE_AND_CROP support"Eino-Ville Talvala
2020-01-21Emulator camera: Add ROTATE_AND_CROP supportEino-Ville Talvala
Support SCALER_ROTATE_AND_CROP_NONE, 90, and AUTO on the back camera, for YUV_420_888 and JPEG outputs. Test: Manually viewing camera output with rotation forced on, new CTS tests pass Bug: 134631897 Change-Id: I52a0650a8133c649e8dd317861557489b9f32ea8
2020-01-20EmulatedCamera: Clamp U/V planes during encodingEmilian Peev
The jpeg encoder will process the input YUV in batches. The height can be padded at the end so it can be aligned with the batch size. The padding must consist of the very last line of the respective input buffer plane. This requirement must be fulfilled for all planes including U/V. Test: Camera CTS Bug: 148018763 Change-Id: I47a1e28d9a29db82a27a93b349ac03aed5aa1b3b
2019-12-19Merge "camera: move IsReconfigurationRequired API implementation to HWL"Vince Chiu
2019-12-19camera: move IsReconfigurationRequired API implementation to HWLvincechiu
Bug: 134698399 Test: Pixel 4 Camera Test Checklist Change-Id: I70b3710d695286577eb989f611cd061cbb4412f1
2019-12-11EmulatedCamera: Add zoom ratio supportShuzhen Wang
- Add zoom ratio support for both front and back cameras - Add zoom ratio ranges for bokeh modes - Handle zoom ratio withn EmulatorSensor to output zoomed image Test: testZoomRatio, testBokehModes, manual testing of zoom Bug: 130025314 Change-Id: I55f35d3769a2975a057f00eda73608e9e053b2cd
2019-11-25hardware: google: camera: fix -Wreorder-init-listNick Desaulniers
C++20 will require members in a designated initializer to be in order unlike C99. Bug: 139945549 Test: lunch sdk_gphone_x86_64-userdebug && mm Change-Id: I48ce873181cc3af3d29346021636853476664f53 Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-20Revert "Revert "EmulatedCamera: Enable HWL build""Cheng Gu
Adds Android.bp back since the dependencies are now available. Removes Android.mk. This partially reverts commit bd55753 and partially reverts commit 081b4bb. devices/EmulatedCamera/ now adds its own soong_namespace, to avoid collision for those projects that import both "vendor/google/camera" and "hardware/google/camera". Bug: 142565658 Test: build success Change-Id: I92ea6338682471feb4f8771c1bb88b869e2a5309
2019-11-14Integrate Emulator Legacy Camera HAL with Google Camera HALHuan Song
Android Studio Emulator supports fake, web and AR cameras. This CL enables GCH to creates Fake cameras based on property qemu.sf.fake_camera, and legacy camera hal creates the web and AR cameras. Bug: 142084574 Bug: 131342297 Test: Test camera preview/take picture/recording with settings: Front Back emulated emulated emulated webcam0 emulated virtualscene webcam0 emulated webcam0 virtualscene Test: Camera CTS using front camera only Change-Id: Ibbe461b7c309ae929f39ccd119326ce35704833b
2019-10-30EmulatedCamera: Add basic Bokeh supportShuzhen Wang
Add basic bokeh support for back and front cameras. Currently only hook up static metadata as well as request/result handling. No bokeh effect is generated. Test: Camera CTS, CtsVerifier Bug: 118258123 Change-Id: Ie05c72a666ce69417c03b4d7c8f3ec90c5f6566d
2019-10-29EmulatedCamera: Return expected error statusEmilian Peev
Correct error status in case we have: - Invalid physical device characteristics query. - Blob stream combination with unknown usage. Bug: 143568228 Test: VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest --hal_service_instance=android.hardware.camera.provider@2.4::ICameraProvider/internal/0 Change-Id: I49d0160e0b1f639ccfedccda91f3e75263e12efb
2019-10-29EmulatedCamera: Fix error logEmilian Peev
Bug: 131342297 Test: Successful build Change-Id: I7892f3f4dbea0e88039b64e1bd21767276c9eaa3
2019-10-28EmulatedCamera: Enable HWL buildEmilian Peev
Enable HWL library builds only on Cuttlefish targets. Bug: 131342297 Test: Successful build Change-Id: I5ed094d67619b5d3fe49a811cef906172b2ce991
2019-10-28Revert "Revert "EmulatedCamera: Logical camera support""Emilian Peev
This reverts commit 039234a023ef7623da93459542d5c5c1a35d0364. Bug: 131342297 Test: Successful build Change-Id: I964a9f93f8201a0996301e3b27e786493dfbb454
2019-10-26Revert "EmulatedCamera: Logical camera support"Raman Tenneti
This reverts commit c33679b04d723ee7be969fbb795ee307460f86ea. Reason for revert: Bug: 143386091 - broken builds on git_master-without-vendor Change-Id: Ibfe5cdab828a26e517404bf4c7650252aafbb02d
2019-10-25EmulatedCamera: Logical camera supportEmilian Peev
Emulate logical camera device backed by two physical cameras with varying focal length. The active device will be set according to the focal length in the client request. Additionally rename the configuration files to be more descriptive. Bug: 131342297 Test: Camera CTS Change-Id: I6a22b9bf594f6cbb30ca9c2181c010eeb4b27c60
2019-10-23EmulatedCamera: Incorporate review feedbackEmilian Peev
Includes following suggested modifications: - Shared data access with atomic variables - Toggle extra Jpeg error logs - Use reentrant 'rand' variant. - Correct the handling of some error cases, typos, long descriptions etc. Bug: 131342297 Test: Camera CTS Change-Id: I08e9d464f78385b5d370b0845ed1cc9c95d5d149
2019-10-23EmulatedCamera: Add support for semi-planar YUV processingEmilian Peev
The camera output and input YUV420_888 buffers can support both planar and semi-planar layouts. Unfortunately 'libyuv' only supports the planar variant natively. Handle the semi-planar case by splitting and merging the U/V plane accordingly. Bug: 141251857 Bug: 131342297 Test: Manual using Emulator build and Camera2, TestingCamera, TestingCamera2 and ZSLDemo Change-Id: I6c46d01d5d7659008c377c31f3a436f9dac4ecb2
2019-10-23EmulatedCamera: Switch code styleEmilian Peev
The implementation style must be consistent with the HWL style. As a reference use the Google C++ derived template in '.clang_format' instead of the usual Android C++ style. Also add pre-upload configuration. Bug: 131342297 Test: Camera CTS Change-Id: I84cc016957879663a8dc0eba97632adc8652d31a
2019-10-11EmulatedCamera: Enable Level 3 device supportEmilian Peev
Add complete RAW capability support which along with reprocessing allows emulating HW level 3 devices. Bug: 131342297 Test: Camera CTS Change-Id: I95e22b3ef7d6897207e69c505784c4697ccfe932
2019-10-11EmulatedCamera: Add Private&YUV reprocess supportEmilian Peev
Enable private and yuv reprocess. Additionally switch the BLOB output entirely to the new YUV pipeline. Bug: 131342297 Test: Camera CTS, Manual using ZSL Demo application Change-Id: I6430842bf218278401b4605e850368ad4368552b
2019-10-11EmulatedCamera: Enable flashEmilian Peev
Enable torch callbacks and appropriate flash states. Bug: 131342297 Test: Camera CTS, Camera VTS Change-Id: Icda82e08e82af8766d407f61f4bce27cc26fb921