saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.99k stars 1.2k forks source link

Cannot compile the macro value of PIXEL_FORMAT_YV12 and PIXEL_FORMAT_RGB256 #550

Open momo1986 opened 4 years ago

momo1986 commented 4 years ago

Hello, I use the bazel build to compile and run some USB camera program.

To reference your maven repositories, my build file is like this:

maven_jar(
    name = "com_serenegiant_uvccamera_usbCameraCommon",
    artifact = "com.serenegiant.uvccamera:usbCameraCommon:0.0.1",
    sha1 = "e00ce54db790d024728d40199912de2986f1f75d",
    server = "bintray_server",
)

maven_jar(
    name = "com_serenegiant_uvccamera_libuvccamera",
    artifact = "com.serenegiant.uvccamera:libuvccamera:1.2.0",
    sha1 = "2bed656b882b7fac5ef81e5785b726ca713c7288",
    server = "bintray_server",
)

maven_jar(
    name = "com_serenegiant_uvccamera_libuvccameras",
    artifact = "com.serenegiant.uvccamera:libuvccameras:0.0.2",
    sha1 = "052915390a50a428cdcf20f0244bc640c5ae29f2",
    server = "bintray_server",
)

maven_jar(
    name = "com_serenegiant_common",
    artifact = "com.serenegiant:common:0.0.3",
    sha1 = "ec67b3aa5e653137ff2fb80be967c1a46c7818d6",
    server = "bintray_server",
)

I can import your library currently. But some old code is expired.

I cannot declare the macro value of PIXEL_FORMAT_YV12 and PIXEL_FORMAT_RGB256.

Has some problem:

NFO: Writing tracer profile to '/private/var/tmp/_bazel_junyan/d0562ae4205a819f08c6b310db2d9181/command.profile.gz' INFO: Analyzed target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facedetectioncpu:facedetectioncpu (0 packages loaded, 0 targets configured). INFO: Found 1 target... ERROR: /Users/junyan/find_android_project/mediapipe-master/mediapipe/java/com/google/mediapipe/components/BUILD:42:1: Building mediapipe/java/com/google/mediapipe/components/libandroid_cameras_helper.jar (5 source files) failed (Exit 1) mediapipe/java/com/google/mediapipe/components/UVCDevice.java:58: 错误: 找不到符号 uvcCamera.setFrameCallback(frameCallback, UVCCamera.PIXEL_FORMAT_YV12); ^ 符号: 变量 PIXEL_FORMAT_YV12 位置: 类 UVCCamera Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facedetectioncpu:facedetectioncpu failed to build INFO: Elapsed time: 4.401s, Critical Path: 3.26s INFO: 8 processes: 7 darwin-sandbox, 1 worker. FAILED: Build did NOT complete successfully

There are some Chinese log, it means the sign of UVCCamera.PIXEL_FORMAT_YV12 also UVCCamera.PIXEL_FORMAT_RGB256 cannot be found.

I use NDK in 19.2.5345600, android sdk in API level from 23 to 29.

My question is what is the lease that I cannot refer to the macro and is there any workaround to fix it, e.g., add some budgets or give some constant value with numerical assignment?

Thanks & Regards!