3 Application Developing Hints
3.1 Including header files
3.1.1 Compilation Procedure
To compile with Video4Linux for Solaris, add
-I/opt/KSWv4lcmn/include into C compiler flags, and then
insert preprocessor directive
#include "solaris/videodev.h"
or,
#include "linux/videodev.h"
or simply
#include "videodev.h"
into your code.
3.2 Difference to Linux implementation
3.2.1 Unsupported ioctls
Following ioctls are not supported and you will get EOPNOTSUPP:
VIDIOCCAPTURE
, VIDIOCGWIN
, VIDIOCSWIN
,
VIDIOCGFBUF
, VIDIOCSFBUF, VIDIOCKEY
, VIDIOCGUNIT
,
VIDIOCGCAPTURE
, VIDIOCSCAPTURE
and other BTTV specific private ioctls.
3.2.2 Byte order of pixel data
- BTTV at x86 Linux
-
- RGB32
- byte[0,1,2,3] = [B, G, R, A], word = ARGB
- RGB24
- byte[0,1,2] = [B, G, R]
- RGB565
- byte[0,1] = [g2g1g0b4b3b2b1b0, r4r3r2r1r0g5g4g3], word = [RGB]
- RGB555
- byte[0,1] = [g2g1g0b4b3b2b1b0, z0r4r3r2r1r0g4g3], word = [ARGB]
- bt848x at SPARC Solaris
-
- RGB32
- byte[0,1,2,3] = [A, R, G, B], word = ARGB
- RGB24
- byte[0,1,2] = [B, G, R]
- RGB565
- byte[0,1] = [r4r3r2r1r0g5g4g3, g2g1g0b4b3b2b1b0], word = [RGB]
- RGB555
- byte[0,1] = [z0r4r3r2r1r0g4g3, g2g1g0b4b3b2b1b0], word = [ARGB]
- bt848x at x86 Solaris
-
- RGB32
- byte[0,1,2,3] = [B, G, R, A], word = ARGB
- RGB24
- byte[0,1,2] = [B, G, R]
- RGB565
- byte[0,1] = [g2g1g0b4b3b2b1b0, r4r3r2r1r0g5g4g3], word = [RGB]
- RGB555
- byte[0,1] = [g2g1g0b4b3b2b1b0, z0r4r3r2r1r0g4g3], word = [ARGB]
- PGX64 at SDL under SPARC Solaris
-
- RGB32
- byte[0,1,2,3] = [A, R, G, B], word = ARGB
- RGB24
- byte[0,1,2] = [R, G, B]
- RGB565
- byte[0,1] = [r4r3r2r1r0g5g4g3, g2g1g0b4b3b2b1b0], word = [RGB]
- RGB555
- byte[0,1] = [z0r4r3r2r1r0g4g3, g2g1g0b4b3b2b1b0], word = [ARGB]
- FFB at SDL under SPARC Solaris
-
- RGB32
- byte[0,1,2,3] = [A, B, G, R], word = ABGR
- RGB24
- byte[0,1,2] = [R, G, B]
- RGB565
- byte[0,1] = [r4r3r2r1r0g5g4g3, g2g1g0b4b3b2b1b0], word = [RGB]
- RGB555
- byte[0,1] = [z0r4r3r2r1r0g4g3, g2g1g0b4b3b2b1b0], word = [ARGB]
3.2.3 Dimension alignment
Width of capture area should be dividable by 16 for
VIDEO_PALETTE_YUV4xxP, and should be dividable by 4 for
VIDEO_PALETTE_YUV4xx. If not so, driver silently ignores it, and
generates odd images.