A question: how can i use camera API?


#1

i am a new learner. Recently, i want to use API to change the resolution of the preview live stream. I find that i can use API from camera API, but where is it? what is the difference between camera API and web API?
https://api.ricoh/docs/theta-plugin-reference/camera-api/ From here, it said that i can configure the resolution as 640,1024, 1920. So what is the specific function that i can use in the demo project included in the SDK?
thank you very much!


#2

Welcome to THETA Plug-in Development. You’re at the right place.

There’s a new Getting Started guide here.

Open this project, NOT the SDK.

Go to line 362 of this file:

private void setSurface(@NonNull SurfaceHolder surfaceHolder) {
    if (mCamera != null) {
        mCamera.stopPreview();

        try {
            mCamera.setPreviewDisplay(surfaceHolder);
            mParameters.setPreviewSize(1920, 960);
            mCamera.setParameters(mParameters);
        } catch (IOException e) {
            e.printStackTrace();
            close();
        }
        mCamera.startPreview();
    }
}

Use the Facial Blur sample to display the stream in a web browser.

image


#3

You really help me a lot! THANK YOU!