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

[FR] About 10bit P010 support #1697

Closed
hua-hua-lin opened this issue Apr 13, 2022 · 6 comments
Closed

[FR] About 10bit P010 support #1697

hua-hua-lin opened this issue Apr 13, 2022 · 6 comments

Comments

@hua-hua-lin
Copy link

Description

  • I would like to ask when will AHARDWAREBUFFER_FORMAT_YCbCr_P010 be supported?
  • If I have a 10bit p010 GraphicBuffer, can I get the correct AHardWareBuffer through GraphicBuffer->toAHardwareBuffer()?
  • How can I use 10bit p010 data in combination with EGLImage?
@DanAlbert
Copy link
Member

I would like to ask when will AHARDWAREBUFFER_FORMAT_YCbCr_P010 be supported?

It's in the headers now according to code search. If you're asking about device support, I think that might be up to each OEM?

We don't write these APIs, we just ship them, so we're not going to be of much help on questions like this. https://groups.google.com/g/android-ndk might be a better place to ask. I'll forward this to someone that knows more about the specific API as well to see if I can get them to chime in.

@hua-hua-lin
Copy link
Author

I would like to ask when will AHARDWAREBUFFER_FORMAT_YCbCr_P010 be supported?

It's in the headers now according to code search. If you're asking about device support, I think that might be up to each OEM?

We don't write these APIs, we just ship them, so we're not going to be of much help on questions like this. https://groups.google.com/g/android-ndk might be a better place to ask. I'll forward this to someone that knows more about the specific API as well to see if I can get them to chime in.

Thank you very much for your reply. I still have some questions. Please help me.

  1. I can't find AHARDWAREBUFFER_FORMAT_YCbCr_P010 defined in the latest NDK version。
  2. Can I force the format to be 0x36?
  3. When I force write, AHardwareBuffer_isSupported shows that it is not supported, maybe there is something wrong with my call?
    int ret = 0;
    AHardwareBuffer_Desc desc { };
    {
        desc.width = (uint32_t)srcImage.m_nWidth;
        desc.height = (uint32_t)srcImage.m_nHeight;
        desc.stride = (uint32_t)srcImage.m_nYStride;
        desc.usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER
                     | AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT | AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;

        // AHARDWAREBUFFER_FORMAT_YCbCr_P010               = 0x36,
        // AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420             = 0x23,
        desc.format = 0x36;
        desc.layers = 1;

        ret = AHardwareBuffer_isSupported(&desc);
        printf("AHardwareBuffer_isSupported %d\n", ret);
    }

@hua-hua-lin
Copy link
Author

@DanAlbert hello?

@hua-hua-lin
Copy link
Author

There is also no description of AHARDWAREBUFFER_FORMAT_YCbCr_P010 on the document.
https://developer.android.com/ndk/reference/group/a-hardware-buffer

@DanAlbert
Copy link
Member

I can't find AHARDWAREBUFFER_FORMAT_YCbCr_P010 defined in the latest NDK version。

Then you need to update your NDK, or wait for the next release if it's not yet in any released NDK.

As I said, I can't help you with the other questions. You're asking the wrong team. I've emailed the folks that do know but they haven't responded yet. I'll update the thread if that changes, or you could file a framework bug on b.android.com.

@hua-hua-lin
Copy link
Author

ok, thanks! Maybe I need to wait for the latest version.
I raised a stackoverflow

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

No branches or pull requests

2 participants