Question

Is it possible to broadcast the android camera preview into 2 different SurfaceView controls at the same time? I have seen some apps that show effects into different previews in real-time, how do they achieve that? I read about the TextureView, is this the view to use? where can I find examples of multiple simultaneous camera previews?

Thanks

Was it helpful?

Solution 2

I don't think that it is possible to independently open 2 camera previews at the same time, as the camera is treated as a shared resource. However, it will be possible to draw to multiple SurfaceViews which is what the apps you describe do.

OTHER TIPS

Well, as they answered in this question, I downloaded the grafika project and revised the "texture from camera" example.

In the RenderThread is a Sprite2d atribute called mRect. I just make another instance called mRect2, and configuired it with the same parameters that mRect has, except the rotation, I put it to the double:

mRect.setRotation(rotAngle); mRect2.setRotation(rotAngle*2);

This is the result

There is still a lot of code to understand, but it works and seems a very promising path to continue by.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top