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.
From front to back: 333 ms to 500 ms.
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?
Thanks!
The
Cameraclass doesn’t know anything about the camera(s) on the device: theCameraclass 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.