Skip to content

在安卓平台如何使用Hardwarebuffer提交纹理? #66

Answered by domchen
xzpqjew asked this question in General
Discussion options

You must be logged in to vote

可以参考 libpag 里的用法 :https://github.com/Tencent/libpag/blob/main/src/platform/android/HardwareDecoder.cpp 主要的代码就是包装 tgfx 的 SurfaceTextureReader 类。视频流用刚刚那个方法。你如果只有一帧的 HardwareBuffer 图像。直接用:

tgfx::Image::MakeFrom(HardwareBufferRef hardwareBuffer, YUVColorSpace colorSpace = YUVColorSpace::BT601_LIMITED);

就可以绘制了。

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by domchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants