SurfaceFlinger测试程序
我想在Android中编写一个本机应用程序进行测试 表面抛掷者。有没有任何简单的程序可以显示如何创建 Surfaceflinger 上的 Surface、寄存器缓冲区和后缓冲区。
I want to write a native application in Android for testing
surfaceflinger. Is there any simple program that shows how to create
surface, register buffers and post buffers on Surfaceflinger.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
frameworks/base/libs/surfaceflinger/tests/resize/resize.cpp
是一个很好的起点。但我的测试应用程序版本(来自供应商的 Eclair)已过时,一些
Surface
API 已移至SurfaceControl
,您必须:SurfaceComposerClient::createSurface()
=>;SurfaceControl
SurfaceControl->getSurface()
=>;Surface
其次使用
SurfaceComposerClient::openTransaction()/closeTransaction()
将所有事务绑定到 SurfaceFlinger 表面,例如:
Surface::lock()/unlockAndPost()
和SurfaceControl::setLayer()/setSize()
以下是一些示例代码(希望可以编译:P)
frameworks/base/libs/surfaceflinger/tests/resize/resize.cpp
is a good place to start.But my version (Eclair from vendor) of the test app is out-dated, some
Surface
API has been moved toSurfaceControl
and you have to:SurfaceComposerClient::createSurface()
=>SurfaceControl
SurfaceControl->getSurface()
=>Surface
Secondly use
SurfaceComposerClient::openTransaction()/closeTransaction()
to bound all transactions to SurfaceFlinger surface, eg:
Surface::lock()/unlockAndPost()
andSurfaceControl::setLayer()/setSize()
Here're some sample codes (hope this compiles :P)
对于姜饼,代码位于
/frameworks/base/services/surfaceflinger
查看此网站以获取有关 Surfaceflinger 的一些信息
http://kcchao.wikidot.com/surfaceflinger
For gingerbread the code is in
/frameworks/base/services/surfaceflinger
Checkout this site for some info on Surfaceflinger
http://kcchao.wikidot.com/surfaceflinger
我也在 Jelly bean 中寻找一些类似的应用程序,但我无法获得可以构建和运行并可以在屏幕上看到一些输出的独立应用程序。有一些应用程序,但它们不是在 Jellybean 中构建的,因为很少有 API 会在较低级别进行修改。请提供一些指示。我想通过这个应用程序来了解Android的Surface Flinger和显示子系统。
谢谢,
维布杰尔
I am also looking for some similar application in Jelly bean but I am no able to get a standalone application which I can build and run and can see some output on the screen. There are some applications but they are not building in Jellybean as few of the APIs would have got modified at lower level. Please provide some pointers. I want to use this app to understand the surface flinger and the display sub system of Android.
Thanks,
Vibgyor
查看 SurfaceFlinger(您感兴趣的平台)的源代码。
../frameworks/base/libs/surfaceflinger/tests/resize/resize.cpp
[platform/frameworks/base.git]/opengl/tests/gralloc/gralloc.cpp
它基本上按照您所描述的进行操作,但要意识到,这些是低级本机 API,并且在 Android 中不断发展。
Look in the source code for SurfaceFlinger(of the platform you're interested in).
../frameworks/base/libs/surfaceflinger/tests/resize/resize.cpp
[platform/frameworks/base.git]/opengl/tests/gralloc/gralloc.cpp
It basically does what you describe, realize though, that these are low level native APIs and are constantly evolving in Android.
如果您正在寻找如何直接与 SurfaceFlinger 交互,最好的开始是查看 /frameworks/base/libs/gui 中的 SurfaceComposerClient 代码。
If you are looking for how to interact directly with the SurfaceFlinger, the best start is to look into the SurfaceComposerClient code in /frameworks/base/libs/gui.