Commit graph

691 commits

Author SHA1 Message Date
Jasmine Chen
ecd3296f1e Camera: Fix double-free in removeCamera
When a camera is removed, |hidlMetadata| takes over ownership of
|metadata|. Therefore, we should not free |metadata| again.

Bug: 180014486
Test: Remove an external camera, and no crashes were observed.
Marged-In: I85246067f8753911cbcb58af24a46f12962226f3
Change-Id: I85246067f8753911cbcb58af24a46f12962226f3
(cherry picked from commit f36a439e3a97315a9f0a8661ea77aff61fb79c82)
(cherry picked from commit 682abf4039)
2021-03-02 21:06:15 +00:00
Pierce Huang
b2bb987951 Camera: Set arbitrary dataspace for RAW streams
Use 'arbitrary' dataspace when trying to configure RAW streams.

Bug: 179158925
Test: pass vts with VtsHalCameraProviderV2_4TargetTest
Change-Id: I6360e4a459ae51af4898a7329fe31ded152efe8f
2021-02-04 11:44:08 +08:00
TreeHugger Robot
25f8e687ba Merge "Camera: fix HAL1 removeCamera crash" into rvc-qpr-dev 2020-12-03 22:13:27 +00:00
Yin-Chia Yeh
de05fd53f4 Camera: fix HAL1 removeCamera crash
Test: partner testing
Bug: 173511749
Merged-In: Ifd5fc7c63e3835945194291d161b491bd5acb342
Change-Id: Ifd5fc7c63e3835945194291d161b491bd5acb342
2020-12-03 11:29:04 -08:00
Jayant Chowdhary
ef9374cb20 Camera HAL Vts : Fix usage flag combination during gralloc allocation.
Earlier, for processCaptureRequestInternal, we took into account
producer and consumer usage flags returned by configureSingleStream.
Instead we should be taking into account the producer flag returned by
configureSingleStream and the consumer flag passed into
processCaptureRequestInternal (for output streams).

Bug: 162344072

Test: Use secure camera as secure only camera and run vts
Test: Run camera vts
Test: Vendor testing

Change-Id: I9fbd4db4cff48c25684f097907e7ba995c3edf41
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-07-28 19:18:00 +00:00
TreeHugger Robot
ef7bf24010 Merge "Camera: fix the VTS test timeout to be 30min" into rvc-dev 2020-06-30 18:01:02 +00:00
Yin-Chia Yeh
f65225671c Camera: fix the VTS test timeout to be 30min
Test: test failure is gone
Bug: 159413657
Change-Id: Id1a350081241910463614960c6fdda3d7e32eddc
2020-06-29 09:45:03 -07:00
Jayant Chowdhary
6a9a809e36 camera : Allow non bc camera devices through getConcurrentStreamingCameraIds
Also Add y16 stream combinations to configureConcurrentStreamsAvailableOutputs vts test

Bug: 159247271

Test: VtsHalCameraProviderV2_4TargetTest
      --gtest_filter=PerInstance/CameraHidlTest.configureConc* on
      cuttlefish

Change-Id: If5fea1fc47a3bcc8d3695e23f01a55091c246eda
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-06-24 12:42:49 -07:00
TreeHugger Robot
7e5c3f0240 Merge "Camera: Fix insensitive language in comments and names" into rvc-dev 2020-06-21 22:53:20 +00:00
Eino-Ville Talvala
d6346872c6 Camera: Fix insensitive language in comments and names
Test: Builds
Bug: 159480149
Change-Id: Ic048071867b69e5c2d337f59f697980a6a64587f
2020-06-19 15:25:01 -07:00
Shuzhen Wang
ce9d001076 Camera: Allow HAL not call notify() with ERROR_BUFFER
The new framework implementation derives capture buffer loss
notification from other information, and treats HAL notify() with
ERROR_BUFFER as no-op.

Test: Build
Bug: 155353799
Change-Id: Ia7ea52ee2750c7404b657467e1cfda4c05e6cc78
2020-06-17 23:34:16 -07:00
TreeHugger Robot
0e6850ee68 Merge "Camera: add new VTS test config file" into rvc-dev 2020-06-12 18:09:29 +00:00
Jayant Chowdhary
416e3d94f9 Merge "Add some updates to documentation regarding concurrent camera operation." into rvc-dev 2020-06-11 20:25:10 +00:00
Jayant Chowdhary
ed8ec83813 Add some updates to documentation regarding concurrent camera operation.
- Add documentation about giving hints to camera HAL about concurrent
  operation before configuring sessions

- Limitations on ZOOM_RATIO_RANGE during concurrent operation.

Bug: 151891611

Test: builds

Change-Id: I79d0bd8be1ed9aa29a1ba080d01833f16eff580c
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-06-10 20:07:07 -07:00
Yin-Chia Yeh
12ef3c9929 Camera: add new VTS test config file
The old config file is no longer being used. Adding new config
file that has the proper 30 minutes timeout.

Test: atest VtsHalCameraProviderV2_4TargetTest on Pixel 4
Bug: 156007290
Change-Id: I97b0fff967f87712f8f96ed06b628c70ad30dde4
2020-06-09 14:15:52 -07:00
Shuzhen Wang
ee71769ebc Merge "Camera: Clarify ERROR_REQUEST callback" into rvc-dev 2020-06-08 19:07:04 +00:00
Jayant Chowdhary
ec37ce4947 Merge changes from topic "vts-secure-only-camera" into rvc-dev
* changes:
  Camera VTS: Add a minimal test for secure only cameras.
  camera vts: Skip regular vts tests for secure only cameras.
2020-06-01 22:52:53 +00:00
Shuzhen Wang
643dd41944 Camera: Clarify ERROR_REQUEST callback
Allow partial result to be generated in the case of ERROR_REQUEST.

Test: Build
Bug: 155353799
Change-Id: I6ade958cac773e854d669aec3caf99191a875ec7
2020-06-01 12:28:28 -07:00
Jayant Chowdhary
a80974ca8c Camera VTS: Add a minimal test for secure only cameras.
Bug: 156749607

Test: VtsHalCameraProviderV2_4TargetTest
      --gtest_filter=PerInstance/CameraHidlTest.processSecureCaptureRequest* on device which
      SECURE_IMAGE_DATA.

Change-Id: I57f6210b69b383dc4f43cc4ee8272050a0432541
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-06-01 12:15:58 -07:00
Jayant Chowdhary
83b724a23f camera vts: Skip regular vts tests for secure only cameras.
Bug: 156749607

Test: fake mark a camera id as a secure only, see that it doesn't get
      tested unless a test calls getCameraDeviceNames with addSecure = true

Test: VtsHalCameraProviderV2_4TargetTest passes on device without any secure only
      cameras

Change-Id: Ibe428b663bd8024f46f0273ed5dfaa108a90dd43
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-06-01 12:14:47 -07:00
Shuzhen Wang
1d4e72f387 Camera: Allow maxDigitalZoom to be less than maxZoomRatio
For concurrent camera, we allow the maximum digital zoom to be smaller
than the maximum zoom ratio. Adjust VTS test accordingly.

Test: camera VTS test
Bug: 151891611
Change-Id: I1d3813ed93faa83689dcb6a83490fae5581c602f
2020-05-27 12:04:38 -07:00
Jason Macnak
2540a38771 Merge "Implement lockYCbCr stub for Mapper 4.0" into rvc-dev 2020-05-14 21:06:54 +00:00
Eino-Ville Talvala
6d9c200198 Merge "Camera: Update documentation for rolling shutter skew" into rvc-dev 2020-05-14 16:49:42 +00:00
Eino-Ville Talvala
34bb3064fe Camera: Update documentation for rolling shutter skew
Existing definition was inconsistent, so update it to be consistent
and match what implementations have actually done.

Test: Builds
Bug: 150331548
Change-Id: I5dfbe7c802bf4ac98f0c5556d5ac3af5d79cff7a
2020-05-13 21:13:20 +00:00
Jason Macnak
eda6dca45c Implement lockYCbCr stub for Mapper 4.0
(Includes bpfmt changes from repo hook)

Bug: b/146515640
Test: cts -m CtsCameraTestCases
Change-Id: Ibd882db1883e0976c2baf95257e51c29de6e6853
2020-05-12 11:40:20 -07:00
Jason Macnak
f2c9ed1309 Adds a lock method to HandleImporter w/ access region
... to allow locking 2D regions of non-BLOB buffers.

Bug: b/146515640
Test: cts -m CtsCameraTestCases
Change-Id: Ia68abf96ffe15891520833921e103efa3f7a80c5
2020-05-12 11:33:55 -07:00
TreeHugger Robot
7b938e3471 Merge "Camera: move preCorrectionActiveArraySize override to cameraserver" into rvc-dev 2020-05-04 05:28:39 +00:00
Suren Baghdasaryan
608059a6bc Replace direct pid writes with setting task profiles for camera interfaces
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I2732f7365351f132dbf0566319e3969c2a25b3e4
Merged-In: I2732f7365351f132dbf0566319e3969c2a25b3e4
2020-05-02 00:34:24 +00:00
Shuzhen Wang
75b0f0288c Camera: move preCorrectionActiveArraySize override to cameraserver
This is to handle the case where HAL isn't using the hidl shim.

Test: dumpsys on Pixel 2
Bug: 145300768
Change-Id: I74874a025904887cc27ec00518f4261dd24e291a
2020-05-01 11:59:10 -07:00
TreeHugger Robot
253be8a6b4 Merge "vts camera characteristtics: add tests for system camera restrictions." into rvc-dev 2020-04-28 19:18:34 +00:00
Jayant Chowdhary
7612f161a7 vts camera characteristtics: add tests for system camera restrictions.
The system camera kind of physical cameras which are public, should be the same as the
system camera kind of the logical cameras they back.

The system camera kinds of all logical cameras that share the same
hidden physical cameras must be the same.

Bug: 152053830

Test: VtsHalCameraProviderV2_4TargetTest
      --gtest_filter=PerInstance/CameraHidlTest.getCameraCharacter*

Test: VtsHalCameraProviderV2_4TargetTest
      --gtest_filter=PerInstance/CameraHidlTest.systemCamera*

Change-Id: Iba07a6aa4a5fb465e9e0c4d0adedf6becaba7d14
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-04-28 10:32:06 -07:00
Dan Shi
aad51fa000 Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 16:37:40 -07:00
TreeHugger Robot
42b7037739 Merge "Camera: Update metadata docs to match current API" into rvc-dev 2020-03-24 18:41:45 +00:00
Jayant Chowdhary
9b56a5a538 Merge "Clarify getConcurrentStreamingCameraids may return hidden physical camera ids as well." into rvc-dev 2020-03-23 03:01:23 +00:00
TreeHugger Robot
ed52cf6f83 Merge "Camera: Migrate BOKEH_MODE to EXTENDED_SCENE_MODE" into rvc-dev 2020-03-21 04:25:09 +00:00
Jayant Chowdhary
61c3ac2a69 Clarify getConcurrentStreamingCameraids may return hidden physical camera ids as well.
Bug: 151891611

Test: builds

Change-Id: I889065b379d9966e9cc8a225fb335685f2f065cd
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-03-20 16:25:05 -07:00
Eino-Ville Talvala
4befcfdddb Camera: Update metadata docs to match current API
Test: Builds
Bug: 150036107
Change-Id: I3e5321e91458d980ad96d3665d9f11bbafb047f1
2020-03-20 15:42:16 -07:00
TreeHugger Robot
104fe8332f Merge "Camera: Avoid adding uninitialized hal requests" into rvc-dev 2020-03-20 17:59:15 +00:00
Shuzhen Wang
acf026ec78 Camera: Migrate BOKEH_MODE to EXTENDED_SCENE_MODE
Migrate BOKEH_MODE_STILL_CAPTURE and BOKEH_MODE_CONTINUOUS to be 2 enums
of CONTROL_EXTENDED_SCENE_MODE.

Test: VtsHalCameraProviderV2_4TargetTest
Bug: 151759402
Change-Id: I4ee88ab550902edadbd8dc446677c5a02ea582cb
2020-03-19 09:49:03 -07:00
Anton D. Kachalov
34cdbcde50 Camera: Advertise numbered string ID for external cameras
With current implementation cameraId is part of something like:

  device@3.5/external//dev/video0

This doesn't work well with Camera2 API based apps.

Adding CameraIdOffset tag to Provider as a base offset.

Test: presubmit builds
Bug: 151350336

Merged-In: I6309d16be565616f048fb24a70e9be5b2f5ed480
Change-Id: I6309d16be565616f048fb24a70e9be5b2f5ed480
(cherry picked from commit 4f6022ae5d)
2020-03-12 21:21:09 +00:00
Automerger Merge Worker
098aae3c96 Camera: Fix possible ExifUtils heap corruption am: aa5673385a am: 711ebe64dd am: f4481c4d98
Change-Id: I4b5e0308f7a5af5e0aaa4b85e458f0e90b4fac7b
2020-03-04 18:28:55 +00:00
Automerger Merge Worker
711ebe64dd Camera: Fix possible ExifUtils heap corruption am: aa5673385a
Change-Id: I209742be498ea65b6763cf673514e74241b75717
2020-03-04 17:58:31 +00:00
Jayant Chowdhary
7d69fc8ffa camera: Add more VTS tests for ICameraProvider@2.6
Add initial test exercising getConcurrentStreamingCameraIds() and
isConcurrentSessionConfigurationSupported()

Bug : 148180006

Test: VtsHalCameraProviderV2_4TargetTest --gtest_filter=PerInstance/CameraHidlTest.configureConc*
      on cuttlefish

Change-Id: If3821ba5452d487e9a0d83d01e2da86ddf509b50
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-03-02 00:15:00 -08:00
Emilian Peev
36aa827f70 Camera: Avoid adding uninitialized hal requests
The offline requests deque is constructed with
specific amount of entries. Initialize the
the already allocated entries before pushing
new ones.

Bug: 149346795
Test: Camera CTS
Change-Id: I6db8d48949caf753429702b60c48698c95ecf4ad
2020-02-26 16:41:57 -08:00
Jayant Chowdhary
6ae828b6f0 ICameraProvider@2.6: Add documentation about resource cost constraints for concurrent camera combinations.
- Also clarify requirements for MONOCHROME devices supporting Y8 outputs.

Bug: 150225538

Test: builds (doc change only)

Change-Id: I992f1bcee4bf266b6e66ddb32ece8291381c8e56
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-02-26 22:44:00 +00:00
Yin-Chia Yeh
6e082e8581 Camera: clarify depth camera requirement for OFFLINE_PROCESSING
Test: build (doc only change)
Bug: 135142453
Change-Id: I48589e6f7fad6ff291a57de305b4a549dbb843b2
2020-02-20 22:44:27 +00:00
Jayant Chowdhary
3a0030faab ICameraProvider@2.6 : Update documentation for getConcurrentStreamingCameraIds.
Bug: 148995918

Test: builds

Change-Id: I89df3be9e15881e081b76d6c0312bc54da931dea
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-02-19 14:16:44 -08:00
Jayant Chowdhary
653ea6c323 ICameraProvider@2.6: Update mandatory concurrent stream combinations.
Bug: 77960042

Test: builds

Change-Id: Ic56d6a10ee3521901aae5d8e7289dead7c20b086
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-02-19 13:36:39 -08:00
Emilian Peev
aa5673385a Camera: Fix possible ExifUtils heap corruption
Both EXIF_TAG_IMAGE_WIDTH and EXIF_TAG_IMAGE_LENGTH
expect short values as per EXIF spec. Call appropriate
libexif function to avoid possible heap corruption.

Bug: 148223871
Test: Successful build
Change-Id: Ib16bf1ae8ab2093da529efe6ff0778331c3e9eb3
2020-02-18 10:20:02 -08:00
Emilian Peev
f0aa3f0107 Camera: Add ICameraDevice@3.6 subinterface
Camera device subinterface version 3.6 must inherit
from the previous version 3.5 and continue to support
device sessions with versions 3.2, 3.5 as well as the
most recent 3.6.

Bug: 148235329
Test: VtsHalCameraProviderV2_4TargetTest
--gtest_filter=PerInstance/CameraHidlTest.switchToOffline/0_external_0

Change-Id: Ia46cbd771eb1d2624cc0cee808a3eb074fc775b6
2020-02-04 10:12:15 -08:00