google / jetpack-camera-app

Apache License 2.0
137 stars 26 forks source link

Two streams in Single Stream mode #186

Open Zeronfinity opened 5 months ago

Zeronfinity commented 5 months ago

Device:

Pixel 7 Pro

Version:

JCA 1.0.0-rc01

Issue description:

Based on dumpsys log, it seems like JCA is actually 2 streams, not 1, in case of Single Stream mode.

    Stream[0]: Output
      Consumer name: ImageReader-4080x3072f21m4-4182-4
      Dims: 4080 x 3072, format 0x21, dataspace 0x8c20000
      ...
    Stream[1]: Output
      Consumer name: SurfaceTexture-1-4182-6
      Dims: 1600 x 1200, format 0x23, dataspace 0x8810000
      ...

Reproduce steps:

  1. Open JCA
  2. Set Single Stream mode from settings
  3. Use a command like adb shell dumpsys media.camera | egrep -A 40 "Stream configuration" to confirm the correct streams are configured.

Extra: Capture an image and record a video to confirm the resolutions.

Others:

A major side-effect of this is that JCA has less video recording resolution than supported in single stream, due to accommodating an extra image capture stream.

For example, in the Pixel 7 pro, video recorded with CameraX core-test-app with Preview + VideoCapture being bound is 1026x1920. In JCA single stream case, it's only 720x1280.

Zeronfinity commented 3 weeks ago
2024-09-18 17:07:45.673 14104-14157 Camera2CameraImpl       com.google.jetpackcamera             D  {Camera@d458eb1[id=0]} Use case androidx.camera.core.ImageCapture-59b187c5-d5df-4d6c-a343-5fd09f3c42aa198133083 ACTIVE
2024-09-18 17:07:45.675 14104-14157 Camera2CameraImpl       com.google.jetpackcamera             D  {Camera@d458eb1[id=0]} Use case androidx.camera.core.streamsharing.StreamSharing-ee259903-5ba0-4ff6-b15d-99c43b865921213048375 ACTIVE

Internal CameraX log also confirms that ImageCapture use case is being bound separately in single stream mode, not being used as part of StreamSharing.