facebookexperimental / facebookexperimental/usb-video

Native usbvideo library doesn't compile if minSdk is below 30

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.