Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera2: Inverted Colors in preview #116

Open
simonschmeisser opened this issue Oct 15, 2023 · 4 comments
Open

Camera2: Inverted Colors in preview #116

simonschmeisser opened this issue Oct 15, 2023 · 4 comments
Labels
Milestone

Comments

@simonschmeisser
Copy link

Currently the colors in camera preview are inverted.

For Xperia 10 III camera2 reports the following supported formats:

10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 32 20  AIMAGE_FORMAT_RAW16
10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 34 22  AIMAGE_FORMAT_PRIVATE
10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 35 23  AIMAGE_FORMAT_YUV_420_888
10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 36 24  AIMAGE_FORMAT_RAW_PRIVATE
10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 37 25  AIMAGE_FORMAT_RAW10
10-13 20:23:08.170  4552   942 I DroidMediaCamera: format 256 100 AIMAGE_FORMAT_JPEG

@mal dropped AIMAGE_FORMAT_YUV_420_888 in some places but commented it out, commenting it back in does not make it work unfortunately

@simonschmeisser
Copy link
Author

simonschmeisser commented Oct 15, 2023

gst-inspect-1.0 droidcamsrc gives the following formats for the viewfinder:

  SRC template: 'vfsrc'
    Availability: Always
    Capabilities:
      video/x-raw(memory:DroidMediaQueueBuffer)
                 format: { (string)NV12_64Z32, (string)YV12, (string)NV16, (string)NV12, (string)NV21, (string)YUY2, (string)RGBA, (string)RGBx, (string)RGB, (string)RGB16, (string)BGRA, (string)ENCODED }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)NV21 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

@simonschmeisser
Copy link
Author

Fun fact: I reverted to camera1 and while sf-camera and fennec browser (via android app support) show the correct colors, sf-browser does not. It has the inverted colors on master/camera1.

@rainemak rainemak added this to the camera2 milestone Oct 24, 2023
@mlehtima
Copy link
Contributor

I managed to find a bit hacky way to get the colors correct on Xperia 10 III but needs to be tested it doesn't break any other devices.

@simonschmeisser
Copy link
Author

I tested your latest branch and it looks good here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants