Using Camera API and Web API in the Same Time

Hi,

I am waiting to my THETA Z1 device and investigating documentation till the device will come. And there is a questions which answer I didn’t find and can’t test with real device yet.

In Plugin development page mentioned that we can use Web API from plugin, if we are not using Camera API. But there is no mention about the external access with Web API. Is the Web API available for external services when the camera runs plugin which uses Camera API?

And if yes what will happen if both will try to use camera device?

1 Like

You cannot use the WebAPI and the CameraAPI at the same time. You most close the WebAPI to access the CameraAPI. If you try at the same time, it will just not respond. The camera shouldn’t crash. You can switch back and forth between the CameraAPI and the WebAPI by closing the processes. There are many examples on GitHub.

This is a bit old, but provides the basic concept

notificationCameraClose()

sendBroadcast(new Intent(“com.theta360.plugin.ACTION_MAIN_CAMERA_CLOSE”)

free the camera resources that is being used by the main camera application

The camera resource can only open one application

  • Implement shooting using the WebAPI
  • Camera API inference → stop inference → take picture with WebAPI (from plug-in) → Use Camera API to restart inference

take picture with web API (from inside of plug-in)

Trigger based on change in acceleration.

2 Likes