Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAllPreviewSizes is not work #689

Open
QDQ82 opened this issue Sep 24, 2024 · 1 comment
Open

getAllPreviewSizes is not work #689

QDQ82 opened this issue Sep 24, 2024 · 1 comment

Comments

@QDQ82
Copy link

QDQ82 commented Sep 24, 2024

version : implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:3.2.8'

I want to bring the resolution in advance.
However, it returns "null".

Is there a way?

@QDQ82
Copy link
Author

QDQ82 commented Sep 24, 2024

public void startCapture() {
    try{
        if(mUvcStrategy != null) {

            mUvcStrategy.addPreviewDataCallBack(new IPreviewDataCallBack() {
                @Override
                public void onPreviewData(@Nullable byte[] bytes, @NonNull DataFormat dataFormat) {
                    System.out.println(dataFormat.toString());
                }
            });
            mUvcStrategy.startPreview(getCameraRequest(),surfaceView.getHolder());
        }
    }catch (Exception e){

    }

}


private CameraRequest getCameraRequest() {
    return new CameraRequest.Builder()
            .setPreviewWidth(mainWidth)
            .setPreviewHeight(mainHeight)
            .setFrontCamera(false)
            .setContinuousAFModel(true)
            .setContinuousAutoModel(true)
            .create();
}

I want to enter the resolution, but I don't know the resolution I support, so it's hard to implement.

It must be operated with startpreview to get the resolution.

Is it possible to change the resolution of the value of the cameraarequest after it has already started?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant