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
libuvccamera
in android project - Copy the
libuvccamera/src/main/jni
folder to thelibuvccamera/src/main
folder. - Copy the
libuvccamera/src/main/java/com/serenegiant/usb
folder to thelibuvccamera/src/main/java/ai/aloft/core
folder. - Added the tasks from the
libuvccamera/build.gradle
to thelibuvccamera/build.gradle
and included thesourceSets
. - Added the
libuvccamera
res
values to thelibuvccamera
res
folder. - Added
com.serenegiant:common
dependency to librarybuild.gradle
- Added generated libs folder dependency to library `build.gradle``
- Added
saki4510t
maven dependency tosettings.gradle
- Ran
./gradlew build
to 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.