隐藏摄像机preVIEW,但仍收到preVIEW回调 [英] Hide camera preview but still receive preview callbacks

查看:172
本文介绍了隐藏摄像机preVIEW,但仍收到preVIEW回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想告诉过滤相机preVIEW在我的应用程序。

I want to show filtered camera preview in my application.

我用Camera.set previewCallback()这一点。我设法处理回调的数据和OpenGL的视图显示过滤的图像,但我不知道如何隐藏原装相机preVIEW和仍然收到preVIEW回调。使表面观水涨船高或隐形不工作,使得它足够小(10×10)躲在GUI也不起作用。它只是停止发送回调用preVIEW数据。

I'm using Camera.setPreviewCallback() for this. I managed to process callback data and show filtered image in OpenGL view but I have no idea how to hide original camera preview and still receive preview callbacks. Making surface view "gone" or "invisible" doesn't work, making it small enough (10x10) to hide behind GUI doesn't work either. It just stops sending callbacks with preview data.

您可以分享一些这方面的解决方法吗?我测试使用的Galaxy S2。

Can you share some workaround on this? I'm testing using Galaxy S2.

感谢你在前进。

推荐答案

一个解决方案是,即使设置了preVIEW大小是一样的实际画面,在的preVIEW的onMeasure SurfaceView使它更小,这对我的作品:

A solution is to even though set the Preview Size to be as the actual screen, in the onMeasure of the Preview SurfaceView make it smaller, that works for me:

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{  
   this.setMeasuredDimension(2, 2);  
}

这篇关于隐藏摄像机preVIEW,但仍收到preVIEW回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆