本文介绍了什么SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS手段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示过滤的摄像头preVIEW,使用在previewFrame()回调。

I am trying to display a filtered camera preview, using onPreviewFrame() callback.

现在的问题是,当我删除此行:    mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

The problem is that when i remove this line: mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

要隐藏preVIEW,应用程序崩溃。日志内容如下:    08-19 15:57:51.042:ERROR / CameraService(59):registerBuffers失败,状态-38

to hide the preview, the app crashes. The log reads: 08-19 15:57:51.042: ERROR/CameraService(59): registerBuffers failed with status -38

这是什么意思?这是记录任何地方?

What does this mean? Is this documented anywhere?

我使用的SDK APIDemos相机preVIEW:<一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Camera$p$pview.html">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Camera$p$pview.html

I am using the CameraPreview from the SDK APIDemos: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html

推荐答案

SURFACE_TYPE_PUSH_BUFFERS产生几个缓冲区的SurfaceView。组件锁定(填充数据)与在OS code深推(显示数据)这些缓冲区。特别的OpenMax(摄像机硬件设备接口)正在使用的图形缓冲器=推缓冲器,填补数据和显示数据。具体而言,相机硬件可以直接填写一推缓冲器和模具图形硬件可直接显示一推缓冲液(它们共享这些缓冲区)。结论:OS迫使你创建推缓冲区一个SurfaceView。然后,它可以使用该缓冲器用于摄像机装置。

SURFACE_TYPE_PUSH_BUFFERS generates several buffers for the SurfaceView. Components are locking (fill with data) and pushing (display data) these buffers deep in the OS code. Especially OpenMax (camera hardware device interface) is using "graphic buffers"="push buffers" to fill data and display data. To be specific, the camera hardware can fill a push buffer directly and die graphics hardware can display a push buffer directly (they share these buffers). Conclusion: The OS forces you to create a SurfaceView with push buffers. Then it can use the buffers for the camera device.

这篇关于什么SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS手段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:14