NetBSD supports the v4l2 API, but it uses different headers and does not provide all the symbols.
In particular, for xpra, the following changes are needed:
I'll attach a patch for (the generated file) xpra/codecs/v4l2/pusher.c, but I don't know what the corresponding changes to the pyx file look like.
Patch for the generated file pusher.c to make it compile on NetBSD.
r12754 should make it easier for you. You need to patch the pyx file and not the generated C file. (though the end result is the same) Replace:
cdef extern from "linux/videodev2.h":
with:
cdef extern from "sys/videoio.h":
This cannot be made conditional from cython, so you will have to carry that patch on the netbsd side. The only alternative is to create our own header file, which contains the required pairs of ifdefs, then we can include that one (untested). ie: something like this should work:
cat > video.h <<EOF #ifdef __NetBSD__ #include <sys/videoio.h> #endif #ifdef __Linux__ #include "linux/videodev2.h" #endif EOF
If you're OK with the patch approach, please close this ticket. Otherwise, please test the header file approach.
r12755 uses the header file approach and should allow netbsd to compile out of the box. (no idea what the correct header file names are for freebsd and others.. those can be added later)
Please close if that works for you.
Thank you, r12755 did make it much better. r12754 commented out the wrong defines though. When I comment out V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT in pusher.pyx (two places) the build succeeds.
r12759 should comment out the correct defines.
Please close if this builds out of the box for you.
Thank you, works!
I'm afraid that I've probably broken it again in fixing trunk build for centos, see r12930. Can you please post your header file so that I can see where we need to ifdef contants?
Sure, here's the link to the NetBSD header file:
https://github.com/jsonn/src/blob/trunk/sys/sys/videoio.h
Made some mistakes along the way.. but as of r12935, we should get the new "device_caps" support on newer linux systems and still be able to build on older ones (including centos6, and I hope netbsd). Feel free to comment or re-open if I've broken it again..
Milestone renamed
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1223