Comments (6)
华为手机需要另外找办法从GPU中提取数据,比如ImageReader等工具,glReadPixels无法提取。华为官方没给出解决方案,这个问题都存在好几年了。
from caincamera.
有实现的Demo,或者可以提供一下具体的解决思路或者博客吗?网站找glReadPixels获取失败的相关解决都是无效的,相关资料也很少
我是需要将getCurrentFrame()方法直接替换成其他的方法去获取缓冲区中的数据吗?
from caincamera.
跟这篇文章写的思路是一样的 —— android 使用ImageReader+共享EGLContext把opengles渲染的图像转bitmap
直接提取GPU纹理数据出错,那就只能用ImageReader 等自带的工具提取,利用新的Surface创建一个SharedContext,makeCurrent到SharedContext上下文中,然后将纹理绘制到Surface中,ImageReader在接收到纹理数据之后,通过reader.acquireNextImage()取出获取图像数据,然后再取出来,思路就这么简单。还有Android 7.0 可以通过DirectTexture直接同GPU内存中提取纹理数据,只不过由于GraphicBuffer对象是在 libui.so中,Android 7.0之后,不能通过dlopen来加载这个非公开共享库了,所以这个方法基本失效。而OpenGLES3.0的PBuffer方案,也不能保证底层一定能够提取得到纹理数据,因此,最稳妥的方案应该是ImageReader了。
from caincamera.
这个问题你解决了吗
from caincamera.
from caincamera.
感谢作者百忙中抽出时间回复,最近忙新的项目,这个问题也一直拖着没解决,您分享的内容及解决办法我大致看了下,只是没时间去代码实现,非常感谢您!!
from caincamera.
Related Issues (20)
- setPreviewSize 无效,保存的图片分辨率只和预览尺寸有关吗
- 想获取美颜后的数据 HOT 3
- 录制视频花屏 HOT 1
- Android11 录制视频失效
- Video black screen HOT 1
- 贴纸的延迟比较高
- 更改了人脸识别API_KEY和API_SECRET,滤镜无效果 HOT 2
- 关于多线程预览录制的问题
- 腮红妆没效果
- 部分滤镜延迟较高.怎么优化啊 HOT 1
- 华为应用市场有个 233相机 的应用,包名都没变,加了个广告就上线了。。。
- 大佬还优化嘛
- RtmpPusher in pushlibrary
- Black screen when use all function relate PlayVideo
- GLConsumer: error creating EGLImage: 0x3002
- E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
- 美颜磨皮效果欠佳 HOT 1
- 使用VideoPlayer组件播放视频时有杂音
- 在 Java 层实现绘制逻辑效率较低也不具备跨平台,建议把对 GL 的操作以及 Render 逻辑都放到 c 层实现
- avcodec_open2! -542398533
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caincamera.