vladimirvivien / go4vl

A Go library for working with the Video for Linux API (V4L2).
MIT License
239 stars 43 forks source link

Missing constants from linux/videodev2.h #13

Closed millerlogic closed 2 years ago

millerlogic commented 2 years ago

Hi, I'm getting the following errors building the package,

/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/capability.go:48:33: could not determine kind of name for C.V4L2_CAP_IO_MC
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:25:55: could not determine kind of name for C.V4L2_FMT_FLAG_CSC_COLORSPACE
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:28:55: could not determine kind of name for C.V4L2_FMT_FLAG_CSC_HSV_ENC
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:29:55: could not determine kind of name for C.V4L2_FMT_FLAG_CSC_QUANTIZATION
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:26:55: could not determine kind of name for C.V4L2_FMT_FLAG_CSC_XFER_FUNC
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:27:55: could not determine kind of name for C.V4L2_FMT_FLAG_CSC_YCBCR_ENC
/home/dev/go/pkg/mod/github.com/vladimirvivien/go4vl@v0.0.1/v4l2/format_desc.go:24:55: could not determine kind of name for C.V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL

When I open /usr/include/linux/videodev2.h I see these constants are not present. This is on ubuntu 20.04.3 with package linux-libc-dev version 5.4.0-94.106 (after update and upgrade). There may be other such constants, it stops showing errors at a certain point.

On my other popos install I see linux-libc-dev is at version 5.15.5 and looks like the constants are present.

It looks like some of those constants are relatively new, like V4L2_CAP_IO_MC might just be from 2020.

Do I need to find a way to get the newer package? or should this library try to accommodate? Thanks

vladimirvivien commented 2 years ago

@millerlogic Hi, thank you for trying this project out. The minimum kernel version supported is 5.10.x and up. If you are using older kernels, it will not compile.

IanPhilips commented 2 years ago

I'm getting a similar error could not determine kind of name for C.V4L2_CAP_IO_MC using the kernel: Linux 5.10.0-1057-oem x86_64

IanPhilips commented 2 years ago

Also had that problem with kernel version 5.11.0-43-generic - but maybe it has something to do with using different kernel versions on the same machine?

ajcasagrande commented 2 years ago

Should be fixed by #20

vladimirvivien commented 2 years ago

@IanPhilips I am going to close because of #20 . If there are still issue, please re-open.