About the problems encountered in debugging UVCCamera

Recently, the company has introduced a large number of USBAR glasses from various manufacturers, so I want to write a unified example, which can be tested and used directly in the future:

Included functions include linking USB glasses, when viewing camera data after linking, you can modify: brightness, contrast, hue, saturation, sharpness; you can get all the devices in the link; get device information; you can make various video settings; audio settings Horizontal flip and vertical flip; video and photo.

Libraries used:

https://github.com/saki4510t/UVCCamera

https://github.com/saki4510t/libcommon

Currently encountered problem one:

When generating the .so file: make the following modifications. The setting of APP_PLATFORM here cannot be too high or too low. Generally, if it is too low, the software will give a prompt, but if it is too high, it seems that there is no prompt, but it will be displayed in the middle of each time. termination.

Configure the environment variables of the ndk; run cmd: return this means that the environment variables are configured successfully

Next execute to generate the .so file

Change to directory jni directory

Execute ndk-build here

The .so file will be automatically generated

Problem two:

When some USB cameras fail to open, after the connection is successful, but the camera fails to open, the screen displays a black screen:

What I encountered here is because the preview resolution is wrong and needs to be modified:

Here you can directly modify the source code:

It can also be modified:

Question 3: The pop-up box of permission permission is not displayed, and no error message appears

Camera permissions need to be given, because my project still has save and recording, add the following permissions:

<uses-permission android:name="android.permission.RECORD_AUDIO"/>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.CAMERA"/>

Guess you like

Origin blog.csdn.net/guliang28/article/details/129709588