-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FreeBSD support #102
Add FreeBSD support #102
Conversation
Thank you! |
let pkg_conf = pkg_config::Config::new() | ||
.probe("libv4l2") | ||
.expect("pkg-config has failed to find `libv4l2`"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't v4l2-sys
to build purely against the kernel bindings? v4l-sys
links against libv4l2
. Can you clarify why this is needed here (i.e. does FreeBSD provide fallbacks here?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Location of linux/videodev2.h
(included in wrapper.h
) is generally speaking indeterminate.
It might reside outside of default include location, i.e. not in /usr/include
.
pkg-config
crate provides means to query include directories necessary to locate libv4l2
header files in pkgconf
database:
$ pkgconf --cflags-only-I libv4l2
-I/usr/local/include
$
I don't think changes from this PR affected/changed linking in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't affect linking, but the question remains why the kernel-only package now relies on pkg-config
and lib4l2
being available, just to locate standard Linux headers. That should at the very least require a comment otherwise, to explain that this build.rs
is not interested in generating bindings to libv4l2
.
There should be a different/better way that doesn't involve these implicit dependencies. @raymanfx what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't realize the presence of linux/videodev2.h
header file doesn't depend on the existence of libv4l2
in pkgconf
database on Linux.
I prepared a PR to limit use of avoid pkg-config
to FreeBSD onlylibv4l2
dependency added via pkg-config
: #106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, understood, yeah it should be a Linux UAPI header (https://github.com/torvalds/linux/blob/master/include/uapi/linux/videodev2.h), but maybe FreeBSD provides it as part of the v4l2 package for compatibility? I'm not certain how FreeBSD works, but I think I found it here: https://www.freshports.org/multimedia/v4l_compat
I've used the proposed changes on a recent
FreeBSD CURRENT
withamd64
(i.e.x86_64
) architecture withLogitech C922 Pro
webcam.What works:
MmapStream
What doesn't work:
UserptrStream