相机preVIEW场较小,如果我使用了preVIEW的方式grifika的ContinuousCaptureActivity [英] Field of camera preview is smaller if I use the way of preview in grifika's ContinuousCaptureActivity

查看:382
本文介绍了相机preVIEW场较小,如果我使用了preVIEW的方式grifika的ContinuousCaptureActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道,我们将获得preVIEW一个啤酒场在同距离,当摄像机preVIEW比例设置为 4:3 而不是 16:9 ,细节如下:

We know that we will get a lager field of preview at the same distance when camera preview ratio set to 4:3 instead of 16:9, the detail is as follows:

Android摄像头API - 古怪的变焦效果

不过,我遇到一个问题时,我曾与Android摄像头preVIEW用OpenGL,也就是下文提到的第二种方式。

But I encountered a problem when I worked with android camera preview with opengl, that is the second way mentioned below.

有2种方式实现摄像头preVIEW的:

There are 2 ways of implementing camera preview:

  1. 在没有OpenGL的传统方式,只需使用 Camera.set previewTexture(纹理表面纹理) Camera.set previewDisplay(SurfaceHolder持有人)
  2. ContinuousCaptureActivity 使用的OpenGL的方式,我们渲染API的preVIEW图像 swapBuffers()
  1. Traditional way without opengl, just use Camera.setPreviewTexture(SurfaceTexture texture) or Camera.setPreviewDisplay(SurfaceHolder holder)
  2. The way of ContinuousCaptureActivity using opengl, we render the preview image with API swapBuffers().

第一种方式是确定的,我会发现,preVIEW领域变大,如果preVIEW比例由16改为:9比4:3

The first way is OK, I will find that preview field become larger if preview ratio changed from 16:9 to 4:3.

然而,第二种方法是不行某些机器人手机,preVIEW字段保持不变时preVIEW比率改变,且preVIEW场是比在比4的第一种方式较小: 3。 我坚持认为这是一个错误,我想解决这个问题非常多,谁能给我一些建议?

However,The second way is not OK in some android phones, the preview field stay the same when preview ratio changed and the preview field is smaller than the first way at the ratio 4:3. I insist that this is an error, I want to resolve this problem very much, Who can give me some advices?

推荐答案

斗争之后,我终于找到了确切的原因,这是API Camera.Parameters.setRecordingHint(真)

After a struggle, I finally found out the exact reason, it is the API Camera.Parameters.setRecordingHint(true)

当我在源$ C ​​$ C删除这一条款中,preVIEW现场恢复正常。

When I removed this clause in my source code, the field of preview became normal.

总之,该API Camera.Parameters.setRecordingHint(真)在一些Android设备中的错误。

In one word, the API Camera.Parameters.setRecordingHint(true) is a bug in some android devices.

对于某些设备,如果preVIEW比设定为4:3(使用API​​ Camera.Parameters.set previewSize(INT,INT)),调用API setRecordingHint(真)会造成相机领域preVIEW要小些。

For some devices, if preview ratio is set to 4:3(use API Camera.Parameters.setPreviewSize(int, int)), calling API setRecordingHint(true) will cause the field of camera preview to be smaller.

这篇关于相机preVIEW场较小,如果我使用了preVIEW的方式grifika的ContinuousCaptureActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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