UVC Camera Android is a library that allows for the use of USB cameras on Android devices. The library was brought over from the hthetiot/UVCCamera repo which is a fork of saki4510t/UVCCamera. The fork was used as it has been updated for later android versions.
- Create the library
libuvccamerain android project - Copy the
libuvccamera/src/main/jnifolder to thelibuvccamera/src/mainfolder. - Copy the
libuvccamera/src/main/java/com/serenegiant/usbfolder to thelibuvccamera/src/main/java/ai/aloft/corefolder. - Added the tasks from the
libuvccamera/build.gradleto thelibuvccamera/build.gradleand included thesourceSets. - Added the
libuvccameraresvalues to thelibuvccameraresfolder. - Added
com.serenegiant:commondependency to librarybuild.gradle - Added generated libs folder dependency to library `build.gradle``
- Added
saki4510tmaven dependency tosettings.gradle - Ran
./gradlew buildto create the libs folder
Normally to grab the frame data you would need to render it on a surface and then you would be able
to get the frames. The UVCPreview.cpp was modified, mostly the do_capture_callback, to bypass
the requirement of rendering it on a surface. The gist of changes can be found from
this closed issue, but there are some
differences between the actual implementation and the issue.