3 * Copyright (C) 2008 Matias De la Puente
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Matias De la Puente <mfpuente.ar@gmail.com>
23 [CCode (lower_case_cprefix="", cprefix="", cheader_filename="linux/videodev2.h")]
26 [CCode (cprefix="V4L2_FIELD_")]
41 [CCode (cname="V4L2_FIELD_HAS_TOP")]
42 public bool field_has_top (uint32 field);
43 [CCode (cname="V4L2_FIELD_HAS_BOTTOM")]
44 public bool field_has_bottom (uint32 field);
45 [CCode (cname="V4L2_FIELD_HAS_BOTH")]
46 public bool field_has_both (uint32 field);
48 [CCode (cprefix="V4L2_BUF_TYPE_")]
49 public enum BufferType
62 [CCode (cprefix="V4L2_CTRL_TYPE_")]
63 public enum ControlType
73 [CCode (cprefix="V4L2_TUNER_")]
81 [CCode (cprefix="V4L2_MEMORY_")]
89 [CCode (cprefix="V4L2_COLORSPACE_")]
90 public enum Colorspace
102 [CCode (cprefix="V4L2_PRIORITY_")]
112 [CCode (cname="struct v4l2_rect")]
121 [CCode (cname="struct v4l2_fract")]
122 public struct Fraction
124 public uint32 numerator;
125 public uint32 denominator;
128 [CCode (cprefix="V4L2_CAP_")]
129 public enum Capabilities
139 VIDEO_OUTPUT_OVERLAY,
149 [CCode (cname="struct v4l2_capability")]
150 public struct Capability
152 public unowned string driver;
153 public unowned string card;
154 public unowned string bus_info;
155 public uint32 version;
156 public uint32 capabilities;
157 public uint32[] reserved;
160 [CCode (cprefix="V4L2_PIX_FMT_")]
161 public enum PixelFormatType
215 [CCode (cname="struct v4l2_pix_format")]
216 public struct PixelFormat
219 public uint32 height;
220 public uint32 pixelformat;
222 public uint32 bytesperline;
223 public uint32 sizeimage;
224 public Colorspace colorspace;
228 [CCode (cprefix="V4L2_FMT_FLAG_")]
229 public enum FormatFlag
234 [CCode (cname="struct v4l2_fmtdesc")]
235 public struct FormatDescriptor
238 public BufferType type;
240 public unowned string description;
241 public uint pixelformat;
244 [CCode (cprefix="V4L2_FRMSIZE_TYPE_")]
245 public enum FramesizeTypes
252 [CCode (cname="struct v4l2_frmsize_discrete")]
253 public struct FramesizeDiscrete
256 public uint32 height;
259 [CCode (cname="struct v4l2_frmsize_stepwise")]
260 public struct FramesizeStepwise
262 public uint32 min_width;
263 public uint32 max_width;
264 public uint32 step_width;
265 public uint32 min_height;
266 public uint32 max_height;
267 public uint32 step_height;
270 [CCode (cname="struct v4l2_frmsizeenum")]
271 public struct FramsizeEnum
274 public uint32 pixel_format;
276 public FramesizeDiscrete discrete;
277 public FramesizeStepwise stepwise;
280 [CCode (cprefix="V4L2_FRMIVAL_TYPE_")]
281 public enum FrameivalTypes
288 [CCode (cname="struct v4l2_frmival_stepwise")]
289 public struct FrameivalStepwise
293 public Fraction step;
296 [CCode (cname="struct v4l2_frmivalenum")]
297 public struct FrameivalEnum
300 public uint32 pixel_format;
302 public uint32 height;
304 public Fraction discrete;
305 public Fraction stepwise;
308 [CCode (cname="struct v4l2_timecode")]
309 public struct Timecode
314 public uint8 seconds;
315 public uint8 minutes;
317 public uint8 userbits[4];
320 [CCode (cprefix="V4L2_TC_TYPE_")]
321 public enum TimecodeType
330 [CCode (cprefix="V4L2_TC_FLAGS_")]
331 public enum TimecodeFlags
337 [CCode (cprefix="V4L2_TC_USERBITS_")]
338 public enum TimecodeUserbits
346 [CCode (cname="struct v4l2_jpegcompression")]
347 public struct JpegCompression
352 public char APP_data[60];
354 public char COM_data[60];
355 public uint32 jpeg_markers;
358 [CCode (cprefix="V4L2_JPEG_MARKER_")]
359 public enum JpegMarker
368 [CCode (cname="struct v4l2_requestbuffers")]
369 public struct RequestBuffers
372 public BufferType type;
373 public Memory memory;
379 public uint32 offset;
380 public ulong userptr;
383 [CCode (cname="struct v4l2_buffer")]
387 public BufferType type;
388 public uint32 bytesused;
391 public GLib.TimeVal timestamp;
392 public Timecode timecode;
393 public uint32 sequence;
394 public Memory memory;
396 public uint32 length;
398 public uint32 reserved;
401 [CCode (cprefix="V4L2_BUF_FLAG_")]
402 public enum BufferFlags
414 [CCode (cname="struct v4l2_framebuffer")]
415 public struct FrameBuffer
417 public uint32 capability;
420 public PixelFormat fmt;
423 [CCode (cprefix="V4L2_FBUF_CAP_")]
424 public enum FrameBufferCapabilites
435 [CCode (cprefix="V4L2_FBUF_FLAG_")]
436 public enum FrameBufferFlags
446 [CCode (cname="struct v4l2_clip")]
453 [CCode (cname="struct v4l2_window")]
458 public uint32 chromakey;
460 public uint32 clipcount;
462 public uint8 global_alpha;
465 [CCode (cname="struct v4l2_captureparm")]
466 public struct CaptureParm
468 public uint32 capability;
469 public uint32 capturemode;
470 public Fraction timeperframe;
471 public uint32 extendedmode;
472 public uint32 readbuffers;
475 [CCode (cprefix="V4L2_")]
476 public const uint32 MODE_HIGHQUALITY;
477 [CCode (cprefix="V4L2_")]
478 public const uint32 CAP_TIMEPERFRAME;
480 [CCode (cname="struct v4l2_outputparm")]
481 public struct OutputParm
483 public uint32 capability;
484 public uint32 outputmode;
485 public Fraction timeperframe;
486 public uint32 extendedmode;
487 public uint32 writebuffers;
490 [CCode (cname="struct v4l2_cropcap")]
491 public struct CropCap
493 public BufferType type;
496 public Fraction pixelaspect;
499 [CCode (cname="struct v4l2_crop")]
502 public BufferType type;
506 [CCode (cprefix="V4L2_STD_")]
507 public enum Standards
552 [CCode (cname="v4l2_std_id")]
553 public struct StdId : uint64 { }
555 [CCode (cname="struct v4l2_standard")]
556 public struct Standard
560 public unowned string name;
561 public Fraction frameperiod;
562 public uint32 framelines;
565 [CCode (cname="struct v4l2_input")]
569 public unowned string name;
571 public uint32 audioset;
574 public uint32 status;
577 [CCode (cprefix="V4L2_INPUT_TYPE_")]
578 public enum InputType
584 [CCode (cprefix="V4L2_IN_ST_")]
585 public enum InputStatus
600 [CCode (cname="struct v4l2_output")]
604 public unowned string name;
606 public uint32 audioset;
607 public uint32 modulator;
611 [CCode (cprefix="V4L2_OUTPUT_TYPE_")]
612 public enum OutputType
619 [CCode (cname="struct v4l2_control")]
620 public struct Control
626 [CCode (cname="struct v4l2_ext_control")]
627 public struct ExtControl
631 public int64 value64;
632 public void* reserved;
635 [CCode (cname="struct v4l2_ext_controls")]
636 public struct ExtControls
638 public uint32 ctrl_class;
640 public uint32 error_idx;
641 public ExtControl* controls;
644 [CCode (cprefix="V4L2_CTRL_CLASS_")]
645 public enum ControlClass
652 [CCode (cprefix="V4L2_")]
653 public const uint32 CTRL_ID_MASK;
654 [CCode (cname="V4L2_CTRL_ID2CLASS")]
655 public uint32 ctrl_id2class (uint32 id);
656 [CCode (cname="V4L2_CTRL_DRIVER_PRIV")]
657 public uint32 ctrl_driver_priv (uint32 id);
659 [CCode (cname="struct v4l2_queryctrl")]
660 public struct QueryControl
663 public ControlType type;
664 public unowned string name;
665 public int32 minimum;
666 public int32 maximum;
668 public int32 default_value;
672 [CCode (cname="struct v4l2_querymenu")]
673 public struct QueryMenu
677 public unowned string name;
678 public uint32 reserved;
681 [CCode (cprefix="V4L2_CTRL_FLAG_")]
682 public enum ControlFlags
693 [CCode (cprefix="V4L2_CID_")]
694 public enum UserClassControlIds
720 POWER_LINE_FREQUENCY,
722 WHITE_BALANCE_TEMPERATURE,
724 BACKLIGHT_COMPENSATION,
730 [CCode (cprefix="V4L2_CID_POWER_LINE_FREQUENCY_")]
731 public enum PowerLineFrequency
738 [CCode (cprefix="V4L2_CID_MPEG_")]
739 public enum MpegClassControlIds
757 AUDIO_MODE_EXTENSION,
770 VIDEO_TEMPORAL_DECIMATION,
775 [CCode (cprefix="V4L2_MPEG_STREAM_TYPE_")]
776 public enum MpegStreamType
786 [CCode (cprefix="V4L2_MPEG_STREAM_VBI_FMT_")]
787 public enum MpegStreamVbiFmt
793 [CCode (cprefix="V4L2_MPEG_AUDIO_SAMPLING_FREQ_")]
794 public enum MpegAudioSamplingFreq
801 [CCode (cprefix="V4L2_MPEG_AUDIO_ENCODING_")]
802 public enum MpegAudioEncoding
809 [CCode (cprefix="V4L2_MPEG_AUDIO_L1_BITRATE_")]
810 public enum MpegAudioL1Bitrate
828 [CCode (cprefix="V4L2_MPEG_AUDIO_L2_BITRATE_")]
829 public enum MpegAudioL2Bitrate
847 [CCode (cprefix="V4L2_MPEG_AUDIO_L3_BITRATE_")]
848 public enum MpegAudioL3Bitrate
866 [CCode (cprefix="V4L2_MPEG_AUDIO_MODE_")]
867 public enum MpegAudioMode
875 [CCode (cprefix="V4L2_MPEG_AUDIO_MODE_EXTENSION_")]
876 public enum MpegAudioModeExtension
884 [CCode (cprefix="V4L2_MPEG_AUDIO_EMPHASIS_")]
885 public enum MpegAudioEmphasis
892 [CCode (cprefix="V4L2_MPEG_AUDIO_CRC_")]
893 public enum MpegAudioCrc
899 [CCode (cprefix="V4L2_MPEG_VIDEO_ENCODING_")]
900 public enum MpegVideoEncoding
906 [CCode (cprefix="V4L2_MPEG_VIDEO_ASPECT_")]
907 public enum MpegVideoAspect
915 [CCode (cprefix="V4L2_MPEG_VIDEO_BITRATE_MODE_")]
916 public enum MpegVideoBitrateMode
922 [CCode (cprefix="V4L2_CID_MPEG_CX2341X_")]
923 public enum MpegCx2341xClassControlIds
926 VIDEO_SPATIAL_FILTER_MODE,
927 VIDEO_SPATIAL_FILTER,
928 VIDEO_LUMA_SPATIAL_FILTER_TYPE,
929 VIDEO_CHROMA_SPATIAL_FILTER_TYPE,
930 VIDEO_TEMPORAL_FILTER_MODE,
931 VIDEO_TEMPORAL_FILTER,
932 VIDEO_MEDIAN_FILTER_TYPE,
933 VIDEO_LUMA_MEDIAN_FILTER_BOTTOM,
934 VIDEO_LUMA_MEDIAN_FILTER_TOP,
935 VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM,
936 VIDEO_CHROMA_MEDIAN_FILTER_TOP,
937 STREAM_INSERT_NAV_PACKETS
940 [CCode (cprefix="V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_")]
941 public enum MpegCx2341xVideoSpatialFilterMode
947 [CCode (cprefix="V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_")]
948 public enum MpegCx2341xVideoLumaSpatialFilterType
954 2D_SYM_NON_SEPARABLE,
957 [CCode (cprefix="V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_")]
958 public enum MpegCx2341xVideoChromaSpatialFilterType
964 [CCode (cprefix="V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_")]
965 public enum MpegCx2341xVideoTemporalFilterMode
971 [CCode (cprefix="V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_")]
972 public enum MpegCx2341xVideoMedianFilterType
981 [CCode (cprefix="V4L2_CID_")]
982 public enum CameraClassControlIds
988 EXPOSURE_AUTO_PRIORITY,
1000 [CCode (cprefix="V4L2_EXPOSURE_")]
1001 public enum ExposureAutoType
1009 [CCode (cname="struct v4l2_tuner")]
1012 public uint32 index;
1013 public unowned string name;
1014 public TunerType type;
1015 public uint32 capability;
1016 public uint32 rangelow;
1017 public uint32 rangehigh;
1018 public uint32 rxsubchans;
1019 public uint32 audmode;
1020 public int32 @signal;
1024 [CCode (cname="struct v4l2_modulator")]
1025 public struct Modulator
1027 public uint32 index;
1028 public unowned string name;
1029 public uint32 capability;
1030 public uint32 rangelow;
1031 public uint32 rangehigh;
1032 public uint32 txsubchans;
1035 [CCode (cprefix="V4L2_TUNER_CAP_")]
1036 public enum TunerCapabilities
1046 [CCode (cprefix="V4L2_TUNER_SUB_")]
1047 public enum TunerSubs
1056 [CCode (cprefix="V4L2_TUNER_MODE_")]
1057 public enum TunerModes
1067 [CCode (cname="struct v4l2_frequency")]
1068 public struct Frequency
1070 public uint32 tuner;
1071 public TunerType type;
1072 public uint32 frequency;
1075 [CCode (cname="struct v4l2_hw_freq_seek")]
1076 public struct HwFreqSeek
1078 public uint32 tuner;
1079 public TunerType type;
1080 public uint32 seek_upward;
1081 public uint32 wrap_around;
1084 [CCode (cname="struct v4l2_audio")]
1087 public uint32 index;
1088 public unowned string name;
1089 public uint32 capability;
1093 [CCode (cprefix="V4L2_AUDCAP_")]
1094 public enum AudioCapabilities
1100 [CCode (cprefix="V4L2_")]
1101 public const uint32 AUDMODE_AVL;
1103 [CCode (cname="struct v4l2_audioout")]
1104 public struct AudioOut
1106 public uint32 index;
1107 public unowned string name;
1108 public uint32 capability;
1112 [CCode (cprefix="V4L2_ENC_IDX_FRAME_")]
1113 public enum EncIdxFrame
1121 [CCode (cname="struct v4l2_enc_idx_entry")]
1122 public struct EncIdxEntry
1124 public uint64 offset;
1126 public uint32 length;
1127 public uint32 flags;
1130 [CCode (cprefix="V4L2_")]
1131 public const int ENC_IDX_ENTRIES;
1133 [CCode (cname="struct v4l2_enc_idx")]
1134 public struct EncIdx
1136 public uint32 entries;
1137 public uint32 entries_cap;
1138 public EncIdxEntry[] entry;
1141 [CCode (cprefix="V4L2_ENC_CMD_")]
1151 [CCode (cname="struct raw")]
1154 public uint32 data[8];
1157 [CCode (cname="struct v4l2_encoder_cmd")]
1158 public struct EncoderCmd
1161 public uint32 flags;
1165 [CCode (cname="struct v4l2_vbi_format")]
1166 public struct VbiFormat
1168 public uint32 sampling_rate;
1169 public uint32 offset;
1170 public uint32 samples_per_line;
1171 public uint32 sample_format;
1172 public int32 start[2];
1173 public uint32 count[2];
1174 public uint32 flags;
1177 [CCode (cprefix="V4L2_VBI_")]
1178 public enum VbiFlags
1184 [CCode (cname="struct v4l2_sliced_vbi_format")]
1185 public struct SlicedVbiFormat
1187 public uint16 service_set;
1188 public uint16[] service_lines;
1189 public uint32 io_size;
1190 public uint32[] reserved;
1193 [CCode (cprefix="V4L2_SLICED_")]
1194 public enum SlicedType
1205 [CCode (cname="struct v4l2_sliced_vbi_cap")]
1206 public struct SlicedVbiCap
1208 public uint16 service_set;
1209 public uint16[] service_lines;
1210 public BufferType type;
1213 [CCode (cname="struct v4l2_sliced_vbi_data")]
1214 public struct SlicedVbiData
1217 public uint32 field;
1219 public uint8 data[48];
1224 public PixelFormat pix;
1226 public VbiFormat vbi;
1227 public SlicedVbiFormat sliced;
1228 public uint8 raw_data[200];
1231 [CCode (cname="struct v4l2_format")]
1232 public struct Format
1234 public BufferType type;
1240 public CaptureParm capture;
1241 public OutputParm output;
1242 public uint8 raw_data[200];
1245 [CCode (cname="struct v4l2_streamparm")]
1246 public struct StreamParm
1248 public BufferType type;
1249 public unowned Parm parm;
1252 [CCode (cprefix="V4L2_CHIP_MATCH_")]
1253 public enum ChipMatch
1260 [CCode (cname="struct v4l2_register")]
1261 public struct Register
1263 public uint32 match_type;
1264 public uint32 match_chip;
1269 [CCode (cname="struct v4l2_chip_ident")]
1270 public struct ChipIdent
1272 public uint32 match_type;
1273 public uint32 match_chip;
1274 public uint32 ident;
1275 public uint32 revision;
1278 public const int VIDIOC_QUERYCAP;
1279 public const int VIDIOC_RESERVED;
1280 public const int VIDIOC_ENUM_FMT;
1281 public const int VIDIOC_G_FMT;
1282 public const int VIDIOC_S_FMT;
1283 public const int VIDIOC_REQBUFS;
1284 public const int VIDIOC_QUERYBUF;
1285 public const int VIDIOC_G_FBUF;
1286 public const int VIDIOC_S_FBUF;
1287 public const int VIDIOC_OVERLAY;
1288 public const int VIDIOC_QBUF;
1289 public const int VIDIOC_DQBUF;
1290 public const int VIDIOC_STREAMON;
1291 public const int VIDIOC_STREAMOFF;
1292 public const int VIDIOC_G_PARM;
1293 public const int VIDIOC_S_PARM;
1294 public const int VIDIOC_G_STD;
1295 public const int VIDIOC_S_STD;
1296 public const int VIDIOC_ENUMSTD;
1297 public const int VIDIOC_ENUMINPUT;
1298 public const int VIDIOC_G_CTRL;
1299 public const int VIDIOC_S_CTRL;
1300 public const int VIDIOC_G_TUNER;
1301 public const int VIDIOC_S_TUNER;
1302 public const int VIDIOC_G_AUDIO;
1303 public const int VIDIOC_S_AUDIO;
1304 public const int VIDIOC_QUERYCTRL;
1305 public const int VIDIOC_QUERYMENU;
1306 public const int VIDIOC_G_INPUT;
1307 public const int VIDIOC_S_INPUT;
1308 public const int VIDIOC_G_OUTPUT;
1309 public const int VIDIOC_S_OUTPUT;
1310 public const int VIDIOC_ENUMOUTPUT;
1311 public const int VIDIOC_G_AUDOUT;
1312 public const int VIDIOC_S_AUDOUT;
1313 public const int VIDIOC_G_MODULATOR;
1314 public const int VIDIOC_S_MODULATOR;
1315 public const int VIDIOC_G_FREQUENCY;
1316 public const int VIDIOC_S_FREQUENCY;
1317 public const int VIDIOC_CROPCAP;
1318 public const int VIDIOC_G_CROP;
1319 public const int VIDIOC_S_CROP;
1320 public const int VIDIOC_G_JPEGCOMP;
1321 public const int VIDIOC_S_JPEGCOMP;
1322 public const int VIDIOC_QUERYSTD;
1323 public const int VIDIOC_TRY_FMT;
1324 public const int VIDIOC_ENUMAUDIO;
1325 public const int VIDIOC_ENUMAUDOUT;
1326 public const int VIDIOC_G_PRIORITY;
1327 public const int VIDIOC_S_PRIORITY;
1328 public const int VIDIOC_G_SLICED_VBI_CAP;
1329 public const int VIDIOC_LOG_STATUS;
1330 public const int VIDIOC_G_EXT_CTRLS;
1331 public const int VIDIOC_S_EXT_CTRLS;
1332 public const int VIDIOC_TRY_EXT_CTRLS;
1333 public const int VIDIOC_ENUM_FRAMESIZES;
1334 public const int VIDIOC_ENUM_FRAMEINTERVALS;
1335 public const int VIDIOC_G_ENC_INDEX;
1336 public const int VIDIOC_ENCODER_CMD;
1337 public const int VIDIOC_TRY_ENCODER_CMD;
1338 public const int VIDIOC_DBG_S_REGISTER;
1339 public const int VIDIOC_DBG_G_REGISTER;
1340 public const int VIDIOC_G_CHIP_IDENT;
1341 public const int VIDIOC_S_HW_FREQ_SEEK;
1342 public const int VIDIOC_OVERLAY_OLD;
1343 public const int VIDIOC_S_PARM_OLD;
1344 public const int VIDIOC_S_CTRL_OLD;
1345 public const int VIDIOC_G_AUDIO_OLD;
1346 public const int VIDIOC_G_AUDOUT_OLD;
1347 public const int VIDIOC_CROPCAP_OLD;
1348 public const int BASE_VIDIOC_PRIVATE;