#1223 closed defect (fixed)
v4l2 on NetBSD
Reported by: | Thomas Klausner | Owned by: | Thomas Klausner |
---|---|---|---|
Priority: | major | Milestone: | 1.0 |
Component: | encodings | Version: | 0.17.x |
Keywords: | Cc: |
Description
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:
- include sys/videoio.h instead of linux/videodev2.h
- do not expect V4L2_FIELD_INTERLACED_BT nor V4L2_FIELD_INTERLACED_TB
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.
Attachments (1)
Change History (11)
Changed 5 years ago by
Attachment: | patch-xpra_codecs_v4l2_pusher.c added |
---|
comment:1 Changed 5 years ago by
Owner: | changed from Antoine Martin to Thomas Klausner |
---|
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.
comment:2 Changed 5 years ago by
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.
comment:3 Changed 5 years ago by
comment:4 Changed 5 years ago by
r12759 should comment out the correct defines.
Please close if this builds out of the box for you.
comment:6 Changed 5 years ago by
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?
comment:8 Changed 5 years ago by
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..
comment:10 Changed 6 weeks ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1223
Patch for the generated file pusher.c to make it compile on NetBSD.