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

how to add a callback function for processing opencv frames ? #2

Open
envery opened this issue Nov 19, 2023 · 1 comment
Open

how to add a callback function for processing opencv frames ? #2

envery opened this issue Nov 19, 2023 · 1 comment

Comments

@envery
Copy link

envery commented Nov 19, 2023

After reading the documentation jiangdongguo/AndroidUSBCamera , I think we should add

// acquire raw data(NV21 or RGBA)
setPreviewDataCallBack(callBack)

but I don 't know how to do it , maybe you can help me ?
Best regards !

@t2ui
Copy link

t2ui commented Oct 3, 2024

I currently have this code, but I'm not sure if it is correct.

        cameraClient.addPreviewDataCallBack(object : IPreviewDataCallBack {
            override fun onPreviewData(data: ByteArray?, width: Int, height: Int, format: IPreviewDataCallBack.DataFormat) {
                val frameData = data       //Frame data form camera
            }
        })

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

2 participants