Android Camera中我遇到的巨坑

来源:互联网 发布:淘宝饰品店店铺介绍 编辑:程序博客网 时间:2024/04/30 20:20
addCallbackBufferAdded in API level 8void addCallbackBuffer (byte[] callbackBuffer)Adds a pre-allocated buffer to the preview callback buffer queue. Applications can add one or more buffers to the queue. When a preview frame arrives and there is still at least one available buffer, the buffer will be used and removed from the queue. Then preview callback is invoked with the buffer. If a frame arrives and there is no buffer left, the frame is discarded. Applications should add buffers back when they finish processing the data in them.


做的时候没有仔细看每个方法的说明,由于我做了输出数据的实时旋转,然后加了一些保护,在剧烈晃动和旋转时可能导致没有数据输出了,找了不少原因,才发现这句话中最关键的一句。

 If a frame arrives and there is no buffer left, the frame is discarded. 

中间所有做保护中断的地方,以及数据处理后必须还要调用

addCallbackBuffer

0 0
原创粉丝点击