gralloc 学习
来源:互联网 发布:网络硬盘录像机16价格 编辑:程序博客网 时间:2024/06/06 04:19
1. 首先给自己做个list, 方便查找
camera 用到ANativewindow src code
/frameworks/av/services/camera/libcameraservice/CameraHardwareInterface.h /system/core/include/system/window.h /frameworks/native/libs/gui/SurfaceTextureClient.cpp
2 . ANativeWindow API:
在这一过程中使用的API
a 、cancelBuffer
Hook used to cancel a buffer that has been dequeued. No synchronization is performed between dequeue() and cancel(), so either external synchronization is needed, or these functions must be called from the same thread.
b、 queuebuffer ---
Hook called by EGL when modifications to the render buffer are done. This unlocks and post the buffer
The window holds a reference to the buffer between dequeueBuffer and either queueBuffer or cancelBuffer, so clients only need their own reference if they might use the buffer after queueing or canceling it.
c、dequeuebuffer
Hook called by EGL to acquire a buffer. This call may block if no buffers are available.
d、lock_buffer -- do nothing
static int __lock_buffer(struct preview_stream_ops* w, buffer_handle_t* /*buffer*/) { ANativeWindow *a = anw(w); (void)a; return 0; }
3. GraphicBufferMapper
GraphicBufferMapper& mapper(GraphicBufferMapper::get());
mapper.lock(*phandle, CAMHAL_GRALLOC_USAGE, rect, &img);
The (*lock)() method is called before a buffer is accessed for the specified usage.
This call may block, for instance if the h/w needsto finish rendering or if CPU caches need to be synchronized.
The caller promises to modify only pixels in the area specified by (l,t,w,h).
mapper.unlock((buffer_handle_t) *phandle);
The (*unlock)() method must be called after all changes to the buffer are completed.
those function been defined in
hardware/libhardware/include/hardware/gralloc.h
gralloc.cpp
88 registerBuffer: gralloc_register_buffer, 89 unregisterBuffer: gralloc_unregister_buffer, 90 lock: gralloc_lock, 91 unlock: gralloc_unlock, ->gc_gralloc_lock 92 perform: gralloc_perform,
lock: 1. Lock android native buffer and get Vaddress
unlock: ion_flush(hnd);
- gralloc 学习
- gralloc
- gralloc
- gralloc
- Android GUI系统学习1:Gralloc
- Android4.0 Gralloc模块学习笔记(2)
- android gralloc
- Gralloc 总结
- Android SurfaceFlinger 学习之路(一)----Android图形显示之HAL层Gralloc模块实现
- android gralloc 流程分析
- android gralloc 流程分析
- Android Gralloc模块分析
- android gralloc 流程分析
- HAL Series(3) Gralloc
- android的gralloc分析
- android gralloc 小结
- GraphicBuffer和Gralloc模块
- android gralloc 流程分析
- prototype 中文参数乱码解决方案
- 添加属性页
- Python yield 使用浅析
- The C++ Programing Language读书笔记之(1):Advise
- Downloaded Files for 11i and R12
- gralloc 学习
- 操作系统概论三
- 算法设计与分析--霍夫曼树编码(C++实现)
- TUXEDO错误解析
- 进程的创建与可执行文件的加载
- 模仿网易新闻客户端(RSS版)(一)
- HDU 4198 Quick out of the Harbour (bfs)
- hdu 1856 More is better 并查集
- 各位周末结束后都累了吧,那我们一起来看看【寒冬】的面试题吧(据说阿里的哟)