android中前后摄像头之间的不同切换时间 [英] Different switch times between front and back cameras in android

查看:50
本文介绍了android中前后摄像头之间的不同切换时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试切换前后摄像头.switchCamera 方法无限循环运行,不会对帧进行任何处理.

I am trying to switch the front and back cameras. The switchCamera method runs in an infinite loop and there is no processing being done on the frames.

我想查看最短切换时间.但是我得到的结果表明,前置和后置摄像头之间的切换时间不同.

I wanted to see the minimum switch time taken. But the results I am getting show that the switching time between front facing and the back facing camera are different.

从前到后:333 毫秒到 500 毫秒.

From front to back: 333 ms to 500 ms.

从后到前:1100 毫秒到 1400 毫秒.

From back to front: 1100 ms to 1400 ms.

因此切换时间取决于您从哪个相机切换.有人对此有解释吗?

So the switching time depends on which camera you are switching from. Does anyone have an explanation for that?

谢谢!

推荐答案

Camera 类对设备上的相机一无所知:Camera 类知道如何对设备驱动程序进行阻塞调用以获取功能、设置选项和执行各种功能.即使设备驱动程序相同并且前后摄像头之间唯一可见的区别是它们的 IO 地址,不同的硬件位也会花费不同的时间来响应相同的命令.当两个相机具有不同的设备驱动程序时,这仍然是正确的,但现在设备驱动程序也可能非常不同:一个人可能(选择或必须)在每次打开时进行非常彻底的重置;另一个可能会减少握手,要么是因为设备本身更简单,要么是因为如果收到错误响应,它可以进行修复".

The Camera class doesn't know anything about the camera(s) on the device: the Camera class knows how to make blocking calls to a device driver to get capabilities, set options, and execute various functions. Even when the device driver is the same and the only visible difference between the front and back camera is their IO address, different bits of hardware will take different amounts of time to respond to the same command. This is still true when the two cameras have different device drivers, but now the device drivers may be very different, too: One may (choose or have to) do a very thorough reset on every open; another may do less handshaking, either because the device itself is simpler or because it can do 'fix up' if it gets an error response.

这篇关于android中前后摄像头之间的不同切换时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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