android ---Using java surface on the native side

阅读 139

2022-11-14


对于 android上的 voip及视频播放器类应用,为提高效率,把视频数据的渲染工作放在native层对提供性能有很大帮助,只需在java层创建一块surface,剩下的工作由native层处理,

无需转换为rgb格式到java层,画面控制仍然交给应用层。

大致过程:

java层创建surface,jni方式传给native层,native层在此surface上渲染

native层大致过程:


1. registerBuffers




2. postBuffer




3. unregisterBuffer



问题:native层获取Isurface没有权限,因为其是surface类的私有函数,需要修改framework 代码。

 

some good links :


​​http://matthiyosi.blogspot.com/2009/10/using-surface-in-android-native-code.html​​


​​http://matthiyosi.blogspot.com/2009/10/using-android-mediaplayer-framework-to.html​​

​​https://groups.google.com/forum/?fromgroups#!topic/android-developers/W3nVRXG4JD0​​

精彩评论(0)

0 0 举报