facebookexperimental / facebookexperimental/usb-video
Native usbvideo library doesn't compile if minSdk is below 30
- Dominant language
- C++
- Stars
- 28
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thank you for this project.
There's `UsbVideoStreamer.cpp` file that interacts with libuvc library. A part of this file has 2 branches, the first branch is active if `minSdk` is greater or equal to 30, otherwise the second branch becomes active instead.
The demo project uses minSdk set to 30, in this case the library uses the first branc that uses Android NDK's `AImageDecoder`, and it compiles without errors.
If I set minSdk below 30, let's say 29, then the second branch becomes active. It uses an undeclared identifier `uvc_mjpeg2rgb` in line 344, and the project can't compile.
The `uvc_mjpeg2rgb` function comes from libuvc, which included into the project. However, libuvc requires the presence of libjpeg in order for the function to work. If libjpeg is not available, `uvc_mjpeg2rgb` function is not exposed. The project doesn't include libjpeg, so `uvc_mjpeg2rgb` is not available, and compilation fails.
One of the solutions could be to include libjpeg if minsdk is below 30.
Contributor guide
Assessment
This issue has not been assessed yet.