aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/media
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/DocBook/media')
-rw-r--r--Documentation/DocBook/media/Makefile386
-rw-r--r--Documentation/DocBook/media/bayer.png.b64171
-rw-r--r--Documentation/DocBook/media/crop.gif.b64105
-rw-r--r--Documentation/DocBook/media/dvb/.gitignore1
-rw-r--r--Documentation/DocBook/media/dvb/audio.xml1314
-rw-r--r--Documentation/DocBook/media/dvb/ca.xml582
-rw-r--r--Documentation/DocBook/media/dvb/demux.xml1130
-rw-r--r--Documentation/DocBook/media/dvb/dvbapi.xml141
-rw-r--r--Documentation/DocBook/media/dvb/dvbproperty.xml1105
-rw-r--r--Documentation/DocBook/media/dvb/dvbstb.pdfbin0 -> 1881 bytes
-rw-r--r--Documentation/DocBook/media/dvb/examples.xml365
-rw-r--r--Documentation/DocBook/media/dvb/frontend.xml1548
-rw-r--r--Documentation/DocBook/media/dvb/intro.xml212
-rw-r--r--Documentation/DocBook/media/dvb/kdapi.xml2309
-rw-r--r--Documentation/DocBook/media/dvb/net.xml156
-rw-r--r--Documentation/DocBook/media/dvb/video.xml1968
-rw-r--r--Documentation/DocBook/media/dvbstb.png.b64398
-rw-r--r--Documentation/DocBook/media/fieldseq_bt.gif.b64447
-rw-r--r--Documentation/DocBook/media/fieldseq_tb.gif.b64445
-rw-r--r--Documentation/DocBook/media/nv12mt.gif.b6437
-rw-r--r--Documentation/DocBook/media/nv12mt_example.gif.b64121
-rw-r--r--Documentation/DocBook/media/pipeline.png.b64213
-rw-r--r--Documentation/DocBook/media/v4l/.gitignore1
-rw-r--r--Documentation/DocBook/media/v4l/biblio.xml269
-rw-r--r--Documentation/DocBook/media/v4l/capture.c.xml659
-rw-r--r--Documentation/DocBook/media/v4l/common.xml1214
-rw-r--r--Documentation/DocBook/media/v4l/compat.xml2624
-rw-r--r--Documentation/DocBook/media/v4l/controls.xml4713
-rw-r--r--Documentation/DocBook/media/v4l/crop.pdfbin0 -> 5846 bytes
-rw-r--r--Documentation/DocBook/media/v4l/dev-capture.xml110
-rw-r--r--Documentation/DocBook/media/v4l/dev-codec.xml18
-rw-r--r--Documentation/DocBook/media/v4l/dev-effect.xml17
-rw-r--r--Documentation/DocBook/media/v4l/dev-event.xml43
-rw-r--r--Documentation/DocBook/media/v4l/dev-osd.xml149
-rw-r--r--Documentation/DocBook/media/v4l/dev-output.xml106
-rw-r--r--Documentation/DocBook/media/v4l/dev-overlay.xml371
-rw-r--r--Documentation/DocBook/media/v4l/dev-radio.xml49
-rw-r--r--Documentation/DocBook/media/v4l/dev-raw-vbi.xml339
-rw-r--r--Documentation/DocBook/media/v4l/dev-rds.xml196
-rw-r--r--Documentation/DocBook/media/v4l/dev-sliced-vbi.xml699
-rw-r--r--Documentation/DocBook/media/v4l/dev-subdev.xml467
-rw-r--r--Documentation/DocBook/media/v4l/dev-teletext.xml29
-rw-r--r--Documentation/DocBook/media/v4l/driver.xml200
-rw-r--r--Documentation/DocBook/media/v4l/fdl-appendix.xml671
-rw-r--r--Documentation/DocBook/media/v4l/fieldseq_bt.pdfbin0 -> 9185 bytes
-rw-r--r--Documentation/DocBook/media/v4l/fieldseq_tb.pdfbin0 -> 9173 bytes
-rw-r--r--Documentation/DocBook/media/v4l/func-close.xml62
-rw-r--r--Documentation/DocBook/media/v4l/func-ioctl.xml71
-rw-r--r--Documentation/DocBook/media/v4l/func-mmap.xml183
-rw-r--r--Documentation/DocBook/media/v4l/func-munmap.xml76
-rw-r--r--Documentation/DocBook/media/v4l/func-open.xml113
-rw-r--r--Documentation/DocBook/media/v4l/func-poll.xml119
-rw-r--r--Documentation/DocBook/media/v4l/func-read.xml181
-rw-r--r--Documentation/DocBook/media/v4l/func-select.xml130
-rw-r--r--Documentation/DocBook/media/v4l/func-write.xml128
-rw-r--r--Documentation/DocBook/media/v4l/gen-errors.xml77
-rw-r--r--Documentation/DocBook/media/v4l/io.xml1450
-rw-r--r--Documentation/DocBook/media/v4l/keytable.c.xml172
-rw-r--r--Documentation/DocBook/media/v4l/libv4l.xml160
-rw-r--r--Documentation/DocBook/media/v4l/lirc_device_interface.xml253
-rw-r--r--Documentation/DocBook/media/v4l/media-controller.xml89
-rw-r--r--Documentation/DocBook/media/v4l/media-func-close.xml59
-rw-r--r--Documentation/DocBook/media/v4l/media-func-ioctl.xml73
-rw-r--r--Documentation/DocBook/media/v4l/media-func-open.xml94
-rw-r--r--Documentation/DocBook/media/v4l/media-ioc-device-info.xml132
-rw-r--r--Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml308
-rw-r--r--Documentation/DocBook/media/v4l/media-ioc-enum-links.xml207
-rw-r--r--Documentation/DocBook/media/v4l/media-ioc-setup-link.xml84
-rw-r--r--Documentation/DocBook/media/v4l/pipeline.pdfbin0 -> 20276 bytes
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-grey.xml62
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-m420.xml139
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv12.xml143
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv12m.xml153
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml66
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv16.xml166
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv24.xml121
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml935
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml236
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml83
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml67
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml67
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml67
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-srggb10.xml90
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml28
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-srggb12.xml90
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-srggb8.xml67
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-uyvy.xml120
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-vyuy.xml120
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-y10.xml79
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-y10b.xml43
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-y12.xml79
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-y16.xml81
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-y41p.xml149
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuv410.xml133
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml147
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuv420.xml149
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml154
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml153
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yuyv.xml120
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml154
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yvyu.xml120
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt.xml1040
-rw-r--r--Documentation/DocBook/media/v4l/planar-apis.xml62
-rw-r--r--Documentation/DocBook/media/v4l/remote_controllers.xml177
-rw-r--r--Documentation/DocBook/media/v4l/selection-api.xml325
-rw-r--r--Documentation/DocBook/media/v4l/selections-common.xml164
-rw-r--r--Documentation/DocBook/media/v4l/subdev-formats.xml2613
-rw-r--r--Documentation/DocBook/media/v4l/v4l2.xml626
-rw-r--r--Documentation/DocBook/media/v4l/v4l2grab.c.xml164
-rw-r--r--Documentation/DocBook/media/v4l/vbi_525.pdfbin0 -> 3395 bytes
-rw-r--r--Documentation/DocBook/media/v4l/vbi_625.pdfbin0 -> 3683 bytes
-rw-r--r--Documentation/DocBook/media/v4l/vbi_hsync.pdfbin0 -> 7405 bytes
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-create-bufs.xml154
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-cropcap.xml167
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml266
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml258
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml249
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-dqevent.xml271
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-dv-timings-cap.xml205
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml189
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml240
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml125
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml159
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml259
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml264
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml179
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumaudio.xml76
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml79
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enuminput.xml313
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumoutput.xml198
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumstd.xml389
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-expbuf.xml212
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-audio.xml172
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-audioout.xml138
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-crop.xml124
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml129
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml113
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml331
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml189
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml341
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml463
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fmt.xml197
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-frequency.xml147
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-input.xml83
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml175
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-modulator.xml238
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-output.xml85
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-parm.xml314
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-priority.xml135
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-selection.xml241
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml255
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-std.xml98
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml569
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-log-status.xml41
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-overlay.xml74
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml94
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-qbuf.xml192
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml78
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml110
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querybuf.xml105
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querycap.xml332
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-queryctrl.xml480
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querystd.xml74
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-reqbufs.xml137
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml184
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-streamon.xml112
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-interval.xml152
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-size.xml154
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-enum-mbus-code.xml119
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-crop.xml158
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml152
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml183
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-frame-interval.xml141
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml165
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml206
-rw-r--r--Documentation/DocBook/media/vbi_525.gif.b6484
-rw-r--r--Documentation/DocBook/media/vbi_625.gif.b6490
-rw-r--r--Documentation/DocBook/media/vbi_hsync.gif.b6443
178 files changed, 52320 insertions, 0 deletions
diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile
new file mode 100644
index 00000000000..6628b4b9cac
--- /dev/null
+++ b/Documentation/DocBook/media/Makefile
@@ -0,0 +1,386 @@
1###
2# Media build rules - Auto-generates media contents/indexes and *.h xml's
3#
4
5SHELL=/bin/bash
6
7MEDIA_OBJ_DIR=$(objtree)/Documentation/DocBook/
8MEDIA_SRC_DIR=$(srctree)/Documentation/DocBook/media
9
10MEDIA_TEMP = media-entities.tmpl \
11 media-indices.tmpl \
12 videodev2.h.xml \
13 v4l2.xml \
14 audio.h.xml \
15 ca.h.xml \
16 dmx.h.xml \
17 frontend.h.xml \
18 net.h.xml \
19 video.h.xml \
20
21IMGFILES := $(patsubst %.b64,%, $(notdir $(shell ls $(MEDIA_SRC_DIR)/*.b64)))
22OBJIMGFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(IMGFILES))
23GENFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(MEDIA_TEMP))
24
25PHONY += cleanmediadocs
26
27cleanmediadocs:
28 -@rm `find $(MEDIA_OBJ_DIR) -type l` $(GENFILES) $(OBJIMGFILES) 2>/dev/null
29
30$(obj)/media_api.xml: $(GENFILES) FORCE
31
32#$(MEDIA_OBJ_DIR)/media_api.html: $(MEDIA_OBJ_DIR)/media_api.xml
33#$(MEDIA_OBJ_DIR)/media_api.pdf: $(MEDIA_OBJ_DIR)/media_api.xml
34#$(MEDIA_OBJ_DIR)/media_api.ps: $(MEDIA_OBJ_DIR)/media_api.xml
35
36V4L_SGMLS = \
37 $(shell ls $(MEDIA_SRC_DIR)/v4l/*.xml|perl -ne 'print "$$1 " if (m,.*/(.*)\n,)') \
38 capture.c.xml \
39 keytable.c.xml \
40 v4l2grab.c.xml
41
42DVB_SGMLS = \
43 $(shell ls $(MEDIA_SRC_DIR)/dvb/*.xml|perl -ne 'print "$$1 " if (m,.*/(.*)\n,)')
44
45MEDIA_SGMLS = $(addprefix ./,$(V4L_SGMLS)) $(addprefix ./,$(DVB_SGMLS)) $(addprefix ./,$(MEDIA_TEMP))
46
47FUNCS = \
48 close \
49 ioctl \
50 mmap \
51 munmap \
52 open \
53 poll \
54 read \
55 select \
56 write \
57
58IOCTLS = \
59 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/videodev2.h) \
60 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/audio.h) \
61 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/ca.h) \
62 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/dmx.h) \
63 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/frontend.h) \
64 $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/net.h) \
65 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/video.h) \
66 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/media.h) \
67 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/v4l2-subdev.h) \
68 VIDIOC_SUBDEV_G_FRAME_INTERVAL \
69 VIDIOC_SUBDEV_S_FRAME_INTERVAL \
70 VIDIOC_SUBDEV_ENUM_MBUS_CODE \
71 VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
72 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
73
74TYPES = \
75 $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/linux/videodev2.h) \
76 $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/linux/dvb/frontend.h)
77
78ENUMS = \
79 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
80 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/audio.h) \
81 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/ca.h) \
82 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/dmx.h) \
83 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/frontend.h) \
84 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/net.h) \
85 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/video.h) \
86 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
87 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h) \
88 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h)
89
90STRUCTS = \
91 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
92 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/linux/dvb/audio.h) \
93 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/ca.h) \
94 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/dmx.h) \
95 $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/frontend.h) \
96 $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/linux/dvb/net.h) \
97 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/video.h) \
98 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
99 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h) \
100 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h)
101
102ERRORS = \
103 E2BIG \
104 EACCES \
105 EAGAIN \
106 EBADF \
107 EBADFD \
108 EBADR \
109 EBADRQC \
110 EBUSY \
111 ECHILD \
112 ECONNRESET \
113 EDEADLK \
114 EDOM \
115 EEXIST \
116 EFAULT \
117 EFBIG \
118 EILSEQ \
119 EINIT \
120 EINPROGRESS \
121 EINTR \
122 EINVAL \
123 EIO \
124 EMFILE \
125 ENFILE \
126 ENOBUFS \
127 ENODATA \
128 ENODEV \
129 ENOENT \
130 ENOIOCTLCMD \
131 ENOMEM \
132 ENOSPC \
133 ENOSR \
134 ENOSYS \
135 ENOTSUP \
136 ENOTSUPP \
137 ENOTTY \
138 ENXIO \
139 EOPNOTSUPP \
140 EOVERFLOW \
141 EPERM \
142 EPIPE \
143 EPROTO \
144 ERANGE \
145 EREMOTE \
146 EREMOTEIO \
147 ERESTART \
148 ERESTARTSYS \
149 ESHUTDOWN \
150 ESPIPE \
151 ETIME \
152 ETIMEDOUT \
153 EUSERS \
154 EWOULDBLOCK \
155 EXDEV \
156
157ESCAPE = \
158 -e "s/&/\\&/g" \
159 -e "s/</\\&lt;/g" \
160 -e "s/>/\\&gt;/g"
161
162FILENAME = \
163 -e s,"^[^\/]*/",, \
164 -e s/"\\.xml"// \
165 -e s/"\\.tmpl"// \
166 -e s/\\\./-/g \
167 -e s/"^func-"// \
168 -e s/"^pixfmt-"// \
169 -e s/"^vidioc-"//
170
171# Generate references to these structs in videodev2.h.xml.
172DOCUMENTED = \
173 -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
174 -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
175 -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
176 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
177 -e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g"
178
179DVB_DOCUMENTED = \
180 -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \
181 -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
182 -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \
183 -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
184 -e "s,<link\s\+linkend=\".*\">\(DTV_IOCTL_MAX_MSGS\|dtv_cmds_h\|__.*_old\)<\/link>,\1,g" \
185 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
186 -e "s,\(audio-mixer\|audio-karaoke\|audio-status\|ca-slot-info\|ca-descr-info\|ca-caps\|ca-msg\|ca-descr\|ca-pid\|dmx-filter\|dmx-caps\|video-system\|video-highlight\|video-spu\|video-spu-palette\|video-navi-pack\)-t,\1,g" \
187 -e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \
188 -e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
189 -e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \
190
191#
192# Media targets and dependencies
193#
194
195install_media_images = \
196 $(Q)cp $(OBJIMGFILES) $(MEDIA_OBJ_DIR)/media_api
197
198$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
199 $(Q)base64 -d $< >$@
200
201$(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES)
202 @$($(quiet)gen_xml)
203 @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/)
204 @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/)
205
206$(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml
207 @$($(quiet)gen_xml)
208 @( \
209 echo "<programlisting>") > $@
210 @( \
211 expand --tabs=8 < $< | \
212 sed $(ESCAPE) $(DOCUMENTED) | \
213 sed 's/i\.e\./&ie;/') >> $@
214 @( \
215 echo "</programlisting>") >> $@
216
217$(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml
218 @$($(quiet)gen_xml)
219 @( \
220 echo "<programlisting>") > $@
221 @( \
222 expand --tabs=8 < $< | \
223 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
224 sed 's/i\.e\./&ie;/') >> $@
225 @( \
226 echo "</programlisting>") >> $@
227
228$(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml
229 @$($(quiet)gen_xml)
230 @( \
231 echo "<programlisting>") > $@
232 @( \
233 expand --tabs=8 < $< | \
234 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
235 sed 's/i\.e\./&ie;/') >> $@
236 @( \
237 echo "</programlisting>") >> $@
238
239$(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml
240 @$($(quiet)gen_xml)
241 @( \
242 echo "<programlisting>") > $@
243 @( \
244 expand --tabs=8 < $< | \
245 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
246 sed 's/i\.e\./&ie;/') >> $@
247 @( \
248 echo "</programlisting>") >> $@
249
250$(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml
251 @$($(quiet)gen_xml)
252 @( \
253 echo "<programlisting>") > $@
254 @( \
255 expand --tabs=8 < $< | \
256 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
257 sed 's/i\.e\./&ie;/') >> $@
258 @( \
259 echo "</programlisting>") >> $@
260
261$(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml
262 @$($(quiet)gen_xml)
263 @( \
264 echo "<programlisting>") > $@
265 @( \
266 expand --tabs=8 < $< | \
267 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
268 sed 's/i\.e\./&ie;/') >> $@
269 @( \
270 echo "</programlisting>") >> $@
271
272$(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml
273 @$($(quiet)gen_xml)
274 @( \
275 echo "<programlisting>") > $@
276 @( \
277 expand --tabs=8 < $< | \
278 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
279 sed 's/i\.e\./&ie;/') >> $@
280 @( \
281 echo "</programlisting>") >> $@
282
283$(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
284 @$($(quiet)gen_xml)
285 @( \
286 echo "<!-- Generated file! Do not edit. -->") >$@
287 @( \
288 echo -e "\n<!-- Functions -->") >>$@
289 @( \
290 for ident in $(FUNCS) ; do \
291 entity=`echo $$ident | tr _ -` ; \
292 echo "<!ENTITY func-$$entity \"<link" \
293 "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
294 >>$@ ; \
295 done)
296 @( \
297 echo -e "\n<!-- Ioctls -->") >>$@
298 @( \
299 for ident in $(IOCTLS) ; do \
300 entity=`echo $$ident | tr _ -` ; \
301 id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
302 echo "<!ENTITY $$entity \"<link" \
303 "linkend='$$id'><constant>$$ident</constant></link>\">" \
304 >>$@ ; \
305 done)
306 @( \
307 echo -e "\n<!-- Types -->") >>$@
308 @( \
309 for ident in $(TYPES) ; do \
310 entity=`echo $$ident | tr _ -` ; \
311 echo "<!ENTITY $$entity \"<link" \
312 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
313 done)
314 @( \
315 echo -e "\n<!-- Enums -->") >>$@
316 @( \
317 for ident in $(ENUMS) ; do \
318 entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
319 echo "<!ENTITY $$entity \"enum&nbsp;<link" \
320 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
321 done)
322 @( \
323 echo -e "\n<!-- Structures -->") >>$@
324 @( \
325 for ident in $(STRUCTS) ; do \
326 entity=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
327 echo "<!ENTITY $$entity \"struct&nbsp;<link" \
328 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
329 done)
330 @( \
331 echo -e "\n<!-- Error Codes -->") >>$@
332 @( \
333 for ident in $(ERRORS) ; do \
334 echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>" \
335 "error code\">" >>$@ ; \
336 done)
337 @( \
338 echo -e "\n<!-- Subsections -->") >>$@
339 @( \
340 for file in $(MEDIA_SGMLS) ; do \
341 entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
342 if ! echo "$$file" | \
343 grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \
344 echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \
345 fi ; \
346 done)
347 @( \
348 echo -e "\n<!-- Function Reference -->") >>$@
349 @( \
350 for file in $(MEDIA_SGMLS) ; do \
351 if echo "$$file" | \
352 grep -q -E -e '(func|vidioc|pixfmt)-' ; then \
353 entity=`echo "$$file" |sed $(FILENAME)` ; \
354 echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \
355 fi ; \
356 done)
357
358# Jade can auto-generate a list-of-tables, which includes all structs,
359# but we only want data types, all types, and sorted please.
360$(MEDIA_OBJ_DIR)/media-indices.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
361 @$($(quiet)gen_xml)
362 @( \
363 echo "<!-- Generated file! Do not edit. -->") >$@
364 @( \
365 echo -e "\n<index><title>List of Types</title>") >>$@
366 @( \
367 for ident in $(TYPES) ; do \
368 id=`echo $$ident | tr _ -` ; \
369 echo "<indexentry><primaryie><link" \
370 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
371 done)
372 @( \
373 for ident in $(ENUMS) ; do \
374 id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \
375 echo "<indexentry><primaryie>enum&nbsp;<link" \
376 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
377 done)
378 @( \
379 for ident in $(STRUCTS) ; do \
380 id=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
381 echo "<indexentry><primaryie>struct&nbsp;<link" \
382 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
383 done)
384 @( \
385 echo "</index>") >>$@
386
diff --git a/Documentation/DocBook/media/bayer.png.b64 b/Documentation/DocBook/media/bayer.png.b64
new file mode 100644
index 00000000000..ccdf2bcda95
--- /dev/null
+++ b/Documentation/DocBook/media/bayer.png.b64
@@ -0,0 +1,171 @@
1iVBORw0KGgoAAAANSUhEUgAAAlgAAACqCAMAAABGfcHVAAAAAXNSR0IArs4c6QAAAwBQTFRFAAIA
2CAICAAQVEQEBAgsAJgECAAogAwsTAQopHQYBNAEAAAxNARQAERIQAhoDABwAABZEHRQKGRYKQw0F
3ACMBACUAERwpHR4cVRAFBR5rZhADACR2JiIhBDAGAiWGgQ4AcxQABDYACSeQMSYlJykmESxYlQ4A
4PSYZIS05OSsJHS5JOC8kAEMDUC8SADXLNDUzADbEAEsAADX/2RABCFIAAD/qxB0AAD//BFgAK0Vp
5WT4r3hwA3RsTRERAAEf/5CIA2iYCCUv+WUgz7iIAOk5g3CgVSU5SiD8uB2sABm8AE1X/U1RQ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P23XYZWOew+/zq0xabB5Ziih+6Sw4WzhOE5F1U4NJE2+9BsJeHmD6Ptckm8iRfWgGH8awp
159dNddSi+LYHl5MPZHApYAZssjDB58YSOJwlrhzidsaAUCyNYKfXWLb7bZ6gJgecGJwba7zNs+EFjF
160atl5j42ZrJggPTwUeyswQWjMGXEAAAJqSURBVPpef366gV8rPCuddp9pYPGLkry7HrEx4+RgoTUo
161YbohU5zzs/FBLMjLfpPBgtFcXISeKK4Vnt+3OMEWh159qvTy44oJ0ntIJxxUYKUVoNu7nOEMjs5e
162YXcDOmJjmHHC1/F5G9rdkItWv6EKfsXM+3MMs80srsR1d3hnAxWMm9LKg5WTh3TOTGDUM++PMGgM
1639PrA4VH8adiKKa3m6Ye2UUjuwhMvAbBganNLK45YSdjJuXg/hh97+Z4QXjYTLDgY3iXQ/QQT6Mxx
1647wS8PFn08ln+fhI7OedmJo5wUjD0fixmmLRss244nhey2ccJW3jwfqwEfr/OyCU9wv21CNalEcwg
1658wZDaacQY59yiE/NmcBWITznt5Wxi2DBACJsQhH3Y/GnmSi968SGkLu8aD9WjrSM0h9veAjsx7Lz
16682z8Nq74wGlmgZXGzBW/AZsYKbkS92PF4xiBs4qWxUPkXvaFBCMcsEpy87Aod1ruLJlbwG/HlO0w
167hMcKln4oZDdNuXmBT+dONm8XKcqYdhbCljdLq2sFvMoFS/mOBHU5c6UAsi53ssiR+jTzBDaUt7Ss
168SbwJzSmTdH8+93GYX1TlCE4uUygDvZyn9nKUwSrJqZLePZO7tNsrtHUYdTDuTG9IL/tkYBAvORnu
169eff6Zb0qSo/OcADM3Pfu1VHWq3fAr2djlNlXudQXdCTYjV4L6uCodfEG97RwSL7nXa2zPwKwqFCJ
170mlCwqFCwqFCwqFCwqFChYFGhYFGhYFGhQsGiQsGiQsGiQoWCRYWCRYWCRYUKBYsKBYsKBYsKFQoW
171FQoWFQoWFSoULCqXq/w/gbudjI6bMwYAAAAASUVORK5CYII=
diff --git a/Documentation/DocBook/media/crop.gif.b64 b/Documentation/DocBook/media/crop.gif.b64
new file mode 100644
index 00000000000..11d936ae72e
--- /dev/null
+++ b/Documentation/DocBook/media/crop.gif.b64
@@ -0,0 +1,105 @@
1R0lGODlhuQJGAeMAAAAAAH9/fwCvAP8AANEA0dEAAK8Ar////wCOAAAA0QAA////////////////
2/////ywAAAAAuQJGAQAE/vDISau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqP
3yKRyyWw6n9CodEqtWq/YrHbL7Xq/4LB4TC6bz+i0es1uu9/wuHxOr9vv+Lx+z+/7/4CBgoOEhYaH
4iImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6gQC9vr/A
5wcLDxMXGx8jJysvMzc7P0NHS09TV1tfYxbth2d3e3+DRAePk5ebn6Onl4ezt7u3q8fLqANtg7/j5
6+s/z/f4B+wIKHAjsn8F09ex5IciwobuDEM1Bi0ixosWLGDNqrJhQIZdk/htDihxJsiTJiSZTqlzJ
7MmNHj1q+tRznsKbNmzhzDoz3EiYWmTN7+vQJgOfQmN5mAjzKtCg9pj+TBoU61ClCqlaAthSKVZdV
8dFy7NtHKMqxYW1/PmT2bhOzKtWxlpZUYF4pblXDrvpq7Tq+Tu+UGCB5MuLDhw4gTK17MuLHjx5Aj
9S55MubLly5gza95MmVxev0EAkxsg8jNoVXNJ0zy9RPQ41RtNsz6V2vPstlLTwdYo+zap2qt9G3Ed
10YLdL4bGAL0VOhLhxjL2Zf1IeXboM56Wtt6KuPXRudM8vVu+eiTt5H9hDjj9vyfyIXrTW80gfO4OC
11+/jz69/Pv7///wAG/ijggAQWaOCBCCao4IIMNujggRe4J4IwBxBg4YUYZqjhhhx26OGHIIYo4ogk
12loihMBbi1k084VlklgLsWQKjBRJqgIwEBJRyY4UqZsNidhjMGOMkQlLgnjERwkdBjuVpk2QFTB5B
13H2/2DUlJkRNYhWQKUTKyJQpdFjHlcUFaSaQxo9nGQph/fCkDm0OMCV2V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/JDb/Qpr/QmD/ECz746f/VYj/U8
97T++sjigYz/Jfn/AYsPBC7/Rkj/JJ//Ri//Qr//FKz/JU/+omnPV0X/dbT/FdXyco//ZCbwEHH/Z/
98//drb/Z9H/htz/Ypr/Fp7+zx/rt1//hXf/eB7LhkP/Qk7/eCn/hwr/kjf/lBv/d7v/mKj/ahn+4x
99P/CQn/o5zNM2jtIPnwGvvwPeDq6qX/uSf99I3PkeEPtE7+JVH761r/q3f+g+zft+7/tyv8HBn/rD
1007+jvLurJz+jL//jNT+nPb/qEbvXTb/f2fegP8v3gH/7iP/7kX/7m/n/+6D/707r93K8bnPH+8B//
1018j//9F//9n//+E//oez47J/1SmHJEHDkpNVenPXm3X8wFEeyNM8RCFa2BVA4lme6tm8g13e+9/lW
102UDgkFgOvW1K5ZDadT6hSVURGrVdsdvnjdntGcHhY1ZbNZ3Ra3ZkSyWt4XF7z1rtivNi+5/f9f8BA
103wUHCQsNDxETFHaO3uUfISDa7vErLS8xMzU3OTr1Az1DRUdJS0yBHSdXVyL3TV9hY2dmjRdtb3NxB
1042iNW3985XeFh4mLjY+Rk5WUeYOdn6Gjpaepq62vsbO1t7m7vb/Bw8XHycvNz9HT1dfZ293f4ePl5
105+nr7e/x8/X3+G37/f4ABBQ4kWNDgQYQJFS5k2NDhQ4gRJdKLAAA7
diff --git a/Documentation/DocBook/media/dvb/.gitignore b/Documentation/DocBook/media/dvb/.gitignore
new file mode 100644
index 00000000000..d7ec32eafac
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/.gitignore
@@ -0,0 +1 @@
!*.xml
diff --git a/Documentation/DocBook/media/dvb/audio.xml b/Documentation/DocBook/media/dvb/audio.xml
new file mode 100644
index 00000000000..a7ea56c71a2
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/audio.xml
@@ -0,0 +1,1314 @@
1<title>DVB Audio Device</title>
2<para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It
3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and
4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/audio.h</emphasis> in your
5application.
6</para>
7<para>Please note that some DVB cards don&#8217;t have their own MPEG decoder, which results in
8the omission of the audio and video device.
9</para>
10<para>
11These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use
12of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls
13have been created to replace that functionality.</para>
14
15<section id="audio_data_types">
16<title>Audio Data Types</title>
17<para>This section describes the structures, data types and defines used when talking to the
18audio device.
19</para>
20
21<section id="audio-stream-source-t">
22<title>audio_stream_source_t</title>
23<para>The audio stream source is set through the AUDIO_SELECT_SOURCE call and can take
24the following values, depending on whether we are replaying from an internal (demux) or
25external (user write) source.
26</para>
27<programlisting>
28typedef enum {
29 AUDIO_SOURCE_DEMUX,
30 AUDIO_SOURCE_MEMORY
31} audio_stream_source_t;
32</programlisting>
33<para>AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
34DVR device) as the source of the video stream. If AUDIO_SOURCE_MEMORY
35is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
36call.
37</para>
38
39</section>
40<section id="audio-play-state-t">
41<title>audio_play_state_t</title>
42<para>The following values can be returned by the AUDIO_GET_STATUS call representing the
43state of audio playback.
44</para>
45<programlisting>
46typedef enum {
47 AUDIO_STOPPED,
48 AUDIO_PLAYING,
49 AUDIO_PAUSED
50} audio_play_state_t;
51</programlisting>
52
53</section>
54<section id="audio-channel-select-t">
55<title>audio_channel_select_t</title>
56<para>The audio channel selected via AUDIO_CHANNEL_SELECT is determined by the
57following values.
58</para>
59<programlisting>
60typedef enum {
61 AUDIO_STEREO,
62 AUDIO_MONO_LEFT,
63 AUDIO_MONO_RIGHT,
64 AUDIO_MONO,
65 AUDIO_STEREO_SWAPPED
66} audio_channel_select_t;
67</programlisting>
68
69</section>
70<section id="audio-status">
71<title>struct audio_status</title>
72<para>The AUDIO_GET_STATUS call returns the following structure informing about various
73states of the playback operation.
74</para>
75<programlisting>
76typedef struct audio_status {
77 boolean AV_sync_state;
78 boolean mute_state;
79 audio_play_state_t play_state;
80 audio_stream_source_t stream_source;
81 audio_channel_select_t channel_select;
82 boolean bypass_mode;
83 audio_mixer_t mixer_state;
84} audio_status_t;
85</programlisting>
86
87</section>
88<section id="audio-mixer">
89<title>struct audio_mixer</title>
90<para>The following structure is used by the AUDIO_SET_MIXER call to set the audio
91volume.
92</para>
93<programlisting>
94typedef struct audio_mixer {
95 unsigned int volume_left;
96 unsigned int volume_right;
97} audio_mixer_t;
98</programlisting>
99
100</section>
101<section id="audio_encodings">
102<title>audio encodings</title>
103<para>A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the following
104bits set according to the hardwares capabilities.
105</para>
106<programlisting>
107 #define AUDIO_CAP_DTS 1
108 #define AUDIO_CAP_LPCM 2
109 #define AUDIO_CAP_MP1 4
110 #define AUDIO_CAP_MP2 8
111 #define AUDIO_CAP_MP3 16
112 #define AUDIO_CAP_AAC 32
113 #define AUDIO_CAP_OGG 64
114 #define AUDIO_CAP_SDDS 128
115 #define AUDIO_CAP_AC3 256
116</programlisting>
117
118</section>
119<section id="audio-karaoke">
120<title>struct audio_karaoke</title>
121<para>The ioctl AUDIO_SET_KARAOKE uses the following format:
122</para>
123<programlisting>
124typedef
125struct audio_karaoke {
126 int vocal1;
127 int vocal2;
128 int melody;
129} audio_karaoke_t;
130</programlisting>
131<para>If Vocal1 or Vocal2 are non-zero, they get mixed into left and right t at 70% each. If both,
132Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed into the left channel and Vocal2 into the
133right channel at 100% each. Ff Melody is non-zero, the melody channel gets mixed into left
134and right.
135</para>
136
137</section>
138<section id="audio-attributes-t">
139<title>audio attributes</title>
140<para>The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
141</para>
142<programlisting>
143 typedef uint16_t audio_attributes_t;
144 /&#x22C6; bits: descr. &#x22C6;/
145 /&#x22C6; 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, &#x22C6;/
146 /&#x22C6; 12 multichannel extension &#x22C6;/
147 /&#x22C6; 11-10 audio type (0=not spec, 1=language included) &#x22C6;/
148 /&#x22C6; 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) &#x22C6;/
149 /&#x22C6; 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, &#x22C6;/
150 /&#x22C6; 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) &#x22C6;/
151 /&#x22C6; 2- 0 number of audio channels (n+1 channels) &#x22C6;/
152</programlisting>
153 </section></section>
154<section id="audio_function_calls">
155<title>Audio Function Calls</title>
156
157
158<section id="audio_fopen">
159<title>open()</title>
160<para>DESCRIPTION
161</para>
162<informaltable><tgroup cols="1"><tbody><row><entry
163 align="char">
164<para>This system call opens a named audio device (e.g. /dev/dvb/adapter0/audio0)
165 for subsequent use. When an open() call has succeeded, the device will be ready
166 for use. The significance of blocking or non-blocking mode is described in the
167 documentation for functions where there is a difference. It does not affect the
168 semantics of the open() call itself. A device opened in blocking mode can later
169 be put into non-blocking mode (and vice versa) using the F_SETFL command
170 of the fcntl system call. This is a standard system call, documented in the Linux
171 manual page for fcntl. Only one user can open the Audio Device in O_RDWR
172 mode. All other attempts to open the device in this mode will fail, and an error
173 code will be returned. If the Audio Device is opened in O_RDONLY mode, the
174 only ioctl call that can be used is AUDIO_GET_STATUS. All other call will
175 return with an error code.</para>
176</entry>
177 </row></tbody></tgroup></informaltable>
178<para>SYNOPSIS
179</para>
180<informaltable><tgroup cols="1"><tbody><row><entry
181 align="char">
182<para>int open(const char &#x22C6;deviceName, int flags);</para>
183</entry>
184 </row></tbody></tgroup></informaltable>
185<para>PARAMETERS
186</para>
187<informaltable><tgroup cols="2"><tbody><row><entry
188 align="char">
189<para>const char
190 *deviceName</para>
191</entry><entry
192 align="char">
193<para>Name of specific audio device.</para>
194</entry>
195 </row><row><entry
196 align="char">
197<para>int flags</para>
198</entry><entry
199 align="char">
200<para>A bit-wise OR of the following flags:</para>
201</entry>
202 </row><row><entry
203 align="char">
204</entry><entry
205 align="char">
206<para>O_RDONLY read-only access</para>
207</entry>
208 </row><row><entry
209 align="char">
210</entry><entry
211 align="char">
212<para>O_RDWR read/write access</para>
213</entry>
214 </row><row><entry
215 align="char">
216</entry><entry
217 align="char">
218<para>O_NONBLOCK open in non-blocking mode</para>
219</entry>
220 </row><row><entry
221 align="char">
222</entry><entry
223 align="char">
224<para>(blocking mode is the default)</para>
225</entry>
226 </row></tbody></tgroup></informaltable>
227<para>RETURN VALUE</para>
228<informaltable><tgroup cols="2"><tbody><row><entry
229 align="char">
230<para>ENODEV</para>
231</entry><entry
232 align="char">
233<para>Device driver not loaded/available.</para>
234</entry>
235 </row><row><entry
236 align="char">
237<para>EBUSY</para>
238</entry><entry
239 align="char">
240<para>Device or resource busy.</para>
241</entry>
242 </row><row><entry
243 align="char">
244<para>EINVAL</para>
245</entry><entry
246 align="char">
247<para>Invalid argument.</para>
248</entry>
249 </row></tbody></tgroup></informaltable>
250
251</section>
252<section id="audio_fclose">
253<title>close()</title>
254<para>DESCRIPTION
255</para>
256<informaltable><tgroup cols="1"><tbody><row><entry
257 align="char">
258<para>This system call closes a previously opened audio device.</para>
259</entry>
260 </row></tbody></tgroup></informaltable>
261<para>SYNOPSIS
262</para>
263<informaltable><tgroup cols="1"><tbody><row><entry
264 align="char">
265<para>int close(int fd);</para>
266</entry>
267 </row></tbody></tgroup></informaltable>
268<para>PARAMETERS
269</para>
270<informaltable><tgroup cols="2"><tbody><row><entry
271 align="char">
272<para>int fd</para>
273</entry><entry
274 align="char">
275<para>File descriptor returned by a previous call to open().</para>
276</entry>
277 </row></tbody></tgroup></informaltable>
278<para>RETURN VALUE</para>
279<informaltable><tgroup cols="2"><tbody><row><entry
280 align="char">
281<para>EBADF</para>
282</entry><entry
283 align="char">
284<para>fd is not a valid open file descriptor.</para>
285</entry>
286 </row></tbody></tgroup></informaltable>
287
288</section>
289<section id="audio_fwrite">
290<title>write()</title>
291<para>DESCRIPTION
292</para>
293<informaltable><tgroup cols="1"><tbody><row><entry
294 align="char">
295<para>This system call can only be used if AUDIO_SOURCE_MEMORY is selected
296 in the ioctl call AUDIO_SELECT_SOURCE. The data provided shall be in
297 PES format. If O_NONBLOCK is not specified the function will block until
298 buffer space is available. The amount of data to be transferred is implied by
299 count.</para>
300</entry>
301 </row></tbody></tgroup></informaltable>
302<para>SYNOPSIS
303</para>
304<informaltable><tgroup cols="1"><tbody><row><entry
305 align="char">
306<para>size_t write(int fd, const void &#x22C6;buf, size_t count);</para>
307</entry>
308 </row></tbody></tgroup></informaltable>
309<para>PARAMETERS
310</para>
311<informaltable><tgroup cols="2"><tbody><row><entry
312 align="char">
313<para>int fd</para>
314</entry><entry
315 align="char">
316<para>File descriptor returned by a previous call to open().</para>
317</entry>
318 </row><row><entry
319 align="char">
320<para>void *buf</para>
321</entry><entry
322 align="char">
323<para>Pointer to the buffer containing the PES data.</para>
324</entry>
325 </row><row><entry
326 align="char">
327<para>size_t count</para>
328</entry><entry
329 align="char">
330<para>Size of buf.</para>
331</entry>
332 </row></tbody></tgroup></informaltable>
333<para>RETURN VALUE</para>
334<informaltable><tgroup cols="2"><tbody><row><entry
335 align="char">
336<para>EPERM</para>
337</entry><entry
338 align="char">
339<para>Mode AUDIO_SOURCE_MEMORY not selected.</para>
340</entry>
341 </row><row><entry
342 align="char">
343<para>ENOMEM</para>
344</entry><entry
345 align="char">
346<para>Attempted to write more data than the internal buffer can
347 hold.</para>
348</entry>
349 </row><row><entry
350 align="char">
351<para>EBADF</para>
352</entry><entry
353 align="char">
354<para>fd is not a valid open file descriptor.</para>
355</entry>
356 </row></tbody></tgroup></informaltable>
357
358</section><section id="AUDIO_STOP"
359role="subsection"><title>AUDIO_STOP</title>
360<para>DESCRIPTION
361</para>
362<informaltable><tgroup cols="1"><tbody><row><entry
363 align="char">
364<para>This ioctl call asks the Audio Device to stop playing the current stream.</para>
365</entry>
366 </row></tbody></tgroup></informaltable>
367<para>SYNOPSIS
368</para>
369<informaltable><tgroup cols="1"><tbody><row><entry
370 align="char">
371<para>int ioctl(int fd, int request = AUDIO_STOP);</para>
372</entry>
373 </row></tbody></tgroup></informaltable>
374<para>PARAMETERS
375</para>
376<informaltable><tgroup cols="2"><tbody><row><entry
377 align="char">
378<para>int fd</para>
379</entry><entry
380 align="char">
381<para>File descriptor returned by a previous call to open().</para>
382</entry>
383 </row><row><entry
384 align="char">
385<para>int request</para>
386</entry><entry
387 align="char">
388<para>Equals AUDIO_STOP for this command.</para>
389</entry>
390 </row></tbody></tgroup></informaltable>
391&return-value-dvb;
392
393</section><section id="AUDIO_PLAY"
394role="subsection"><title>AUDIO_PLAY</title>
395<para>DESCRIPTION
396</para>
397<informaltable><tgroup cols="1"><tbody><row><entry
398 align="char">
399<para>This ioctl call asks the Audio Device to start playing an audio stream from the
400 selected source.</para>
401</entry>
402 </row></tbody></tgroup></informaltable>
403<para>SYNOPSIS
404</para>
405<informaltable><tgroup cols="1"><tbody><row><entry
406 align="char">
407<para>int ioctl(int fd, int request = AUDIO_PLAY);</para>
408</entry>
409 </row></tbody></tgroup></informaltable>
410<para>PARAMETERS
411</para>
412<informaltable><tgroup cols="2"><tbody><row><entry
413 align="char">
414<para>int fd</para>
415</entry><entry
416 align="char">
417<para>File descriptor returned by a previous call to open().</para>
418</entry>
419 </row><row><entry
420 align="char">
421<para>int request</para>
422</entry><entry
423 align="char">
424<para>Equals AUDIO_PLAY for this command.</para>
425</entry>
426 </row></tbody></tgroup></informaltable>
427&return-value-dvb;
428
429</section><section id="AUDIO_PAUSE"
430role="subsection"><title>AUDIO_PAUSE</title>
431<para>DESCRIPTION
432</para>
433<informaltable><tgroup cols="1"><tbody><row><entry
434 align="char">
435<para>This ioctl call suspends the audio stream being played. Decoding and playing
436 are paused. It is then possible to restart again decoding and playing process of
437 the audio stream using AUDIO_CONTINUE command.</para>
438</entry>
439 </row><row><entry
440 align="char">
441<para>If AUDIO_SOURCE_MEMORY is selected in the ioctl call
442 AUDIO_SELECT_SOURCE, the DVB-subsystem will not decode (consume)
443 any more data until the ioctl call AUDIO_CONTINUE or AUDIO_PLAY is
444 performed.</para>
445</entry>
446 </row></tbody></tgroup></informaltable>
447<para>SYNOPSIS
448</para>
449<informaltable><tgroup cols="1"><tbody><row><entry
450 align="char">
451<para>int ioctl(int fd, int request = AUDIO_PAUSE);</para>
452</entry>
453 </row></tbody></tgroup></informaltable>
454<para>PARAMETERS
455</para>
456<informaltable><tgroup cols="2"><tbody><row><entry
457 align="char">
458<para>int fd</para>
459</entry><entry
460 align="char">
461<para>File descriptor returned by a previous call to open().</para>
462</entry>
463 </row><row><entry
464 align="char">
465<para>int request</para>
466</entry><entry
467 align="char">
468<para>Equals AUDIO_PAUSE for this command.</para>
469</entry>
470 </row></tbody></tgroup></informaltable>
471&return-value-dvb;
472
473</section><section id="AUDIO_CONTINUE"
474role="subsection"><title>AUDIO_CONTINUE</title>
475<para>DESCRIPTION
476</para>
477<informaltable><tgroup cols="1"><tbody><row><entry
478 align="char">
479<para>This ioctl restarts the decoding and playing process previously paused
480with AUDIO_PAUSE command.</para>
481</entry>
482 </row><row><entry
483 align="char">
484<para>It only works if the stream were previously stopped with AUDIO_PAUSE</para>
485</entry>
486 </row></tbody></tgroup></informaltable>
487<para>SYNOPSIS
488</para>
489<informaltable><tgroup cols="1"><tbody><row><entry
490 align="char">
491<para>int ioctl(int fd, int request = AUDIO_CONTINUE);</para>
492</entry>
493 </row></tbody></tgroup></informaltable>
494<para>PARAMETERS
495</para>
496<informaltable><tgroup cols="2"><tbody><row><entry
497 align="char">
498<para>int fd</para>
499</entry><entry
500 align="char">
501<para>File descriptor returned by a previous call to open().</para>
502</entry>
503 </row><row><entry
504 align="char">
505<para>int request</para>
506</entry><entry
507 align="char">
508<para>Equals AUDIO_CONTINUE for this command.</para>
509</entry>
510 </row></tbody></tgroup></informaltable>
511&return-value-dvb;
512
513</section><section id="AUDIO_SELECT_SOURCE"
514role="subsection"><title>AUDIO_SELECT_SOURCE</title>
515<para>DESCRIPTION
516</para>
517<informaltable><tgroup cols="1"><tbody><row><entry
518 align="char">
519<para>This ioctl call informs the audio device which source shall be used
520 for the input data. The possible sources are demux or memory. If
521 AUDIO_SOURCE_MEMORY is selected, the data is fed to the Audio Device
522 through the write command.</para>
523</entry>
524 </row></tbody></tgroup></informaltable>
525<para>SYNOPSIS
526</para>
527<informaltable><tgroup cols="1"><tbody><row><entry
528 align="char">
529<para>int ioctl(int fd, int request = AUDIO_SELECT_SOURCE,
530 audio_stream_source_t source);</para>
531</entry>
532 </row></tbody></tgroup></informaltable>
533<para>PARAMETERS
534</para>
535<informaltable><tgroup cols="2"><tbody><row><entry
536 align="char">
537<para>int fd</para>
538</entry><entry
539 align="char">
540<para>File descriptor returned by a previous call to open().</para>
541</entry>
542 </row><row><entry
543 align="char">
544<para>int request</para>
545</entry><entry
546 align="char">
547<para>Equals AUDIO_SELECT_SOURCE for this command.</para>
548</entry>
549 </row><row><entry
550 align="char">
551<para>audio_stream_source_t
552 source</para>
553</entry><entry
554 align="char">
555<para>Indicates the source that shall be used for the Audio
556 stream.</para>
557</entry>
558 </row></tbody></tgroup></informaltable>
559&return-value-dvb;
560
561</section><section id="AUDIO_SET_MUTE"
562role="subsection"><title>AUDIO_SET_MUTE</title>
563<para>DESCRIPTION
564</para>
565<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
566&VIDIOC-DECODER-CMD; with the <constant>V4L2_DEC_CMD_START_MUTE_AUDIO</constant> flag instead.</para>
567<informaltable><tgroup cols="1"><tbody><row><entry
568 align="char">
569<para>This ioctl call asks the audio device to mute the stream that is currently being
570 played.</para>
571</entry>
572 </row></tbody></tgroup></informaltable>
573<para>SYNOPSIS
574</para>
575<informaltable><tgroup cols="1"><tbody><row><entry
576 align="char">
577<para>int ioctl(int fd, int request = AUDIO_SET_MUTE,
578 boolean state);</para>
579</entry>
580 </row></tbody></tgroup></informaltable>
581<para>PARAMETERS
582</para>
583<informaltable><tgroup cols="2"><tbody><row><entry
584 align="char">
585<para>int fd</para>
586</entry><entry
587 align="char">
588<para>File descriptor returned by a previous call to open().</para>
589</entry>
590 </row><row><entry
591 align="char">
592<para>int request</para>
593</entry><entry
594 align="char">
595<para>Equals AUDIO_SET_MUTE for this command.</para>
596</entry>
597 </row><row><entry
598 align="char">
599<para>boolean state</para>
600</entry><entry
601 align="char">
602<para>Indicates if audio device shall mute or not.</para>
603</entry>
604 </row><row><entry
605 align="char">
606</entry><entry
607 align="char">
608<para>TRUE Audio Mute</para>
609</entry>
610 </row><row><entry
611 align="char">
612</entry><entry
613 align="char">
614<para>FALSE Audio Un-mute</para>
615</entry>
616 </row></tbody></tgroup></informaltable>
617&return-value-dvb;
618
619</section><section id="AUDIO_SET_AV_SYNC"
620role="subsection"><title>AUDIO_SET_AV_SYNC</title>
621<para>DESCRIPTION
622</para>
623<informaltable><tgroup cols="1"><tbody><row><entry
624 align="char">
625<para>This ioctl call asks the Audio Device to turn ON or OFF A/V synchronization.</para>
626</entry>
627 </row></tbody></tgroup></informaltable>
628<para>SYNOPSIS
629</para>
630<informaltable><tgroup cols="1"><tbody><row><entry
631 align="char">
632<para>int ioctl(int fd, int request = AUDIO_SET_AV_SYNC,
633 boolean state);</para>
634</entry>
635 </row></tbody></tgroup></informaltable>
636<para>PARAMETERS
637</para>
638<informaltable><tgroup cols="2"><tbody><row><entry
639 align="char">
640<para>int fd</para>
641</entry><entry
642 align="char">
643<para>File descriptor returned by a previous call to open().</para>
644</entry>
645 </row><row><entry
646 align="char">
647<para>int request</para>
648</entry><entry
649 align="char">
650<para>Equals AUDIO_AV_SYNC for this command.</para>
651</entry>
652 </row><row><entry
653 align="char">
654<para>boolean state</para>
655</entry><entry
656 align="char">
657<para>Tells the DVB subsystem if A/V synchronization shall be
658 ON or OFF.</para>
659</entry>
660 </row><row><entry
661 align="char">
662</entry><entry
663 align="char">
664<para>TRUE AV-sync ON</para>
665</entry>
666 </row><row><entry
667 align="char">
668</entry><entry
669 align="char">
670<para>FALSE AV-sync OFF</para>
671</entry>
672 </row></tbody></tgroup></informaltable>
673&return-value-dvb;
674
675</section><section id="AUDIO_SET_BYPASS_MODE"
676role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
677<para>DESCRIPTION
678</para>
679<informaltable><tgroup cols="1"><tbody><row><entry
680 align="char">
681<para>This ioctl call asks the Audio Device to bypass the Audio decoder and forward
682 the stream without decoding. This mode shall be used if streams that can&#8217;t be
683 handled by the DVB system shall be decoded. Dolby DigitalTM streams are
684 automatically forwarded by the DVB subsystem if the hardware can handle it.</para>
685</entry>
686 </row></tbody></tgroup></informaltable>
687<para>SYNOPSIS
688</para>
689<informaltable><tgroup cols="1"><tbody><row><entry
690 align="char">
691<para>int ioctl(int fd, int request =
692 AUDIO_SET_BYPASS_MODE, boolean mode);</para>
693</entry>
694 </row></tbody></tgroup></informaltable>
695<para>PARAMETERS
696</para>
697<informaltable><tgroup cols="2"><tbody><row><entry
698 align="char">
699<para>int fd</para>
700</entry><entry
701 align="char">
702<para>File descriptor returned by a previous call to open().</para>
703</entry>
704 </row><row><entry
705 align="char">
706<para>int request</para>
707</entry><entry
708 align="char">
709<para>Equals AUDIO_SET_BYPASS_MODE for this
710 command.</para>
711</entry>
712 </row><row><entry
713 align="char">
714<para>boolean mode</para>
715</entry><entry
716 align="char">
717<para>Enables or disables the decoding of the current Audio
718 stream in the DVB subsystem.</para>
719</entry>
720 </row><row><entry
721 align="char">
722</entry><entry
723 align="char">
724<para>TRUE Bypass is disabled</para>
725</entry>
726 </row><row><entry
727 align="char">
728</entry><entry
729 align="char">
730<para>FALSE Bypass is enabled</para>
731</entry>
732 </row></tbody></tgroup></informaltable>
733&return-value-dvb;
734
735</section><section id="AUDIO_CHANNEL_SELECT"
736role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
737<para>DESCRIPTION
738</para>
739<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
740<constant>V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK</constant> control instead.</para>
741<informaltable><tgroup cols="1"><tbody><row><entry
742 align="char">
743<para>This ioctl call asks the Audio Device to select the requested channel if possible.</para>
744</entry>
745 </row></tbody></tgroup></informaltable>
746<para>SYNOPSIS
747</para>
748<informaltable><tgroup cols="1"><tbody><row><entry
749 align="char">
750<para>int ioctl(int fd, int request =
751 AUDIO_CHANNEL_SELECT, audio_channel_select_t);</para>
752</entry>
753 </row></tbody></tgroup></informaltable>
754<para>PARAMETERS
755</para>
756<informaltable><tgroup cols="2"><tbody><row><entry
757 align="char">
758<para>int fd</para>
759</entry><entry
760 align="char">
761<para>File descriptor returned by a previous call to open().</para>
762</entry>
763 </row><row><entry
764 align="char">
765<para>int request</para>
766</entry><entry
767 align="char">
768<para>Equals AUDIO_CHANNEL_SELECT for this
769 command.</para>
770</entry>
771 </row><row><entry
772 align="char">
773<para>audio_channel_select_t
774 ch</para>
775</entry><entry
776 align="char">
777<para>Select the output format of the audio (mono left/right,
778 stereo).</para>
779</entry>
780 </row></tbody></tgroup></informaltable>
781&return-value-dvb;
782
783</section><section id="AUDIO_BILINGUAL_CHANNEL_SELECT"
784role="subsection"><title>AUDIO_BILINGUAL_CHANNEL_SELECT</title>
785<para>DESCRIPTION
786</para>
787<para>This ioctl is obsolete. Do not use in new drivers. It has been replaced by
788the V4L2 <constant>V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK</constant> control
789for MPEG decoders controlled through V4L2.</para>
790<informaltable><tgroup cols="1"><tbody><row><entry
791 align="char">
792<para>This ioctl call asks the Audio Device to select the requested channel for bilingual streams if possible.</para>
793</entry>
794 </row></tbody></tgroup></informaltable>
795<para>SYNOPSIS
796</para>
797<informaltable><tgroup cols="1"><tbody><row><entry
798 align="char">
799<para>int ioctl(int fd, int request =
800 AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t);</para>
801</entry>
802 </row></tbody></tgroup></informaltable>
803<para>PARAMETERS
804</para>
805<informaltable><tgroup cols="2"><tbody><row><entry
806 align="char">
807<para>int fd</para>
808</entry><entry
809 align="char">
810<para>File descriptor returned by a previous call to open().</para>
811</entry>
812 </row><row><entry
813 align="char">
814<para>int request</para>
815</entry><entry
816 align="char">
817<para>Equals AUDIO_BILINGUAL_CHANNEL_SELECT for this
818 command.</para>
819</entry>
820 </row><row><entry
821 align="char">
822<para>audio_channel_select_t
823ch</para>
824</entry><entry
825 align="char">
826<para>Select the output format of the audio (mono left/right,
827 stereo).</para>
828</entry>
829 </row>
830</tbody></tgroup></informaltable>
831&return-value-dvb;
832
833</section><section id="AUDIO_GET_PTS"
834role="subsection"><title>AUDIO_GET_PTS</title>
835<para>DESCRIPTION
836</para>
837<para>This ioctl is obsolete. Do not use in new drivers. If you need this functionality,
838then please contact the linux-media mailing list (&v4l-ml;).</para>
839<informaltable><tgroup cols="1"><tbody><row><entry
840 align="char">
841<para>This ioctl call asks the Audio Device to return the current PTS timestamp.</para>
842</entry>
843 </row></tbody></tgroup></informaltable>
844<para>SYNOPSIS
845</para>
846<informaltable><tgroup cols="1"><tbody><row><entry
847 align="char">
848<para>int ioctl(int fd, int request =
849 AUDIO_GET_PTS, __u64 *pts);</para>
850</entry>
851 </row></tbody></tgroup></informaltable>
852<para>PARAMETERS
853</para>
854<informaltable><tgroup cols="2"><tbody><row><entry
855 align="char">
856<para>int fd</para>
857</entry><entry
858 align="char">
859<para>File descriptor returned by a previous call to open().</para>
860</entry>
861 </row><row><entry
862 align="char">
863<para>int request</para>
864</entry><entry
865 align="char">
866<para>Equals AUDIO_GET_PTS for this
867 command.</para>
868</entry>
869 </row><row><entry
870 align="char">
871<para>__u64 *pts
872</para>
873</entry><entry
874 align="char">
875<para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
876</para>
877<para>
878The PTS should belong to the currently played
879frame if possible, but may also be a value close to it
880like the PTS of the last decoded frame or the last PTS
881extracted by the PES parser.</para>
882</entry>
883 </row></tbody></tgroup></informaltable>
884&return-value-dvb;
885
886</section><section id="AUDIO_GET_STATUS"
887role="subsection"><title>AUDIO_GET_STATUS</title>
888<para>DESCRIPTION
889</para>
890<informaltable><tgroup cols="1"><tbody><row><entry
891 align="char">
892<para>This ioctl call asks the Audio Device to return the current state of the Audio
893 Device.</para>
894</entry>
895 </row></tbody></tgroup></informaltable>
896<para>SYNOPSIS
897</para>
898<informaltable><tgroup cols="1"><tbody><row><entry
899 align="char">
900<para>int ioctl(int fd, int request = AUDIO_GET_STATUS,
901 struct audio_status &#x22C6;status);</para>
902</entry>
903 </row></tbody></tgroup></informaltable>
904<para>PARAMETERS
905</para>
906<informaltable><tgroup cols="2"><tbody><row><entry
907 align="char">
908<para>int fd</para>
909</entry><entry
910 align="char">
911<para>File descriptor returned by a previous call to open().</para>
912</entry>
913 </row><row><entry
914 align="char">
915<para>int request</para>
916</entry><entry
917 align="char">
918<para>Equals AUDIO_GET_STATUS for this command.</para>
919</entry>
920 </row><row><entry
921 align="char">
922<para>struct audio_status
923 *status</para>
924</entry><entry
925 align="char">
926<para>Returns the current state of Audio Device.</para>
927</entry>
928 </row></tbody></tgroup></informaltable>
929&return-value-dvb;
930
931</section><section id="AUDIO_GET_CAPABILITIES"
932role="subsection"><title>AUDIO_GET_CAPABILITIES</title>
933<para>DESCRIPTION
934</para>
935<informaltable><tgroup cols="1"><tbody><row><entry
936 align="char">
937<para>This ioctl call asks the Audio Device to tell us about the decoding capabilities
938 of the audio hardware.</para>
939</entry>
940 </row></tbody></tgroup></informaltable>
941<para>SYNOPSIS
942</para>
943<informaltable><tgroup cols="1"><tbody><row><entry
944 align="char">
945<para>int ioctl(int fd, int request =
946 AUDIO_GET_CAPABILITIES, unsigned int &#x22C6;cap);</para>
947</entry>
948 </row></tbody></tgroup></informaltable>
949<para>PARAMETERS
950</para>
951<informaltable><tgroup cols="2"><tbody><row><entry
952 align="char">
953<para>int fd</para>
954</entry><entry
955 align="char">
956<para>File descriptor returned by a previous call to open().</para>
957</entry>
958 </row><row><entry
959 align="char">
960<para>int request</para>
961</entry><entry
962 align="char">
963<para>Equals AUDIO_GET_CAPABILITIES for this
964 command.</para>
965</entry>
966 </row><row><entry
967 align="char">
968<para>unsigned int *cap</para>
969</entry><entry
970 align="char">
971<para>Returns a bit array of supported sound formats.</para>
972</entry>
973 </row></tbody></tgroup></informaltable>
974&return-value-dvb;
975
976</section><section id="AUDIO_CLEAR_BUFFER"
977role="subsection"><title>AUDIO_CLEAR_BUFFER</title>
978<para>DESCRIPTION
979</para>
980<informaltable><tgroup cols="1"><tbody><row><entry
981 align="char">
982<para>This ioctl call asks the Audio Device to clear all software and hardware buffers
983 of the audio decoder device.</para>
984</entry>
985 </row></tbody></tgroup></informaltable>
986<para>SYNOPSIS
987</para>
988<informaltable><tgroup cols="1"><tbody><row><entry
989 align="char">
990<para>int ioctl(int fd, int request = AUDIO_CLEAR_BUFFER);</para>
991</entry>
992 </row></tbody></tgroup></informaltable>
993<para>PARAMETERS
994</para>
995<informaltable><tgroup cols="2"><tbody><row><entry
996 align="char">
997<para>int fd</para>
998</entry><entry
999 align="char">
1000<para>File descriptor returned by a previous call to open().</para>
1001</entry>
1002 </row><row><entry
1003 align="char">
1004<para>int request</para>
1005</entry><entry
1006 align="char">
1007<para>Equals AUDIO_CLEAR_BUFFER for this command.</para>
1008</entry>
1009 </row></tbody></tgroup></informaltable>
1010&return-value-dvb;
1011
1012</section><section id="AUDIO_SET_ID"
1013role="subsection"><title>AUDIO_SET_ID</title>
1014<para>DESCRIPTION
1015</para>
1016<informaltable><tgroup cols="1"><tbody><row><entry
1017 align="char">
1018<para>This ioctl selects which sub-stream is to be decoded if a program or system
1019 stream is sent to the video device. If no audio stream type is set the id has to be
1020 in [0xC0,0xDF] for MPEG sound, in [0x80,0x87] for AC3 and in [0xA0,0xA7]
1021 for LPCM. More specifications may follow for other stream types. If the stream
1022 type is set the id just specifies the substream id of the audio stream and only
1023 the first 5 bits are recognized.</para>
1024</entry>
1025 </row></tbody></tgroup></informaltable>
1026<para>SYNOPSIS
1027</para>
1028<informaltable><tgroup cols="1"><tbody><row><entry
1029 align="char">
1030<para>int ioctl(int fd, int request = AUDIO_SET_ID, int
1031 id);</para>
1032</entry>
1033 </row></tbody></tgroup></informaltable>
1034<para>PARAMETERS
1035</para>
1036<informaltable><tgroup cols="2"><tbody><row><entry
1037 align="char">
1038<para>int fd</para>
1039</entry><entry
1040 align="char">
1041<para>File descriptor returned by a previous call to open().</para>
1042</entry>
1043 </row><row><entry
1044 align="char">
1045<para>int request</para>
1046</entry><entry
1047 align="char">
1048<para>Equals AUDIO_SET_ID for this command.</para>
1049</entry>
1050 </row><row><entry
1051 align="char">
1052<para>int id</para>
1053</entry><entry
1054 align="char">
1055<para>audio sub-stream id</para>
1056</entry>
1057 </row></tbody></tgroup></informaltable>
1058&return-value-dvb;
1059
1060</section><section id="AUDIO_SET_MIXER"
1061role="subsection"><title>AUDIO_SET_MIXER</title>
1062<para>DESCRIPTION
1063</para>
1064<informaltable><tgroup cols="1"><tbody><row><entry
1065 align="char">
1066<para>This ioctl lets you adjust the mixer settings of the audio decoder.</para>
1067</entry>
1068 </row></tbody></tgroup></informaltable>
1069<para>SYNOPSIS
1070</para>
1071<informaltable><tgroup cols="1"><tbody><row><entry
1072 align="char">
1073<para>int ioctl(int fd, int request = AUDIO_SET_MIXER,
1074 audio_mixer_t &#x22C6;mix);</para>
1075</entry>
1076 </row></tbody></tgroup></informaltable>
1077<para>PARAMETERS
1078</para>
1079<informaltable><tgroup cols="2"><tbody><row><entry
1080 align="char">
1081<para>int fd</para>
1082</entry><entry
1083 align="char">
1084<para>File descriptor returned by a previous call to open().</para>
1085</entry>
1086 </row><row><entry
1087 align="char">
1088<para>int request</para>
1089</entry><entry
1090 align="char">
1091<para>Equals AUDIO_SET_ID for this command.</para>
1092</entry>
1093 </row><row><entry
1094 align="char">
1095<para>audio_mixer_t *mix</para>
1096</entry><entry
1097 align="char">
1098<para>mixer settings.</para>
1099</entry>
1100 </row></tbody></tgroup></informaltable>
1101&return-value-dvb;
1102
1103</section><section id="AUDIO_SET_STREAMTYPE"
1104role="subsection"><title>AUDIO_SET_STREAMTYPE</title>
1105<para>DESCRIPTION
1106</para>
1107<informaltable><tgroup cols="1"><tbody><row><entry
1108 align="char">
1109<para>This ioctl tells the driver which kind of audio stream to expect. This is useful
1110 if the stream offers several audio sub-streams like LPCM and AC3.</para>
1111</entry>
1112 </row></tbody></tgroup></informaltable>
1113<para>SYNOPSIS
1114</para>
1115<informaltable><tgroup cols="1"><tbody><row><entry
1116 align="char">
1117<para>int ioctl(fd, int request = AUDIO_SET_STREAMTYPE,
1118 int type);</para>
1119</entry>
1120 </row></tbody></tgroup></informaltable>
1121<para>PARAMETERS
1122</para>
1123<informaltable><tgroup cols="2"><tbody><row><entry
1124 align="char">
1125<para>int fd</para>
1126</entry><entry
1127 align="char">
1128<para>File descriptor returned by a previous call to open().</para>
1129</entry>
1130 </row><row><entry
1131 align="char">
1132<para>int request</para>
1133</entry><entry
1134 align="char">
1135<para>Equals AUDIO_SET_STREAMTYPE for this
1136 command.</para>
1137</entry>
1138 </row><row><entry
1139 align="char">
1140<para>int type</para>
1141</entry><entry
1142 align="char">
1143<para>stream type</para>
1144</entry>
1145 </row></tbody></tgroup></informaltable>
1146&return-value-dvb;
1147<informaltable><tgroup cols="2"><tbody><row><entry
1148 align="char">
1149<para>EINVAL</para>
1150</entry><entry
1151 align="char">
1152<para>type is not a valid or supported stream type.</para>
1153</entry>
1154 </row></tbody></tgroup></informaltable>
1155
1156</section><section id="AUDIO_SET_EXT_ID"
1157role="subsection"><title>AUDIO_SET_EXT_ID</title>
1158<para>DESCRIPTION
1159</para>
1160<informaltable><tgroup cols="1"><tbody><row><entry
1161 align="char">
1162<para>This ioctl can be used to set the extension id for MPEG streams in DVD
1163 playback. Only the first 3 bits are recognized.</para>
1164</entry>
1165 </row></tbody></tgroup></informaltable>
1166<para>SYNOPSIS
1167</para>
1168<informaltable><tgroup cols="1"><tbody><row><entry
1169 align="char">
1170<para>int ioctl(fd, int request = AUDIO_SET_EXT_ID, int
1171 id);</para>
1172</entry>
1173 </row></tbody></tgroup></informaltable>
1174<para>PARAMETERS
1175</para>
1176<informaltable><tgroup cols="2"><tbody><row><entry
1177 align="char">
1178<para>int fd</para>
1179</entry><entry
1180 align="char">
1181<para>File descriptor returned by a previous call to open().</para>
1182</entry>
1183 </row><row><entry
1184 align="char">
1185<para>int request</para>
1186</entry><entry
1187 align="char">
1188<para>Equals AUDIO_SET_EXT_ID for this command.</para>
1189</entry>
1190 </row><row><entry
1191 align="char">
1192<para>int id</para>
1193</entry><entry
1194 align="char">
1195<para>audio sub_stream_id</para>
1196</entry>
1197 </row></tbody></tgroup></informaltable>
1198&return-value-dvb;
1199<informaltable><tgroup cols="2"><tbody><row><entry
1200 align="char">
1201<para>EINVAL</para>
1202</entry><entry
1203 align="char">
1204<para>id is not a valid id.</para>
1205</entry>
1206 </row></tbody></tgroup></informaltable>
1207
1208</section><section id="AUDIO_SET_ATTRIBUTES"
1209role="subsection"><title>AUDIO_SET_ATTRIBUTES</title>
1210<para>DESCRIPTION
1211</para>
1212<informaltable><tgroup cols="1"><tbody><row><entry
1213 align="char">
1214<para>This ioctl is intended for DVD playback and allows you to set certain
1215 information about the audio stream.</para>
1216</entry>
1217 </row></tbody></tgroup></informaltable>
1218<para>SYNOPSIS
1219</para>
1220<informaltable><tgroup cols="1"><tbody><row><entry
1221 align="char">
1222<para>int ioctl(fd, int request = AUDIO_SET_ATTRIBUTES,
1223 audio_attributes_t attr );</para>
1224</entry>
1225 </row></tbody></tgroup></informaltable>
1226<para>PARAMETERS
1227</para>
1228<informaltable><tgroup cols="2"><tbody><row><entry
1229 align="char">
1230<para>int fd</para>
1231</entry><entry
1232 align="char">
1233<para>File descriptor returned by a previous call to open().</para>
1234</entry>
1235 </row><row><entry
1236 align="char">
1237<para>int request</para>
1238</entry><entry
1239 align="char">
1240<para>Equals AUDIO_SET_ATTRIBUTES for this command.</para>
1241</entry>
1242 </row><row><entry
1243 align="char">
1244<para>audio_attributes_t
1245 attr</para>
1246</entry><entry
1247 align="char">
1248<para>audio attributes according to section ??</para>
1249</entry>
1250 </row></tbody></tgroup></informaltable>
1251&return-value-dvb;
1252<informaltable><tgroup cols="2"><tbody><row><entry
1253 align="char">
1254<para>EINVAL</para>
1255</entry><entry
1256 align="char">
1257<para>attr is not a valid or supported attribute setting.</para>
1258</entry>
1259 </row></tbody></tgroup></informaltable>
1260
1261</section><section id="AUDIO_SET_KARAOKE"
1262role="subsection"><title>AUDIO_SET_KARAOKE</title>
1263<para>DESCRIPTION
1264</para>
1265<informaltable><tgroup cols="1"><tbody><row><entry
1266 align="char">
1267<para>This ioctl allows one to set the mixer settings for a karaoke DVD.</para>
1268</entry>
1269 </row></tbody></tgroup></informaltable>
1270<para>SYNOPSIS
1271</para>
1272<informaltable><tgroup cols="1"><tbody><row><entry
1273 align="char">
1274<para>int ioctl(fd, int request = AUDIO_SET_KARAOKE,
1275 audio_karaoke_t &#x22C6;karaoke);</para>
1276</entry>
1277 </row></tbody></tgroup></informaltable>
1278<para>PARAMETERS
1279</para>
1280<informaltable><tgroup cols="2"><tbody><row><entry
1281 align="char">
1282<para>int fd</para>
1283</entry><entry
1284 align="char">
1285<para>File descriptor returned by a previous call to open().</para>
1286</entry>
1287 </row><row><entry
1288 align="char">
1289<para>int request</para>
1290</entry><entry
1291 align="char">
1292<para>Equals AUDIO_SET_KARAOKE for this
1293 command.</para>
1294</entry>
1295 </row><row><entry
1296 align="char">
1297<para>audio_karaoke_t
1298 *karaoke</para>
1299</entry><entry
1300 align="char">
1301<para>karaoke settings according to section ??.</para>
1302</entry>
1303 </row></tbody></tgroup></informaltable>
1304&return-value-dvb;
1305<informaltable><tgroup cols="2"><tbody><row><entry
1306 align="char">
1307<para>EINVAL</para>
1308</entry><entry
1309 align="char">
1310<para>karaoke is not a valid or supported karaoke setting.</para>
1311</entry>
1312 </row></tbody></tgroup></informaltable>
1313 </section>
1314</section>
diff --git a/Documentation/DocBook/media/dvb/ca.xml b/Documentation/DocBook/media/dvb/ca.xml
new file mode 100644
index 00000000000..85eaf4fe293
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/ca.xml
@@ -0,0 +1,582 @@
1<title>DVB CA Device</title>
2<para>The DVB CA device controls the conditional access hardware. It can be accessed through
3<emphasis role="tt">/dev/dvb/adapter0/ca0</emphasis>. Data types and and ioctl definitions can be accessed by
4including <emphasis role="tt">linux/dvb/ca.h</emphasis> in your application.
5</para>
6
7<section id="ca_data_types">
8<title>CA Data Types</title>
9
10
11<section id="ca-slot-info">
12<title>ca_slot_info_t</title>
13 <programlisting>
14typedef struct ca_slot_info {
15 int num; /&#x22C6; slot number &#x22C6;/
16
17 int type; /&#x22C6; CA interface this slot supports &#x22C6;/
18#define CA_CI 1 /&#x22C6; CI high level interface &#x22C6;/
19#define CA_CI_LINK 2 /&#x22C6; CI link layer level interface &#x22C6;/
20#define CA_CI_PHYS 4 /&#x22C6; CI physical layer level interface &#x22C6;/
21#define CA_DESCR 8 /&#x22C6; built-in descrambler &#x22C6;/
22#define CA_SC 128 /&#x22C6; simple smart card interface &#x22C6;/
23
24 unsigned int flags;
25#define CA_CI_MODULE_PRESENT 1 /&#x22C6; module (or card) inserted &#x22C6;/
26#define CA_CI_MODULE_READY 2
27} ca_slot_info_t;
28</programlisting>
29
30</section>
31<section id="ca-descr-info">
32<title>ca_descr_info_t</title>
33<programlisting>
34typedef struct ca_descr_info {
35 unsigned int num; /&#x22C6; number of available descramblers (keys) &#x22C6;/
36 unsigned int type; /&#x22C6; type of supported scrambling system &#x22C6;/
37#define CA_ECD 1
38#define CA_NDS 2
39#define CA_DSS 4
40} ca_descr_info_t;
41</programlisting>
42
43</section>
44<section id="ca-caps">
45<title>ca_caps_t</title>
46<programlisting>
47typedef struct ca_caps {
48 unsigned int slot_num; /&#x22C6; total number of CA card and module slots &#x22C6;/
49 unsigned int slot_type; /&#x22C6; OR of all supported types &#x22C6;/
50 unsigned int descr_num; /&#x22C6; total number of descrambler slots (keys) &#x22C6;/
51 unsigned int descr_type;/&#x22C6; OR of all supported types &#x22C6;/
52 } ca_cap_t;
53</programlisting>
54
55</section>
56<section id="ca-msg">
57<title>ca_msg_t</title>
58<programlisting>
59/&#x22C6; a message to/from a CI-CAM &#x22C6;/
60typedef struct ca_msg {
61 unsigned int index;
62 unsigned int type;
63 unsigned int length;
64 unsigned char msg[256];
65} ca_msg_t;
66</programlisting>
67
68</section>
69<section id="ca-descr">
70<title>ca_descr_t</title>
71<programlisting>
72typedef struct ca_descr {
73 unsigned int index;
74 unsigned int parity;
75 unsigned char cw[8];
76} ca_descr_t;
77</programlisting>
78</section>
79
80<section id="ca-pid">
81<title>ca-pid</title>
82<programlisting>
83typedef struct ca_pid {
84 unsigned int pid;
85 int index; /&#x22C6; -1 == disable&#x22C6;/
86} ca_pid_t;
87</programlisting>
88</section></section>
89
90<section id="ca_function_calls">
91<title>CA Function Calls</title>
92
93
94<section id="ca_fopen">
95<title>open()</title>
96<para>DESCRIPTION
97</para>
98<informaltable><tgroup cols="1"><tbody><row><entry
99 align="char">
100<para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
101<para>When an open() call has succeeded, the device will be ready for use.
102 The significance of blocking or non-blocking mode is described in the
103 documentation for functions where there is a difference. It does not affect the
104 semantics of the open() call itself. A device opened in blocking mode can later
105 be put into non-blocking mode (and vice versa) using the F_SETFL command
106 of the fcntl system call. This is a standard system call, documented in the Linux
107 manual page for fcntl. Only one user can open the CA Device in O_RDWR
108 mode. All other attempts to open the device in this mode will fail, and an error
109 code will be returned.</para>
110</entry>
111 </row></tbody></tgroup></informaltable>
112<para>SYNOPSIS
113</para>
114<informaltable><tgroup cols="1"><tbody><row><entry
115 align="char">
116<para>int open(const char &#x22C6;deviceName, int flags);</para>
117</entry>
118 </row></tbody></tgroup></informaltable>
119<para>PARAMETERS
120</para>
121<informaltable><tgroup cols="2"><tbody><row><entry
122 align="char">
123<para>const char
124 *deviceName</para>
125</entry><entry
126 align="char">
127<para>Name of specific video device.</para>
128</entry>
129 </row><row><entry
130 align="char">
131<para>int flags</para>
132</entry><entry
133 align="char">
134<para>A bit-wise OR of the following flags:</para>
135</entry>
136 </row><row><entry
137 align="char">
138</entry><entry
139 align="char">
140<para>O_RDONLY read-only access</para>
141</entry>
142 </row><row><entry
143 align="char">
144</entry><entry
145 align="char">
146<para>O_RDWR read/write access</para>
147</entry>
148 </row><row><entry
149 align="char">
150</entry><entry
151 align="char">
152<para>O_NONBLOCK open in non-blocking mode</para>
153</entry>
154 </row><row><entry
155 align="char">
156</entry><entry
157 align="char">
158<para>(blocking mode is the default)</para>
159</entry>
160 </row></tbody></tgroup></informaltable>
161<para>RETURN VALUE</para>
162<informaltable><tgroup cols="2"><tbody><row><entry
163 align="char">
164<para>ENODEV</para>
165</entry><entry
166 align="char">
167<para>Device driver not loaded/available.</para>
168</entry>
169 </row><row><entry
170 align="char">
171<para>EINTERNAL</para>
172</entry><entry
173 align="char">
174<para>Internal error.</para>
175</entry>
176 </row><row><entry
177 align="char">
178<para>EBUSY</para>
179</entry><entry
180 align="char">
181<para>Device or resource busy.</para>
182</entry>
183 </row><row><entry
184 align="char">
185<para>EINVAL</para>
186</entry><entry
187 align="char">
188<para>Invalid argument.</para>
189</entry>
190 </row></tbody></tgroup></informaltable>
191
192</section>
193<section id="ca_fclose">
194<title>close()</title>
195<para>DESCRIPTION
196</para>
197<informaltable><tgroup cols="1"><tbody><row><entry
198 align="char">
199<para>This system call closes a previously opened audio device.</para>
200</entry>
201 </row></tbody></tgroup></informaltable>
202<para>SYNOPSIS
203</para>
204<informaltable><tgroup cols="1"><tbody><row><entry
205 align="char">
206<para>int close(int fd);</para>
207</entry>
208 </row></tbody></tgroup></informaltable>
209<para>PARAMETERS
210</para>
211<informaltable><tgroup cols="2"><tbody><row><entry
212 align="char">
213<para>int fd</para>
214</entry><entry
215 align="char">
216<para>File descriptor returned by a previous call to open().</para>
217</entry>
218 </row></tbody></tgroup></informaltable>
219<para>RETURN VALUE</para>
220<informaltable><tgroup cols="2"><tbody><row><entry
221 align="char">
222<para>EBADF</para>
223</entry><entry
224 align="char">
225<para>fd is not a valid open file descriptor.</para>
226</entry>
227 </row></tbody></tgroup></informaltable>
228 </section>
229
230<section id="CA_RESET"
231role="subsection"><title>CA_RESET</title>
232<para>DESCRIPTION
233</para>
234<informaltable><tgroup cols="1"><tbody><row><entry
235 align="char">
236<para>This ioctl is undocumented. Documentation is welcome.</para>
237</entry>
238 </row></tbody></tgroup></informaltable>
239<para>SYNOPSIS
240</para>
241<informaltable><tgroup cols="1"><tbody><row><entry
242 align="char">
243<para>int ioctl(fd, int request = CA_RESET);
244</para>
245</entry>
246 </row></tbody></tgroup></informaltable>
247<para>PARAMETERS
248</para>
249<informaltable><tgroup cols="2"><tbody><row><entry
250 align="char">
251<para>int fd</para>
252</entry><entry
253 align="char">
254<para>File descriptor returned by a previous call to open().</para>
255</entry>
256 </row><row><entry
257 align="char">
258<para>int request</para>
259</entry><entry
260 align="char">
261<para>Equals CA_RESET for this command.</para>
262</entry>
263 </row></tbody></tgroup></informaltable>
264&return-value-dvb;
265</section>
266
267<section id="CA_GET_CAP"
268role="subsection"><title>CA_GET_CAP</title>
269<para>DESCRIPTION
270</para>
271<informaltable><tgroup cols="1"><tbody><row><entry
272 align="char">
273<para>This ioctl is undocumented. Documentation is welcome.</para>
274</entry>
275 </row></tbody></tgroup></informaltable>
276<para>SYNOPSIS
277</para>
278<informaltable><tgroup cols="1"><tbody><row><entry
279 align="char">
280<para>int ioctl(fd, int request = CA_GET_CAP,
281 ca_caps_t *);</para>
282</entry>
283 </row></tbody></tgroup></informaltable>
284<para>PARAMETERS
285</para>
286<informaltable><tgroup cols="2"><tbody><row><entry
287 align="char">
288<para>int fd</para>
289</entry><entry
290 align="char">
291<para>File descriptor returned by a previous call to open().</para>
292</entry>
293 </row><row><entry
294 align="char">
295<para>int request</para>
296</entry><entry
297 align="char">
298<para>Equals CA_GET_CAP for this command.</para>
299</entry>
300 </row><row><entry
301 align="char">
302<para>ca_caps_t *
303</para>
304</entry><entry
305 align="char">
306<para>Undocumented.</para>
307</entry>
308 </row></tbody></tgroup></informaltable>
309&return-value-dvb;
310</section>
311
312<section id="CA_GET_SLOT_INFO"
313role="subsection"><title>CA_GET_SLOT_INFO</title>
314<para>DESCRIPTION
315</para>
316<informaltable><tgroup cols="1"><tbody><row><entry
317 align="char">
318<para>This ioctl is undocumented. Documentation is welcome.</para>
319</entry>
320 </row></tbody></tgroup></informaltable>
321<para>SYNOPSIS
322</para>
323<informaltable><tgroup cols="1"><tbody><row><entry
324 align="char">
325<para>int ioctl(fd, int request = CA_GET_SLOT_INFO,
326 ca_slot_info_t *);</para>
327</entry>
328 </row></tbody></tgroup></informaltable>
329<para>PARAMETERS
330</para>
331<informaltable><tgroup cols="2"><tbody><row><entry
332 align="char">
333<para>int fd</para>
334</entry><entry
335 align="char">
336<para>File descriptor returned by a previous call to open().</para>
337</entry>
338 </row><row><entry
339 align="char">
340<para>int request</para>
341</entry><entry
342 align="char">
343<para>Equals CA_GET_SLOT_INFO for this command.</para>
344</entry>
345 </row><row><entry
346 align="char">
347<para>ca_slot_info_t *
348</para>
349</entry><entry
350 align="char">
351<para>Undocumented.</para>
352</entry>
353 </row></tbody></tgroup></informaltable>
354&return-value-dvb;
355</section>
356
357<section id="CA_GET_DESCR_INFO"
358role="subsection"><title>CA_GET_DESCR_INFO</title>
359<para>DESCRIPTION
360</para>
361<informaltable><tgroup cols="1"><tbody><row><entry
362 align="char">
363<para>This ioctl is undocumented. Documentation is welcome.</para>
364</entry>
365 </row></tbody></tgroup></informaltable>
366<para>SYNOPSIS
367</para>
368<informaltable><tgroup cols="1"><tbody><row><entry
369 align="char">
370<para>int ioctl(fd, int request = CA_GET_DESCR_INFO,
371 ca_descr_info_t *);</para>
372</entry>
373 </row></tbody></tgroup></informaltable>
374<para>PARAMETERS
375</para>
376<informaltable><tgroup cols="2"><tbody><row><entry
377 align="char">
378<para>int fd</para>
379</entry><entry
380 align="char">
381<para>File descriptor returned by a previous call to open().</para>
382</entry>
383 </row><row><entry
384 align="char">
385<para>int request</para>
386</entry><entry
387 align="char">
388<para>Equals CA_GET_DESCR_INFO for this command.</para>
389</entry>
390 </row><row><entry
391 align="char">
392<para>ca_descr_info_t *
393</para>
394</entry><entry
395 align="char">
396<para>Undocumented.</para>
397</entry>
398 </row></tbody></tgroup></informaltable>
399&return-value-dvb;
400</section>
401
402<section id="CA_GET_MSG"
403role="subsection"><title>CA_GET_MSG</title>
404<para>DESCRIPTION
405</para>
406<informaltable><tgroup cols="1"><tbody><row><entry
407 align="char">
408<para>This ioctl is undocumented. Documentation is welcome.</para>
409</entry>
410 </row></tbody></tgroup></informaltable>
411<para>SYNOPSIS
412</para>
413<informaltable><tgroup cols="1"><tbody><row><entry
414 align="char">
415<para>int ioctl(fd, int request = CA_GET_MSG,
416 ca_msg_t *);</para>
417</entry>
418 </row></tbody></tgroup></informaltable>
419<para>PARAMETERS
420</para>
421<informaltable><tgroup cols="2"><tbody><row><entry
422 align="char">
423<para>int fd</para>
424</entry><entry
425 align="char">
426<para>File descriptor returned by a previous call to open().</para>
427</entry>
428 </row><row><entry
429 align="char">
430<para>int request</para>
431</entry><entry
432 align="char">
433<para>Equals CA_GET_MSG for this command.</para>
434</entry>
435 </row><row><entry
436 align="char">
437<para>ca_msg_t *
438</para>
439</entry><entry
440 align="char">
441<para>Undocumented.</para>
442</entry>
443 </row></tbody></tgroup></informaltable>
444&return-value-dvb;
445</section>
446
447<section id="CA_SEND_MSG"
448role="subsection"><title>CA_SEND_MSG</title>
449<para>DESCRIPTION
450</para>
451<informaltable><tgroup cols="1"><tbody><row><entry
452 align="char">
453<para>This ioctl is undocumented. Documentation is welcome.</para>
454</entry>
455 </row></tbody></tgroup></informaltable>
456<para>SYNOPSIS
457</para>
458<informaltable><tgroup cols="1"><tbody><row><entry
459 align="char">
460<para>int ioctl(fd, int request = CA_SEND_MSG,
461 ca_msg_t *);</para>
462</entry>
463 </row></tbody></tgroup></informaltable>
464<para>PARAMETERS
465</para>
466<informaltable><tgroup cols="2"><tbody><row><entry
467 align="char">
468<para>int fd</para>
469</entry><entry
470 align="char">
471<para>File descriptor returned by a previous call to open().</para>
472</entry>
473 </row><row><entry
474 align="char">
475<para>int request</para>
476</entry><entry
477 align="char">
478<para>Equals CA_SEND_MSG for this command.</para>
479</entry>
480 </row><row><entry
481 align="char">
482<para>ca_msg_t *
483</para>
484</entry><entry
485 align="char">
486<para>Undocumented.</para>
487</entry>
488 </row></tbody></tgroup></informaltable>
489&return-value-dvb;
490</section>
491
492<section id="CA_SET_DESCR"
493role="subsection"><title>CA_SET_DESCR</title>
494<para>DESCRIPTION
495</para>
496<informaltable><tgroup cols="1"><tbody><row><entry
497 align="char">
498<para>This ioctl is undocumented. Documentation is welcome.</para>
499</entry>
500 </row></tbody></tgroup></informaltable>
501<para>SYNOPSIS
502</para>
503<informaltable><tgroup cols="1"><tbody><row><entry
504 align="char">
505<para>int ioctl(fd, int request = CA_SET_DESCR,
506 ca_descr_t *);</para>
507</entry>
508 </row></tbody></tgroup></informaltable>
509<para>PARAMETERS
510</para>
511<informaltable><tgroup cols="2"><tbody><row><entry
512 align="char">
513<para>int fd</para>
514</entry><entry
515 align="char">
516<para>File descriptor returned by a previous call to open().</para>
517</entry>
518 </row><row><entry
519 align="char">
520<para>int request</para>
521</entry><entry
522 align="char">
523<para>Equals CA_SET_DESCR for this command.</para>
524</entry>
525 </row><row><entry
526 align="char">
527<para>ca_descr_t *
528</para>
529</entry><entry
530 align="char">
531<para>Undocumented.</para>
532</entry>
533 </row></tbody></tgroup></informaltable>
534&return-value-dvb;
535</section>
536
537<section id="CA_SET_PID"
538role="subsection"><title>CA_SET_PID</title>
539<para>DESCRIPTION
540</para>
541<informaltable><tgroup cols="1"><tbody><row><entry
542 align="char">
543<para>This ioctl is undocumented. Documentation is welcome.</para>
544</entry>
545 </row></tbody></tgroup></informaltable>
546<para>SYNOPSIS
547</para>
548<informaltable><tgroup cols="1"><tbody><row><entry
549 align="char">
550<para>int ioctl(fd, int request = CA_SET_PID,
551 ca_pid_t *);</para>
552</entry>
553 </row></tbody></tgroup></informaltable>
554<para>PARAMETERS
555</para>
556<informaltable><tgroup cols="2"><tbody><row><entry
557 align="char">
558<para>int fd</para>
559</entry><entry
560 align="char">
561<para>File descriptor returned by a previous call to open().</para>
562</entry>
563 </row><row><entry
564 align="char">
565<para>int request</para>
566</entry><entry
567 align="char">
568<para>Equals CA_SET_PID for this command.</para>
569</entry>
570 </row><row><entry
571 align="char">
572<para>ca_pid_t *
573</para>
574</entry><entry
575 align="char">
576<para>Undocumented.</para>
577</entry>
578 </row></tbody></tgroup></informaltable>
579&return-value-dvb;
580</section>
581
582</section>
diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml
new file mode 100644
index 00000000000..86de89cfbd6
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/demux.xml
@@ -0,0 +1,1130 @@
1<title>DVB Demux Device</title>
2
3<para>The DVB demux device controls the filters of the DVB hardware/software. It can be
4accessed through <emphasis role="tt">/dev/adapter0/demux0</emphasis>. Data types and and ioctl definitions can be
5accessed by including <emphasis role="tt">linux/dvb/dmx.h</emphasis> in your application.
6</para>
7<section id="dmx_types">
8<title>Demux Data Types</title>
9
10<section id="dmx-output-t">
11<title>dmx_output_t</title>
12<programlisting>
13typedef enum
14{
15 DMX_OUT_DECODER, /&#x22C6; Streaming directly to decoder. &#x22C6;/
16 DMX_OUT_TAP, /&#x22C6; Output going to a memory buffer &#x22C6;/
17 /&#x22C6; (to be retrieved via the read command).&#x22C6;/
18 DMX_OUT_TS_TAP, /&#x22C6; Output multiplexed into a new TS &#x22C6;/
19 /&#x22C6; (to be retrieved by reading from the &#x22C6;/
20 /&#x22C6; logical DVR device). &#x22C6;/
21 DMX_OUT_TSDEMUX_TAP /&#x22C6; Like TS_TAP but retrieved from the DMX device &#x22C6;/
22} dmx_output_t;
23</programlisting>
24<para><emphasis role="tt">DMX_OUT_TAP</emphasis> delivers the stream output to the demux device on which the ioctl is
25called.
26</para>
27<para><emphasis role="tt">DMX_OUT_TS_TAP</emphasis> routes output to the logical DVR device <emphasis role="tt">/dev/dvb/adapter0/dvr0</emphasis>,
28which delivers a TS multiplexed from all filters for which <emphasis role="tt">DMX_OUT_TS_TAP</emphasis> was
29specified.
30</para>
31</section>
32
33<section id="dmx-input-t">
34<title>dmx_input_t</title>
35<programlisting>
36typedef enum
37{
38 DMX_IN_FRONTEND, /&#x22C6; Input from a front-end device. &#x22C6;/
39 DMX_IN_DVR /&#x22C6; Input from the logical DVR device. &#x22C6;/
40} dmx_input_t;
41</programlisting>
42</section>
43
44<section id="dmx-pes-type-t">
45<title>dmx_pes_type_t</title>
46<programlisting>
47typedef enum
48{
49 DMX_PES_AUDIO0,
50 DMX_PES_VIDEO0,
51 DMX_PES_TELETEXT0,
52 DMX_PES_SUBTITLE0,
53 DMX_PES_PCR0,
54
55 DMX_PES_AUDIO1,
56 DMX_PES_VIDEO1,
57 DMX_PES_TELETEXT1,
58 DMX_PES_SUBTITLE1,
59 DMX_PES_PCR1,
60
61 DMX_PES_AUDIO2,
62 DMX_PES_VIDEO2,
63 DMX_PES_TELETEXT2,
64 DMX_PES_SUBTITLE2,
65 DMX_PES_PCR2,
66
67 DMX_PES_AUDIO3,
68 DMX_PES_VIDEO3,
69 DMX_PES_TELETEXT3,
70 DMX_PES_SUBTITLE3,
71 DMX_PES_PCR3,
72
73 DMX_PES_OTHER
74} dmx_pes_type_t;
75</programlisting>
76</section>
77
78<section id="dmx-filter">
79<title>struct dmx_filter</title>
80 <programlisting>
81 typedef struct dmx_filter
82{
83 __u8 filter[DMX_FILTER_SIZE];
84 __u8 mask[DMX_FILTER_SIZE];
85 __u8 mode[DMX_FILTER_SIZE];
86} dmx_filter_t;
87</programlisting>
88</section>
89
90<section id="dmx-sct-filter-params">
91<title>struct dmx_sct_filter_params</title>
92<programlisting>
93struct dmx_sct_filter_params
94{
95 __u16 pid;
96 dmx_filter_t filter;
97 __u32 timeout;
98 __u32 flags;
99#define DMX_CHECK_CRC 1
100#define DMX_ONESHOT 2
101#define DMX_IMMEDIATE_START 4
102#define DMX_KERNEL_CLIENT 0x8000
103};
104</programlisting>
105</section>
106
107<section id="dmx-pes-filter-params">
108<title>struct dmx_pes_filter_params</title>
109<programlisting>
110struct dmx_pes_filter_params
111{
112 __u16 pid;
113 dmx_input_t input;
114 dmx_output_t output;
115 dmx_pes_type_t pes_type;
116 __u32 flags;
117};
118</programlisting>
119</section>
120
121<section id="dmx-event">
122<title>struct dmx_event</title>
123 <programlisting>
124 struct dmx_event
125 {
126 dmx_event_t event;
127 time_t timeStamp;
128 union
129 {
130 dmx_scrambling_status_t scrambling;
131 } u;
132 };
133</programlisting>
134</section>
135
136<section id="dmx-stc">
137<title>struct dmx_stc</title>
138<programlisting>
139struct dmx_stc {
140 unsigned int num; /&#x22C6; input : which STC? 0..N &#x22C6;/
141 unsigned int base; /&#x22C6; output: divisor for stc to get 90 kHz clock &#x22C6;/
142 __u64 stc; /&#x22C6; output: stc in 'base'&#x22C6;90 kHz units &#x22C6;/
143};
144</programlisting>
145</section>
146
147<section id="dmx-caps">
148<title>struct dmx_caps</title>
149<programlisting>
150 typedef struct dmx_caps {
151 __u32 caps;
152 int num_decoders;
153} dmx_caps_t;
154</programlisting>
155</section>
156
157<section id="dmx-source-t">
158<title>enum dmx_source_t</title>
159<programlisting>
160typedef enum {
161 DMX_SOURCE_FRONT0 = 0,
162 DMX_SOURCE_FRONT1,
163 DMX_SOURCE_FRONT2,
164 DMX_SOURCE_FRONT3,
165 DMX_SOURCE_DVR0 = 16,
166 DMX_SOURCE_DVR1,
167 DMX_SOURCE_DVR2,
168 DMX_SOURCE_DVR3
169} dmx_source_t;
170</programlisting>
171</section>
172
173</section>
174<section id="dmx_fcalls">
175<title>Demux Function Calls</title>
176
177<section id="dmx_fopen">
178<title>open()</title>
179<para>DESCRIPTION
180</para>
181<informaltable><tgroup cols="1"><tbody><row><entry
182 align="char">
183<para>This system call, used with a device name of /dev/dvb/adapter0/demux0,
184 allocates a new filter and returns a handle which can be used for subsequent
185 control of that filter. This call has to be made for each filter to be used, i.e. every
186 returned file descriptor is a reference to a single filter. /dev/dvb/adapter0/dvr0
187 is a logical device to be used for retrieving Transport Streams for digital
188 video recording. When reading from this device a transport stream containing
189 the packets from all PES filters set in the corresponding demux device
190 (/dev/dvb/adapter0/demux0) having the output set to DMX_OUT_TS_TAP. A
191 recorded Transport Stream is replayed by writing to this device. </para>
192<para>The significance of blocking or non-blocking mode is described in the
193 documentation for functions where there is a difference. It does not affect the
194 semantics of the open() call itself. A device opened in blocking mode can later
195 be put into non-blocking mode (and vice versa) using the F_SETFL command
196 of the fcntl system call.</para>
197</entry>
198 </row></tbody></tgroup></informaltable>
199<para>SYNOPSIS
200</para>
201<informaltable><tgroup cols="1"><tbody><row><entry
202 align="char">
203<para>int open(const char &#x22C6;deviceName, int flags);</para>
204</entry>
205 </row></tbody></tgroup></informaltable>
206<para>PARAMETERS
207</para>
208<informaltable><tgroup cols="2"><tbody><row><entry
209 align="char">
210<para>const char
211 *deviceName</para>
212</entry><entry
213 align="char">
214<para>Name of demux device.</para>
215</entry>
216 </row><row><entry
217 align="char">
218<para>int flags</para>
219</entry><entry
220 align="char">
221<para>A bit-wise OR of the following flags:</para>
222</entry>
223 </row><row><entry
224 align="char">
225</entry><entry
226 align="char">
227<para>O_RDWR read/write access</para>
228</entry>
229 </row><row><entry
230 align="char">
231</entry><entry
232 align="char">
233<para>O_NONBLOCK open in non-blocking mode</para>
234</entry>
235 </row><row><entry
236 align="char">
237</entry><entry
238 align="char">
239<para>(blocking mode is the default)</para>
240</entry>
241 </row></tbody></tgroup></informaltable>
242<para>RETURN VALUE</para>
243<informaltable><tgroup cols="2"><tbody><row><entry
244 align="char">
245<para>ENODEV</para>
246</entry><entry
247 align="char">
248<para>Device driver not loaded/available.</para>
249</entry>
250 </row><row><entry
251 align="char">
252<para>EINVAL</para>
253</entry><entry
254 align="char">
255<para>Invalid argument.</para>
256</entry>
257 </row><row><entry
258 align="char">
259<para>EMFILE</para>
260</entry><entry
261 align="char">
262<para>&#8220;Too many open files&#8221;, i.e. no more filters available.</para>
263</entry>
264 </row><row><entry
265 align="char">
266<para>ENOMEM</para>
267</entry><entry
268 align="char">
269<para>The driver failed to allocate enough memory.</para>
270</entry>
271 </row></tbody></tgroup></informaltable>
272</section>
273
274<section id="dmx_fclose">
275<title>close()</title>
276<para>DESCRIPTION
277</para>
278<informaltable><tgroup cols="1"><tbody><row><entry
279 align="char">
280<para>This system call deactivates and deallocates a filter that was previously
281 allocated via the open() call.</para>
282</entry>
283 </row></tbody></tgroup></informaltable>
284<para>SYNOPSIS
285</para>
286<informaltable><tgroup cols="1"><tbody><row><entry
287 align="char">
288<para>int close(int fd);</para>
289</entry>
290 </row></tbody></tgroup></informaltable>
291<para>PARAMETERS
292</para>
293<informaltable><tgroup cols="2"><tbody><row><entry
294 align="char">
295<para>int fd</para>
296</entry><entry
297 align="char">
298<para>File descriptor returned by a previous call to open().</para>
299</entry>
300 </row></tbody></tgroup></informaltable>
301<para>RETURN VALUE</para>
302<informaltable><tgroup cols="2"><tbody><row><entry
303 align="char">
304<para>EBADF</para>
305</entry><entry
306 align="char">
307<para>fd is not a valid open file descriptor.</para>
308</entry>
309 </row></tbody></tgroup></informaltable>
310</section>
311
312<section id="dmx_fread">
313<title>read()</title>
314<para>DESCRIPTION
315</para>
316<informaltable><tgroup cols="1"><tbody><row><entry
317 align="char">
318<para>This system call returns filtered data, which might be section or PES data. The
319 filtered data is transferred from the driver&#8217;s internal circular buffer to buf. The
320 maximum amount of data to be transferred is implied by count.</para>
321</entry>
322 </row><row><entry
323 align="char">
324<para>When returning section data the driver always tries to return a complete single
325 section (even though buf would provide buffer space for more data). If the size
326 of the buffer is smaller than the section as much as possible will be returned,
327 and the remaining data will be provided in subsequent calls.</para>
328</entry>
329 </row><row><entry
330 align="char">
331<para>The size of the internal buffer is 2 * 4096 bytes (the size of two maximum
332 sized sections) by default. The size of this buffer may be changed by using the
333 DMX_SET_BUFFER_SIZE function. If the buffer is not large enough, or if
334 the read operations are not performed fast enough, this may result in a buffer
335 overflow error. In this case EOVERFLOW will be returned, and the circular
336 buffer will be emptied. This call is blocking if there is no data to return, i.e. the
337 process will be put to sleep waiting for data, unless the O_NONBLOCK flag
338 is specified.</para>
339</entry>
340 </row><row><entry
341 align="char">
342<para>Note that in order to be able to read, the filtering process has to be started
343 by defining either a section or a PES filter by means of the ioctl functions,
344 and then starting the filtering process via the DMX_START ioctl function
345 or by setting the DMX_IMMEDIATE_START flag. If the reading is done
346 from a logical DVR demux device, the data will constitute a Transport Stream
347 including the packets from all PES filters in the corresponding demux device
348 /dev/dvb/adapter0/demux0 having the output set to DMX_OUT_TS_TAP.</para>
349</entry>
350 </row></tbody></tgroup></informaltable>
351<para>SYNOPSIS
352</para>
353<informaltable><tgroup cols="1"><tbody><row><entry
354 align="char">
355<para>size_t read(int fd, void &#x22C6;buf, size_t count);</para>
356</entry>
357 </row></tbody></tgroup></informaltable>
358<para>PARAMETERS
359</para>
360<informaltable><tgroup cols="2"><tbody><row><entry
361 align="char">
362<para>int fd</para>
363</entry><entry
364 align="char">
365<para>File descriptor returned by a previous call to open().</para>
366</entry>
367 </row><row><entry
368 align="char">
369<para>void *buf</para>
370</entry><entry
371 align="char">
372<para>Pointer to the buffer to be used for returned filtered data.</para>
373</entry>
374 </row><row><entry
375 align="char">
376<para>size_t count</para>
377</entry><entry
378 align="char">
379<para>Size of buf.</para>
380</entry>
381 </row></tbody></tgroup></informaltable>
382<para>RETURN VALUE</para>
383<informaltable><tgroup cols="2"><tbody><row><entry
384 align="char">
385<para>EWOULDBLOCK</para>
386</entry><entry
387 align="char">
388<para>No data to return and O_NONBLOCK was specified.</para>
389</entry>
390 </row><row><entry
391 align="char">
392<para>EBADF</para>
393</entry><entry
394 align="char">
395<para>fd is not a valid open file descriptor.</para>
396</entry>
397 </row><row><entry
398 align="char">
399<para>ECRC</para>
400</entry><entry
401 align="char">
402<para>Last section had a CRC error - no data returned. The
403 buffer is flushed.</para>
404</entry>
405 </row><row><entry
406 align="char">
407<para>EOVERFLOW</para>
408</entry><entry
409 align="char">
410</entry>
411 </row><row><entry
412 align="char">
413</entry><entry
414 align="char">
415<para>The filtered data was not read from the buffer in due
416 time, resulting in non-read data being lost. The buffer is
417 flushed.</para>
418</entry>
419 </row><row><entry
420 align="char">
421<para>ETIMEDOUT</para>
422</entry><entry
423 align="char">
424<para>The section was not loaded within the stated timeout
425 period. See ioctl DMX_SET_FILTER for how to set a
426 timeout.</para>
427</entry>
428 </row><row><entry
429 align="char">
430<para>EFAULT</para>
431</entry><entry
432 align="char">
433<para>The driver failed to write to the callers buffer due to an
434 invalid *buf pointer.</para>
435</entry>
436 </row></tbody></tgroup></informaltable>
437</section>
438
439<section id="dmx_fwrite">
440<title>write()</title>
441<para>DESCRIPTION
442</para>
443<informaltable><tgroup cols="1"><tbody><row><entry
444 align="char">
445<para>This system call is only provided by the logical device /dev/dvb/adapter0/dvr0,
446 associated with the physical demux device that provides the actual DVR
447 functionality. It is used for replay of a digitally recorded Transport Stream.
448 Matching filters have to be defined in the corresponding physical demux
449 device, /dev/dvb/adapter0/demux0. The amount of data to be transferred is
450 implied by count.</para>
451</entry>
452 </row></tbody></tgroup></informaltable>
453<para>SYNOPSIS
454</para>
455<informaltable><tgroup cols="1"><tbody><row><entry
456 align="char">
457<para>ssize_t write(int fd, const void &#x22C6;buf, size_t
458 count);</para>
459</entry>
460 </row></tbody></tgroup></informaltable>
461<para>PARAMETERS
462</para>
463<informaltable><tgroup cols="2"><tbody><row><entry
464 align="char">
465<para>int fd</para>
466</entry><entry
467 align="char">
468<para>File descriptor returned by a previous call to open().</para>
469</entry>
470 </row><row><entry
471 align="char">
472<para>void *buf</para>
473</entry><entry
474 align="char">
475<para>Pointer to the buffer containing the Transport Stream.</para>
476</entry>
477 </row><row><entry
478 align="char">
479<para>size_t count</para>
480</entry><entry
481 align="char">
482<para>Size of buf.</para>
483</entry>
484 </row></tbody></tgroup></informaltable>
485<para>RETURN VALUE</para>
486<informaltable><tgroup cols="2"><tbody><row><entry
487 align="char">
488<para>EWOULDBLOCK</para>
489</entry><entry
490 align="char">
491<para>No data was written. This
492 might happen if O_NONBLOCK was specified and there
493 is no more buffer space available (if O_NONBLOCK is
494 not specified the function will block until buffer space is
495 available).</para>
496</entry>
497 </row><row><entry
498 align="char">
499<para>EBUSY</para>
500</entry><entry
501 align="char">
502<para>This error code indicates that there are conflicting
503 requests. The corresponding demux device is setup to
504 receive data from the front- end. Make sure that these
505 filters are stopped and that the filters with input set to
506 DMX_IN_DVR are started.</para>
507</entry>
508 </row><row><entry
509 align="char">
510<para>EBADF</para>
511</entry><entry
512 align="char">
513<para>fd is not a valid open file descriptor.</para>
514</entry>
515 </row></tbody></tgroup></informaltable>
516</section>
517
518<section id="DMX_START">
519<title>DMX_START</title>
520<para>DESCRIPTION
521</para>
522<informaltable><tgroup cols="1"><tbody><row><entry
523 align="char">
524<para>This ioctl call is used to start the actual filtering operation defined via the ioctl
525 calls DMX_SET_FILTER or DMX_SET_PES_FILTER.</para>
526</entry>
527 </row></tbody></tgroup></informaltable>
528<para>SYNOPSIS
529</para>
530<informaltable><tgroup cols="1"><tbody><row><entry
531 align="char">
532<para>int ioctl( int fd, int request = DMX_START);</para>
533</entry>
534 </row></tbody></tgroup></informaltable>
535<para>PARAMETERS
536</para>
537<informaltable><tgroup cols="2"><tbody><row><entry
538 align="char">
539<para>int fd</para>
540</entry><entry
541 align="char">
542<para>File descriptor returned by a previous call to open().</para>
543</entry>
544 </row><row><entry
545 align="char">
546<para>int request</para>
547</entry><entry
548 align="char">
549<para>Equals DMX_START for this command.</para>
550</entry>
551 </row></tbody></tgroup></informaltable>
552&return-value-dvb;
553<informaltable><tgroup cols="2"><tbody><row><entry
554 align="char">
555<para>EINVAL</para>
556</entry><entry
557 align="char">
558<para>Invalid argument, i.e. no filtering parameters provided via
559 the DMX_SET_FILTER or DMX_SET_PES_FILTER
560 functions.</para>
561</entry>
562 </row><row><entry
563 align="char">
564<para>EBUSY</para>
565</entry><entry
566 align="char">
567<para>This error code indicates that there are conflicting
568 requests. There are active filters filtering data from
569 another input source. Make sure that these filters are
570 stopped before starting this filter.</para>
571</entry>
572 </row></tbody></tgroup></informaltable>
573</section>
574
575<section id="DMX_STOP">
576<title>DMX_STOP</title>
577<para>DESCRIPTION
578</para>
579<informaltable><tgroup cols="1"><tbody><row><entry
580 align="char">
581<para>This ioctl call is used to stop the actual filtering operation defined via the
582 ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER and started via
583 the DMX_START command.</para>
584</entry>
585 </row></tbody></tgroup></informaltable>
586<para>SYNOPSIS
587</para>
588<informaltable><tgroup cols="1"><tbody><row><entry
589 align="char">
590<para>int ioctl( int fd, int request = DMX_STOP);</para>
591</entry>
592 </row></tbody></tgroup></informaltable>
593<para>PARAMETERS
594</para>
595<informaltable><tgroup cols="2"><tbody><row><entry
596 align="char">
597<para>int fd</para>
598</entry><entry
599 align="char">
600<para>File descriptor returned by a previous call to open().</para>
601</entry>
602 </row><row><entry
603 align="char">
604<para>int request</para>
605</entry><entry
606 align="char">
607<para>Equals DMX_STOP for this command.</para>
608</entry>
609 </row></tbody></tgroup></informaltable>
610&return-value-dvb;
611</section>
612
613<section id="DMX_SET_FILTER">
614<title>DMX_SET_FILTER</title>
615<para>DESCRIPTION
616</para>
617<informaltable><tgroup cols="1"><tbody><row><entry
618 align="char">
619<para>This ioctl call sets up a filter according to the filter and mask parameters
620 provided. A timeout may be defined stating number of seconds to wait for a
621 section to be loaded. A value of 0 means that no timeout should be applied.
622 Finally there is a flag field where it is possible to state whether a section should
623 be CRC-checked, whether the filter should be a &#8221;one-shot&#8221; filter, i.e. if the
624 filtering operation should be stopped after the first section is received, and
625 whether the filtering operation should be started immediately (without waiting
626 for a DMX_START ioctl call). If a filter was previously set-up, this filter will
627 be canceled, and the receive buffer will be flushed.</para>
628</entry>
629 </row></tbody></tgroup></informaltable>
630<para>SYNOPSIS
631</para>
632<informaltable><tgroup cols="1"><tbody><row><entry
633 align="char">
634<para>int ioctl( int fd, int request = DMX_SET_FILTER,
635 struct dmx_sct_filter_params &#x22C6;params);</para>
636</entry>
637 </row></tbody></tgroup></informaltable>
638<para>PARAMETERS
639</para>
640<informaltable><tgroup cols="2"><tbody><row><entry
641 align="char">
642<para>int fd</para>
643</entry><entry
644 align="char">
645<para>File descriptor returned by a previous call to open().</para>
646</entry>
647 </row><row><entry
648 align="char">
649<para>int request</para>
650</entry><entry
651 align="char">
652<para>Equals DMX_SET_FILTER for this command.</para>
653</entry>
654 </row><row><entry
655 align="char">
656<para>struct
657 dmx_sct_filter_params
658 *params</para>
659</entry><entry
660 align="char">
661<para>Pointer to structure containing filter parameters.</para>
662</entry>
663 </row></tbody></tgroup></informaltable>
664&return-value-dvb;
665</section>
666
667<section id="DMX_SET_PES_FILTER">
668<title>DMX_SET_PES_FILTER</title>
669<para>DESCRIPTION
670</para>
671<informaltable><tgroup cols="1"><tbody><row><entry
672 align="char">
673<para>This ioctl call sets up a PES filter according to the parameters provided. By a
674 PES filter is meant a filter that is based just on the packet identifier (PID), i.e.
675 no PES header or payload filtering capability is supported.</para>
676</entry>
677 </row><row><entry
678 align="char">
679<para>The transport stream destination for the filtered output may be set. Also the
680 PES type may be stated in order to be able to e.g. direct a video stream directly
681 to the video decoder. Finally there is a flag field where it is possible to state
682 whether the filtering operation should be started immediately (without waiting
683 for a DMX_START ioctl call). If a filter was previously set-up, this filter will
684 be cancelled, and the receive buffer will be flushed.</para>
685</entry>
686 </row></tbody></tgroup></informaltable>
687<para>SYNOPSIS
688</para>
689<informaltable><tgroup cols="1"><tbody><row><entry
690 align="char">
691<para>int ioctl( int fd, int request = DMX_SET_PES_FILTER,
692 struct dmx_pes_filter_params &#x22C6;params);</para>
693</entry>
694 </row></tbody></tgroup></informaltable>
695<para>PARAMETERS
696</para>
697<informaltable><tgroup cols="2"><tbody><row><entry
698 align="char">
699<para>int fd</para>
700</entry><entry
701 align="char">
702<para>File descriptor returned by a previous call to open().</para>
703</entry>
704 </row><row><entry
705 align="char">
706<para>int request</para>
707</entry><entry
708 align="char">
709<para>Equals DMX_SET_PES_FILTER for this command.</para>
710</entry>
711 </row><row><entry
712 align="char">
713<para>struct
714 dmx_pes_filter_params
715 *params</para>
716</entry><entry
717 align="char">
718<para>Pointer to structure containing filter parameters.</para>
719</entry>
720 </row></tbody></tgroup></informaltable>
721&return-value-dvb;
722<informaltable><tgroup cols="2"><tbody><row><entry
723 align="char">
724<para>EBUSY</para>
725</entry><entry
726 align="char">
727<para>This error code indicates that there are conflicting
728 requests. There are active filters filtering data from
729 another input source. Make sure that these filters are
730 stopped before starting this filter.</para>
731</entry>
732 </row></tbody></tgroup></informaltable>
733</section>
734
735<section id="DMX_SET_BUFFER_SIZE">
736<title>DMX_SET_BUFFER_SIZE</title>
737<para>DESCRIPTION
738</para>
739<informaltable><tgroup cols="1"><tbody><row><entry
740 align="char">
741<para>This ioctl call is used to set the size of the circular buffer used for filtered data.
742 The default size is two maximum sized sections, i.e. if this function is not called
743 a buffer size of 2 * 4096 bytes will be used.</para>
744</entry>
745 </row></tbody></tgroup></informaltable>
746<para>SYNOPSIS
747</para>
748<informaltable><tgroup cols="1"><tbody><row><entry
749 align="char">
750<para>int ioctl( int fd, int request =
751 DMX_SET_BUFFER_SIZE, unsigned long size);</para>
752</entry>
753 </row></tbody></tgroup></informaltable>
754<para>PARAMETERS
755</para>
756<informaltable><tgroup cols="2"><tbody><row><entry
757 align="char">
758<para>int fd</para>
759</entry><entry
760 align="char">
761<para>File descriptor returned by a previous call to open().</para>
762</entry>
763 </row><row><entry
764 align="char">
765<para>int request</para>
766</entry><entry
767 align="char">
768<para>Equals DMX_SET_BUFFER_SIZE for this command.</para>
769</entry>
770 </row><row><entry
771 align="char">
772<para>unsigned long size</para>
773</entry><entry
774 align="char">
775<para>Size of circular buffer.</para>
776</entry>
777 </row></tbody></tgroup></informaltable>
778&return-value-dvb;
779</section>
780
781<section id="DMX_GET_EVENT">
782<title>DMX_GET_EVENT</title>
783<para>DESCRIPTION
784</para>
785<informaltable><tgroup cols="1"><tbody><row><entry
786 align="char">
787<para>This ioctl call returns an event if available. If an event is not available,
788 the behavior depends on whether the device is in blocking or non-blocking
789 mode. In the latter case, the call fails immediately with errno set to
790 EWOULDBLOCK. In the former case, the call blocks until an event becomes
791 available.</para>
792</entry>
793 </row><row><entry
794 align="char">
795<para>The standard Linux poll() and/or select() system calls can be used with the
796 device file descriptor to watch for new events. For select(), the file descriptor
797 should be included in the exceptfds argument, and for poll(), POLLPRI should
798 be specified as the wake-up condition. Only the latest event for each filter is
799 saved.</para>
800</entry>
801 </row></tbody></tgroup></informaltable>
802<para>SYNOPSIS
803</para>
804<informaltable><tgroup cols="1"><tbody><row><entry
805 align="char">
806<para>int ioctl( int fd, int request = DMX_GET_EVENT,
807 struct dmx_event &#x22C6;ev);</para>
808</entry>
809 </row></tbody></tgroup></informaltable>
810<para>PARAMETERS
811</para>
812<informaltable><tgroup cols="2"><tbody><row><entry
813 align="char">
814<para>int fd</para>
815</entry><entry
816 align="char">
817<para>File descriptor returned by a previous call to open().</para>
818</entry>
819 </row><row><entry
820 align="char">
821<para>int request</para>
822</entry><entry
823 align="char">
824<para>Equals DMX_GET_EVENT for this command.</para>
825</entry>
826 </row><row><entry
827 align="char">
828<para>struct dmx_event *ev</para>
829</entry><entry
830 align="char">
831<para>Pointer to the location where the event is to be stored.</para>
832</entry>
833 </row></tbody></tgroup></informaltable>
834&return-value-dvb;
835<informaltable><tgroup cols="2"><tbody><row><entry
836 align="char">
837<para>EWOULDBLOCK</para>
838</entry><entry
839 align="char">
840<para>There is no event pending, and the device is in
841 non-blocking mode.</para>
842</entry>
843 </row></tbody></tgroup></informaltable>
844</section>
845
846<section id="DMX_GET_STC">
847<title>DMX_GET_STC</title>
848<para>DESCRIPTION
849</para>
850<informaltable><tgroup cols="1"><tbody><row><entry
851 align="char">
852<para>This ioctl call returns the current value of the system time counter (which is driven
853 by a PES filter of type DMX_PES_PCR). Some hardware supports more than one
854 STC, so you must specify which one by setting the num field of stc before the ioctl
855 (range 0...n). The result is returned in form of a ratio with a 64 bit numerator
856 and a 32 bit denominator, so the real 90kHz STC value is stc-&#x003E;stc /
857 stc-&#x003E;base
858 .</para>
859</entry>
860 </row></tbody></tgroup></informaltable>
861<para>SYNOPSIS
862</para>
863<informaltable><tgroup cols="1"><tbody><row><entry
864 align="char">
865<para>int ioctl( int fd, int request = DMX_GET_STC, struct
866 dmx_stc &#x22C6;stc);</para>
867</entry>
868 </row></tbody></tgroup></informaltable>
869<para>PARAMETERS
870</para>
871<informaltable><tgroup cols="2"><tbody><row><entry
872 align="char">
873<para>int fd</para>
874</entry><entry
875 align="char">
876<para>File descriptor returned by a previous call to open().</para>
877</entry>
878 </row><row><entry
879 align="char">
880<para>int request</para>
881</entry><entry
882 align="char">
883<para>Equals DMX_GET_STC for this command.</para>
884</entry>
885 </row><row><entry
886 align="char">
887<para>struct dmx_stc *stc</para>
888</entry><entry
889 align="char">
890<para>Pointer to the location where the stc is to be stored.</para>
891</entry>
892 </row></tbody></tgroup></informaltable>
893&return-value-dvb;
894<informaltable><tgroup cols="2"><tbody><row><entry
895 align="char">
896<para>EINVAL</para>
897</entry><entry
898 align="char">
899<para>Invalid stc number.</para>
900</entry>
901 </row></tbody></tgroup></informaltable>
902 </section>
903
904<section id="DMX_GET_PES_PIDS"
905role="subsection"><title>DMX_GET_PES_PIDS</title>
906<para>DESCRIPTION
907</para>
908<informaltable><tgroup cols="1"><tbody><row><entry
909 align="char">
910<para>This ioctl is undocumented. Documentation is welcome.</para>
911</entry>
912 </row></tbody></tgroup></informaltable>
913<para>SYNOPSIS
914</para>
915<informaltable><tgroup cols="1"><tbody><row><entry
916 align="char">
917<para>int ioctl(fd, int request = DMX_GET_PES_PIDS,
918 __u16[5]);</para>
919</entry>
920 </row></tbody></tgroup></informaltable>
921<para>PARAMETERS
922</para>
923<informaltable><tgroup cols="2"><tbody><row><entry
924 align="char">
925<para>int fd</para>
926</entry><entry
927 align="char">
928<para>File descriptor returned by a previous call to open().</para>
929</entry>
930 </row><row><entry
931 align="char">
932<para>int request</para>
933</entry><entry
934 align="char">
935<para>Equals DMX_GET_PES_PIDS for this command.</para>
936</entry>
937 </row><row><entry
938 align="char">
939<para>__u16[5]
940</para>
941</entry><entry
942 align="char">
943<para>Undocumented.</para>
944</entry>
945 </row></tbody></tgroup></informaltable>
946&return-value-dvb;
947</section>
948
949<section id="DMX_GET_CAPS"
950role="subsection"><title>DMX_GET_CAPS</title>
951<para>DESCRIPTION
952</para>
953<informaltable><tgroup cols="1"><tbody><row><entry
954 align="char">
955<para>This ioctl is undocumented. Documentation is welcome.</para>
956</entry>
957 </row></tbody></tgroup></informaltable>
958<para>SYNOPSIS
959</para>
960<informaltable><tgroup cols="1"><tbody><row><entry
961 align="char">
962<para>int ioctl(fd, int request = DMX_GET_CAPS,
963 dmx_caps_t *);</para>
964</entry>
965 </row></tbody></tgroup></informaltable>
966<para>PARAMETERS
967</para>
968<informaltable><tgroup cols="2"><tbody><row><entry
969 align="char">
970<para>int fd</para>
971</entry><entry
972 align="char">
973<para>File descriptor returned by a previous call to open().</para>
974</entry>
975 </row><row><entry
976 align="char">
977<para>int request</para>
978</entry><entry
979 align="char">
980<para>Equals DMX_GET_CAPS for this command.</para>
981</entry>
982 </row><row><entry
983 align="char">
984<para>dmx_caps_t *
985</para>
986</entry><entry
987 align="char">
988<para>Undocumented.</para>
989</entry>
990 </row></tbody></tgroup></informaltable>
991&return-value-dvb;
992</section>
993
994<section id="DMX_SET_SOURCE"
995role="subsection"><title>DMX_SET_SOURCE</title>
996<para>DESCRIPTION
997</para>
998<informaltable><tgroup cols="1"><tbody><row><entry
999 align="char">
1000<para>This ioctl is undocumented. Documentation is welcome.</para>
1001</entry>
1002 </row></tbody></tgroup></informaltable>
1003<para>SYNOPSIS
1004</para>
1005<informaltable><tgroup cols="1"><tbody><row><entry
1006 align="char">
1007<para>int ioctl(fd, int request = DMX_SET_SOURCE,
1008 dmx_source_t *);</para>
1009</entry>
1010 </row></tbody></tgroup></informaltable>
1011<para>PARAMETERS
1012</para>
1013<informaltable><tgroup cols="2"><tbody><row><entry
1014 align="char">
1015<para>int fd</para>
1016</entry><entry
1017 align="char">
1018<para>File descriptor returned by a previous call to open().</para>
1019</entry>
1020 </row><row><entry
1021 align="char">
1022<para>int request</para>
1023</entry><entry
1024 align="char">
1025<para>Equals DMX_SET_SOURCE for this command.</para>
1026</entry>
1027 </row><row><entry
1028 align="char">
1029<para>dmx_source_t *
1030</para>
1031</entry><entry
1032 align="char">
1033<para>Undocumented.</para>
1034</entry>
1035 </row></tbody></tgroup></informaltable>
1036&return-value-dvb;
1037</section>
1038
1039<section id="DMX_ADD_PID"
1040role="subsection"><title>DMX_ADD_PID</title>
1041<para>DESCRIPTION
1042</para>
1043<informaltable><tgroup cols="1"><tbody><row><entry
1044 align="char">
1045<para>This ioctl is undocumented. Documentation is welcome.</para>
1046</entry>
1047 </row></tbody></tgroup></informaltable>
1048<para>SYNOPSIS
1049</para>
1050<informaltable><tgroup cols="1"><tbody><row><entry
1051 align="char">
1052<para>int ioctl(fd, int request = DMX_ADD_PID,
1053 __u16 *);</para>
1054</entry>
1055 </row></tbody></tgroup></informaltable>
1056<para>PARAMETERS
1057</para>
1058<informaltable><tgroup cols="2"><tbody><row><entry
1059 align="char">
1060<para>int fd</para>
1061</entry><entry
1062 align="char">
1063<para>File descriptor returned by a previous call to open().</para>
1064</entry>
1065 </row><row><entry
1066 align="char">
1067<para>int request</para>
1068</entry><entry
1069 align="char">
1070<para>Equals DMX_ADD_PID for this command.</para>
1071</entry>
1072 </row><row><entry
1073 align="char">
1074<para>__u16 *
1075</para>
1076</entry><entry
1077 align="char">
1078<para>Undocumented.</para>
1079</entry>
1080 </row></tbody></tgroup></informaltable>
1081&return-value-dvb;
1082</section>
1083
1084<section id="DMX_REMOVE_PID"
1085role="subsection"><title>DMX_REMOVE_PID</title>
1086<para>DESCRIPTION
1087</para>
1088<informaltable><tgroup cols="1"><tbody><row><entry
1089 align="char">
1090<para>This ioctl is undocumented. Documentation is welcome.</para>
1091</entry>
1092 </row></tbody></tgroup></informaltable>
1093<para>SYNOPSIS
1094</para>
1095<informaltable><tgroup cols="1"><tbody><row><entry
1096 align="char">
1097<para>int ioctl(fd, int request = DMX_REMOVE_PID,
1098 __u16 *);</para>
1099</entry>
1100 </row></tbody></tgroup></informaltable>
1101<para>PARAMETERS
1102</para>
1103<informaltable><tgroup cols="2"><tbody><row><entry
1104 align="char">
1105<para>int fd</para>
1106</entry><entry
1107 align="char">
1108<para>File descriptor returned by a previous call to open().</para>
1109</entry>
1110 </row><row><entry
1111 align="char">
1112<para>int request</para>
1113</entry><entry
1114 align="char">
1115<para>Equals DMX_REMOVE_PID for this command.</para>
1116</entry>
1117 </row><row><entry
1118 align="char">
1119<para>__u16 *
1120</para>
1121</entry><entry
1122 align="char">
1123<para>Undocumented.</para>
1124</entry>
1125 </row></tbody></tgroup></informaltable>
1126&return-value-dvb;
1127</section>
1128
1129
1130</section>
diff --git a/Documentation/DocBook/media/dvb/dvbapi.xml b/Documentation/DocBook/media/dvb/dvbapi.xml
new file mode 100644
index 00000000000..757488b24f4
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/dvbapi.xml
@@ -0,0 +1,141 @@
1<partinfo>
2<authorgroup>
3<author>
4<firstname>Ralph</firstname>
5<surname>Metzler</surname>
6<othername role="mi">J. K.</othername>
7<affiliation><address><email>rjkm@metzlerbros.de</email></address></affiliation>
8</author>
9<author>
10<firstname>Marcus</firstname>
11<surname>Metzler</surname>
12<othername role="mi">O. C.</othername>
13<affiliation><address><email>rjkm@metzlerbros.de</email></address></affiliation>
14</author>
15</authorgroup>
16<authorgroup>
17<author>
18<firstname>Mauro</firstname>
19<othername role="mi">Carvalho</othername>
20<surname>Chehab</surname>
21<affiliation><address><email>mchehab@redhat.com</email></address></affiliation>
22<contrib>Ported document to Docbook XML.</contrib>
23</author>
24</authorgroup>
25<copyright>
26 <year>2002</year>
27 <year>2003</year>
28 <holder>Convergence GmbH</holder>
29</copyright>
30<copyright>
31 <year>2009-2012</year>
32 <holder>Mauro Carvalho Chehab</holder>
33</copyright>
34
35<revhistory>
36<!-- Put document revisions here, newest first. -->
37<revision>
38 <revnumber>2.0.4</revnumber>
39 <date>2011-05-06</date>
40 <authorinitials>mcc</authorinitials>
41 <revremark>
42 Add more information about DVB APIv5, better describing the frontend GET/SET props ioctl's.
43 </revremark>
44</revision>
45<revision>
46 <revnumber>2.0.3</revnumber>
47 <date>2010-07-03</date>
48 <authorinitials>mcc</authorinitials>
49 <revremark>
50 Add some frontend capabilities flags, present on kernel, but missing at the specs.
51 </revremark>
52</revision>
53<revision>
54 <revnumber>2.0.2</revnumber>
55 <date>2009-10-25</date>
56 <authorinitials>mcc</authorinitials>
57 <revremark>
58 documents FE_SET_FRONTEND_TUNE_MODE and FE_DISHETWORK_SEND_LEGACY_CMD ioctls.
59 </revremark>
60</revision>
61<revision>
62<revnumber>2.0.1</revnumber>
63<date>2009-09-16</date>
64<authorinitials>mcc</authorinitials>
65<revremark>
66Added ISDB-T test originally written by Patrick Boettcher
67</revremark>
68</revision>
69<revision>
70<revnumber>2.0.0</revnumber>
71<date>2009-09-06</date>
72<authorinitials>mcc</authorinitials>
73<revremark>Conversion from LaTex to DocBook XML. The
74 contents is the same as the original LaTex version.</revremark>
75</revision>
76<revision>
77<revnumber>1.0.0</revnumber>
78<date>2003-07-24</date>
79<authorinitials>rjkm</authorinitials>
80<revremark>Initial revision on LaTEX.</revremark>
81</revision>
82</revhistory>
83</partinfo>
84
85
86<title>LINUX DVB API</title>
87<subtitle>Version 5.8</subtitle>
88<!-- ADD THE CHAPTERS HERE -->
89 <chapter id="dvb_introdution">
90 &sub-intro;
91 </chapter>
92 <chapter id="dvb_frontend">
93 &sub-frontend;
94 </chapter>
95 <chapter id="dvb_demux">
96 &sub-demux;
97 </chapter>
98 <chapter id="dvb_video">
99 &sub-video;
100 </chapter>
101 <chapter id="dvb_audio">
102 &sub-audio;
103 </chapter>
104 <chapter id="dvb_ca">
105 &sub-ca;
106 </chapter>
107 <chapter id="dvb_net">
108 &sub-net;
109 </chapter>
110 <chapter id="dvb_kdapi">
111 &sub-kdapi;
112 </chapter>
113 <chapter id="dvb_examples">
114 &sub-examples;
115 </chapter>
116<!-- END OF CHAPTERS -->
117 <appendix id="audio_h">
118 <title>DVB Audio Header File</title>
119 &sub-audio-h;
120 </appendix>
121 <appendix id="ca_h">
122 <title>DVB Conditional Access Header File</title>
123 &sub-ca-h;
124 </appendix>
125 <appendix id="dmx_h">
126 <title>DVB Demux Header File</title>
127 &sub-dmx-h;
128 </appendix>
129 <appendix id="frontend_h">
130 <title>DVB Frontend Header File</title>
131 &sub-frontend-h;
132 </appendix>
133 <appendix id="net_h">
134 <title>DVB Network Header File</title>
135 &sub-net-h;
136 </appendix>
137 <appendix id="video_h">
138 <title>DVB Video Header File</title>
139 &sub-video-h;
140 </appendix>
141
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
new file mode 100644
index 00000000000..957e3acaae8
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -0,0 +1,1105 @@
1<section id="FE_GET_SET_PROPERTY">
2<title><constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></title>
3<para>This section describes the DVB version 5 extention of the DVB-API, also
4called "S2API", as this API were added to provide support for DVB-S2. It was
5designed to be able to replace the old frontend API. Yet, the DISEQC and
6the capability ioctls weren't implemented yet via the new way.</para>
7<para>The typical usage for the <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant>
8API is to replace the ioctl's were the <link linkend="dvb-frontend-parameters">
9struct <constant>dvb_frontend_parameters</constant></link> were used.</para>
10<section id="dtv-property">
11<title>DTV property type</title>
12<programlisting>
13/* Reserved fields should be set to 0 */
14struct dtv_property {
15 __u32 cmd;
16 union {
17 __u32 data;
18 struct {
19 __u8 data[32];
20 __u32 len;
21 __u32 reserved1[3];
22 void *reserved2;
23 } buffer;
24 } u;
25 int result;
26} __attribute__ ((packed));
27
28/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
29#define DTV_IOCTL_MAX_MSGS 64
30</programlisting>
31</section>
32<section id="dtv-properties">
33<title>DTV properties type</title>
34<programlisting>
35struct dtv_properties {
36 __u32 num;
37 struct dtv_property *props;
38};
39</programlisting>
40</section>
41
42<section id="FE_GET_PROPERTY">
43<title>FE_GET_PROPERTY</title>
44<para>DESCRIPTION
45</para>
46<informaltable><tgroup cols="1"><tbody><row><entry
47 align="char">
48<para>This ioctl call returns one or more frontend properties. This call only
49 requires read-only access to the device.</para>
50</entry>
51 </row></tbody></tgroup></informaltable>
52<para>SYNOPSIS
53</para>
54<informaltable><tgroup cols="1"><tbody><row><entry
55 align="char">
56<para>int ioctl(int fd, int request = <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link>,
57 dtv_properties &#x22C6;props);</para>
58</entry>
59 </row></tbody></tgroup></informaltable>
60<para>PARAMETERS
61</para>
62<informaltable><tgroup cols="2"><tbody><row><entry align="char">
63<para>int fd</para>
64</entry><entry
65 align="char">
66<para>File descriptor returned by a previous call to open().</para>
67</entry>
68 </row><row><entry
69 align="char">
70<para>int num</para>
71</entry><entry
72 align="char">
73<para>Equals <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link> for this command.</para>
74</entry>
75 </row><row><entry
76 align="char">
77<para>struct dtv_property *props</para>
78</entry><entry
79 align="char">
80<para>Points to the location where the front-end property commands are stored.</para>
81</entry>
82 </row></tbody></tgroup></informaltable>
83&return-value-dvb;
84<informaltable><tgroup cols="2"><tbody><row>
85 <entry align="char"><para>EOPNOTSUPP</para></entry>
86 <entry align="char"><para>Property type not supported.</para></entry>
87 </row></tbody></tgroup></informaltable>
88</section>
89
90<section id="FE_SET_PROPERTY">
91<title>FE_SET_PROPERTY</title>
92<para>DESCRIPTION
93</para>
94<informaltable><tgroup cols="1"><tbody><row><entry
95 align="char">
96<para>This ioctl call sets one or more frontend properties. This call only
97 requires read-only access to the device.</para>
98</entry>
99 </row></tbody></tgroup></informaltable>
100<para>SYNOPSIS
101</para>
102<informaltable><tgroup cols="1"><tbody><row><entry
103 align="char">
104<para>int ioctl(int fd, int request = <link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link>,
105 dtv_properties &#x22C6;props);</para>
106</entry>
107 </row></tbody></tgroup></informaltable>
108<para>PARAMETERS
109</para>
110<informaltable><tgroup cols="2"><tbody><row><entry align="char">
111<para>int fd</para>
112</entry><entry
113 align="char">
114<para>File descriptor returned by a previous call to open().</para>
115</entry>
116 </row><row><entry
117 align="char">
118<para>int num</para>
119</entry><entry
120 align="char">
121<para>Equals <link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link> for this command.</para>
122</entry>
123 </row><row><entry
124 align="char">
125<para>struct dtv_property *props</para>
126</entry><entry
127 align="char">
128<para>Points to the location where the front-end property commands are stored.</para>
129</entry>
130 </row></tbody></tgroup></informaltable>
131&return-value-dvb;
132<informaltable><tgroup cols="2"><tbody><row>
133 <entry align="char"><para>EOPNOTSUPP</para></entry>
134 <entry align="char"><para>Property type not supported.</para></entry>
135 </row></tbody></tgroup></informaltable>
136</section>
137
138<section>
139 <title>Property types</title>
140<para>
141On <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link>/<link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link>,
142the actual action is determined by the dtv_property cmd/data pairs. With one single ioctl, is possible to
143get/set up to 64 properties. The actual meaning of each property is described on the next sections.
144</para>
145
146<para>The available frontend property types are shown on the next section.</para>
147</section>
148
149<section id="fe_property_parameters">
150 <title>Digital TV property parameters</title>
151 <section id="DTV-UNDEFINED">
152 <title><constant>DTV_UNDEFINED</constant></title>
153 <para>Used internally. A GET/SET operation for it won't change or return anything.</para>
154 </section>
155 <section id="DTV-TUNE">
156 <title><constant>DTV_TUNE</constant></title>
157 <para>Interpret the cache of data, build either a traditional frontend tunerequest so we can pass validation in the <constant>FE_SET_FRONTEND</constant> ioctl.</para>
158 </section>
159 <section id="DTV-CLEAR">
160 <title><constant>DTV_CLEAR</constant></title>
161 <para>Reset a cache of data specific to the frontend here. This does not effect hardware.</para>
162 </section>
163 <section id="DTV-FREQUENCY">
164 <title><constant>DTV_FREQUENCY</constant></title>
165
166 <para>Central frequency of the channel.</para>
167
168 <para>Notes:</para>
169 <para>1)For satellital delivery systems, it is measured in kHz.
170 For the other ones, it is measured in Hz.</para>
171 <para>2)For ISDB-T, the channels are usually transmitted with an offset of 143kHz.
172 E.g. a valid frequncy could be 474143 kHz. The stepping is bound to the bandwidth of
173 the channel which is 6MHz.</para>
174
175 <para>3)As in ISDB-Tsb the channel consists of only one or three segments the
176 frequency step is 429kHz, 3*429 respectively. As for ISDB-T the
177 central frequency of the channel is expected.</para>
178 </section>
179 <section id="DTV-MODULATION">
180 <title><constant>DTV_MODULATION</constant></title>
181<para>Specifies the frontend modulation type for cable and satellite types. The modulation can be one of the types bellow:</para>
182<programlisting>
183 typedef enum fe_modulation {
184 QPSK,
185 QAM_16,
186 QAM_32,
187 QAM_64,
188 QAM_128,
189 QAM_256,
190 QAM_AUTO,
191 VSB_8,
192 VSB_16,
193 PSK_8,
194 APSK_16,
195 APSK_32,
196 DQPSK,
197 QAM_4_NR,
198 } fe_modulation_t;
199</programlisting>
200 </section>
201 <section id="DTV-BANDWIDTH-HZ">
202 <title><constant>DTV_BANDWIDTH_HZ</constant></title>
203
204 <para>Bandwidth for the channel, in HZ.</para>
205
206 <para>Possible values:
207 <constant>1712000</constant>,
208 <constant>5000000</constant>,
209 <constant>6000000</constant>,
210 <constant>7000000</constant>,
211 <constant>8000000</constant>,
212 <constant>10000000</constant>.
213 </para>
214
215 <para>Notes:</para>
216
217 <para>1) For ISDB-T it should be always 6000000Hz (6MHz)</para>
218 <para>2) For ISDB-Tsb it can vary depending on the number of connected segments</para>
219 <para>3) Bandwidth doesn't apply for DVB-C transmissions, as the bandwidth
220 for DVB-C depends on the symbol rate</para>
221 <para>4) Bandwidth in ISDB-T is fixed (6MHz) or can be easily derived from
222 other parameters (DTV_ISDBT_SB_SEGMENT_IDX,
223 DTV_ISDBT_SB_SEGMENT_COUNT).</para>
224 <para>5) DVB-T supports 6, 7 and 8MHz.</para>
225 <para>6) In addition, DVB-T2 supports 1.172, 5 and 10MHz.</para>
226 </section>
227 <section id="DTV-INVERSION">
228 <title><constant>DTV_INVERSION</constant></title>
229 <para>The Inversion field can take one of these values:
230 </para>
231 <programlisting>
232 typedef enum fe_spectral_inversion {
233 INVERSION_OFF,
234 INVERSION_ON,
235 INVERSION_AUTO
236 } fe_spectral_inversion_t;
237 </programlisting>
238 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
239 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
240 itself.
241 </para>
242 </section>
243 <section id="DTV-DISEQC-MASTER">
244 <title><constant>DTV_DISEQC_MASTER</constant></title>
245 <para>Currently not implemented.</para>
246 </section>
247 <section id="DTV-SYMBOL-RATE">
248 <title><constant>DTV_SYMBOL_RATE</constant></title>
249 <para>Digital TV symbol rate, in bauds (symbols/second). Used on cable standards.</para>
250 </section>
251 <section id="DTV-INNER-FEC">
252 <title><constant>DTV_INNER_FEC</constant></title>
253 <para>Used cable/satellite transmissions. The acceptable values are:
254 </para>
255 <programlisting>
256typedef enum fe_code_rate {
257 FEC_NONE = 0,
258 FEC_1_2,
259 FEC_2_3,
260 FEC_3_4,
261 FEC_4_5,
262 FEC_5_6,
263 FEC_6_7,
264 FEC_7_8,
265 FEC_8_9,
266 FEC_AUTO,
267 FEC_3_5,
268 FEC_9_10,
269 FEC_2_5,
270} fe_code_rate_t;
271 </programlisting>
272 <para>which correspond to error correction rates of 1/2, 2/3, etc.,
273 no error correction or auto detection.</para>
274 </section>
275 <section id="DTV-VOLTAGE">
276 <title><constant>DTV_VOLTAGE</constant></title>
277 <para>The voltage is usually used with non-DiSEqC capable LNBs to switch
278 the polarzation (horizontal/vertical). When using DiSEqC epuipment this
279 voltage has to be switched consistently to the DiSEqC commands as
280 described in the DiSEqC spec.</para>
281 <programlisting>
282 typedef enum fe_sec_voltage {
283 SEC_VOLTAGE_13,
284 SEC_VOLTAGE_18
285 } fe_sec_voltage_t;
286 </programlisting>
287 </section>
288 <section id="DTV-TONE">
289 <title><constant>DTV_TONE</constant></title>
290 <para>Currently not used.</para>
291 </section>
292 <section id="DTV-PILOT">
293 <title><constant>DTV_PILOT</constant></title>
294 <para>Sets DVB-S2 pilot</para>
295 <section id="fe-pilot-t">
296 <title>fe_pilot type</title>
297 <programlisting>
298typedef enum fe_pilot {
299 PILOT_ON,
300 PILOT_OFF,
301 PILOT_AUTO,
302} fe_pilot_t;
303 </programlisting>
304 </section>
305 </section>
306 <section id="DTV-ROLLOFF">
307 <title><constant>DTV_ROLLOFF</constant></title>
308 <para>Sets DVB-S2 rolloff</para>
309
310 <section id="fe-rolloff-t">
311 <title>fe_rolloff type</title>
312 <programlisting>
313typedef enum fe_rolloff {
314 ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
315 ROLLOFF_20,
316 ROLLOFF_25,
317 ROLLOFF_AUTO,
318} fe_rolloff_t;
319 </programlisting>
320 </section>
321 </section>
322 <section id="DTV-DISEQC-SLAVE-REPLY">
323 <title><constant>DTV_DISEQC_SLAVE_REPLY</constant></title>
324 <para>Currently not implemented.</para>
325 </section>
326 <section id="DTV-FE-CAPABILITY-COUNT">
327 <title><constant>DTV_FE_CAPABILITY_COUNT</constant></title>
328 <para>Currently not implemented.</para>
329 </section>
330 <section id="DTV-FE-CAPABILITY">
331 <title><constant>DTV_FE_CAPABILITY</constant></title>
332 <para>Currently not implemented.</para>
333 </section>
334 <section id="DTV-DELIVERY-SYSTEM">
335 <title><constant>DTV_DELIVERY_SYSTEM</constant></title>
336 <para>Specifies the type of Delivery system</para>
337 <section id="fe-delivery-system-t">
338 <title>fe_delivery_system type</title>
339 <para>Possible values: </para>
340<programlisting>
341
342typedef enum fe_delivery_system {
343 SYS_UNDEFINED,
344 SYS_DVBC_ANNEX_A,
345 SYS_DVBC_ANNEX_B,
346 SYS_DVBT,
347 SYS_DSS,
348 SYS_DVBS,
349 SYS_DVBS2,
350 SYS_DVBH,
351 SYS_ISDBT,
352 SYS_ISDBS,
353 SYS_ISDBC,
354 SYS_ATSC,
355 SYS_ATSCMH,
356 SYS_DTMB,
357 SYS_CMMB,
358 SYS_DAB,
359 SYS_DVBT2,
360 SYS_TURBO,
361 SYS_DVBC_ANNEX_C,
362} fe_delivery_system_t;
363</programlisting>
364 </section>
365 </section>
366 <section id="DTV-ISDBT-PARTIAL-RECEPTION">
367 <title><constant>DTV_ISDBT_PARTIAL_RECEPTION</constant></title>
368
369 <para>If <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> is '0' this bit-field represents whether
370 the channel is in partial reception mode or not.</para>
371
372 <para>If '1' <constant>DTV_ISDBT_LAYERA_*</constant> values are assigned to the center segment and
373 <constant>DTV_ISDBT_LAYERA_SEGMENT_COUNT</constant> has to be '1'.</para>
374
375 <para>If in addition <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> is '1'
376 <constant>DTV_ISDBT_PARTIAL_RECEPTION</constant> represents whether this ISDB-Tsb channel
377 is consisting of one segment and layer or three segments and two layers.</para>
378
379 <para>Possible values: 0, 1, -1 (AUTO)</para>
380 </section>
381 <section id="DTV-ISDBT-SOUND-BROADCASTING">
382 <title><constant>DTV_ISDBT_SOUND_BROADCASTING</constant></title>
383
384 <para>This field represents whether the other DTV_ISDBT_*-parameters are
385 referring to an ISDB-T and an ISDB-Tsb channel. (See also
386 <constant>DTV_ISDBT_PARTIAL_RECEPTION</constant>).</para>
387
388 <para>Possible values: 0, 1, -1 (AUTO)</para>
389 </section>
390 <section id="DTV-ISDBT-SB-SUBCHANNEL-ID">
391 <title><constant>DTV_ISDBT_SB_SUBCHANNEL_ID</constant></title>
392
393 <para>This field only applies if <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> is '1'.</para>
394
395 <para>(Note of the author: This might not be the correct description of the
396 <constant>SUBCHANNEL-ID</constant> in all details, but it is my understanding of the technical
397 background needed to program a device)</para>
398
399 <para>An ISDB-Tsb channel (1 or 3 segments) can be broadcasted alone or in a
400 set of connected ISDB-Tsb channels. In this set of channels every
401 channel can be received independently. The number of connected
402 ISDB-Tsb segment can vary, e.g. depending on the frequency spectrum
403 bandwidth available.</para>
404
405 <para>Example: Assume 8 ISDB-Tsb connected segments are broadcasted. The
406 broadcaster has several possibilities to put those channels in the
407 air: Assuming a normal 13-segment ISDB-T spectrum he can align the 8
408 segments from position 1-8 to 5-13 or anything in between.</para>
409
410 <para>The underlying layer of segments are subchannels: each segment is
411 consisting of several subchannels with a predefined IDs. A sub-channel
412 is used to help the demodulator to synchronize on the channel.</para>
413
414 <para>An ISDB-T channel is always centered over all sub-channels. As for
415 the example above, in ISDB-Tsb it is no longer as simple as that.</para>
416
417 <para><constant>The DTV_ISDBT_SB_SUBCHANNEL_ID</constant> parameter is used to give the
418 sub-channel ID of the segment to be demodulated.</para>
419
420 <para>Possible values: 0 .. 41, -1 (AUTO)</para>
421 </section>
422 <section id="DTV-ISDBT-SB-SEGMENT-IDX">
423 <title><constant>DTV_ISDBT_SB_SEGMENT_IDX</constant></title>
424 <para>This field only applies if <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> is '1'.</para>
425 <para><constant>DTV_ISDBT_SB_SEGMENT_IDX</constant> gives the index of the segment to be
426 demodulated for an ISDB-Tsb channel where several of them are
427 transmitted in the connected manner.</para>
428 <para>Possible values: 0 .. <constant>DTV_ISDBT_SB_SEGMENT_COUNT</constant> - 1</para>
429 <para>Note: This value cannot be determined by an automatic channel search.</para>
430 </section>
431 <section id="DTV-ISDBT-SB-SEGMENT-COUNT">
432 <title><constant>DTV_ISDBT_SB_SEGMENT_COUNT</constant></title>
433 <para>This field only applies if <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> is '1'.</para>
434 <para><constant>DTV_ISDBT_SB_SEGMENT_COUNT</constant> gives the total count of connected ISDB-Tsb
435 channels.</para>
436 <para>Possible values: 1 .. 13</para>
437 <para>Note: This value cannot be determined by an automatic channel search.</para>
438 </section>
439 <section id="isdb-hierq-layers">
440 <title><constant>DTV-ISDBT-LAYER*</constant> parameters</title>
441 <para>ISDB-T channels can be coded hierarchically. As opposed to DVB-T in
442 ISDB-T hierarchical layers can be decoded simultaneously. For that
443 reason a ISDB-T demodulator has 3 viterbi and 3 reed-solomon-decoders.</para>
444 <para>ISDB-T has 3 hierarchical layers which each can use a part of the
445 available segments. The total number of segments over all layers has
446 to 13 in ISDB-T.</para>
447 <para>There are 3 parameter sets, for Layers A, B and C.</para>
448 <section id="DTV-ISDBT-LAYER-ENABLED">
449 <title><constant>DTV_ISDBT_LAYER_ENABLED</constant></title>
450 <para>Hierarchical reception in ISDB-T is achieved by enabling or disabling
451 layers in the decoding process. Setting all bits of
452 <constant>DTV_ISDBT_LAYER_ENABLED</constant> to '1' forces all layers (if applicable) to be
453 demodulated. This is the default.</para>
454 <para>If the channel is in the partial reception mode
455 (<constant>DTV_ISDBT_PARTIAL_RECEPTION</constant> = 1) the central segment can be decoded
456 independently of the other 12 segments. In that mode layer A has to
457 have a <constant>SEGMENT_COUNT</constant> of 1.</para>
458 <para>In ISDB-Tsb only layer A is used, it can be 1 or 3 in ISDB-Tsb
459 according to <constant>DTV_ISDBT_PARTIAL_RECEPTION</constant>. <constant>SEGMENT_COUNT</constant> must be filled
460 accordingly.</para>
461 <para>Possible values: 0x1, 0x2, 0x4 (|-able)</para>
462 <para><constant>DTV_ISDBT_LAYER_ENABLED[0:0]</constant> - layer A</para>
463 <para><constant>DTV_ISDBT_LAYER_ENABLED[1:1]</constant> - layer B</para>
464 <para><constant>DTV_ISDBT_LAYER_ENABLED[2:2]</constant> - layer C</para>
465 <para><constant>DTV_ISDBT_LAYER_ENABLED[31:3]</constant> unused</para>
466 </section>
467 <section id="DTV-ISDBT-LAYER-FEC">
468 <title><constant>DTV_ISDBT_LAYER*_FEC</constant></title>
469 <para>Possible values: <constant>FEC_AUTO</constant>, <constant>FEC_1_2</constant>, <constant>FEC_2_3</constant>, <constant>FEC_3_4</constant>, <constant>FEC_5_6</constant>, <constant>FEC_7_8</constant></para>
470 </section>
471 <section id="DTV-ISDBT-LAYER-MODULATION">
472 <title><constant>DTV_ISDBT_LAYER*_MODULATION</constant></title>
473 <para>Possible values: <constant>QAM_AUTO</constant>, QP<constant>SK, QAM_16</constant>, <constant>QAM_64</constant>, <constant>DQPSK</constant></para>
474 <para>Note: If layer C is <constant>DQPSK</constant> layer B has to be <constant>DQPSK</constant>. If layer B is <constant>DQPSK</constant>
475 and <constant>DTV_ISDBT_PARTIAL_RECEPTION</constant>=0 layer has to be <constant>DQPSK</constant>.</para>
476 </section>
477 <section id="DTV-ISDBT-LAYER-SEGMENT-COUNT">
478 <title><constant>DTV_ISDBT_LAYER*_SEGMENT_COUNT</constant></title>
479 <para>Possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1 (AUTO)</para>
480 <para>Note: Truth table for <constant>DTV_ISDBT_SOUND_BROADCASTING</constant> and
481 <constant>DTV_ISDBT_PARTIAL_RECEPTION</constant> and <constant>LAYER</constant>*_SEGMENT_COUNT</para>
482 <informaltable id="isdbt-layer_seg-cnt-table">
483 <tgroup cols="6">
484 <tbody>
485 <row>
486 <entry>PR</entry>
487 <entry>SB</entry>
488 <entry>Layer A width</entry>
489 <entry>Layer B width</entry>
490 <entry>Layer C width</entry>
491 <entry>total width</entry>
492 </row>
493 <row>
494 <entry>0</entry>
495 <entry>0</entry>
496 <entry>1 .. 13</entry>
497 <entry>1 .. 13</entry>
498 <entry>1 .. 13</entry>
499 <entry>13</entry>
500 </row>
501 <row>
502 <entry>1</entry>
503 <entry>0</entry>
504 <entry>1</entry>
505 <entry>1 .. 13</entry>
506 <entry>1 .. 13</entry>
507 <entry>13</entry>
508 </row>
509 <row>
510 <entry>0</entry>
511 <entry>1</entry>
512 <entry>1</entry>
513 <entry>0</entry>
514 <entry>0</entry>
515 <entry>1</entry>
516 </row>
517 <row>
518 <entry>1</entry>
519 <entry>1</entry>
520 <entry>1</entry>
521 <entry>2</entry>
522 <entry>0</entry>
523 <entry>13</entry>
524 </row>
525 </tbody>
526 </tgroup>
527 </informaltable>
528 </section>
529 <section id="DTV-ISDBT-LAYER-TIME-INTERLEAVING">
530 <title><constant>DTV_ISDBT_LAYER*_TIME_INTERLEAVING</constant></title>
531 <para>Possible values: 0, 1, 2, 3, -1 (AUTO)</para>
532 <para>Note: The real inter-leaver depth-names depend on the mode (fft-size); the values
533 here are referring to what can be found in the TMCC-structure -
534 independent of the mode.</para>
535 </section>
536 <section id="DTV-ATSCMH-FIC-VER">
537 <title><constant>DTV_ATSCMH_FIC_VER</constant></title>
538 <para>Version number of the FIC (Fast Information Channel) signaling data.</para>
539 <para>FIC is used for relaying information to allow rapid service acquisition by the receiver.</para>
540 <para>Possible values: 0, 1, 2, 3, ..., 30, 31</para>
541 </section>
542 <section id="DTV-ATSCMH-PARADE-ID">
543 <title><constant>DTV_ATSCMH_PARADE_ID</constant></title>
544 <para>Parade identification number</para>
545 <para>A parade is a collection of up to eight MH groups, conveying one or two ensembles.</para>
546 <para>Possible values: 0, 1, 2, 3, ..., 126, 127</para>
547 </section>
548 <section id="DTV-ATSCMH-NOG">
549 <title><constant>DTV_ATSCMH_NOG</constant></title>
550 <para>Number of MH groups per MH subframe for a designated parade.</para>
551 <para>Possible values: 1, 2, 3, 4, 5, 6, 7, 8</para>
552 </section>
553 <section id="DTV-ATSCMH-TNOG">
554 <title><constant>DTV_ATSCMH_TNOG</constant></title>
555 <para>Total number of MH groups including all MH groups belonging to all MH parades in one MH subframe.</para>
556 <para>Possible values: 0, 1, 2, 3, ..., 30, 31</para>
557 </section>
558 <section id="DTV-ATSCMH-SGN">
559 <title><constant>DTV_ATSCMH_SGN</constant></title>
560 <para>Start group number.</para>
561 <para>Possible values: 0, 1, 2, 3, ..., 14, 15</para>
562 </section>
563 <section id="DTV-ATSCMH-PRC">
564 <title><constant>DTV_ATSCMH_PRC</constant></title>
565 <para>Parade repetition cycle.</para>
566 <para>Possible values: 1, 2, 3, 4, 5, 6, 7, 8</para>
567 </section>
568 <section id="DTV-ATSCMH-RS-FRAME-MODE">
569 <title><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></title>
570 <para>RS frame mode.</para>
571 <para>Possible values are:</para>
572 <para id="atscmh-rs-frame-mode">
573<programlisting>
574typedef enum atscmh_rs_frame_mode {
575 ATSCMH_RSFRAME_PRI_ONLY = 0,
576 ATSCMH_RSFRAME_PRI_SEC = 1,
577} atscmh_rs_frame_mode_t;
578</programlisting>
579 </para>
580 </section>
581 <section id="DTV-ATSCMH-RS-FRAME-ENSEMBLE">
582 <title><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></title>
583 <para>RS frame ensemble.</para>
584 <para>Possible values are:</para>
585 <para id="atscmh-rs-frame-ensemble">
586<programlisting>
587typedef enum atscmh_rs_frame_ensemble {
588 ATSCMH_RSFRAME_ENS_PRI = 0,
589 ATSCMH_RSFRAME_ENS_SEC = 1,
590} atscmh_rs_frame_ensemble_t;
591</programlisting>
592 </para>
593 </section>
594 <section id="DTV-ATSCMH-RS-CODE-MODE-PRI">
595 <title><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></title>
596 <para>RS code mode (primary).</para>
597 <para>Possible values are:</para>
598 <para id="atscmh-rs-code-mode">
599<programlisting>
600typedef enum atscmh_rs_code_mode {
601 ATSCMH_RSCODE_211_187 = 0,
602 ATSCMH_RSCODE_223_187 = 1,
603 ATSCMH_RSCODE_235_187 = 2,
604} atscmh_rs_code_mode_t;
605</programlisting>
606 </para>
607 </section>
608 <section id="DTV-ATSCMH-RS-CODE-MODE-SEC">
609 <title><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></title>
610 <para>RS code mode (secondary).</para>
611 <para>Possible values are:</para>
612<programlisting>
613typedef enum atscmh_rs_code_mode {
614 ATSCMH_RSCODE_211_187 = 0,
615 ATSCMH_RSCODE_223_187 = 1,
616 ATSCMH_RSCODE_235_187 = 2,
617} atscmh_rs_code_mode_t;
618</programlisting>
619 </section>
620 <section id="DTV-ATSCMH-SCCC-BLOCK-MODE">
621 <title><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></title>
622 <para>Series Concatenated Convolutional Code Block Mode.</para>
623 <para>Possible values are:</para>
624 <para id="atscmh-sccc-block-mode">
625<programlisting>
626typedef enum atscmh_sccc_block_mode {
627 ATSCMH_SCCC_BLK_SEP = 0,
628 ATSCMH_SCCC_BLK_COMB = 1,
629} atscmh_sccc_block_mode_t;
630</programlisting>
631 </para>
632 </section>
633 <section id="DTV-ATSCMH-SCCC-CODE-MODE-A">
634 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></title>
635 <para>Series Concatenated Convolutional Code Rate.</para>
636 <para>Possible values are:</para>
637 <para id="atscmh-sccc-code-mode">
638<programlisting>
639typedef enum atscmh_sccc_code_mode {
640 ATSCMH_SCCC_CODE_HLF = 0,
641 ATSCMH_SCCC_CODE_QTR = 1,
642} atscmh_sccc_code_mode_t;
643</programlisting>
644 </para>
645 </section>
646 <section id="DTV-ATSCMH-SCCC-CODE-MODE-B">
647 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></title>
648 <para>Series Concatenated Convolutional Code Rate.</para>
649 <para>Possible values are:</para>
650<programlisting>
651typedef enum atscmh_sccc_code_mode {
652 ATSCMH_SCCC_CODE_HLF = 0,
653 ATSCMH_SCCC_CODE_QTR = 1,
654} atscmh_sccc_code_mode_t;
655</programlisting>
656 </section>
657 <section id="DTV-ATSCMH-SCCC-CODE-MODE-C">
658 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></title>
659 <para>Series Concatenated Convolutional Code Rate.</para>
660 <para>Possible values are:</para>
661<programlisting>
662typedef enum atscmh_sccc_code_mode {
663 ATSCMH_SCCC_CODE_HLF = 0,
664 ATSCMH_SCCC_CODE_QTR = 1,
665} atscmh_sccc_code_mode_t;
666</programlisting>
667 </section>
668 <section id="DTV-ATSCMH-SCCC-CODE-MODE-D">
669 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></title>
670 <para>Series Concatenated Convolutional Code Rate.</para>
671 <para>Possible values are:</para>
672<programlisting>
673typedef enum atscmh_sccc_code_mode {
674 ATSCMH_SCCC_CODE_HLF = 0,
675 ATSCMH_SCCC_CODE_QTR = 1,
676} atscmh_sccc_code_mode_t;
677</programlisting>
678 </section>
679 </section>
680 <section id="DTV-API-VERSION">
681 <title><constant>DTV_API_VERSION</constant></title>
682 <para>Returns the major/minor version of the DVB API</para>
683 </section>
684 <section id="DTV-CODE-RATE-HP">
685 <title><constant>DTV_CODE_RATE_HP</constant></title>
686 <para>Used on terrestrial transmissions. The acceptable values are:
687 </para>
688 <programlisting>
689typedef enum fe_code_rate {
690 FEC_NONE = 0,
691 FEC_1_2,
692 FEC_2_3,
693 FEC_3_4,
694 FEC_4_5,
695 FEC_5_6,
696 FEC_6_7,
697 FEC_7_8,
698 FEC_8_9,
699 FEC_AUTO,
700 FEC_3_5,
701 FEC_9_10,
702} fe_code_rate_t;
703 </programlisting>
704 </section>
705 <section id="DTV-CODE-RATE-LP">
706 <title><constant>DTV_CODE_RATE_LP</constant></title>
707 <para>Used on terrestrial transmissions. The acceptable values are:
708 </para>
709 <programlisting>
710typedef enum fe_code_rate {
711 FEC_NONE = 0,
712 FEC_1_2,
713 FEC_2_3,
714 FEC_3_4,
715 FEC_4_5,
716 FEC_5_6,
717 FEC_6_7,
718 FEC_7_8,
719 FEC_8_9,
720 FEC_AUTO,
721 FEC_3_5,
722 FEC_9_10,
723} fe_code_rate_t;
724 </programlisting>
725 </section>
726 <section id="DTV-GUARD-INTERVAL">
727 <title><constant>DTV_GUARD_INTERVAL</constant></title>
728
729 <para>Possible values are:</para>
730<programlisting>
731typedef enum fe_guard_interval {
732 GUARD_INTERVAL_1_32,
733 GUARD_INTERVAL_1_16,
734 GUARD_INTERVAL_1_8,
735 GUARD_INTERVAL_1_4,
736 GUARD_INTERVAL_AUTO,
737 GUARD_INTERVAL_1_128,
738 GUARD_INTERVAL_19_128,
739 GUARD_INTERVAL_19_256,
740 GUARD_INTERVAL_PN420,
741 GUARD_INTERVAL_PN595,
742 GUARD_INTERVAL_PN945,
743} fe_guard_interval_t;
744</programlisting>
745
746 <para>Notes:</para>
747 <para>1) If <constant>DTV_GUARD_INTERVAL</constant> is set the <constant>GUARD_INTERVAL_AUTO</constant> the hardware will
748 try to find the correct guard interval (if capable) and will use TMCC to fill
749 in the missing parameters.</para>
750 <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para>
751 <para>3) DTMB specifies PN420, PN595 and PN945.</para>
752 </section>
753 <section id="DTV-TRANSMISSION-MODE">
754 <title><constant>DTV_TRANSMISSION_MODE</constant></title>
755
756 <para>Specifies the number of carriers used by the standard</para>
757
758 <para>Possible values are:</para>
759<programlisting>
760typedef enum fe_transmit_mode {
761 TRANSMISSION_MODE_2K,
762 TRANSMISSION_MODE_8K,
763 TRANSMISSION_MODE_AUTO,
764 TRANSMISSION_MODE_4K,
765 TRANSMISSION_MODE_1K,
766 TRANSMISSION_MODE_16K,
767 TRANSMISSION_MODE_32K,
768 TRANSMISSION_MODE_C1,
769 TRANSMISSION_MODE_C3780,
770} fe_transmit_mode_t;
771</programlisting>
772 <para>Notes:</para>
773 <para>1) ISDB-T supports three carrier/symbol-size: 8K, 4K, 2K. It is called
774 'mode' in the standard: Mode 1 is 2K, mode 2 is 4K, mode 3 is 8K</para>
775
776 <para>2) If <constant>DTV_TRANSMISSION_MODE</constant> is set the <constant>TRANSMISSION_MODE_AUTO</constant> the
777 hardware will try to find the correct FFT-size (if capable) and will
778 use TMCC to fill in the missing parameters.</para>
779 <para>3) DVB-T specifies 2K and 8K as valid sizes.</para>
780 <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para>
781 <para>5) DTMB specifies C1 and C3780.</para>
782 </section>
783 <section id="DTV-HIERARCHY">
784 <title><constant>DTV_HIERARCHY</constant></title>
785 <para>Frontend hierarchy</para>
786 <programlisting>
787typedef enum fe_hierarchy {
788 HIERARCHY_NONE,
789 HIERARCHY_1,
790 HIERARCHY_2,
791 HIERARCHY_4,
792 HIERARCHY_AUTO
793 } fe_hierarchy_t;
794 </programlisting>
795 </section>
796 <section id="DTV-STREAM-ID">
797 <title><constant>DTV_STREAM_ID</constant></title>
798 <para>DVB-S2, DVB-T2 and ISDB-S support the transmission of several
799 streams on a single transport stream.
800 This property enables the DVB driver to handle substream filtering,
801 when supported by the hardware.
802 By default, substream filtering is disabled.
803 </para><para>
804 For DVB-S2 and DVB-T2, the valid substream id range is from 0 to 255.
805 </para><para>
806 For ISDB, the valid substream id range is from 1 to 65535.
807 </para><para>
808 To disable it, you should use the special macro NO_STREAM_ID_FILTER.
809 </para><para>
810 Note: any value outside the id range also disables filtering.
811 </para>
812 </section>
813 <section id="DTV-DVBT2-PLP-ID-LEGACY">
814 <title><constant>DTV_DVBT2_PLP_ID_LEGACY</constant></title>
815 <para>Obsolete, replaced with DTV_STREAM_ID.</para>
816 </section>
817 <section id="DTV-ENUM-DELSYS">
818 <title><constant>DTV_ENUM_DELSYS</constant></title>
819 <para>A Multi standard frontend needs to advertise the delivery systems provided.
820 Applications need to enumerate the provided delivery systems, before using
821 any other operation with the frontend. Prior to it's introduction,
822 FE_GET_INFO was used to determine a frontend type. A frontend which
823 provides more than a single delivery system, FE_GET_INFO doesn't help much.
824 Applications which intends to use a multistandard frontend must enumerate
825 the delivery systems associated with it, rather than trying to use
826 FE_GET_INFO. In the case of a legacy frontend, the result is just the same
827 as with FE_GET_INFO, but in a more structured format </para>
828 </section>
829 <section id="DTV-INTERLEAVING">
830 <title><constant>DTV_INTERLEAVING</constant></title>
831 <para id="fe-interleaving">Interleaving mode</para>
832 <programlisting>
833enum fe_interleaving {
834 INTERLEAVING_NONE,
835 INTERLEAVING_AUTO,
836 INTERLEAVING_240,
837 INTERLEAVING_720,
838};
839 </programlisting>
840 </section>
841 <section id="DTV-LNA">
842 <title><constant>DTV_LNA</constant></title>
843 <para>Low-noise amplifier.</para>
844 <para>Hardware might offer controllable LNA which can be set manually
845 using that parameter. Usually LNA could be found only from
846 terrestrial devices if at all.</para>
847 <para>Possible values: 0, 1, LNA_AUTO</para>
848 <para>0, LNA off</para>
849 <para>1, LNA on</para>
850 <para>use the special macro LNA_AUTO to set LNA auto</para>
851 </section>
852</section>
853 <section id="frontend-property-terrestrial-systems">
854 <title>Properties used on terrestrial delivery systems</title>
855 <section id="dvbt-params">
856 <title>DVB-T delivery system</title>
857 <para>The following parameters are valid for DVB-T:</para>
858 <itemizedlist mark='opencircle'>
859 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
860 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
861 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
862 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
863 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
864 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
865 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
866 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
867 <listitem><para><link linkend="DTV-CODE-RATE-HP"><constant>DTV_CODE_RATE_HP</constant></link></para></listitem>
868 <listitem><para><link linkend="DTV-CODE-RATE-LP"><constant>DTV_CODE_RATE_LP</constant></link></para></listitem>
869 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
870 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
871 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem>
872 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
873 </itemizedlist>
874 </section>
875 <section id="dvbt2-params">
876 <title>DVB-T2 delivery system</title>
877 <para>DVB-T2 support is currently in the early stages
878 of development, so expect that this section maygrow and become
879 more detailed with time.</para>
880 <para>The following parameters are valid for DVB-T2:</para>
881 <itemizedlist mark='opencircle'>
882 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
883 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
884 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
885 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
886 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
887 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
888 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
889 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
890 <listitem><para><link linkend="DTV-CODE-RATE-HP"><constant>DTV_CODE_RATE_HP</constant></link></para></listitem>
891 <listitem><para><link linkend="DTV-CODE-RATE-LP"><constant>DTV_CODE_RATE_LP</constant></link></para></listitem>
892 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
893 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
894 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem>
895 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
896 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
897 </itemizedlist>
898 </section>
899 <section id="isdbt">
900 <title>ISDB-T delivery system</title>
901 <para>This ISDB-T/ISDB-Tsb API extension should reflect all information
902 needed to tune any ISDB-T/ISDB-Tsb hardware. Of course it is possible
903 that some very sophisticated devices won't need certain parameters to
904 tune.</para>
905 <para>The information given here should help application writers to know how
906 to handle ISDB-T and ISDB-Tsb hardware using the Linux DVB-API.</para>
907 <para>The details given here about ISDB-T and ISDB-Tsb are just enough to
908 basically show the dependencies between the needed parameter values,
909 but surely some information is left out. For more detailed information
910 see the following documents:</para>
911 <para>ARIB STD-B31 - "Transmission System for Digital Terrestrial
912 Television Broadcasting" and</para>
913 <para>ARIB TR-B14 - "Operational Guidelines for Digital Terrestrial
914 Television Broadcasting".</para>
915 <para>In order to understand the ISDB specific parameters,
916 one has to have some knowledge the channel structure in
917 ISDB-T and ISDB-Tsb. I.e. it has to be known to
918 the reader that an ISDB-T channel consists of 13 segments,
919 that it can have up to 3 layer sharing those segments,
920 and things like that.</para>
921 <para>The following parameters are valid for ISDB-T:</para>
922 <itemizedlist mark='opencircle'>
923 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
924 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
925 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
926 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
927 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
928 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
929 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
930 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
931 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
932 <listitem><para><link linkend="DTV-ISDBT-LAYER-ENABLED"><constant>DTV_ISDBT_LAYER_ENABLED</constant></link></para></listitem>
933 <listitem><para><link linkend="DTV-ISDBT-PARTIAL-RECEPTION"><constant>DTV_ISDBT_PARTIAL_RECEPTION</constant></link></para></listitem>
934 <listitem><para><link linkend="DTV-ISDBT-SOUND-BROADCASTING"><constant>DTV_ISDBT_SOUND_BROADCASTING</constant></link></para></listitem>
935 <listitem><para><link linkend="DTV-ISDBT-SB-SUBCHANNEL-ID"><constant>DTV_ISDBT_SB_SUBCHANNEL_ID</constant></link></para></listitem>
936 <listitem><para><link linkend="DTV-ISDBT-SB-SEGMENT-IDX"><constant>DTV_ISDBT_SB_SEGMENT_IDX</constant></link></para></listitem>
937 <listitem><para><link linkend="DTV-ISDBT-SB-SEGMENT-COUNT"><constant>DTV_ISDBT_SB_SEGMENT_COUNT</constant></link></para></listitem>
938 <listitem><para><link linkend="DTV-ISDBT-LAYER-FEC"><constant>DTV_ISDBT_LAYERA_FEC</constant></link></para></listitem>
939 <listitem><para><link linkend="DTV-ISDBT-LAYER-MODULATION"><constant>DTV_ISDBT_LAYERA_MODULATION</constant></link></para></listitem>
940 <listitem><para><link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT"><constant>DTV_ISDBT_LAYERA_SEGMENT_COUNT</constant></link></para></listitem>
941 <listitem><para><link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING"><constant>DTV_ISDBT_LAYERA_TIME_INTERLEAVING</constant></link></para></listitem>
942 <listitem><para><link linkend="DTV-ISDBT-LAYER-FEC"><constant>DTV_ISDBT_LAYERB_FEC</constant></link></para></listitem>
943 <listitem><para><link linkend="DTV-ISDBT-LAYER-MODULATION"><constant>DTV_ISDBT_LAYERB_MODULATION</constant></link></para></listitem>
944 <listitem><para><link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT"><constant>DTV_ISDBT_LAYERB_SEGMENT_COUNT</constant></link></para></listitem>
945 <listitem><para><link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING"><constant>DTV_ISDBT_LAYERB_TIME_INTERLEAVING</constant></link></para></listitem>
946 <listitem><para><link linkend="DTV-ISDBT-LAYER-FEC"><constant>DTV_ISDBT_LAYERC_FEC</constant></link></para></listitem>
947 <listitem><para><link linkend="DTV-ISDBT-LAYER-MODULATION"><constant>DTV_ISDBT_LAYERC_MODULATION</constant></link></para></listitem>
948 <listitem><para><link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT"><constant>DTV_ISDBT_LAYERC_SEGMENT_COUNT</constant></link></para></listitem>
949 <listitem><para><link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING"><constant>DTV_ISDBT_LAYERC_TIME_INTERLEAVING</constant></link></para></listitem>
950 </itemizedlist>
951 </section>
952 <section id="atsc-params">
953 <title>ATSC delivery system</title>
954 <para>The following parameters are valid for ATSC:</para>
955 <itemizedlist mark='opencircle'>
956 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
957 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
958 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
959 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
960 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
961 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
962 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
963 </itemizedlist>
964 </section>
965 <section id="atscmh-params">
966 <title>ATSC-MH delivery system</title>
967 <para>The following parameters are valid for ATSC-MH:</para>
968 <itemizedlist mark='opencircle'>
969 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
970 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
971 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
972 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
973 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
974 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
975 <listitem><para><link linkend="DTV-ATSCMH-FIC-VER"><constant>DTV_ATSCMH_FIC_VER</constant></link></para></listitem>
976 <listitem><para><link linkend="DTV-ATSCMH-PARADE-ID"><constant>DTV_ATSCMH_PARADE_ID</constant></link></para></listitem>
977 <listitem><para><link linkend="DTV-ATSCMH-NOG"><constant>DTV_ATSCMH_NOG</constant></link></para></listitem>
978 <listitem><para><link linkend="DTV-ATSCMH-TNOG"><constant>DTV_ATSCMH_TNOG</constant></link></para></listitem>
979 <listitem><para><link linkend="DTV-ATSCMH-SGN"><constant>DTV_ATSCMH_SGN</constant></link></para></listitem>
980 <listitem><para><link linkend="DTV-ATSCMH-PRC"><constant>DTV_ATSCMH_PRC</constant></link></para></listitem>
981 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-MODE"><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></link></para></listitem>
982 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE"><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></link></para></listitem>
983 <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-PRI"><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></link></para></listitem>
984 <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-SEC"><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></link></para></listitem>
985 <listitem><para><link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE"><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></link></para></listitem>
986 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-A"><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></link></para></listitem>
987 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-B"><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></link></para></listitem>
988 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-C"><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></link></para></listitem>
989 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem>
990 </itemizedlist>
991 </section>
992 <section id="dtmb-params">
993 <title>DTMB delivery system</title>
994 <para>The following parameters are valid for DTMB:</para>
995 <itemizedlist mark='opencircle'>
996 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
997 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
998 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
999 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1000 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1001 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1002 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
1003 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1004 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1005 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
1006 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
1007 <listitem><para><link linkend="DTV-INTERLEAVING"><constant>DTV_INTERLEAVING</constant></link></para></listitem>
1008 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
1009 </itemizedlist>
1010 </section>
1011 </section>
1012 <section id="frontend-property-cable-systems">
1013 <title>Properties used on cable delivery systems</title>
1014 <section id="dvbc-params">
1015 <title>DVB-C delivery system</title>
1016 <para>The DVB-C Annex-A is the widely used cable standard. Transmission uses QAM modulation.</para>
1017 <para>The DVB-C Annex-C is optimized for 6MHz, and is used in Japan. It supports a subset of the Annex A modulation types, and a roll-off of 0.13, instead of 0.15</para>
1018 <para>The following parameters are valid for DVB-C Annex A/C:</para>
1019 <itemizedlist mark='opencircle'>
1020 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
1021 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
1022 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
1023 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1024 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1025 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1026 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1027 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
1028 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1029 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
1030 </itemizedlist>
1031 </section>
1032 <section id="dvbc-annex-b-params">
1033 <title>DVB-C Annex B delivery system</title>
1034 <para>The DVB-C Annex-B is only used on a few Countries like the United States.</para>
1035 <para>The following parameters are valid for DVB-C Annex B:</para>
1036 <itemizedlist mark='opencircle'>
1037 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
1038 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
1039 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
1040 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1041 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1042 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1043 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1044 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
1045 </itemizedlist>
1046 </section>
1047 </section>
1048 <section id="frontend-property-satellital-systems">
1049 <title>Properties used on satellital delivery systems</title>
1050 <section id="dvbs-params">
1051 <title>DVB-S delivery system</title>
1052 <para>The following parameters are valid for DVB-S:</para>
1053 <itemizedlist mark='opencircle'>
1054 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
1055 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
1056 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
1057 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1058 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1059 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1060 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
1061 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1062 <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
1063 <listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem>
1064 </itemizedlist>
1065 <para>Future implementations might add those two missing parameters:</para>
1066 <itemizedlist mark='opencircle'>
1067 <listitem><para><link linkend="DTV-DISEQC-MASTER"><constant>DTV_DISEQC_MASTER</constant></link></para></listitem>
1068 <listitem><para><link linkend="DTV-DISEQC-SLAVE-REPLY"><constant>DTV_DISEQC_SLAVE_REPLY</constant></link></para></listitem>
1069 </itemizedlist>
1070 </section>
1071 <section id="dvbs2-params">
1072 <title>DVB-S2 delivery system</title>
1073 <para>In addition to all parameters valid for DVB-S, DVB-S2 supports the following parameters:</para>
1074 <itemizedlist mark='opencircle'>
1075 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1076 <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem>
1077 <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem>
1078 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
1079 </itemizedlist>
1080 </section>
1081 <section id="turbo-params">
1082 <title>Turbo code delivery system</title>
1083 <para>In addition to all parameters valid for DVB-S, turbo code supports the following parameters:</para>
1084 <itemizedlist mark='opencircle'>
1085 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1086 </itemizedlist>
1087 </section>
1088 <section id="isdbs-params">
1089 <title>ISDB-S delivery system</title>
1090 <para>The following parameters are valid for ISDB-S:</para>
1091 <itemizedlist mark='opencircle'>
1092 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
1093 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
1094 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
1095 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1096 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1097 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1098 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
1099 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1100 <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
1101 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
1102 </itemizedlist>
1103 </section>
1104 </section>
1105</section>
diff --git a/Documentation/DocBook/media/dvb/dvbstb.pdf b/Documentation/DocBook/media/dvb/dvbstb.pdf
new file mode 100644
index 00000000000..0fa75d90c3e
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/dvbstb.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/dvb/examples.xml b/Documentation/DocBook/media/dvb/examples.xml
new file mode 100644
index 00000000000..f037e568eb6
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/examples.xml
@@ -0,0 +1,365 @@
1<title>Examples</title>
2<para>In this section we would like to present some examples for using the DVB API.
3</para>
4<para>Maintainer note: This section is out of date. Please refer to the sample programs packaged
5with the driver distribution from <ulink url="http://linuxtv.org/hg/dvb-apps" />.
6</para>
7
8<section id="tuning">
9<title>Tuning</title>
10<para>We will start with a generic tuning subroutine that uses the frontend and SEC, as well as
11the demux devices. The example is given for QPSK tuners, but can easily be adjusted for
12QAM.
13</para>
14<programlisting>
15 #include &#x003C;sys/ioctl.h&#x003E;
16 #include &#x003C;stdio.h&#x003E;
17 #include &#x003C;stdint.h&#x003E;
18 #include &#x003C;sys/types.h&#x003E;
19 #include &#x003C;sys/stat.h&#x003E;
20 #include &#x003C;fcntl.h&#x003E;
21 #include &#x003C;time.h&#x003E;
22 #include &#x003C;unistd.h&#x003E;
23
24 #include &#x003C;linux/dvb/dmx.h&#x003E;
25 #include &#x003C;linux/dvb/frontend.h&#x003E;
26 #include &#x003C;linux/dvb/sec.h&#x003E;
27 #include &#x003C;sys/poll.h&#x003E;
28
29 #define DMX "/dev/dvb/adapter0/demux1"
30 #define FRONT "/dev/dvb/adapter0/frontend1"
31 #define SEC "/dev/dvb/adapter0/sec1"
32
33 /&#x22C6; routine for checking if we have a signal and other status information&#x22C6;/
34 int FEReadStatus(int fd, fe_status_t &#x22C6;stat)
35 {
36 int ans;
37
38 if ( (ans = ioctl(fd,FE_READ_STATUS,stat) &#x003C; 0)){
39 perror("FE READ STATUS: ");
40 return -1;
41 }
42
43 if (&#x22C6;stat &amp; FE_HAS_POWER)
44 printf("FE HAS POWER\n");
45
46 if (&#x22C6;stat &amp; FE_HAS_SIGNAL)
47 printf("FE HAS SIGNAL\n");
48
49 if (&#x22C6;stat &amp; FE_SPECTRUM_INV)
50 printf("SPEKTRUM INV\n");
51
52 return 0;
53 }
54
55
56 /&#x22C6; tune qpsk &#x22C6;/
57 /&#x22C6; freq: frequency of transponder &#x22C6;/
58 /&#x22C6; vpid, apid, tpid: PIDs of video, audio and teletext TS packets &#x22C6;/
59 /&#x22C6; diseqc: DiSEqC address of the used LNB &#x22C6;/
60 /&#x22C6; pol: Polarisation &#x22C6;/
61 /&#x22C6; srate: Symbol Rate &#x22C6;/
62 /&#x22C6; fec. FEC &#x22C6;/
63 /&#x22C6; lnb_lof1: local frequency of lower LNB band &#x22C6;/
64 /&#x22C6; lnb_lof2: local frequency of upper LNB band &#x22C6;/
65 /&#x22C6; lnb_slof: switch frequency of LNB &#x22C6;/
66
67 int set_qpsk_channel(int freq, int vpid, int apid, int tpid,
68 int diseqc, int pol, int srate, int fec, int lnb_lof1,
69 int lnb_lof2, int lnb_slof)
70 {
71 struct secCommand scmd;
72 struct secCmdSequence scmds;
73 struct dmx_pes_filter_params pesFilterParams;
74 FrontendParameters frp;
75 struct pollfd pfd[1];
76 FrontendEvent event;
77 int demux1, demux2, demux3, front;
78
79 frequency = (uint32_t) freq;
80 symbolrate = (uint32_t) srate;
81
82 if((front = open(FRONT,O_RDWR)) &#x003C; 0){
83 perror("FRONTEND DEVICE: ");
84 return -1;
85 }
86
87 if((sec = open(SEC,O_RDWR)) &#x003C; 0){
88 perror("SEC DEVICE: ");
89 return -1;
90 }
91
92 if (demux1 &#x003C; 0){
93 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
94 &#x003C; 0){
95 perror("DEMUX DEVICE: ");
96 return -1;
97 }
98 }
99
100 if (demux2 &#x003C; 0){
101 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
102 &#x003C; 0){
103 perror("DEMUX DEVICE: ");
104 return -1;
105 }
106 }
107
108 if (demux3 &#x003C; 0){
109 if ((demux3=open(DMX, O_RDWR|O_NONBLOCK))
110 &#x003C; 0){
111 perror("DEMUX DEVICE: ");
112 return -1;
113 }
114 }
115
116 if (freq &#x003C; lnb_slof) {
117 frp.Frequency = (freq - lnb_lof1);
118 scmds.continuousTone = SEC_TONE_OFF;
119 } else {
120 frp.Frequency = (freq - lnb_lof2);
121 scmds.continuousTone = SEC_TONE_ON;
122 }
123 frp.Inversion = INVERSION_AUTO;
124 if (pol) scmds.voltage = SEC_VOLTAGE_18;
125 else scmds.voltage = SEC_VOLTAGE_13;
126
127 scmd.type=0;
128 scmd.u.diseqc.addr=0x10;
129 scmd.u.diseqc.cmd=0x38;
130 scmd.u.diseqc.numParams=1;
131 scmd.u.diseqc.params[0] = 0xF0 | ((diseqc &#x22C6; 4) &amp; 0x0F) |
132 (scmds.continuousTone == SEC_TONE_ON ? 1 : 0) |
133 (scmds.voltage==SEC_VOLTAGE_18 ? 2 : 0);
134
135 scmds.miniCommand=SEC_MINI_NONE;
136 scmds.numCommands=1;
137 scmds.commands=&amp;scmd;
138 if (ioctl(sec, SEC_SEND_SEQUENCE, &amp;scmds) &#x003C; 0){
139 perror("SEC SEND: ");
140 return -1;
141 }
142
143 if (ioctl(sec, SEC_SEND_SEQUENCE, &amp;scmds) &#x003C; 0){
144 perror("SEC SEND: ");
145 return -1;
146 }
147
148 frp.u.qpsk.SymbolRate = srate;
149 frp.u.qpsk.FEC_inner = fec;
150
151 if (ioctl(front, FE_SET_FRONTEND, &amp;frp) &#x003C; 0){
152 perror("QPSK TUNE: ");
153 return -1;
154 }
155
156 pfd[0].fd = front;
157 pfd[0].events = POLLIN;
158
159 if (poll(pfd,1,3000)){
160 if (pfd[0].revents &amp; POLLIN){
161 printf("Getting QPSK event\n");
162 if ( ioctl(front, FE_GET_EVENT, &amp;event)
163
164 == -EOVERFLOW){
165 perror("qpsk get event");
166 return -1;
167 }
168 printf("Received ");
169 switch(event.type){
170 case FE_UNEXPECTED_EV:
171 printf("unexpected event\n");
172 return -1;
173 case FE_FAILURE_EV:
174 printf("failure event\n");
175 return -1;
176
177 case FE_COMPLETION_EV:
178 printf("completion event\n");
179 }
180 }
181 }
182
183
184 pesFilterParams.pid = vpid;
185 pesFilterParams.input = DMX_IN_FRONTEND;
186 pesFilterParams.output = DMX_OUT_DECODER;
187 pesFilterParams.pes_type = DMX_PES_VIDEO;
188 pesFilterParams.flags = DMX_IMMEDIATE_START;
189 if (ioctl(demux1, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
190 perror("set_vpid");
191 return -1;
192 }
193
194 pesFilterParams.pid = apid;
195 pesFilterParams.input = DMX_IN_FRONTEND;
196 pesFilterParams.output = DMX_OUT_DECODER;
197 pesFilterParams.pes_type = DMX_PES_AUDIO;
198 pesFilterParams.flags = DMX_IMMEDIATE_START;
199 if (ioctl(demux2, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
200 perror("set_apid");
201 return -1;
202 }
203
204 pesFilterParams.pid = tpid;
205 pesFilterParams.input = DMX_IN_FRONTEND;
206 pesFilterParams.output = DMX_OUT_DECODER;
207 pesFilterParams.pes_type = DMX_PES_TELETEXT;
208 pesFilterParams.flags = DMX_IMMEDIATE_START;
209 if (ioctl(demux3, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
210 perror("set_tpid");
211 return -1;
212 }
213
214 return has_signal(fds);
215 }
216
217</programlisting>
218<para>The program assumes that you are using a universal LNB and a standard DiSEqC
219switch with up to 4 addresses. Of course, you could build in some more checking if
220tuning was successful and maybe try to repeat the tuning process. Depending on the
221external hardware, i.e. LNB and DiSEqC switch, and weather conditions this may be
222necessary.
223</para>
224</section>
225
226<section id="the_dvr_device">
227<title>The DVR device</title>
228<para>The following program code shows how to use the DVR device for recording.
229</para>
230<programlisting>
231 #include &#x003C;sys/ioctl.h&#x003E;
232 #include &#x003C;stdio.h&#x003E;
233 #include &#x003C;stdint.h&#x003E;
234 #include &#x003C;sys/types.h&#x003E;
235 #include &#x003C;sys/stat.h&#x003E;
236 #include &#x003C;fcntl.h&#x003E;
237 #include &#x003C;time.h&#x003E;
238 #include &#x003C;unistd.h&#x003E;
239
240 #include &#x003C;linux/dvb/dmx.h&#x003E;
241 #include &#x003C;linux/dvb/video.h&#x003E;
242 #include &#x003C;sys/poll.h&#x003E;
243 #define DVR "/dev/dvb/adapter0/dvr1"
244 #define AUDIO "/dev/dvb/adapter0/audio1"
245 #define VIDEO "/dev/dvb/adapter0/video1"
246
247 #define BUFFY (188&#x22C6;20)
248 #define MAX_LENGTH (1024&#x22C6;1024&#x22C6;5) /&#x22C6; record 5MB &#x22C6;/
249
250
251 /&#x22C6; switch the demuxes to recording, assuming the transponder is tuned &#x22C6;/
252
253 /&#x22C6; demux1, demux2: file descriptor of video and audio filters &#x22C6;/
254 /&#x22C6; vpid, apid: PIDs of video and audio channels &#x22C6;/
255
256 int switch_to_record(int demux1, int demux2, uint16_t vpid, uint16_t apid)
257 {
258 struct dmx_pes_filter_params pesFilterParams;
259
260 if (demux1 &#x003C; 0){
261 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
262 &#x003C; 0){
263 perror("DEMUX DEVICE: ");
264 return -1;
265 }
266 }
267
268 if (demux2 &#x003C; 0){
269 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
270 &#x003C; 0){
271 perror("DEMUX DEVICE: ");
272 return -1;
273 }
274 }
275
276 pesFilterParams.pid = vpid;
277 pesFilterParams.input = DMX_IN_FRONTEND;
278 pesFilterParams.output = DMX_OUT_TS_TAP;
279 pesFilterParams.pes_type = DMX_PES_VIDEO;
280 pesFilterParams.flags = DMX_IMMEDIATE_START;
281 if (ioctl(demux1, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
282 perror("DEMUX DEVICE");
283 return -1;
284 }
285 pesFilterParams.pid = apid;
286 pesFilterParams.input = DMX_IN_FRONTEND;
287 pesFilterParams.output = DMX_OUT_TS_TAP;
288 pesFilterParams.pes_type = DMX_PES_AUDIO;
289 pesFilterParams.flags = DMX_IMMEDIATE_START;
290 if (ioctl(demux2, DMX_SET_PES_FILTER, &amp;pesFilterParams) &#x003C; 0){
291 perror("DEMUX DEVICE");
292 return -1;
293 }
294 return 0;
295 }
296
297 /&#x22C6; start recording MAX_LENGTH , assuming the transponder is tuned &#x22C6;/
298
299 /&#x22C6; demux1, demux2: file descriptor of video and audio filters &#x22C6;/
300 /&#x22C6; vpid, apid: PIDs of video and audio channels &#x22C6;/
301 int record_dvr(int demux1, int demux2, uint16_t vpid, uint16_t apid)
302 {
303 int i;
304 int len;
305 int written;
306 uint8_t buf[BUFFY];
307 uint64_t length;
308 struct pollfd pfd[1];
309 int dvr, dvr_out;
310
311 /&#x22C6; open dvr device &#x22C6;/
312 if ((dvr = open(DVR, O_RDONLY|O_NONBLOCK)) &#x003C; 0){
313 perror("DVR DEVICE");
314 return -1;
315 }
316
317 /&#x22C6; switch video and audio demuxes to dvr &#x22C6;/
318 printf ("Switching dvr on\n");
319 i = switch_to_record(demux1, demux2, vpid, apid);
320 printf("finished: ");
321
322 printf("Recording %2.0f MB of test file in TS format\n",
323 MAX_LENGTH/(1024.0&#x22C6;1024.0));
324 length = 0;
325
326 /&#x22C6; open output file &#x22C6;/
327 if ((dvr_out = open(DVR_FILE,O_WRONLY|O_CREAT
328 |O_TRUNC, S_IRUSR|S_IWUSR
329 |S_IRGRP|S_IWGRP|S_IROTH|
330 S_IWOTH)) &#x003C; 0){
331 perror("Can't open file for dvr test");
332 return -1;
333 }
334
335 pfd[0].fd = dvr;
336 pfd[0].events = POLLIN;
337
338 /&#x22C6; poll for dvr data and write to file &#x22C6;/
339 while (length &#x003C; MAX_LENGTH ) {
340 if (poll(pfd,1,1)){
341 if (pfd[0].revents &amp; POLLIN){
342 len = read(dvr, buf, BUFFY);
343 if (len &#x003C; 0){
344 perror("recording");
345 return -1;
346 }
347 if (len &#x003E; 0){
348 written = 0;
349 while (written &#x003C; len)
350 written +=
351 write (dvr_out,
352 buf, len);
353 length += len;
354 printf("written %2.0f MB\r",
355 length/1024./1024.);
356 }
357 }
358 }
359 }
360 return 0;
361 }
362
363</programlisting>
364
365</section>
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
new file mode 100644
index 00000000000..426c2526a45
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -0,0 +1,1548 @@
1<title>DVB Frontend API</title>
2
3<para>The DVB frontend device controls the tuner and DVB demodulator
4hardware. It can be accessed through <emphasis
5role="tt">/dev/dvb/adapter0/frontend0</emphasis>. Data types and and
6ioctl definitions can be accessed by including <emphasis
7role="tt">linux/dvb/frontend.h</emphasis> in your application.</para>
8
9<para>DVB frontends come in three varieties: DVB-S (satellite), DVB-C
10(cable) and DVB-T (terrestrial). Transmission via the internet (DVB-IP)
11is not yet handled by this API but a future extension is possible. For
12DVB-S the frontend device also supports satellite equipment control
13(SEC) via DiSEqC and V-SEC protocols. The DiSEqC (digital SEC)
14specification is available from
15<ulink url="http://www.eutelsat.com/satellites/4_5_5.html">Eutelsat</ulink>.</para>
16
17<para>Note that the DVB API may also be used for MPEG decoder-only PCI
18cards, in which case there exists no frontend device.</para>
19
20<section id="frontend_types">
21<title>Frontend Data Types</title>
22
23<section id="fe-type-t">
24<title>Frontend type</title>
25
26<para>For historical reasons, frontend types are named by the type of modulation used in
27transmission. The fontend types are given by fe_type_t type, defined as:</para>
28
29<table pgwide="1" frame="none" id="fe-type">
30<title>Frontend types</title>
31<tgroup cols="3">
32 &cs-def;
33 <thead>
34 <row>
35 <entry>fe_type</entry>
36 <entry>Description</entry>
37 <entry><link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> equivalent type</entry>
38 </row>
39 </thead>
40 <tbody valign="top">
41 <row>
42 <entry id="FE_QPSK"><constant>FE_QPSK</constant></entry>
43 <entry>For DVB-S standard</entry>
44 <entry><constant>SYS_DVBS</constant></entry>
45 </row>
46 <row>
47 <entry id="FE_QAM"><constant>FE_QAM</constant></entry>
48 <entry>For DVB-C annex A standard</entry>
49 <entry><constant>SYS_DVBC_ANNEX_A</constant></entry>
50 </row>
51 <row>
52 <entry id="FE_OFDM"><constant>FE_OFDM</constant></entry>
53 <entry>For DVB-T standard</entry>
54 <entry><constant>SYS_DVBT</constant></entry>
55 </row>
56 <row>
57 <entry id="FE_ATSC"><constant>FE_ATSC</constant></entry>
58 <entry>For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used in US.</entry>
59 <entry><constant>SYS_ATSC</constant> (terrestrial) or <constant>SYS_DVBC_ANNEX_B</constant> (cable)</entry>
60 </row>
61</tbody></tgroup></table>
62
63<para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're
64supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter.
65</para>
66
67<para>The usage of this field is deprecated, as it doesn't report all supported standards, and
68will provide an incomplete information for frontends that support multiple delivery systems.
69Please use <link linkend="DTV-ENUM-DELSYS">DTV_ENUM_DELSYS</link> instead.</para>
70</section>
71
72<section id="fe-caps-t">
73<title>frontend capabilities</title>
74
75<para>Capabilities describe what a frontend can do. Some capabilities can only be supported for
76a specific frontend type.</para>
77<programlisting>
78 typedef enum fe_caps {
79 FE_IS_STUPID = 0,
80 FE_CAN_INVERSION_AUTO = 0x1,
81 FE_CAN_FEC_1_2 = 0x2,
82 FE_CAN_FEC_2_3 = 0x4,
83 FE_CAN_FEC_3_4 = 0x8,
84 FE_CAN_FEC_4_5 = 0x10,
85 FE_CAN_FEC_5_6 = 0x20,
86 FE_CAN_FEC_6_7 = 0x40,
87 FE_CAN_FEC_7_8 = 0x80,
88 FE_CAN_FEC_8_9 = 0x100,
89 FE_CAN_FEC_AUTO = 0x200,
90 FE_CAN_QPSK = 0x400,
91 FE_CAN_QAM_16 = 0x800,
92 FE_CAN_QAM_32 = 0x1000,
93 FE_CAN_QAM_64 = 0x2000,
94 FE_CAN_QAM_128 = 0x4000,
95 FE_CAN_QAM_256 = 0x8000,
96 FE_CAN_QAM_AUTO = 0x10000,
97 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
98 FE_CAN_BANDWIDTH_AUTO = 0x40000,
99 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
100 FE_CAN_HIERARCHY_AUTO = 0x100000,
101 FE_CAN_8VSB = 0x200000,
102 FE_CAN_16VSB = 0x400000,
103 FE_HAS_EXTENDED_CAPS = 0x800000,
104 FE_CAN_MULTISTREAM = 0x4000000,
105 FE_CAN_TURBO_FEC = 0x8000000,
106 FE_CAN_2G_MODULATION = 0x10000000,
107 FE_NEEDS_BENDING = 0x20000000,
108 FE_CAN_RECOVER = 0x40000000,
109 FE_CAN_MUTE_TS = 0x80000000
110 } fe_caps_t;
111</programlisting>
112</section>
113
114<section id="dvb-frontend-info">
115<title>frontend information</title>
116
117<para>Information about the frontend ca be queried with
118 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
119
120<programlisting>
121 struct dvb_frontend_info {
122 char name[128];
123 fe_type_t type;
124 uint32_t frequency_min;
125 uint32_t frequency_max;
126 uint32_t frequency_stepsize;
127 uint32_t frequency_tolerance;
128 uint32_t symbol_rate_min;
129 uint32_t symbol_rate_max;
130 uint32_t symbol_rate_tolerance; /&#x22C6; ppm &#x22C6;/
131 uint32_t notifier_delay; /&#x22C6; ms &#x22C6;/
132 fe_caps_t caps;
133 };
134</programlisting>
135</section>
136
137<section id="dvb-diseqc-master-cmd">
138<title>diseqc master command</title>
139
140<para>A message sent from the frontend to DiSEqC capable equipment.</para>
141<programlisting>
142 struct dvb_diseqc_master_cmd {
143 uint8_t msg [6]; /&#x22C6; { framing, address, command, data[3] } &#x22C6;/
144 uint8_t msg_len; /&#x22C6; valid values are 3...6 &#x22C6;/
145 };
146</programlisting>
147</section>
148<section role="subsection" id="dvb-diseqc-slave-reply">
149<title>diseqc slave reply</title>
150
151<para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
152<programlisting>
153 struct dvb_diseqc_slave_reply {
154 uint8_t msg [4]; /&#x22C6; { framing, data [3] } &#x22C6;/
155 uint8_t msg_len; /&#x22C6; valid values are 0...4, 0 means no msg &#x22C6;/
156 int timeout; /&#x22C6; return from ioctl after timeout ms with &#x22C6;/
157 }; /&#x22C6; errorcode when no message was received &#x22C6;/
158</programlisting>
159</section>
160
161<section id="fe-sec-voltage-t">
162<title>diseqc slave reply</title>
163<para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
164(horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
165consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
166<programlisting>
167 typedef enum fe_sec_voltage {
168 SEC_VOLTAGE_13,
169 SEC_VOLTAGE_18
170 } fe_sec_voltage_t;
171</programlisting>
172</section>
173
174<section id="fe-sec-tone-mode-t">
175<title>SEC continuous tone</title>
176
177<para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
178high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
179be switched consistently to the DiSEqC commands as described in the DiSEqC
180spec.</para>
181<programlisting>
182 typedef enum fe_sec_tone_mode {
183 SEC_TONE_ON,
184 SEC_TONE_OFF
185 } fe_sec_tone_mode_t;
186</programlisting>
187</section>
188
189<section id="fe-sec-mini-cmd-t">
190<title>SEC tone burst</title>
191
192<para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
193between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
194be switched consistently to the DiSEqC commands as described in the DiSEqC
195spec.</para>
196<programlisting>
197 typedef enum fe_sec_mini_cmd {
198 SEC_MINI_A,
199 SEC_MINI_B
200 } fe_sec_mini_cmd_t;
201</programlisting>
202
203<para></para>
204</section>
205
206<section id="fe-status-t">
207<title>frontend status</title>
208<para>Several functions of the frontend device use the fe_status data type defined
209by</para>
210<programlisting>
211typedef enum fe_status {
212 FE_HAS_SIGNAL = 0x01,
213 FE_HAS_CARRIER = 0x02,
214 FE_HAS_VITERBI = 0x04,
215 FE_HAS_SYNC = 0x08,
216 FE_HAS_LOCK = 0x10,
217 FE_TIMEDOUT = 0x20,
218 FE_REINIT = 0x40,
219} fe_status_t;
220</programlisting>
221<para>to indicate the current state and/or state changes of the frontend hardware:
222</para>
223
224<informaltable><tgroup cols="2"><tbody>
225<row>
226<entry align="char">FE_HAS_SIGNAL</entry>
227<entry align="char">The frontend has found something above the noise level</entry>
228</row><row>
229<entry align="char">FE_HAS_CARRIER</entry>
230<entry align="char">The frontend has found a DVB signal</entry>
231</row><row>
232<entry align="char">FE_HAS_VITERBI</entry>
233<entry align="char">The frontend FEC code is stable</entry>
234</row><row>
235<entry align="char">FE_HAS_SYNC</entry>
236<entry align="char">Syncronization bytes was found</entry>
237</row><row>
238<entry align="char">FE_HAS_LOCK</entry>
239<entry align="char">The DVB were locked and everything is working</entry>
240</row><row>
241<entry align="char">FE_TIMEDOUT</entry>
242<entry align="char">no lock within the last about 2 seconds</entry>
243</row><row>
244<entry align="char">FE_REINIT</entry>
245<entry align="char">The frontend was reinitialized, application is
246recommended to reset DiSEqC, tone and parameters</entry>
247</row>
248</tbody></tgroup></informaltable>
249
250</section>
251
252<section id="dvb-frontend-parameters">
253<title>frontend parameters</title>
254<para>The kind of parameters passed to the frontend device for tuning depend on
255the kind of hardware you are using.</para>
256<para>The struct <constant>dvb_frontend_parameters</constant> uses an
257union with specific per-system parameters. However, as newer delivery systems
258required more data, the structure size weren't enough to fit, and just
259extending its size would break the existing applications. So, those parameters
260were replaced by the usage of <link linkend="FE_GET_SET_PROPERTY">
261<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> ioctl's. The
262new API is flexible enough to add new parameters to existing delivery systems,
263and to add newer delivery systems.</para>
264<para>So, newer applications should use <link linkend="FE_GET_SET_PROPERTY">
265<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in
266order to be able to support the newer System Delivery like DVB-S2, DVB-T2,
267DVB-C2, ISDB, etc.</para>
268<para>All kinds of parameters are combined as an union in the FrontendParameters structure:
269<programlisting>
270struct dvb_frontend_parameters {
271 uint32_t frequency; /&#x22C6; (absolute) frequency in Hz for QAM/OFDM &#x22C6;/
272 /&#x22C6; intermediate frequency in kHz for QPSK &#x22C6;/
273 fe_spectral_inversion_t inversion;
274 union {
275 struct dvb_qpsk_parameters qpsk;
276 struct dvb_qam_parameters qam;
277 struct dvb_ofdm_parameters ofdm;
278 struct dvb_vsb_parameters vsb;
279 } u;
280};
281</programlisting></para>
282<para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate
283frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
284the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
285OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz.
286</para>
287
288<section id="dvb-qpsk-parameters">
289<title>QPSK parameters</title>
290<para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para>
291<programlisting>
292 struct dvb_qpsk_parameters {
293 uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
294 fe_code_rate_t fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
295 };
296</programlisting>
297</section>
298<section id="dvb-qam-parameters">
299<title>QAM parameters</title>
300<para>for cable QAM frontend you use the <constant>dvb_qam_parameters</constant> structure:</para>
301<programlisting>
302 struct dvb_qam_parameters {
303 uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
304 fe_code_rate_t fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
305 fe_modulation_t modulation; /&#x22C6; modulation type (see above) &#x22C6;/
306 };
307</programlisting>
308</section>
309<section id="dvb-vsb-parameters">
310<title>VSB parameters</title>
311<para>ATSC frontends are supported by the <constant>dvb_vsb_parameters</constant> structure:</para>
312<programlisting>
313struct dvb_vsb_parameters {
314 fe_modulation_t modulation; /&#x22C6; modulation type (see above) &#x22C6;/
315};
316</programlisting>
317</section>
318<section id="dvb-ofdm-parameters">
319<title>OFDM parameters</title>
320<para>DVB-T frontends are supported by the <constant>dvb_ofdm_parameters</constant> structure:</para>
321<programlisting>
322 struct dvb_ofdm_parameters {
323 fe_bandwidth_t bandwidth;
324 fe_code_rate_t code_rate_HP; /&#x22C6; high priority stream code rate &#x22C6;/
325 fe_code_rate_t code_rate_LP; /&#x22C6; low priority stream code rate &#x22C6;/
326 fe_modulation_t constellation; /&#x22C6; modulation type (see above) &#x22C6;/
327 fe_transmit_mode_t transmission_mode;
328 fe_guard_interval_t guard_interval;
329 fe_hierarchy_t hierarchy_information;
330 };
331</programlisting>
332</section>
333<section id="fe-spectral-inversion-t">
334<title>frontend spectral inversion</title>
335<para>The Inversion field can take one of these values:
336</para>
337<programlisting>
338typedef enum fe_spectral_inversion {
339 INVERSION_OFF,
340 INVERSION_ON,
341 INVERSION_AUTO
342} fe_spectral_inversion_t;
343</programlisting>
344<para>It indicates if spectral inversion should be presumed or not. In the automatic setting
345(<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
346itself.
347</para>
348</section>
349<section id="fe-code-rate-t">
350<title>frontend code rate</title>
351<para>The possible values for the <constant>fec_inner</constant> field used on
352<link linkend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
353<link linkend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
354</para>
355<programlisting>
356typedef enum fe_code_rate {
357 FEC_NONE = 0,
358 FEC_1_2,
359 FEC_2_3,
360 FEC_3_4,
361 FEC_4_5,
362 FEC_5_6,
363 FEC_6_7,
364 FEC_7_8,
365 FEC_8_9,
366 FEC_AUTO,
367 FEC_3_5,
368 FEC_9_10,
369} fe_code_rate_t;
370</programlisting>
371<para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
372detection.
373</para>
374</section>
375<section id="fe-modulation-t">
376<title>frontend modulation type for QAM, OFDM and VSB</title>
377<para>For cable and terrestrial frontends, e. g. for
378<link linkend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
379<link linkend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
380<link linkend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
381it needs to specify the quadrature modulation mode which can be one of the following:
382</para>
383<programlisting>
384 typedef enum fe_modulation {
385 QPSK,
386 QAM_16,
387 QAM_32,
388 QAM_64,
389 QAM_128,
390 QAM_256,
391 QAM_AUTO,
392 VSB_8,
393 VSB_16,
394 PSK_8,
395 APSK_16,
396 APSK_32,
397 DQPSK,
398 } fe_modulation_t;
399</programlisting>
400</section>
401<section>
402<title>More OFDM parameters</title>
403<section id="fe-transmit-mode-t">
404<title>Number of carriers per channel</title>
405<programlisting>
406typedef enum fe_transmit_mode {
407 TRANSMISSION_MODE_2K,
408 TRANSMISSION_MODE_8K,
409 TRANSMISSION_MODE_AUTO,
410 TRANSMISSION_MODE_4K,
411 TRANSMISSION_MODE_1K,
412 TRANSMISSION_MODE_16K,
413 TRANSMISSION_MODE_32K,
414 } fe_transmit_mode_t;
415</programlisting>
416</section>
417<section id="fe-bandwidth-t">
418<title>frontend bandwidth</title>
419<programlisting>
420typedef enum fe_bandwidth {
421 BANDWIDTH_8_MHZ,
422 BANDWIDTH_7_MHZ,
423 BANDWIDTH_6_MHZ,
424 BANDWIDTH_AUTO,
425 BANDWIDTH_5_MHZ,
426 BANDWIDTH_10_MHZ,
427 BANDWIDTH_1_712_MHZ,
428} fe_bandwidth_t;
429</programlisting>
430</section>
431<section id="fe-guard-interval-t">
432<title>frontend guard inverval</title>
433<programlisting>
434typedef enum fe_guard_interval {
435 GUARD_INTERVAL_1_32,
436 GUARD_INTERVAL_1_16,
437 GUARD_INTERVAL_1_8,
438 GUARD_INTERVAL_1_4,
439 GUARD_INTERVAL_AUTO,
440 GUARD_INTERVAL_1_128,
441 GUARD_INTERVAL_19_128,
442 GUARD_INTERVAL_19_256,
443} fe_guard_interval_t;
444</programlisting>
445</section>
446<section id="fe-hierarchy-t">
447<title>frontend hierarchy</title>
448<programlisting>
449typedef enum fe_hierarchy {
450 HIERARCHY_NONE,
451 HIERARCHY_1,
452 HIERARCHY_2,
453 HIERARCHY_4,
454 HIERARCHY_AUTO
455 } fe_hierarchy_t;
456</programlisting>
457</section>
458</section>
459
460</section>
461
462<section id="dvb-frontend-event">
463<title>frontend events</title>
464 <programlisting>
465 struct dvb_frontend_event {
466 fe_status_t status;
467 struct dvb_frontend_parameters parameters;
468 };
469</programlisting>
470 </section>
471</section>
472
473
474<section id="frontend_fcalls">
475<title>Frontend Function Calls</title>
476
477<section id="frontend_f_open">
478<title>open()</title>
479<para>DESCRIPTION</para>
480<informaltable><tgroup cols="1"><tbody><row>
481<entry align="char">
482<para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
483 for subsequent use. Usually the first thing to do after a successful open is to
484 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
485<para>The device can be opened in read-only mode, which only allows monitoring of
486 device status and statistics, or read/write mode, which allows any kind of use
487 (e.g. performing tuning operations.)
488</para>
489<para>In a system with multiple front-ends, it is usually the case that multiple devices
490 cannot be open in read/write mode simultaneously. As long as a front-end
491 device is opened in read/write mode, other open() calls in read/write mode will
492 either fail or block, depending on whether non-blocking or blocking mode was
493 specified. A front-end device opened in blocking mode can later be put into
494 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
495 system call. This is a standard system call, documented in the Linux manual
496 page for fcntl. When an open() call has succeeded, the device will be ready
497 for use in the specified mode. This implies that the corresponding hardware is
498 powered up, and that other front-ends may have been powered down to make
499 that possible.</para>
500</entry>
501 </row></tbody></tgroup></informaltable>
502
503<para>SYNOPSIS</para>
504<informaltable><tgroup cols="1"><tbody><row><entry
505 align="char">
506<para>int open(const char &#x22C6;deviceName, int flags);</para>
507</entry>
508 </row></tbody></tgroup></informaltable>
509<para>PARAMETERS
510</para>
511<informaltable><tgroup cols="2"><tbody><row><entry
512 align="char">
513<para>const char
514 *deviceName</para>
515</entry><entry
516 align="char">
517<para>Name of specific video device.</para>
518</entry>
519 </row><row><entry
520 align="char">
521<para>int flags</para>
522</entry><entry
523 align="char">
524<para>A bit-wise OR of the following flags:</para>
525</entry>
526 </row><row><entry
527 align="char">
528</entry><entry
529 align="char">
530<para>O_RDONLY read-only access</para>
531</entry>
532 </row><row><entry
533 align="char">
534</entry><entry
535 align="char">
536<para>O_RDWR read/write access</para>
537</entry>
538 </row><row><entry
539 align="char">
540</entry><entry
541 align="char">
542<para>O_NONBLOCK open in non-blocking mode</para>
543</entry>
544 </row><row><entry
545 align="char">
546</entry><entry
547 align="char">
548<para>(blocking mode is the default)</para>
549</entry>
550 </row></tbody></tgroup></informaltable>
551<para>RETURN VALUE</para>
552<informaltable><tgroup cols="2"><tbody><row><entry
553 align="char">
554<para>ENODEV</para>
555</entry><entry
556 align="char">
557<para>Device driver not loaded/available.</para>
558</entry>
559 </row><row><entry
560 align="char">
561<para>EINTERNAL</para>
562</entry><entry
563 align="char">
564<para>Internal error.</para>
565</entry>
566 </row><row><entry
567 align="char">
568<para>EBUSY</para>
569</entry><entry
570 align="char">
571<para>Device or resource busy.</para>
572</entry>
573 </row><row><entry
574 align="char">
575<para>EINVAL</para>
576</entry><entry
577 align="char">
578<para>Invalid argument.</para>
579</entry>
580 </row></tbody></tgroup></informaltable>
581</section>
582
583<section id="frontend_f_close">
584<title>close()</title>
585<para>DESCRIPTION
586</para>
587<informaltable><tgroup cols="1"><tbody><row><entry
588 align="char">
589<para>This system call closes a previously opened front-end device. After closing
590 a front-end device, its corresponding hardware might be powered down
591 automatically.</para>
592</entry>
593 </row></tbody></tgroup></informaltable>
594<para>SYNOPSIS
595</para>
596<informaltable><tgroup cols="1"><tbody><row><entry
597 align="char">
598<para>int close(int fd);</para>
599</entry>
600 </row></tbody></tgroup></informaltable>
601<para>PARAMETERS
602</para>
603<informaltable><tgroup cols="2"><tbody><row><entry
604 align="char">
605<para>int fd</para>
606</entry><entry
607 align="char">
608<para>File descriptor returned by a previous call to open().</para>
609</entry>
610 </row></tbody></tgroup></informaltable>
611<para>RETURN VALUE</para>
612<informaltable><tgroup cols="2"><tbody><row><entry
613 align="char">
614<para>EBADF</para>
615</entry><entry
616 align="char">
617<para>fd is not a valid open file descriptor.</para>
618</entry>
619 </row></tbody></tgroup></informaltable>
620</section>
621
622<section id="FE_READ_STATUS">
623<title>FE_READ_STATUS</title>
624<para>DESCRIPTION
625</para>
626<informaltable><tgroup cols="1"><tbody><row><entry
627 align="char">
628<para>This ioctl call returns status information about the front-end. This call only
629 requires read-only access to the device.</para>
630</entry>
631 </row></tbody></tgroup></informaltable>
632<para>SYNOPSIS
633</para>
634<informaltable><tgroup cols="1"><tbody><row><entry
635 align="char">
636<para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>,
637 fe_status_t &#x22C6;status);</para>
638</entry>
639 </row></tbody></tgroup></informaltable>
640<para>PARAMETERS
641</para>
642
643<informaltable><tgroup cols="2"><tbody><row><entry
644 align="char">
645<para>int fd</para>
646</entry><entry
647 align="char">
648<para>File descriptor returned by a previous call to open().</para>
649</entry>
650 </row><row><entry
651 align="char">
652<para>int request</para>
653</entry><entry
654 align="char">
655<para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para>
656</entry>
657 </row><row><entry
658 align="char">
659<para>struct fe_status_t
660 *status</para>
661</entry><entry
662 align="char">
663<para>Points to the location where the front-end status word is
664 to be stored.</para>
665</entry>
666 </row></tbody></tgroup></informaltable>
667<para>RETURN VALUE</para>
668<informaltable><tgroup cols="2"><tbody><row><entry
669 align="char">
670<para>EBADF</para>
671</entry><entry
672 align="char">
673<para>fd is not a valid open file descriptor.</para>
674</entry>
675 </row><row><entry
676 align="char">
677<para>EFAULT</para>
678</entry><entry
679 align="char">
680<para>status points to invalid address.</para>
681</entry>
682 </row></tbody></tgroup></informaltable>
683</section>
684
685<section id="FE_READ_BER">
686<title>FE_READ_BER</title>
687<para>DESCRIPTION
688</para>
689<informaltable><tgroup cols="1"><tbody><row><entry
690 align="char">
691<para>This ioctl call returns the bit error rate for the signal currently
692 received/demodulated by the front-end. For this command, read-only access to
693 the device is sufficient.</para>
694</entry>
695 </row></tbody></tgroup></informaltable>
696<para>SYNOPSIS
697</para>
698<informaltable><tgroup cols="1"><tbody><row><entry
699 align="char">
700<para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
701 uint32_t &#x22C6;ber);</para>
702</entry>
703 </row></tbody></tgroup></informaltable>
704<para>PARAMETERS
705</para>
706<informaltable><tgroup cols="2"><tbody><row><entry
707 align="char">
708<para>int fd</para>
709</entry><entry
710 align="char">
711<para>File descriptor returned by a previous call to open().</para>
712</entry>
713 </row><row><entry
714 align="char">
715<para>int request</para>
716</entry><entry
717 align="char">
718<para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
719</entry>
720 </row><row><entry
721 align="char">
722<para>uint32_t *ber</para>
723</entry><entry
724 align="char">
725<para>The bit error rate is stored into *ber.</para>
726</entry>
727 </row></tbody></tgroup></informaltable>
728
729&return-value-dvb;
730</section>
731
732<section id="FE_READ_SNR">
733<title>FE_READ_SNR</title>
734
735<para>DESCRIPTION
736</para>
737<informaltable><tgroup cols="1"><tbody><row><entry
738 align="char">
739<para>This ioctl call returns the signal-to-noise ratio for the signal currently received
740 by the front-end. For this command, read-only access to the device is sufficient.</para>
741</entry>
742 </row></tbody></tgroup></informaltable>
743<para>SYNOPSIS
744</para>
745<informaltable><tgroup cols="1"><tbody><row><entry
746 align="char">
747<para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t
748 &#x22C6;snr);</para>
749</entry>
750 </row></tbody></tgroup></informaltable>
751<para>PARAMETERS
752</para>
753<informaltable><tgroup cols="2"><tbody><row><entry
754 align="char">
755<para>int fd</para>
756</entry><entry
757 align="char">
758<para>File descriptor returned by a previous call to open().</para>
759</entry>
760 </row><row><entry
761 align="char">
762<para>int request</para>
763</entry><entry
764 align="char">
765<para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
766</entry>
767 </row><row><entry
768 align="char">
769<para>int16_t *snr</para>
770</entry><entry
771 align="char">
772<para>The signal-to-noise ratio is stored into *snr.</para>
773</entry>
774 </row></tbody></tgroup></informaltable>
775
776&return-value-dvb;
777</section>
778
779<section id="FE_READ_SIGNAL_STRENGTH">
780<title>FE_READ_SIGNAL_STRENGTH</title>
781<para>DESCRIPTION
782</para>
783<informaltable><tgroup cols="1"><tbody><row><entry
784 align="char">
785<para>This ioctl call returns the signal strength value for the signal currently received
786 by the front-end. For this command, read-only access to the device is sufficient.</para>
787</entry>
788 </row></tbody></tgroup></informaltable>
789<para>SYNOPSIS
790</para>
791<informaltable><tgroup cols="1"><tbody><row><entry
792 align="char">
793<para>int ioctl( int fd, int request =
794 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t &#x22C6;strength);</para>
795</entry>
796 </row></tbody></tgroup></informaltable>
797
798<para>PARAMETERS
799</para>
800<informaltable><tgroup cols="2"><tbody><row><entry
801 align="char">
802<para>int fd</para>
803</entry><entry
804 align="char">
805<para>File descriptor returned by a previous call to open().</para>
806</entry>
807 </row><row><entry
808 align="char">
809<para>int request</para>
810</entry><entry
811 align="char">
812<para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
813 command.</para>
814</entry>
815 </row><row><entry
816 align="char">
817<para>int16_t *strength</para>
818</entry><entry
819 align="char">
820<para>The signal strength value is stored into *strength.</para>
821</entry>
822 </row></tbody></tgroup></informaltable>
823
824&return-value-dvb;
825</section>
826
827<section id="FE_READ_UNCORRECTED_BLOCKS">
828<title>FE_READ_UNCORRECTED_BLOCKS</title>
829<para>DESCRIPTION
830</para>
831<informaltable><tgroup cols="1"><tbody><row><entry
832 align="char">
833<para>This ioctl call returns the number of uncorrected blocks detected by the device
834 driver during its lifetime. For meaningful measurements, the increment in block
835 count during a specific time interval should be calculated. For this command,
836 read-only access to the device is sufficient.</para>
837</entry>
838 </row><row><entry
839 align="char">
840<para>Note that the counter will wrap to zero after its maximum count has been
841 reached.</para>
842</entry>
843 </row></tbody></tgroup></informaltable>
844<para>SYNOPSIS
845</para>
846<informaltable><tgroup cols="1"><tbody><row><entry
847 align="char">
848<para>int ioctl( int fd, int request =
849 <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t &#x22C6;ublocks);</para>
850</entry>
851 </row></tbody></tgroup></informaltable>
852<para>PARAMETERS
853</para>
854<informaltable><tgroup cols="2"><tbody><row><entry
855 align="char">
856<para>int fd</para>
857</entry><entry
858 align="char">
859<para>File descriptor returned by a previous call to open().</para>
860</entry>
861 </row><row><entry
862 align="char">
863<para>int request</para>
864</entry><entry
865 align="char">
866<para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
867 command.</para>
868</entry>
869 </row><row><entry
870 align="char">
871<para>uint32_t *ublocks</para>
872</entry><entry
873 align="char">
874<para>The total number of uncorrected blocks seen by the driver
875 so far.</para>
876</entry>
877 </row></tbody></tgroup></informaltable>
878
879&return-value-dvb;
880</section>
881
882<section id="FE_SET_FRONTEND">
883<title>FE_SET_FRONTEND</title>
884<para>DESCRIPTION
885</para>
886<informaltable><tgroup cols="1"><tbody><row><entry
887 align="char">
888<para>This ioctl call starts a tuning operation using specified parameters. The result
889 of this call will be successful if the parameters were valid and the tuning could
890 be initiated. The result of the tuning operation in itself, however, will arrive
891 asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
892 FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
893 the previous one was completed, the previous operation will be aborted in favor
894 of the new one. This command requires read/write access to the device.</para>
895</entry>
896 </row></tbody></tgroup></informaltable>
897
898<para>SYNOPSIS
899</para>
900<informaltable><tgroup cols="1"><tbody><row><entry
901 align="char">
902<para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
903 struct dvb_frontend_parameters &#x22C6;p);</para>
904</entry>
905 </row></tbody></tgroup></informaltable>
906<para>PARAMETERS
907</para>
908<informaltable><tgroup cols="2"><tbody><row><entry
909 align="char">
910<para>int fd</para>
911</entry><entry
912 align="char">
913<para>File descriptor returned by a previous call to open().</para>
914</entry>
915 </row><row><entry
916 align="char">
917<para>int request</para>
918</entry><entry
919 align="char">
920<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
921</entry>
922 </row><row><entry
923 align="char">
924<para>struct
925 dvb_frontend_parameters
926 *p</para>
927</entry><entry
928 align="char">
929<para>Points to parameters for tuning operation.</para>
930</entry>
931 </row></tbody></tgroup></informaltable>
932
933&return-value-dvb;
934<informaltable><tgroup cols="2"><tbody><row><entry
935 align="char">
936<para>EINVAL</para>
937</entry><entry
938 align="char">
939<para>Maximum supported symbol rate reached.</para>
940</entry>
941</row></tbody></tgroup></informaltable>
942</section>
943
944<section id="FE_GET_FRONTEND">
945<title>FE_GET_FRONTEND</title>
946<para>DESCRIPTION
947</para>
948<informaltable><tgroup cols="1"><tbody><row><entry
949 align="char">
950<para>This ioctl call queries the currently effective frontend parameters. For this
951 command, read-only access to the device is sufficient.</para>
952</entry>
953 </row></tbody></tgroup></informaltable>
954
955<para>SYNOPSIS
956</para>
957<informaltable><tgroup cols="1"><tbody><row><entry
958 align="char">
959<para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
960 struct dvb_frontend_parameters &#x22C6;p);</para>
961</entry>
962 </row></tbody></tgroup></informaltable>
963
964<para>PARAMETERS
965</para>
966<informaltable><tgroup cols="2"><tbody><row><entry
967 align="char">
968<para>int fd</para>
969</entry><entry
970 align="char">
971<para>File descriptor returned by a previous call to open().</para>
972</entry>
973 </row><row><entry
974 align="char">
975<para>int request</para>
976</entry><entry
977 align="char">
978<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
979</entry>
980 </row><row><entry
981 align="char">
982<para>struct
983 dvb_frontend_parameters
984 *p</para>
985</entry><entry
986 align="char">
987<para>Points to parameters for tuning operation.</para>
988</entry>
989 </row></tbody></tgroup></informaltable>
990
991&return-value-dvb;
992<informaltable><tgroup cols="2"><tbody><row><entry
993 align="char">
994<para>EINVAL</para>
995</entry><entry
996 align="char">
997<para>Maximum supported symbol rate reached.</para>
998</entry>
999 </row></tbody></tgroup></informaltable>
1000
1001</section>
1002
1003<section id="FE_GET_EVENT">
1004<title>FE_GET_EVENT</title>
1005<para>DESCRIPTION
1006</para>
1007<informaltable><tgroup cols="1"><tbody><row><entry
1008 align="char">
1009<para>This ioctl call returns a frontend event if available. If an event is not
1010 available, the behavior depends on whether the device is in blocking or
1011 non-blocking mode. In the latter case, the call fails immediately with errno
1012 set to EWOULDBLOCK. In the former case, the call blocks until an event
1013 becomes available.</para>
1014</entry>
1015 </row><row><entry
1016 align="char">
1017<para>The standard Linux poll() and/or select() system calls can be used with the
1018 device file descriptor to watch for new events. For select(), the file descriptor
1019 should be included in the exceptfds argument, and for poll(), POLLPRI should
1020 be specified as the wake-up condition. Since the event queue allocated is
1021 rather small (room for 8 events), the queue must be serviced regularly to avoid
1022 overflow. If an overflow happens, the oldest event is discarded from the queue,
1023 and an error (EOVERFLOW) occurs the next time the queue is read. After
1024 reporting the error condition in this fashion, subsequent
1025 <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
1026 calls will return events from the queue as usual.</para>
1027</entry>
1028 </row><row><entry
1029 align="char">
1030<para>For the sake of implementation simplicity, this command requires read/write
1031 access to the device.</para>
1032</entry>
1033 </row></tbody></tgroup></informaltable>
1034
1035<para>SYNOPSIS
1036</para>
1037<informaltable><tgroup cols="1"><tbody><row><entry
1038 align="char">
1039<para>int ioctl(int fd, int request = QPSK_GET_EVENT,
1040 struct dvb_frontend_event &#x22C6;ev);</para>
1041</entry>
1042 </row></tbody></tgroup></informaltable>
1043
1044<para>PARAMETERS
1045</para>
1046<informaltable><tgroup cols="2"><tbody><row><entry
1047 align="char">
1048<para>int fd</para>
1049</entry><entry
1050 align="char">
1051<para>File descriptor returned by a previous call to open().</para>
1052</entry>
1053 </row><row><entry
1054 align="char">
1055<para>int request</para>
1056</entry><entry
1057 align="char">
1058<para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
1059</entry>
1060 </row><row><entry
1061 align="char">
1062<para>struct
1063 dvb_frontend_event
1064 *ev</para>
1065</entry><entry
1066 align="char">
1067<para>Points to the location where the event,</para>
1068</entry>
1069 </row><row><entry
1070 align="char">
1071</entry><entry
1072 align="char">
1073<para>if any, is to be stored.</para>
1074</entry>
1075 </row></tbody></tgroup></informaltable>
1076
1077&return-value-dvb;
1078<informaltable><tgroup cols="2"><tbody><row><entry
1079 align="char">
1080<para>EWOULDBLOCK</para>
1081</entry><entry
1082 align="char">
1083<para>There is no event pending, and the device is in
1084 non-blocking mode.</para>
1085</entry>
1086 </row><row><entry
1087 align="char">
1088<para>EOVERFLOW</para>
1089</entry><entry
1090 align="char">
1091<para>Overflow in event queue - one or more events were lost.</para>
1092</entry>
1093</row></tbody></tgroup></informaltable>
1094</section>
1095
1096<section id="FE_GET_INFO">
1097<title>FE_GET_INFO</title>
1098<para>DESCRIPTION
1099</para>
1100<informaltable><tgroup cols="1"><tbody><row><entry
1101 align="char">
1102<para>This ioctl call returns information about the front-end. This call only requires
1103 read-only access to the device.</para>
1104</entry>
1105 </row></tbody></tgroup></informaltable>
1106<para>SYNOPSIS
1107</para>
1108
1109<informaltable><tgroup cols="1"><tbody><row><entry
1110 align="char">
1111<para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct
1112 dvb_frontend_info &#x22C6;info);</para>
1113</entry>
1114 </row></tbody></tgroup></informaltable>
1115<para>PARAMETERS
1116</para>
1117
1118<informaltable><tgroup cols="2"><tbody><row><entry
1119 align="char">
1120<para>int fd</para>
1121</entry><entry
1122 align="char">
1123<para>File descriptor returned by a previous call to open().</para>
1124</entry>
1125 </row><row><entry
1126 align="char">
1127<para>int request</para>
1128</entry><entry
1129 align="char">
1130<para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para>
1131</entry>
1132 </row><row><entry
1133 align="char">
1134<para>struct
1135 dvb_frontend_info
1136 *info</para>
1137</entry><entry
1138 align="char">
1139<para>Points to the location where the front-end information is
1140 to be stored.</para>
1141</entry>
1142 </row></tbody></tgroup></informaltable>
1143&return-value-dvb;
1144</section>
1145
1146<section id="FE_DISEQC_RESET_OVERLOAD">
1147<title>FE_DISEQC_RESET_OVERLOAD</title>
1148<para>DESCRIPTION
1149</para>
1150<informaltable><tgroup cols="1"><tbody><row><entry
1151 align="char">
1152<para>If the bus has been automatically powered off due to power overload, this ioctl
1153 call restores the power to the bus. The call requires read/write access to the
1154 device. This call has no effect if the device is manually powered off. Not all
1155 DVB adapters support this ioctl.</para>
1156</entry>
1157 </row></tbody></tgroup></informaltable>
1158
1159<para>SYNOPSIS
1160</para>
1161<informaltable><tgroup cols="1"><tbody><row><entry
1162 align="char">
1163<para>int ioctl(int fd, int request =
1164 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
1165</entry>
1166 </row></tbody></tgroup></informaltable>
1167<para>PARAMETERS
1168</para>
1169<informaltable><tgroup cols="2"><tbody><row><entry
1170 align="char">
1171<para>int fd</para>
1172</entry><entry
1173 align="char">
1174<para>File descriptor returned by a previous call to open().</para>
1175</entry>
1176 </row><row><entry
1177 align="char">
1178<para>int request</para>
1179</entry><entry
1180 align="char">
1181<para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
1182 command.</para>
1183</entry>
1184 </row></tbody></tgroup></informaltable>
1185
1186&return-value-dvb;
1187</section>
1188
1189<section id="FE_DISEQC_SEND_MASTER_CMD">
1190<title>FE_DISEQC_SEND_MASTER_CMD</title>
1191<para>DESCRIPTION
1192</para>
1193<informaltable><tgroup cols="1"><tbody><row><entry
1194 align="char">
1195<para>This ioctl call is used to send a a DiSEqC command.</para>
1196</entry>
1197 </row></tbody></tgroup></informaltable>
1198<para>SYNOPSIS
1199</para>
1200<informaltable><tgroup cols="1"><tbody><row><entry
1201 align="char">
1202<para>int ioctl(int fd, int request =
1203 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
1204 dvb_diseqc_master_cmd &#x22C6;cmd);</para>
1205</entry>
1206 </row></tbody></tgroup></informaltable>
1207
1208<para>PARAMETERS
1209</para>
1210<informaltable><tgroup cols="2"><tbody><row><entry
1211 align="char">
1212<para>int fd</para>
1213</entry><entry
1214 align="char">
1215<para>File descriptor returned by a previous call to open().</para>
1216</entry>
1217 </row><row><entry
1218 align="char">
1219<para>int request</para>
1220</entry><entry
1221 align="char">
1222<para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
1223 command.</para>
1224</entry>
1225 </row><row><entry
1226 align="char">
1227<para>struct
1228 dvb_diseqc_master_cmd
1229 *cmd</para>
1230</entry><entry
1231 align="char">
1232<para>Pointer to the command to be transmitted.</para>
1233</entry>
1234 </row></tbody></tgroup></informaltable>
1235
1236&return-value-dvb;
1237</section>
1238
1239<section id="FE_DISEQC_RECV_SLAVE_REPLY">
1240<title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1241<para>DESCRIPTION
1242</para>
1243<informaltable><tgroup cols="1"><tbody><row><entry
1244 align="char">
1245<para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
1246</entry>
1247 </row></tbody></tgroup></informaltable>
1248
1249<para>SYNOPSIS
1250</para>
1251<informaltable><tgroup cols="1"><tbody><row><entry
1252 align="char">
1253<para>int ioctl(int fd, int request =
1254 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
1255 dvb_diseqc_slave_reply &#x22C6;reply);</para>
1256</entry>
1257 </row></tbody></tgroup></informaltable>
1258
1259<para>PARAMETERS
1260</para>
1261<informaltable><tgroup cols="2"><tbody><row><entry
1262 align="char">
1263<para>int fd</para>
1264</entry><entry
1265 align="char">
1266<para>File descriptor returned by a previous call to open().</para>
1267</entry>
1268 </row><row><entry
1269 align="char">
1270<para>int request</para>
1271</entry><entry
1272 align="char">
1273<para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
1274 command.</para>
1275</entry>
1276 </row><row><entry
1277 align="char">
1278<para>struct
1279 dvb_diseqc_slave_reply
1280 *reply</para>
1281</entry><entry
1282 align="char">
1283<para>Pointer to the command to be received.</para>
1284</entry>
1285 </row></tbody></tgroup></informaltable>
1286&return-value-dvb;
1287</section>
1288
1289<section id="FE_DISEQC_SEND_BURST">
1290<title>FE_DISEQC_SEND_BURST</title>
1291<para>DESCRIPTION
1292</para>
1293<informaltable><tgroup cols="1"><tbody><row><entry
1294 align="char">
1295<para>This ioctl call is used to send a 22KHz tone burst.</para>
1296</entry>
1297 </row></tbody></tgroup></informaltable>
1298
1299<para>SYNOPSIS
1300</para>
1301<informaltable><tgroup cols="1"><tbody><row><entry
1302 align="char">
1303<para>int ioctl(int fd, int request =
1304 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
1305</entry>
1306 </row></tbody></tgroup></informaltable>
1307
1308<para>PARAMETERS
1309</para>
1310<informaltable><tgroup cols="2"><tbody><row><entry
1311 align="char">
1312<para>int fd</para>
1313</entry><entry
1314 align="char">
1315<para>File descriptor returned by a previous call to open().</para>
1316</entry>
1317 </row><row><entry
1318 align="char">
1319<para>int request</para>
1320</entry><entry
1321 align="char">
1322<para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
1323</entry>
1324 </row><row><entry
1325 align="char">
1326<para>fe_sec_mini_cmd_t
1327 burst</para>
1328</entry><entry
1329 align="char">
1330<para>burst A or B.</para>
1331</entry>
1332 </row></tbody></tgroup></informaltable>
1333
1334&return-value-dvb;
1335</section>
1336
1337<section id="FE_SET_TONE">
1338<title>FE_SET_TONE</title>
1339<para>DESCRIPTION
1340</para>
1341<informaltable><tgroup cols="1"><tbody><row><entry
1342 align="char">
1343<para>This call is used to set the generation of the continuous 22kHz tone. This call
1344 requires read/write permissions.</para>
1345</entry>
1346 </row></tbody></tgroup></informaltable>
1347<para>SYNOPSIS
1348</para>
1349<informaltable><tgroup cols="1"><tbody><row><entry
1350 align="char">
1351<para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
1352 fe_sec_tone_mode_t tone);</para>
1353</entry>
1354 </row></tbody></tgroup></informaltable>
1355<para>PARAMETERS
1356</para>
1357<informaltable><tgroup cols="2"><tbody><row><entry
1358 align="char">
1359<para>int fd</para>
1360</entry><entry
1361 align="char">
1362<para>File descriptor returned by a previous call to open().</para>
1363</entry>
1364 </row><row><entry
1365 align="char">
1366<para>int request</para>
1367</entry><entry
1368 align="char">
1369<para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
1370</entry>
1371 </row><row><entry
1372 align="char">
1373<para>fe_sec_tone_mode_t
1374 tone</para>
1375</entry><entry
1376 align="char">
1377<para>The requested tone generation mode (on/off).</para>
1378</entry>
1379 </row></tbody></tgroup></informaltable>
1380&return-value-dvb;
1381</section>
1382
1383<section id="FE_SET_VOLTAGE">
1384<title>FE_SET_VOLTAGE</title>
1385<para>DESCRIPTION
1386</para>
1387<informaltable><tgroup cols="1"><tbody><row><entry
1388 align="char">
1389<para>This call is used to set the bus voltage. This call requires read/write
1390 permissions.</para>
1391</entry>
1392 </row></tbody></tgroup></informaltable>
1393<para>SYNOPSIS
1394</para>
1395<informaltable><tgroup cols="1"><tbody><row><entry
1396 align="char">
1397<para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
1398 fe_sec_voltage_t voltage);</para>
1399</entry>
1400 </row></tbody></tgroup></informaltable>
1401
1402<para>PARAMETERS
1403</para>
1404<informaltable><tgroup cols="2"><tbody><row><entry
1405 align="char">
1406<para>int fd</para>
1407</entry><entry
1408 align="char">
1409<para>File descriptor returned by a previous call to open().</para>
1410</entry>
1411 </row><row><entry
1412 align="char">
1413<para>int request</para>
1414</entry><entry
1415 align="char">
1416<para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1417</entry>
1418 </row><row><entry
1419 align="char">
1420<para>fe_sec_voltage_t
1421 voltage</para>
1422</entry><entry
1423 align="char">
1424<para>The requested bus voltage.</para>
1425</entry>
1426 </row></tbody></tgroup></informaltable>
1427
1428&return-value-dvb;
1429</section>
1430
1431<section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
1432<title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1433<para>DESCRIPTION
1434</para>
1435<informaltable><tgroup cols="1"><tbody><row><entry
1436 align="char">
1437<para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
1438 for long cables). This call requires read/write permissions. Not all DVB
1439 adapters support this ioctl.</para>
1440</entry>
1441 </row></tbody></tgroup></informaltable>
1442
1443<para>SYNOPSIS
1444</para>
1445<informaltable><tgroup cols="1"><tbody><row><entry
1446 align="char">
1447<para>int ioctl(int fd, int request =
1448 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
1449</entry>
1450 </row></tbody></tgroup></informaltable>
1451
1452<para>PARAMETERS
1453</para>
1454<informaltable><tgroup cols="2"><tbody><row><entry
1455 align="char">
1456<para>int fd</para>
1457</entry><entry
1458 align="char">
1459<para>File descriptor returned by a previous call to open().</para>
1460</entry>
1461 </row><row><entry
1462 align="char">
1463<para>int request</para>
1464</entry><entry
1465 align="char">
1466<para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1467</entry>
1468 </row><row><entry
1469 align="char">
1470<para>int high</para>
1471</entry><entry
1472 align="char">
1473<para>The requested bus voltage.</para>
1474</entry>
1475 </row></tbody></tgroup></informaltable>
1476
1477&return-value-dvb;
1478</section>
1479
1480<section id="FE_SET_FRONTEND_TUNE_MODE">
1481<title>FE_SET_FRONTEND_TUNE_MODE</title>
1482<para>DESCRIPTION</para>
1483<informaltable><tgroup cols="1"><tbody><row>
1484<entry align="char">
1485<para>Allow setting tuner mode flags to the frontend.</para>
1486</entry>
1487</row></tbody></tgroup></informaltable>
1488
1489<para>SYNOPSIS</para>
1490<informaltable><tgroup cols="1"><tbody><row>
1491<entry align="char">
1492<para>int ioctl(int fd, int request =
1493<link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
1494</entry>
1495</row></tbody></tgroup></informaltable>
1496
1497<para>PARAMETERS</para>
1498<informaltable><tgroup cols="2"><tbody><row>
1499<entry align="char">
1500 <para>unsigned int flags</para>
1501</entry>
1502<entry align="char">
1503<para>
1504FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write.
1505</para>
1506</entry>
1507 </row></tbody></tgroup></informaltable>
1508
1509&return-value-dvb;
1510</section>
1511
1512<section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
1513 <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
1514<para>DESCRIPTION</para>
1515<informaltable><tgroup cols="1"><tbody><row>
1516<entry align="char">
1517<para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
1518<para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
1519<para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
1520</entry>
1521</row></tbody></tgroup></informaltable>
1522
1523<para>SYNOPSIS</para>
1524<informaltable><tgroup cols="1"><tbody><row>
1525<entry align="char">
1526<para>int ioctl(int fd, int request =
1527 <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
1528</entry>
1529</row></tbody></tgroup></informaltable>
1530
1531<para>PARAMETERS</para>
1532<informaltable><tgroup cols="2"><tbody><row>
1533<entry align="char">
1534 <para>unsigned long cmd</para>
1535</entry>
1536<entry align="char">
1537<para>
1538sends the specified raw cmd to the dish via DISEqC.
1539</para>
1540</entry>
1541 </row></tbody></tgroup></informaltable>
1542
1543&return-value-dvb;
1544</section>
1545
1546</section>
1547
1548&sub-dvbproperty;
diff --git a/Documentation/DocBook/media/dvb/intro.xml b/Documentation/DocBook/media/dvb/intro.xml
new file mode 100644
index 00000000000..2048b53d19b
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/intro.xml
@@ -0,0 +1,212 @@
1<title>Introduction</title>
2
3<section id="requisites">
4<title>What you need to know</title>
5
6<para>The reader of this document is required to have some knowledge in
7the area of digital video broadcasting (DVB) and should be familiar with
8part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e
9you should know what a program/transport stream (PS/TS) is and what is
10meant by a packetized elementary stream (PES) or an I-frame.</para>
11
12<para>Various DVB standards documents are available from
13<ulink url="http://www.dvb.org" /> and/or
14<ulink url="http://www.etsi.org" />.</para>
15
16<para>It is also necessary to know how to access unix/linux devices and
17how to use ioctl calls. This also includes the knowledge of C or C++.
18</para>
19</section>
20
21<section id="history">
22<title>History</title>
23
24<para>The first API for DVB cards we used at Convergence in late 1999
25was an extension of the Video4Linux API which was primarily developed
26for frame grabber cards. As such it was not really well suited to be
27used for DVB cards and their new features like recording MPEG streams
28and filtering several section and PES data streams at the same time.
29</para>
30
31<para>In early 2000, we were approached by Nokia with a proposal for a
32new standard Linux DVB API. As a commitment to the development of
33terminals based on open standards, Nokia and Convergence made it
34available to all Linux developers and published it on
35<ulink url="http://www.linuxtv.org/" /> in September 2000.
36Convergence is the maintainer of the Linux DVB API. Together with the
37LinuxTV community (i.e. you, the reader of this document), the Linux DVB
38API will be constantly reviewed and improved. With the Linux driver for
39the Siemens/Hauppauge DVB PCI card Convergence provides a first
40implementation of the Linux DVB API.</para>
41</section>
42
43<section id="overview">
44<title>Overview</title>
45
46<figure id="stb_components">
47<title>Components of a DVB card/STB</title>
48<mediaobject>
49<imageobject>
50<imagedata fileref="dvbstb.pdf" format="PS" />
51</imageobject>
52<imageobject>
53<imagedata fileref="dvbstb.png" format="PNG" />
54</imageobject>
55</mediaobject>
56</figure>
57
58<para>A DVB PCI card or DVB set-top-box (STB) usually consists of the
59following main hardware components: </para>
60
61<itemizedlist>
62 <listitem>
63
64<para>Frontend consisting of tuner and DVB demodulator</para>
65
66<para>Here the raw signal reaches the DVB hardware from a satellite dish
67or antenna or directly from cable. The frontend down-converts and
68demodulates this signal into an MPEG transport stream (TS). In case of a
69satellite frontend, this includes a facility for satellite equipment
70control (SEC), which allows control of LNB polarization, multi feed
71switches or dish rotors.</para>
72
73</listitem>
74 <listitem>
75
76<para>Conditional Access (CA) hardware like CI adapters and smartcard slots
77</para>
78
79<para>The complete TS is passed through the CA hardware. Programs to
80which the user has access (controlled by the smart card) are decoded in
81real time and re-inserted into the TS.</para>
82
83</listitem>
84 <listitem>
85 <para>Demultiplexer which filters the incoming DVB stream</para>
86
87<para>The demultiplexer splits the TS into its components like audio and
88video streams. Besides usually several of such audio and video streams
89it also contains data streams with information about the programs
90offered in this or other streams of the same provider.</para>
91
92</listitem>
93<listitem>
94
95<para>MPEG2 audio and video decoder</para>
96
97<para>The main targets of the demultiplexer are the MPEG2 audio and
98video decoders. After decoding they pass on the uncompressed audio and
99video to the computer screen or (through a PAL/NTSC encoder) to a TV
100set.</para>
101
102
103</listitem>
104</itemizedlist>
105
106<para><xref linkend="stb_components" /> shows a crude schematic of the control and data flow
107between those components.</para>
108
109<para>On a DVB PCI card not all of these have to be present since some
110functionality can be provided by the main CPU of the PC (e.g. MPEG
111picture and sound decoding) or is not needed (e.g. for data-only uses
112like &#8220;internet over satellite&#8221;). Also not every card or STB
113provides conditional access hardware.</para>
114
115</section>
116
117<section id="dvb_devices">
118<title>Linux DVB Devices</title>
119
120<para>The Linux DVB API lets you control these hardware components
121through currently six Unix-style character devices for video, audio,
122frontend, demux, CA and IP-over-DVB networking. The video and audio
123devices control the MPEG2 decoder hardware, the frontend device the
124tuner and the DVB demodulator. The demux device gives you control over
125the PES and section filters of the hardware. If the hardware does not
126support filtering these filters can be implemented in software. Finally,
127the CA device controls all the conditional access capabilities of the
128hardware. It can depend on the individual security requirements of the
129platform, if and how many of the CA functions are made available to the
130application through this device.</para>
131
132<para>All devices can be found in the <emphasis role="tt">/dev</emphasis>
133tree under <emphasis role="tt">/dev/dvb</emphasis>. The individual devices
134are called:</para>
135
136<itemizedlist>
137<listitem>
138
139<para><emphasis role="tt">/dev/dvb/adapterN/audioM</emphasis>,</para>
140</listitem>
141<listitem>
142<para><emphasis role="tt">/dev/dvb/adapterN/videoM</emphasis>,</para>
143</listitem>
144<listitem>
145<para><emphasis role="tt">/dev/dvb/adapterN/frontendM</emphasis>,</para>
146</listitem>
147 <listitem>
148
149<para><emphasis role="tt">/dev/dvb/adapterN/netM</emphasis>,</para>
150</listitem>
151 <listitem>
152
153<para><emphasis role="tt">/dev/dvb/adapterN/demuxM</emphasis>,</para>
154</listitem>
155 <listitem>
156
157<para><emphasis role="tt">/dev/dvb/adapterN/dvrM</emphasis>,</para>
158</listitem>
159 <listitem>
160
161<para><emphasis role="tt">/dev/dvb/adapterN/caM</emphasis>,</para></listitem></itemizedlist>
162
163<para>where N enumerates the DVB PCI cards in a system starting
164from&#x00A0;0, and M enumerates the devices of each type within each
165adapter, starting from&#x00A0;0, too. We will omit the &#8220;<emphasis
166role="tt">/dev/dvb/adapterN/</emphasis>&#8221; in the further dicussion
167of these devices. The naming scheme for the devices is the same wheter
168devfs is used or not.</para>
169
170<para>More details about the data structures and function calls of all
171the devices are described in the following chapters.</para>
172
173</section>
174
175<section id="include_files">
176<title>API include files</title>
177
178<para>For each of the DVB devices a corresponding include file exists.
179The DVB API include files should be included in application sources with
180a partial path like:</para>
181
182<programlisting>
183 #include &#x003C;linux/dvb/audio.h&#x003E;
184</programlisting>
185<programlisting>
186 #include &#x003C;linux/dvb/ca.h&#x003E;
187</programlisting>
188<programlisting>
189 #include &#x003C;linux/dvb/dmx.h&#x003E;
190</programlisting>
191<programlisting>
192 #include &#x003C;linux/dvb/frontend.h&#x003E;
193</programlisting>
194<programlisting>
195 #include &#x003C;linux/dvb/net.h&#x003E;
196</programlisting>
197<programlisting>
198 #include &#x003C;linux/dvb/osd.h&#x003E;
199</programlisting>
200<programlisting>
201 #include &#x003C;linux/dvb/video.h&#x003E;
202</programlisting>
203
204<para>To enable applications to support different API version, an
205additional include file <emphasis
206role="tt">linux/dvb/version.h</emphasis> exists, which defines the
207constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
208describes <emphasis role="tt">DVB_API_VERSION 5.8</emphasis>.
209</para>
210
211</section>
212
diff --git a/Documentation/DocBook/media/dvb/kdapi.xml b/Documentation/DocBook/media/dvb/kdapi.xml
new file mode 100644
index 00000000000..6c11ec52cbe
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/kdapi.xml
@@ -0,0 +1,2309 @@
1<title>Kernel Demux API</title>
2<para>The kernel demux API defines a driver-internal interface for registering low-level,
3hardware specific driver to a hardware independent demux layer. It is only of interest for
4DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in
5<emphasis role="tt">drivers/media/dvb-core</emphasis>.
6</para>
7<para>Maintainer note: This section must be reviewed. It is probably out of date.
8</para>
9
10<section id="kernel_demux_data_types">
11<title>Kernel Demux Data Types</title>
12
13
14<section id="dmx_success_t">
15<title>dmx_success_t</title>
16 <programlisting>
17 typedef enum {
18 DMX_OK = 0, /&#x22C6; Received Ok &#x22C6;/
19 DMX_LENGTH_ERROR, /&#x22C6; Incorrect length &#x22C6;/
20 DMX_OVERRUN_ERROR, /&#x22C6; Receiver ring buffer overrun &#x22C6;/
21 DMX_CRC_ERROR, /&#x22C6; Incorrect CRC &#x22C6;/
22 DMX_FRAME_ERROR, /&#x22C6; Frame alignment error &#x22C6;/
23 DMX_FIFO_ERROR, /&#x22C6; Receiver FIFO overrun &#x22C6;/
24 DMX_MISSED_ERROR /&#x22C6; Receiver missed packet &#x22C6;/
25 } dmx_success_t;
26</programlisting>
27
28</section>
29<section id="ts_filter_types">
30<title>TS filter types</title>
31 <programlisting>
32 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
33 /&#x22C6; TS packet reception &#x22C6;/
34 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
35
36 /&#x22C6; TS filter type for set_type() &#x22C6;/
37
38 #define TS_PACKET 1 /&#x22C6; send TS packets (188 bytes) to callback (default) &#x22C6;/
39 #define TS_PAYLOAD_ONLY 2 /&#x22C6; in case TS_PACKET is set, only send the TS
40 payload (&#x003C;=184 bytes per packet) to callback &#x22C6;/
41 #define TS_DECODER 4 /&#x22C6; send stream to built-in decoder (if present) &#x22C6;/
42</programlisting>
43
44</section>
45<section id="dmx_ts_pes_t">
46<title>dmx_ts_pes_t</title>
47<para>The structure
48</para>
49<programlisting>
50 typedef enum
51 {
52 DMX_TS_PES_AUDIO, /&#x22C6; also send packets to audio decoder (if it exists) &#x22C6;/
53 DMX_TS_PES_VIDEO, /&#x22C6; ... &#x22C6;/
54 DMX_TS_PES_TELETEXT,
55 DMX_TS_PES_SUBTITLE,
56 DMX_TS_PES_PCR,
57 DMX_TS_PES_OTHER,
58 } dmx_ts_pes_t;
59</programlisting>
60<para>describes the PES type for filters which write to a built-in decoder. The correspond (and
61should be kept identical) to the types in the demux device.
62</para>
63<programlisting>
64 struct dmx_ts_feed_s {
65 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
66 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
67 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
68 int (&#x22C6;set) (struct dmx_ts_feed_s&#x22C6; feed,
69 __u16 pid,
70 size_t callback_length,
71 size_t circular_buffer_size,
72 int descramble,
73 struct timespec timeout);
74 int (&#x22C6;start_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
75 int (&#x22C6;stop_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
76 int (&#x22C6;set_type) (struct dmx_ts_feed_s&#x22C6; feed,
77 int type,
78 dmx_ts_pes_t pes_type);
79 };
80
81 typedef struct dmx_ts_feed_s dmx_ts_feed_t;
82</programlisting>
83 <programlisting>
84 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
85 /&#x22C6; PES packet reception (not supported yet) &#x22C6;/
86 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
87
88 typedef struct dmx_pes_filter_s {
89 struct dmx_pes_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
90 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
91 } dmx_pes_filter_t;
92</programlisting>
93 <programlisting>
94 typedef struct dmx_pes_feed_s {
95 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
96 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
97 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
98 int (&#x22C6;set) (struct dmx_pes_feed_s&#x22C6; feed,
99 __u16 pid,
100 size_t circular_buffer_size,
101 int descramble,
102 struct timespec timeout);
103 int (&#x22C6;start_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
104 int (&#x22C6;stop_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
105 int (&#x22C6;allocate_filter) (struct dmx_pes_feed_s&#x22C6; feed,
106 dmx_pes_filter_t&#x22C6;&#x22C6; filter);
107 int (&#x22C6;release_filter) (struct dmx_pes_feed_s&#x22C6; feed,
108 dmx_pes_filter_t&#x22C6; filter);
109 } dmx_pes_feed_t;
110</programlisting>
111 <programlisting>
112 typedef struct {
113 __u8 filter_value [DMX_MAX_FILTER_SIZE];
114 __u8 filter_mask [DMX_MAX_FILTER_SIZE];
115 struct dmx_section_feed_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
116 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
117 } dmx_section_filter_t;
118</programlisting>
119 <programlisting>
120 struct dmx_section_feed_s {
121 int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
122 struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
123 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
124 int (&#x22C6;set) (struct dmx_section_feed_s&#x22C6; feed,
125 __u16 pid,
126 size_t circular_buffer_size,
127 int descramble,
128 int check_crc);
129 int (&#x22C6;allocate_filter) (struct dmx_section_feed_s&#x22C6; feed,
130 dmx_section_filter_t&#x22C6;&#x22C6; filter);
131 int (&#x22C6;release_filter) (struct dmx_section_feed_s&#x22C6; feed,
132 dmx_section_filter_t&#x22C6; filter);
133 int (&#x22C6;start_filtering) (struct dmx_section_feed_s&#x22C6; feed);
134 int (&#x22C6;stop_filtering) (struct dmx_section_feed_s&#x22C6; feed);
135 };
136 typedef struct dmx_section_feed_s dmx_section_feed_t;
137
138 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
139 /&#x22C6; Callback functions &#x22C6;/
140 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
141
142 typedef int (&#x22C6;dmx_ts_cb) ( __u8 &#x22C6; buffer1,
143 size_t buffer1_length,
144 __u8 &#x22C6; buffer2,
145 size_t buffer2_length,
146 dmx_ts_feed_t&#x22C6; source,
147 dmx_success_t success);
148
149 typedef int (&#x22C6;dmx_section_cb) ( __u8 &#x22C6; buffer1,
150 size_t buffer1_len,
151 __u8 &#x22C6; buffer2,
152 size_t buffer2_len,
153 dmx_section_filter_t &#x22C6; source,
154 dmx_success_t success);
155
156 typedef int (&#x22C6;dmx_pes_cb) ( __u8 &#x22C6; buffer1,
157 size_t buffer1_len,
158 __u8 &#x22C6; buffer2,
159 size_t buffer2_len,
160 dmx_pes_filter_t&#x22C6; source,
161 dmx_success_t success);
162
163 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
164 /&#x22C6; DVB Front-End &#x22C6;/
165 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
166
167 typedef enum {
168 DMX_OTHER_FE = 0,
169 DMX_SATELLITE_FE,
170 DMX_CABLE_FE,
171 DMX_TERRESTRIAL_FE,
172 DMX_LVDS_FE,
173 DMX_ASI_FE, /&#x22C6; DVB-ASI interface &#x22C6;/
174 DMX_MEMORY_FE
175 } dmx_frontend_source_t;
176
177 typedef struct {
178 /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
179 char&#x22C6; id; /&#x22C6; Unique front-end identifier &#x22C6;/
180 char&#x22C6; vendor; /&#x22C6; Name of the front-end vendor &#x22C6;/
181 char&#x22C6; model; /&#x22C6; Name of the front-end model &#x22C6;/
182 struct list_head connectivity_list; /&#x22C6; List of front-ends that can
183 be connected to a particular
184 demux &#x22C6;/
185 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
186 dmx_frontend_source_t source;
187 } dmx_frontend_t;
188
189 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
190 /&#x22C6; MPEG-2 TS Demux &#x22C6;/
191 /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
192
193 /&#x22C6;
194 &#x22C6; Flags OR'ed in the capabilites field of struct dmx_demux_s.
195 &#x22C6;/
196
197 #define DMX_TS_FILTERING 1
198 #define DMX_PES_FILTERING 2
199 #define DMX_SECTION_FILTERING 4
200 #define DMX_MEMORY_BASED_FILTERING 8 /&#x22C6; write() available &#x22C6;/
201 #define DMX_CRC_CHECKING 16
202 #define DMX_TS_DESCRAMBLING 32
203 #define DMX_SECTION_PAYLOAD_DESCRAMBLING 64
204 #define DMX_MAC_ADDRESS_DESCRAMBLING 128
205</programlisting>
206
207</section>
208<section id="demux_demux_t">
209<title>demux_demux_t</title>
210 <programlisting>
211 /&#x22C6;
212 &#x22C6; DMX_FE_ENTRY(): Casts elements in the list of registered
213 &#x22C6; front-ends from the generic type struct list_head
214 &#x22C6; to the type &#x22C6; dmx_frontend_t
215 &#x22C6;.
216 &#x22C6;/
217
218 #define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list)
219
220 struct dmx_demux_s {
221 /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
222 char&#x22C6; id; /&#x22C6; Unique demux identifier &#x22C6;/
223 char&#x22C6; vendor; /&#x22C6; Name of the demux vendor &#x22C6;/
224 char&#x22C6; model; /&#x22C6; Name of the demux model &#x22C6;/
225 __u32 capabilities; /&#x22C6; Bitfield of capability flags &#x22C6;/
226 dmx_frontend_t&#x22C6; frontend; /&#x22C6; Front-end connected to the demux &#x22C6;/
227 struct list_head reg_list; /&#x22C6; List of registered demuxes &#x22C6;/
228 void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
229 int users; /&#x22C6; Number of users &#x22C6;/
230 int (&#x22C6;open) (struct dmx_demux_s&#x22C6; demux);
231 int (&#x22C6;close) (struct dmx_demux_s&#x22C6; demux);
232 int (&#x22C6;write) (struct dmx_demux_s&#x22C6; demux, const char&#x22C6; buf, size_t count);
233 int (&#x22C6;allocate_ts_feed) (struct dmx_demux_s&#x22C6; demux,
234 dmx_ts_feed_t&#x22C6;&#x22C6; feed,
235 dmx_ts_cb callback);
236 int (&#x22C6;release_ts_feed) (struct dmx_demux_s&#x22C6; demux,
237 dmx_ts_feed_t&#x22C6; feed);
238 int (&#x22C6;allocate_pes_feed) (struct dmx_demux_s&#x22C6; demux,
239 dmx_pes_feed_t&#x22C6;&#x22C6; feed,
240 dmx_pes_cb callback);
241 int (&#x22C6;release_pes_feed) (struct dmx_demux_s&#x22C6; demux,
242 dmx_pes_feed_t&#x22C6; feed);
243 int (&#x22C6;allocate_section_feed) (struct dmx_demux_s&#x22C6; demux,
244 dmx_section_feed_t&#x22C6;&#x22C6; feed,
245 dmx_section_cb callback);
246 int (&#x22C6;release_section_feed) (struct dmx_demux_s&#x22C6; demux,
247 dmx_section_feed_t&#x22C6; feed);
248 int (&#x22C6;descramble_mac_address) (struct dmx_demux_s&#x22C6; demux,
249 __u8&#x22C6; buffer1,
250 size_t buffer1_length,
251 __u8&#x22C6; buffer2,
252 size_t buffer2_length,
253 __u16 pid);
254 int (&#x22C6;descramble_section_payload) (struct dmx_demux_s&#x22C6; demux,
255 __u8&#x22C6; buffer1,
256 size_t buffer1_length,
257 __u8&#x22C6; buffer2, size_t buffer2_length,
258 __u16 pid);
259 int (&#x22C6;add_frontend) (struct dmx_demux_s&#x22C6; demux,
260 dmx_frontend_t&#x22C6; frontend);
261 int (&#x22C6;remove_frontend) (struct dmx_demux_s&#x22C6; demux,
262 dmx_frontend_t&#x22C6; frontend);
263 struct list_head&#x22C6; (&#x22C6;get_frontends) (struct dmx_demux_s&#x22C6; demux);
264 int (&#x22C6;connect_frontend) (struct dmx_demux_s&#x22C6; demux,
265 dmx_frontend_t&#x22C6; frontend);
266 int (&#x22C6;disconnect_frontend) (struct dmx_demux_s&#x22C6; demux);
267
268
269 /&#x22C6; added because js cannot keep track of these himself &#x22C6;/
270 int (&#x22C6;get_pes_pids) (struct dmx_demux_s&#x22C6; demux, __u16 &#x22C6;pids);
271 };
272 typedef struct dmx_demux_s dmx_demux_t;
273</programlisting>
274
275</section>
276<section id="demux_directory">
277<title>Demux directory</title>
278 <programlisting>
279 /&#x22C6;
280 &#x22C6; DMX_DIR_ENTRY(): Casts elements in the list of registered
281 &#x22C6; demuxes from the generic type struct list_head&#x22C6; to the type dmx_demux_t
282 &#x22C6;.
283 &#x22C6;/
284
285 #define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list)
286
287 int dmx_register_demux (dmx_demux_t&#x22C6; demux);
288 int dmx_unregister_demux (dmx_demux_t&#x22C6; demux);
289 struct list_head&#x22C6; dmx_get_demuxes (void);
290</programlisting>
291 </section></section>
292<section id="demux_directory_api">
293<title>Demux Directory API</title>
294<para>The demux directory is a Linux kernel-wide facility for registering and accessing the
295MPEG-2 TS demuxes in the system. Run-time registering and unregistering of demux drivers
296is possible using this API.
297</para>
298<para>All demux drivers in the directory implement the abstract interface dmx_demux_t.
299</para>
300
301<section
302role="subsection"><title>dmx_register_demux()</title>
303<para>DESCRIPTION
304</para>
305<informaltable><tgroup cols="1"><tbody><row><entry
306 align="char">
307<para>This function makes a demux driver interface available to the Linux kernel. It is
308 usually called by the init_module() function of the kernel module that contains
309 the demux driver. The caller of this function is responsible for allocating
310 dynamic or static memory for the demux structure and for initializing its fields
311 before calling this function. The memory allocated for the demux structure
312 must not be freed before calling dmx_unregister_demux(),</para>
313</entry>
314 </row></tbody></tgroup></informaltable>
315<para>SYNOPSIS
316</para>
317<informaltable><tgroup cols="1"><tbody><row><entry
318 align="char">
319<para>int dmx_register_demux ( dmx_demux_t &#x22C6;demux )</para>
320</entry>
321 </row></tbody></tgroup></informaltable>
322<para>PARAMETERS
323</para>
324<informaltable><tgroup cols="2"><tbody><row><entry
325 align="char">
326<para>dmx_demux_t*
327 demux</para>
328</entry><entry
329 align="char">
330<para>Pointer to the demux structure.</para>
331</entry>
332 </row></tbody></tgroup></informaltable>
333<para>RETURNS
334</para>
335<informaltable><tgroup cols="2"><tbody><row><entry
336 align="char">
337<para>0</para>
338</entry><entry
339 align="char">
340<para>The function was completed without errors.</para>
341</entry>
342 </row><row><entry
343 align="char">
344<para>-EEXIST</para>
345</entry><entry
346 align="char">
347<para>A demux with the same value of the id field already stored
348 in the directory.</para>
349</entry>
350 </row><row><entry
351 align="char">
352<para>-ENOSPC</para>
353</entry><entry
354 align="char">
355<para>No space left in the directory.</para>
356</entry>
357 </row></tbody></tgroup></informaltable>
358
359</section><section
360role="subsection"><title>dmx_unregister_demux()</title>
361<para>DESCRIPTION
362</para>
363<informaltable><tgroup cols="1"><tbody><row><entry
364 align="char">
365<para>This function is called to indicate that the given demux interface is no
366 longer available. The caller of this function is responsible for freeing the
367 memory of the demux structure, if it was dynamically allocated before calling
368 dmx_register_demux(). The cleanup_module() function of the kernel module
369 that contains the demux driver should call this function. Note that this function
370 fails if the demux is currently in use, i.e., release_demux() has not been called
371 for the interface.</para>
372</entry>
373 </row></tbody></tgroup></informaltable>
374<para>SYNOPSIS
375</para>
376<informaltable><tgroup cols="1"><tbody><row><entry
377 align="char">
378<para>int dmx_unregister_demux ( dmx_demux_t &#x22C6;demux )</para>
379</entry>
380 </row></tbody></tgroup></informaltable>
381<para>PARAMETERS
382</para>
383<informaltable><tgroup cols="2"><tbody><row><entry
384 align="char">
385<para>dmx_demux_t*
386 demux</para>
387</entry><entry
388 align="char">
389<para>Pointer to the demux structure which is to be
390 unregistered.</para>
391</entry>
392 </row></tbody></tgroup></informaltable>
393<para>RETURNS
394</para>
395<informaltable><tgroup cols="2"><tbody><row><entry
396 align="char">
397<para>0</para>
398</entry><entry
399 align="char">
400<para>The function was completed without errors.</para>
401</entry>
402 </row><row><entry
403 align="char">
404<para>ENODEV</para>
405</entry><entry
406 align="char">
407<para>The specified demux is not registered in the demux
408 directory.</para>
409</entry>
410 </row><row><entry
411 align="char">
412<para>EBUSY</para>
413</entry><entry
414 align="char">
415<para>The specified demux is currently in use.</para>
416</entry>
417 </row></tbody></tgroup></informaltable>
418
419</section><section
420role="subsection"><title>dmx_get_demuxes()</title>
421<para>DESCRIPTION
422</para>
423<informaltable><tgroup cols="1"><tbody><row><entry
424 align="char">
425<para>Provides the caller with the list of registered demux interfaces, using the
426 standard list structure defined in the include file linux/list.h. The include file
427 demux.h defines the macro DMX_DIR_ENTRY() for converting an element of
428 the generic type struct list_head* to the type dmx_demux_t*. The caller must
429 not free the memory of any of the elements obtained via this function call.</para>
430</entry>
431 </row></tbody></tgroup></informaltable>
432<para>SYNOPSIS
433</para>
434<informaltable><tgroup cols="1"><tbody><row><entry
435 align="char">
436<para>struct list_head &#x22C6;dmx_get_demuxes ()</para>
437</entry>
438 </row></tbody></tgroup></informaltable>
439<para>PARAMETERS
440</para>
441<informaltable><tgroup cols="2"><tbody><row><entry
442 align="char">
443<para>none</para>
444</entry>
445 </row></tbody></tgroup></informaltable>
446<para>RETURNS
447</para>
448<informaltable><tgroup cols="2"><tbody><row><entry
449 align="char">
450<para>struct list_head *</para>
451</entry><entry
452 align="char">
453<para>A list of demux interfaces, or NULL in the case of an
454 empty list.</para>
455</entry>
456 </row></tbody></tgroup></informaltable>
457 </section></section>
458<section id="demux_api">
459<title>Demux API</title>
460<para>The demux API should be implemented for each demux in the system. It is used to select
461the TS source of a demux and to manage the demux resources. When the demux
462client allocates a resource via the demux API, it receives a pointer to the API of that
463resource.
464</para>
465<para>Each demux receives its TS input from a DVB front-end or from memory, as set via the
466demux API. In a system with more than one front-end, the API can be used to select one of
467the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform. The
468demux API only controls front-ends regarding their connections with demuxes; the APIs
469used to set the other front-end parameters, such as tuning, are not defined in this
470document.
471</para>
472<para>The functions that implement the abstract interface demux should be defined static or
473module private and registered to the Demux Directory for external access. It is not necessary
474to implement every function in the demux_t struct, however (for example, a demux interface
475might support Section filtering, but not TS or PES filtering). The API client is expected to
476check the value of any function pointer before calling the function: the value of NULL means
477&#8220;function not available&#8221;.
478</para>
479<para>Whenever the functions of the demux API modify shared data, the possibilities of lost
480update and race condition problems should be addressed, e.g. by protecting parts of code with
481mutexes. This is especially important on multi-processor hosts.
482</para>
483<para>Note that functions called from a bottom half context must not sleep, at least in the 2.2.x
484kernels. Even a simple memory allocation can result in a kernel thread being put to sleep if
485swapping is needed. For example, the Linux kernel calls the functions of a network device
486interface from a bottom half context. Thus, if a demux API function is called from network
487device code, the function must not sleep.
488</para>
489
490
491<section id="kdapi_fopen">
492<title>open()</title>
493<para>DESCRIPTION
494</para>
495<informaltable><tgroup cols="1"><tbody><row><entry
496 align="char">
497<para>This function reserves the demux for use by the caller and, if necessary,
498 initializes the demux. When the demux is no longer needed, the function close()
499 should be called. It should be possible for multiple clients to access the demux
500 at the same time. Thus, the function implementation should increment the
501 demux usage count when open() is called and decrement it when close() is
502 called.</para>
503</entry>
504 </row></tbody></tgroup></informaltable>
505<para>SYNOPSIS
506</para>
507<informaltable><tgroup cols="1"><tbody><row><entry
508 align="char">
509<para>int open ( demux_t&#x22C6; demux );</para>
510</entry>
511 </row></tbody></tgroup></informaltable>
512<para>PARAMETERS
513</para>
514<informaltable><tgroup cols="2"><tbody><row><entry
515 align="char">
516<para>demux_t* demux</para>
517</entry><entry
518 align="char">
519<para>Pointer to the demux API and instance data.</para>
520</entry>
521 </row></tbody></tgroup></informaltable>
522<para>RETURNS
523</para>
524<informaltable><tgroup cols="2"><tbody><row><entry
525 align="char">
526<para>0</para>
527</entry><entry
528 align="char">
529<para>The function was completed without errors.</para>
530</entry>
531 </row><row><entry
532 align="char">
533<para>-EUSERS</para>
534</entry><entry
535 align="char">
536<para>Maximum usage count reached.</para>
537</entry>
538 </row><row><entry
539 align="char">
540<para>-EINVAL</para>
541</entry><entry
542 align="char">
543<para>Bad parameter.</para>
544</entry>
545 </row></tbody></tgroup></informaltable>
546
547</section>
548<section id="kdapi_fclose">
549<title>close()</title>
550<para>DESCRIPTION
551</para>
552<informaltable><tgroup cols="1"><tbody><row><entry
553 align="char">
554<para>This function reserves the demux for use by the caller and, if necessary,
555 initializes the demux. When the demux is no longer needed, the function close()
556 should be called. It should be possible for multiple clients to access the demux
557 at the same time. Thus, the function implementation should increment the
558 demux usage count when open() is called and decrement it when close() is
559 called.</para>
560</entry>
561 </row></tbody></tgroup></informaltable>
562<para>SYNOPSIS
563</para>
564<informaltable><tgroup cols="1"><tbody><row><entry
565 align="char">
566<para>int close(demux_t&#x22C6; demux);</para>
567</entry>
568 </row></tbody></tgroup></informaltable>
569<para>PARAMETERS
570</para>
571<informaltable><tgroup cols="2"><tbody><row><entry
572 align="char">
573<para>demux_t* demux</para>
574</entry><entry
575 align="char">
576<para>Pointer to the demux API and instance data.</para>
577</entry>
578 </row></tbody></tgroup></informaltable>
579<para>RETURNS
580</para>
581<informaltable><tgroup cols="2"><tbody><row><entry
582 align="char">
583<para>0</para>
584</entry><entry
585 align="char">
586<para>The function was completed without errors.</para>
587</entry>
588 </row><row><entry
589 align="char">
590<para>-ENODEV</para>
591</entry><entry
592 align="char">
593<para>The demux was not in use.</para>
594</entry>
595 </row><row><entry
596 align="char">
597<para>-EINVAL</para>
598</entry><entry
599 align="char">
600<para>Bad parameter.</para>
601</entry>
602 </row></tbody></tgroup></informaltable>
603
604</section>
605<section id="kdapi_fwrite">
606<title>write()</title>
607<para>DESCRIPTION
608</para>
609<informaltable><tgroup cols="1"><tbody><row><entry
610 align="char">
611<para>This function provides the demux driver with a memory buffer containing TS
612 packets. Instead of receiving TS packets from the DVB front-end, the demux
613 driver software will read packets from memory. Any clients of this demux
614 with active TS, PES or Section filters will receive filtered data via the Demux
615 callback API (see 0). The function returns when all the data in the buffer has
616 been consumed by the demux. Demux hardware typically cannot read TS from
617 memory. If this is the case, memory-based filtering has to be implemented
618 entirely in software.</para>
619</entry>
620 </row></tbody></tgroup></informaltable>
621<para>SYNOPSIS
622</para>
623<informaltable><tgroup cols="1"><tbody><row><entry
624 align="char">
625<para>int write(demux_t&#x22C6; demux, const char&#x22C6; buf, size_t
626 count);</para>
627</entry>
628 </row></tbody></tgroup></informaltable>
629<para>PARAMETERS
630</para>
631<informaltable><tgroup cols="2"><tbody><row><entry
632 align="char">
633<para>demux_t* demux</para>
634</entry><entry
635 align="char">
636<para>Pointer to the demux API and instance data.</para>
637</entry>
638 </row><row><entry
639 align="char">
640<para>const char* buf</para>
641</entry><entry
642 align="char">
643<para>Pointer to the TS data in kernel-space memory.</para>
644</entry>
645 </row><row><entry
646 align="char">
647<para>size_t length</para>
648</entry><entry
649 align="char">
650<para>Length of the TS data.</para>
651</entry>
652 </row></tbody></tgroup></informaltable>
653<para>RETURNS
654</para>
655<informaltable><tgroup cols="2"><tbody><row><entry
656 align="char">
657<para>0</para>
658</entry><entry
659 align="char">
660<para>The function was completed without errors.</para>
661</entry>
662 </row><row><entry
663 align="char">
664<para>-ENOSYS</para>
665</entry><entry
666 align="char">
667<para>The command is not implemented.</para>
668</entry>
669 </row><row><entry
670 align="char">
671<para>-EINVAL</para>
672</entry><entry
673 align="char">
674<para>Bad parameter.</para>
675</entry>
676 </row></tbody></tgroup></informaltable>
677
678</section><section
679role="subsection"><title>allocate_ts_feed()</title>
680<para>DESCRIPTION
681</para>
682<informaltable><tgroup cols="1"><tbody><row><entry
683 align="char">
684<para>Allocates a new TS feed, which is used to filter the TS packets carrying a
685 certain PID. The TS feed normally corresponds to a hardware PID filter on the
686 demux chip.</para>
687</entry>
688 </row></tbody></tgroup></informaltable>
689<para>SYNOPSIS
690</para>
691<informaltable><tgroup cols="1"><tbody><row><entry
692 align="char">
693<para>int allocate_ts_feed(dmx_demux_t&#x22C6; demux,
694 dmx_ts_feed_t&#x22C6;&#x22C6; feed, dmx_ts_cb callback);</para>
695</entry>
696 </row></tbody></tgroup></informaltable>
697<para>PARAMETERS
698</para>
699<informaltable><tgroup cols="2"><tbody><row><entry
700 align="char">
701<para>demux_t* demux</para>
702</entry><entry
703 align="char">
704<para>Pointer to the demux API and instance data.</para>
705</entry>
706 </row><row><entry
707 align="char">
708<para>dmx_ts_feed_t**
709 feed</para>
710</entry><entry
711 align="char">
712<para>Pointer to the TS feed API and instance data.</para>
713</entry>
714 </row><row><entry
715 align="char">
716<para>dmx_ts_cb callback</para>
717</entry><entry
718 align="char">
719<para>Pointer to the callback function for passing received TS
720 packet</para>
721</entry>
722 </row></tbody></tgroup></informaltable>
723<para>RETURNS
724</para>
725<informaltable><tgroup cols="2"><tbody><row><entry
726 align="char">
727<para>0</para>
728</entry><entry
729 align="char">
730<para>The function was completed without errors.</para>
731</entry>
732 </row><row><entry
733 align="char">
734<para>-EBUSY</para>
735</entry><entry
736 align="char">
737<para>No more TS feeds available.</para>
738</entry>
739 </row><row><entry
740 align="char">
741<para>-ENOSYS</para>
742</entry><entry
743 align="char">
744<para>The command is not implemented.</para>
745</entry>
746 </row><row><entry
747 align="char">
748<para>-EINVAL</para>
749</entry><entry
750 align="char">
751<para>Bad parameter.</para>
752</entry>
753 </row></tbody></tgroup></informaltable>
754
755</section><section
756role="subsection"><title>release_ts_feed()</title>
757<para>DESCRIPTION
758</para>
759<informaltable><tgroup cols="1"><tbody><row><entry
760 align="char">
761<para>Releases the resources allocated with allocate_ts_feed(). Any filtering in
762 progress on the TS feed should be stopped before calling this function.</para>
763</entry>
764 </row></tbody></tgroup></informaltable>
765<para>SYNOPSIS
766</para>
767<informaltable><tgroup cols="1"><tbody><row><entry
768 align="char">
769<para>int release_ts_feed(dmx_demux_t&#x22C6; demux,
770 dmx_ts_feed_t&#x22C6; feed);</para>
771</entry>
772 </row></tbody></tgroup></informaltable>
773<para>PARAMETERS
774</para>
775<informaltable><tgroup cols="2"><tbody><row><entry
776 align="char">
777<para>demux_t* demux</para>
778</entry><entry
779 align="char">
780<para>Pointer to the demux API and instance data.</para>
781</entry>
782 </row><row><entry
783 align="char">
784<para>dmx_ts_feed_t* feed</para>
785</entry><entry
786 align="char">
787<para>Pointer to the TS feed API and instance data.</para>
788</entry>
789 </row></tbody></tgroup></informaltable>
790<para>RETURNS
791</para>
792<informaltable><tgroup cols="2"><tbody><row><entry
793 align="char">
794<para>0</para>
795</entry><entry
796 align="char">
797<para>The function was completed without errors.</para>
798</entry>
799 </row><row><entry
800 align="char">
801<para>-EINVAL</para>
802</entry><entry
803 align="char">
804<para>Bad parameter.</para>
805</entry>
806 </row></tbody></tgroup></informaltable>
807
808</section><section
809role="subsection"><title>allocate_section_feed()</title>
810<para>DESCRIPTION
811</para>
812<informaltable><tgroup cols="1"><tbody><row><entry
813 align="char">
814<para>Allocates a new section feed, i.e. a demux resource for filtering and receiving
815 sections. On platforms with hardware support for section filtering, a section
816 feed is directly mapped to the demux HW. On other platforms, TS packets are
817 first PID filtered in hardware and a hardware section filter then emulated in
818 software. The caller obtains an API pointer of type dmx_section_feed_t as an
819 out parameter. Using this API the caller can set filtering parameters and start
820 receiving sections.</para>
821</entry>
822 </row></tbody></tgroup></informaltable>
823<para>SYNOPSIS
824</para>
825<informaltable><tgroup cols="1"><tbody><row><entry
826 align="char">
827<para>int allocate_section_feed(dmx_demux_t&#x22C6; demux,
828 dmx_section_feed_t &#x22C6;&#x22C6;feed, dmx_section_cb callback);</para>
829</entry>
830 </row></tbody></tgroup></informaltable>
831<para>PARAMETERS
832</para>
833<informaltable><tgroup cols="2"><tbody><row><entry
834 align="char">
835<para>demux_t *demux</para>
836</entry><entry
837 align="char">
838<para>Pointer to the demux API and instance data.</para>
839</entry>
840 </row><row><entry
841 align="char">
842<para>dmx_section_feed_t
843 **feed</para>
844</entry><entry
845 align="char">
846<para>Pointer to the section feed API and instance data.</para>
847</entry>
848 </row><row><entry
849 align="char">
850<para>dmx_section_cb
851 callback</para>
852</entry><entry
853 align="char">
854<para>Pointer to the callback function for passing received
855 sections.</para>
856</entry>
857 </row></tbody></tgroup></informaltable>
858<para>RETURNS
859</para>
860<informaltable><tgroup cols="2"><tbody><row><entry
861 align="char">
862<para>0</para>
863</entry><entry
864 align="char">
865<para>The function was completed without errors.</para>
866</entry>
867 </row><row><entry
868 align="char">
869<para>-EBUSY</para>
870</entry><entry
871 align="char">
872<para>No more section feeds available.</para>
873</entry>
874 </row><row><entry
875 align="char">
876<para>-ENOSYS</para>
877</entry><entry
878 align="char">
879<para>The command is not implemented.</para>
880</entry>
881 </row><row><entry
882 align="char">
883<para>-EINVAL</para>
884</entry><entry
885 align="char">
886<para>Bad parameter.</para>
887</entry>
888 </row></tbody></tgroup></informaltable>
889
890</section><section
891role="subsection"><title>release_section_feed()</title>
892<para>DESCRIPTION
893</para>
894<informaltable><tgroup cols="1"><tbody><row><entry
895 align="char">
896<para>Releases the resources allocated with allocate_section_feed(), including
897 allocated filters. Any filtering in progress on the section feed should be stopped
898 before calling this function.</para>
899</entry>
900 </row></tbody></tgroup></informaltable>
901<para>SYNOPSIS
902</para>
903<informaltable><tgroup cols="1"><tbody><row><entry
904 align="char">
905<para>int release_section_feed(dmx_demux_t&#x22C6; demux,
906 dmx_section_feed_t &#x22C6;feed);</para>
907</entry>
908 </row></tbody></tgroup></informaltable>
909<para>PARAMETERS
910</para>
911<informaltable><tgroup cols="2"><tbody><row><entry
912 align="char">
913<para>demux_t *demux</para>
914</entry><entry
915 align="char">
916<para>Pointer to the demux API and instance data.</para>
917</entry>
918 </row><row><entry
919 align="char">
920<para>dmx_section_feed_t
921 *feed</para>
922</entry><entry
923 align="char">
924<para>Pointer to the section feed API and instance data.</para>
925</entry>
926 </row></tbody></tgroup></informaltable>
927<para>RETURNS
928</para>
929<informaltable><tgroup cols="2"><tbody><row><entry
930 align="char">
931<para>0</para>
932</entry><entry
933 align="char">
934<para>The function was completed without errors.</para>
935</entry>
936 </row><row><entry
937 align="char">
938<para>-EINVAL</para>
939</entry><entry
940 align="char">
941<para>Bad parameter.</para>
942</entry>
943 </row></tbody></tgroup></informaltable>
944
945</section><section
946role="subsection"><title>descramble_mac_address()</title>
947<para>DESCRIPTION
948</para>
949<informaltable><tgroup cols="1"><tbody><row><entry
950 align="char">
951<para>This function runs a descrambling algorithm on the destination MAC
952 address field of a DVB Datagram Section, replacing the original address
953 with its un-encrypted version. Otherwise, the description on the function
954 descramble_section_payload() applies also to this function.</para>
955</entry>
956 </row></tbody></tgroup></informaltable>
957<para>SYNOPSIS
958</para>
959<informaltable><tgroup cols="1"><tbody><row><entry
960 align="char">
961<para>int descramble_mac_address(dmx_demux_t&#x22C6; demux, __u8
962 &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
963 size_t buffer2_length, __u16 pid);</para>
964</entry>
965 </row></tbody></tgroup></informaltable>
966<para>PARAMETERS
967</para>
968<informaltable><tgroup cols="2"><tbody><row><entry
969 align="char">
970<para>dmx_demux_t
971 *demux</para>
972</entry><entry
973 align="char">
974<para>Pointer to the demux API and instance data.</para>
975</entry>
976 </row><row><entry
977 align="char">
978<para>__u8 *buffer1</para>
979</entry><entry
980 align="char">
981<para>Pointer to the first byte of the section.</para>
982</entry>
983 </row><row><entry
984 align="char">
985<para>size_t buffer1_length</para>
986</entry><entry
987 align="char">
988<para>Length of the section data, including headers and CRC,
989 in buffer1.</para>
990</entry>
991 </row><row><entry
992 align="char">
993<para>__u8* buffer2</para>
994</entry><entry
995 align="char">
996<para>Pointer to the tail of the section data, or NULL. The
997 pointer has a non-NULL value if the section wraps past
998 the end of a circular buffer.</para>
999</entry>
1000 </row><row><entry
1001 align="char">
1002<para>size_t buffer2_length</para>
1003</entry><entry
1004 align="char">
1005<para>Length of the section data, including headers and CRC,
1006 in buffer2.</para>
1007</entry>
1008 </row><row><entry
1009 align="char">
1010<para>__u16 pid</para>
1011</entry><entry
1012 align="char">
1013<para>The PID on which the section was received. Useful
1014 for obtaining the descrambling key, e.g. from a DVB
1015 Common Access facility.</para>
1016</entry>
1017 </row></tbody></tgroup></informaltable>
1018<para>RETURNS
1019</para>
1020<informaltable><tgroup cols="2"><tbody><row><entry
1021 align="char">
1022<para>0</para>
1023</entry><entry
1024 align="char">
1025<para>The function was completed without errors.</para>
1026</entry>
1027 </row><row><entry
1028 align="char">
1029<para>-ENOSYS</para>
1030</entry><entry
1031 align="char">
1032<para>No descrambling facility available.</para>
1033</entry>
1034 </row><row><entry
1035 align="char">
1036<para>-EINVAL</para>
1037</entry><entry
1038 align="char">
1039<para>Bad parameter.</para>
1040</entry>
1041 </row></tbody></tgroup></informaltable>
1042
1043</section><section
1044role="subsection"><title>descramble_section_payload()</title>
1045<para>DESCRIPTION
1046</para>
1047<informaltable><tgroup cols="1"><tbody><row><entry
1048 align="char">
1049<para>This function runs a descrambling algorithm on the payload of a DVB
1050 Datagram Section, replacing the original payload with its un-encrypted
1051 version. The function will be called from the demux API implementation;
1052 the API client need not call this function directly. Section-level scrambling
1053 algorithms are currently standardized only for DVB-RCC (return channel
1054 over 2-directional cable TV network) systems. For all other DVB networks,
1055 encryption schemes are likely to be proprietary to each data broadcaster. Thus,
1056 it is expected that this function pointer will have the value of NULL (i.e.,
1057 function not available) in most demux API implementations. Nevertheless, it
1058 should be possible to use the function pointer as a hook for dynamically adding
1059 a &#8220;plug-in&#8221; descrambling facility to a demux driver.</para>
1060</entry>
1061 </row><row><entry
1062 align="char">
1063<para>While this function is not needed with hardware-based section descrambling,
1064 the descramble_section_payload function pointer can be used to override the
1065 default hardware-based descrambling algorithm: if the function pointer has a
1066 non-NULL value, the corresponding function should be used instead of any
1067 descrambling hardware.</para>
1068</entry>
1069 </row></tbody></tgroup></informaltable>
1070<para>SYNOPSIS
1071</para>
1072<informaltable><tgroup cols="1"><tbody><row><entry
1073 align="char">
1074<para>int descramble_section_payload(dmx_demux_t&#x22C6; demux,
1075 __u8 &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
1076 size_t buffer2_length, __u16 pid);</para>
1077</entry>
1078 </row></tbody></tgroup></informaltable>
1079<para>PARAMETERS
1080</para>
1081<informaltable><tgroup cols="2"><tbody><row><entry
1082 align="char">
1083<para>dmx_demux_t
1084 *demux</para>
1085</entry><entry
1086 align="char">
1087<para>Pointer to the demux API and instance data.</para>
1088</entry>
1089 </row><row><entry
1090 align="char">
1091<para>__u8 *buffer1</para>
1092</entry><entry
1093 align="char">
1094<para>Pointer to the first byte of the section.</para>
1095</entry>
1096 </row><row><entry
1097 align="char">
1098<para>size_t buffer1_length</para>
1099</entry><entry
1100 align="char">
1101<para>Length of the section data, including headers and CRC,
1102 in buffer1.</para>
1103</entry>
1104 </row><row><entry
1105 align="char">
1106<para>__u8 *buffer2</para>
1107</entry><entry
1108 align="char">
1109<para>Pointer to the tail of the section data, or NULL. The
1110 pointer has a non-NULL value if the section wraps past
1111 the end of a circular buffer.</para>
1112</entry>
1113 </row><row><entry
1114 align="char">
1115<para>size_t buffer2_length</para>
1116</entry><entry
1117 align="char">
1118<para>Length of the section data, including headers and CRC,
1119 in buffer2.</para>
1120</entry>
1121 </row><row><entry
1122 align="char">
1123<para>__u16 pid</para>
1124</entry><entry
1125 align="char">
1126<para>The PID on which the section was received. Useful
1127 for obtaining the descrambling key, e.g. from a DVB
1128 Common Access facility.</para>
1129</entry>
1130 </row></tbody></tgroup></informaltable>
1131<para>RETURNS
1132</para>
1133<informaltable><tgroup cols="2"><tbody><row><entry
1134 align="char">
1135<para>0</para>
1136</entry><entry
1137 align="char">
1138<para>The function was completed without errors.</para>
1139</entry>
1140 </row><row><entry
1141 align="char">
1142<para>-ENOSYS</para>
1143</entry><entry
1144 align="char">
1145<para>No descrambling facility available.</para>
1146</entry>
1147 </row><row><entry
1148 align="char">
1149<para>-EINVAL</para>
1150</entry><entry
1151 align="char">
1152<para>Bad parameter.</para>
1153</entry>
1154 </row></tbody></tgroup></informaltable>
1155
1156</section><section
1157role="subsection"><title>add_frontend()</title>
1158<para>DESCRIPTION
1159</para>
1160<informaltable><tgroup cols="1"><tbody><row><entry
1161 align="char">
1162<para>Registers a connectivity between a demux and a front-end, i.e., indicates that
1163 the demux can be connected via a call to connect_frontend() to use the given
1164 front-end as a TS source. The client of this function has to allocate dynamic or
1165 static memory for the frontend structure and initialize its fields before calling
1166 this function. This function is normally called during the driver initialization.
1167 The caller must not free the memory of the frontend struct before successfully
1168 calling remove_frontend().</para>
1169</entry>
1170 </row></tbody></tgroup></informaltable>
1171<para>SYNOPSIS
1172</para>
1173<informaltable><tgroup cols="1"><tbody><row><entry
1174 align="char">
1175<para>int add_frontend(dmx_demux_t &#x22C6;demux, dmx_frontend_t
1176 &#x22C6;frontend);</para>
1177</entry>
1178 </row></tbody></tgroup></informaltable>
1179<para>PARAMETERS
1180</para>
1181<informaltable><tgroup cols="2"><tbody><row><entry
1182 align="char">
1183<para>dmx_demux_t*
1184 demux</para>
1185</entry><entry
1186 align="char">
1187<para>Pointer to the demux API and instance data.</para>
1188</entry>
1189 </row><row><entry
1190 align="char">
1191<para>dmx_frontend_t*
1192 frontend</para>
1193</entry><entry
1194 align="char">
1195<para>Pointer to the front-end instance data.</para>
1196</entry>
1197 </row></tbody></tgroup></informaltable>
1198<para>RETURNS
1199</para>
1200<informaltable><tgroup cols="2"><tbody><row><entry
1201 align="char">
1202<para>0</para>
1203</entry><entry
1204 align="char">
1205<para>The function was completed without errors.</para>
1206</entry>
1207 </row><row><entry
1208 align="char">
1209<para>-EEXIST</para>
1210</entry><entry
1211 align="char">
1212<para>A front-end with the same value of the id field already
1213 registered.</para>
1214</entry>
1215 </row><row><entry
1216 align="char">
1217<para>-EINUSE</para>
1218</entry><entry
1219 align="char">
1220<para>The demux is in use.</para>
1221</entry>
1222 </row><row><entry
1223 align="char">
1224<para>-ENOMEM</para>
1225</entry><entry
1226 align="char">
1227<para>No more front-ends can be added.</para>
1228</entry>
1229 </row><row><entry
1230 align="char">
1231<para>-EINVAL</para>
1232</entry><entry
1233 align="char">
1234<para>Bad parameter.</para>
1235</entry>
1236 </row></tbody></tgroup></informaltable>
1237
1238</section><section
1239role="subsection"><title>remove_frontend()</title>
1240<para>DESCRIPTION
1241</para>
1242<informaltable><tgroup cols="1"><tbody><row><entry
1243 align="char">
1244<para>Indicates that the given front-end, registered by a call to add_frontend(), can
1245 no longer be connected as a TS source by this demux. The function should be
1246 called when a front-end driver or a demux driver is removed from the system.
1247 If the front-end is in use, the function fails with the return value of -EBUSY.
1248 After successfully calling this function, the caller can free the memory of
1249 the frontend struct if it was dynamically allocated before the add_frontend()
1250 operation.</para>
1251</entry>
1252 </row></tbody></tgroup></informaltable>
1253<para>SYNOPSIS
1254</para>
1255<informaltable><tgroup cols="1"><tbody><row><entry
1256 align="char">
1257<para>int remove_frontend(dmx_demux_t&#x22C6; demux,
1258 dmx_frontend_t&#x22C6; frontend);</para>
1259</entry>
1260 </row></tbody></tgroup></informaltable>
1261<para>PARAMETERS
1262</para>
1263<informaltable><tgroup cols="2"><tbody><row><entry
1264 align="char">
1265<para>dmx_demux_t*
1266 demux</para>
1267</entry><entry
1268 align="char">
1269<para>Pointer to the demux API and instance data.</para>
1270</entry>
1271 </row><row><entry
1272 align="char">
1273<para>dmx_frontend_t*
1274 frontend</para>
1275</entry><entry
1276 align="char">
1277<para>Pointer to the front-end instance data.</para>
1278</entry>
1279 </row></tbody></tgroup></informaltable>
1280<para>RETURNS
1281</para>
1282<informaltable><tgroup cols="2"><tbody><row><entry
1283 align="char">
1284<para>0</para>
1285</entry><entry
1286 align="char">
1287<para>The function was completed without errors.</para>
1288</entry>
1289 </row><row><entry
1290 align="char">
1291<para>-EINVAL</para>
1292</entry><entry
1293 align="char">
1294<para>Bad parameter.</para>
1295</entry>
1296 </row><row><entry
1297 align="char">
1298<para>-EBUSY</para>
1299</entry><entry
1300 align="char">
1301<para>The front-end is in use, i.e. a call to connect_frontend()
1302 has not been followed by a call to disconnect_frontend().</para>
1303</entry>
1304 </row></tbody></tgroup></informaltable>
1305
1306</section><section
1307role="subsection"><title>get_frontends()</title>
1308<para>DESCRIPTION
1309</para>
1310<informaltable><tgroup cols="1"><tbody><row><entry
1311 align="char">
1312<para>Provides the APIs of the front-ends that have been registered for this demux.
1313 Any of the front-ends obtained with this call can be used as a parameter for
1314 connect_frontend().</para>
1315</entry>
1316 </row><row><entry
1317 align="char">
1318<para>The include file demux.h contains the macro DMX_FE_ENTRY() for
1319 converting an element of the generic type struct list_head* to the type
1320 dmx_frontend_t*. The caller must not free the memory of any of the elements
1321 obtained via this function call.</para>
1322</entry>
1323 </row></tbody></tgroup></informaltable>
1324<para>SYNOPSIS
1325</para>
1326<informaltable><tgroup cols="1"><tbody><row><entry
1327 align="char">
1328<para>struct list_head&#x22C6; get_frontends(dmx_demux_t&#x22C6; demux);</para>
1329</entry>
1330 </row></tbody></tgroup></informaltable>
1331<para>PARAMETERS
1332</para>
1333<informaltable><tgroup cols="2"><tbody><row><entry
1334 align="char">
1335<para>dmx_demux_t*
1336 demux</para>
1337</entry><entry
1338 align="char">
1339<para>Pointer to the demux API and instance data.</para>
1340</entry>
1341 </row></tbody></tgroup></informaltable>
1342<para>RETURNS
1343</para>
1344<informaltable><tgroup cols="2"><tbody><row><entry
1345 align="char">
1346<para>dmx_demux_t*</para>
1347</entry><entry
1348 align="char">
1349<para>A list of front-end interfaces, or NULL in the case of an
1350 empty list.</para>
1351</entry>
1352 </row></tbody></tgroup></informaltable>
1353
1354</section><section
1355role="subsection"><title>connect_frontend()</title>
1356<para>DESCRIPTION
1357</para>
1358<informaltable><tgroup cols="1"><tbody><row><entry
1359 align="char">
1360<para>Connects the TS output of the front-end to the input of the demux. A demux
1361 can only be connected to a front-end registered to the demux with the function
1362 add_frontend().</para>
1363</entry>
1364 </row><row><entry
1365 align="char">
1366<para>It may or may not be possible to connect multiple demuxes to the same
1367 front-end, depending on the capabilities of the HW platform. When not used,
1368 the front-end should be released by calling disconnect_frontend().</para>
1369</entry>
1370 </row></tbody></tgroup></informaltable>
1371<para>SYNOPSIS
1372</para>
1373<informaltable><tgroup cols="1"><tbody><row><entry
1374 align="char">
1375<para>int connect_frontend(dmx_demux_t&#x22C6; demux,
1376 dmx_frontend_t&#x22C6; frontend);</para>
1377</entry>
1378 </row></tbody></tgroup></informaltable>
1379<para>PARAMETERS
1380</para>
1381<informaltable><tgroup cols="2"><tbody><row><entry
1382 align="char">
1383<para>dmx_demux_t*
1384 demux</para>
1385</entry><entry
1386 align="char">
1387<para>Pointer to the demux API and instance data.</para>
1388</entry>
1389 </row><row><entry
1390 align="char">
1391<para>dmx_frontend_t*
1392 frontend</para>
1393</entry><entry
1394 align="char">
1395<para>Pointer to the front-end instance data.</para>
1396</entry>
1397 </row></tbody></tgroup></informaltable>
1398<para>RETURNS
1399</para>
1400<informaltable><tgroup cols="2"><tbody><row><entry
1401 align="char">
1402<para>0</para>
1403</entry><entry
1404 align="char">
1405<para>The function was completed without errors.</para>
1406</entry>
1407 </row><row><entry
1408 align="char">
1409<para>-EINVAL</para>
1410</entry><entry
1411 align="char">
1412<para>Bad parameter.</para>
1413</entry>
1414 </row><row><entry
1415 align="char">
1416<para>-EBUSY</para>
1417</entry><entry
1418 align="char">
1419<para>The front-end is in use.</para>
1420</entry>
1421 </row></tbody></tgroup></informaltable>
1422
1423</section><section
1424role="subsection"><title>disconnect_frontend()</title>
1425<para>DESCRIPTION
1426</para>
1427<informaltable><tgroup cols="1"><tbody><row><entry
1428 align="char">
1429<para>Disconnects the demux and a front-end previously connected by a
1430 connect_frontend() call.</para>
1431</entry>
1432 </row></tbody></tgroup></informaltable>
1433<para>SYNOPSIS
1434</para>
1435<informaltable><tgroup cols="1"><tbody><row><entry
1436 align="char">
1437<para>int disconnect_frontend(dmx_demux_t&#x22C6; demux);</para>
1438</entry>
1439 </row></tbody></tgroup></informaltable>
1440<para>PARAMETERS
1441</para>
1442<informaltable><tgroup cols="2"><tbody><row><entry
1443 align="char">
1444<para>dmx_demux_t*
1445 demux</para>
1446</entry><entry
1447 align="char">
1448<para>Pointer to the demux API and instance data.</para>
1449</entry>
1450 </row></tbody></tgroup></informaltable>
1451<para>RETURNS
1452</para>
1453<informaltable><tgroup cols="2"><tbody><row><entry
1454 align="char">
1455<para>0</para>
1456</entry><entry
1457 align="char">
1458<para>The function was completed without errors.</para>
1459</entry>
1460 </row><row><entry
1461 align="char">
1462<para>-EINVAL</para>
1463</entry><entry
1464 align="char">
1465<para>Bad parameter.</para>
1466</entry>
1467 </row></tbody></tgroup></informaltable>
1468 </section></section>
1469<section id="demux_callback_api">
1470<title>Demux Callback API</title>
1471<para>This kernel-space API comprises the callback functions that deliver filtered data to the
1472demux client. Unlike the other APIs, these API functions are provided by the client and called
1473from the demux code.
1474</para>
1475<para>The function pointers of this abstract interface are not packed into a structure as in the
1476other demux APIs, because the callback functions are registered and used independent
1477of each other. As an example, it is possible for the API client to provide several
1478callback functions for receiving TS packets and no callbacks for PES packets or
1479sections.
1480</para>
1481<para>The functions that implement the callback API need not be re-entrant: when a demux
1482driver calls one of these functions, the driver is not allowed to call the function again before
1483the original call returns. If a callback is triggered by a hardware interrupt, it is recommended
1484to use the Linux &#8220;bottom half&#8221; mechanism or start a tasklet instead of making the callback
1485function call directly from a hardware interrupt.
1486</para>
1487
1488<section
1489role="subsection"><title>dmx_ts_cb()</title>
1490<para>DESCRIPTION
1491</para>
1492<informaltable><tgroup cols="1"><tbody><row><entry
1493 align="char">
1494<para>This function, provided by the client of the demux API, is called from the
1495 demux code. The function is only called when filtering on this TS feed has
1496 been enabled using the start_filtering() function.</para>
1497</entry>
1498 </row><row><entry
1499 align="char">
1500<para>Any TS packets that match the filter settings are copied to a circular buffer. The
1501 filtered TS packets are delivered to the client using this callback function. The
1502 size of the circular buffer is controlled by the circular_buffer_size parameter
1503 of the set() function in the TS Feed API. It is expected that the buffer1 and
1504 buffer2 callback parameters point to addresses within the circular buffer, but
1505 other implementations are also possible. Note that the called party should not
1506 try to free the memory the buffer1 and buffer2 parameters point to.</para>
1507</entry>
1508 </row><row><entry
1509 align="char">
1510<para>When this function is called, the buffer1 parameter typically points to the
1511 start of the first undelivered TS packet within a circular buffer. The buffer2
1512 buffer parameter is normally NULL, except when the received TS packets have
1513 crossed the last address of the circular buffer and &#8221;wrapped&#8221; to the beginning
1514 of the buffer. In the latter case the buffer1 parameter would contain an address
1515 within the circular buffer, while the buffer2 parameter would contain the first
1516 address of the circular buffer.</para>
1517</entry>
1518 </row><row><entry
1519 align="char">
1520<para>The number of bytes delivered with this function (i.e. buffer1_length +
1521 buffer2_length) is usually equal to the value of callback_length parameter
1522 given in the set() function, with one exception: if a timeout occurs before
1523 receiving callback_length bytes of TS data, any undelivered packets are
1524 immediately delivered to the client by calling this function. The timeout
1525 duration is controlled by the set() function in the TS Feed API.</para>
1526</entry>
1527 </row><row><entry
1528 align="char">
1529<para>If a TS packet is received with errors that could not be fixed by the TS-level
1530 forward error correction (FEC), the Transport_error_indicator flag of the TS
1531 packet header should be set. The TS packet should not be discarded, as
1532 the error can possibly be corrected by a higher layer protocol. If the called
1533 party is slow in processing the callback, it is possible that the circular buffer
1534 eventually fills up. If this happens, the demux driver should discard any TS
1535 packets received while the buffer is full. The error should be indicated to the
1536 client on the next callback by setting the success parameter to the value of
1537 DMX_OVERRUN_ERROR.</para>
1538</entry>
1539 </row><row><entry
1540 align="char">
1541<para>The type of data returned to the callback can be selected by the new
1542 function int (*set_type) (struct dmx_ts_feed_s* feed, int type, dmx_ts_pes_t
1543 pes_type) which is part of the dmx_ts_feed_s struct (also cf. to the
1544 include file ost/demux.h) The type parameter decides if the raw TS packet
1545 (TS_PACKET) or just the payload (TS_PACKET&#8212;TS_PAYLOAD_ONLY)
1546 should be returned. If additionally the TS_DECODER bit is set the stream
1547 will also be sent to the hardware MPEG decoder. In this case, the second
1548 flag decides as what kind of data the stream should be interpreted. The
1549 possible choices are one of DMX_TS_PES_AUDIO, DMX_TS_PES_VIDEO,
1550 DMX_TS_PES_TELETEXT, DMX_TS_PES_SUBTITLE,
1551 DMX_TS_PES_PCR, or DMX_TS_PES_OTHER.</para>
1552</entry>
1553 </row></tbody></tgroup></informaltable>
1554<para>SYNOPSIS
1555</para>
1556<informaltable><tgroup cols="1"><tbody><row><entry
1557 align="char">
1558<para>int dmx_ts_cb(__u8&#x22C6; buffer1, size_t buffer1_length,
1559 __u8&#x22C6; buffer2, size_t buffer2_length, dmx_ts_feed_t&#x22C6;
1560 source, dmx_success_t success);</para>
1561</entry>
1562 </row></tbody></tgroup></informaltable>
1563<para>PARAMETERS
1564</para>
1565<informaltable><tgroup cols="2"><tbody><row><entry
1566 align="char">
1567<para>__u8* buffer1</para>
1568</entry><entry
1569 align="char">
1570<para>Pointer to the start of the filtered TS packets.</para>
1571</entry>
1572 </row><row><entry
1573 align="char">
1574<para>size_t buffer1_length</para>
1575</entry><entry
1576 align="char">
1577<para>Length of the TS data in buffer1.</para>
1578</entry>
1579 </row><row><entry
1580 align="char">
1581<para>__u8* buffer2</para>
1582</entry><entry
1583 align="char">
1584<para>Pointer to the tail of the filtered TS packets, or NULL.</para>
1585</entry>
1586 </row><row><entry
1587 align="char">
1588<para>size_t buffer2_length</para>
1589</entry><entry
1590 align="char">
1591<para>Length of the TS data in buffer2.</para>
1592</entry>
1593 </row><row><entry
1594 align="char">
1595<para>dmx_ts_feed_t*
1596 source</para>
1597</entry><entry
1598 align="char">
1599<para>Indicates which TS feed is the source of the callback.</para>
1600</entry>
1601 </row><row><entry
1602 align="char">
1603<para>dmx_success_t
1604 success</para>
1605</entry><entry
1606 align="char">
1607<para>Indicates if there was an error in TS reception.</para>
1608</entry>
1609 </row></tbody></tgroup></informaltable>
1610<para>RETURNS
1611</para>
1612<informaltable><tgroup cols="2"><tbody><row><entry
1613 align="char">
1614<para>0</para>
1615</entry><entry
1616 align="char">
1617<para>Continue filtering.</para>
1618</entry>
1619 </row><row><entry
1620 align="char">
1621<para>-1</para>
1622</entry><entry
1623 align="char">
1624<para>Stop filtering - has the same effect as a call to
1625 stop_filtering() on the TS Feed API.</para>
1626</entry>
1627 </row></tbody></tgroup></informaltable>
1628
1629</section><section
1630role="subsection"><title>dmx_section_cb()</title>
1631<para>DESCRIPTION
1632</para>
1633<informaltable><tgroup cols="1"><tbody><row><entry
1634 align="char">
1635<para>This function, provided by the client of the demux API, is called from the
1636 demux code. The function is only called when filtering of sections has been
1637 enabled using the function start_filtering() of the section feed API. When the
1638 demux driver has received a complete section that matches at least one section
1639 filter, the client is notified via this callback function. Normally this function is
1640 called for each received section; however, it is also possible to deliver multiple
1641 sections with one callback, for example when the system load is high. If an
1642 error occurs while receiving a section, this function should be called with
1643 the corresponding error type set in the success field, whether or not there is
1644 data to deliver. The Section Feed implementation should maintain a circular
1645 buffer for received sections. However, this is not necessary if the Section Feed
1646 API is implemented as a client of the TS Feed API, because the TS Feed
1647 implementation then buffers the received data. The size of the circular buffer
1648 can be configured using the set() function in the Section Feed API. If there
1649 is no room in the circular buffer when a new section is received, the section
1650 must be discarded. If this happens, the value of the success parameter should
1651 be DMX_OVERRUN_ERROR on the next callback.</para>
1652</entry>
1653 </row></tbody></tgroup></informaltable>
1654<para>SYNOPSIS
1655</para>
1656<informaltable><tgroup cols="1"><tbody><row><entry
1657 align="char">
1658<para>int dmx_section_cb(__u8&#x22C6; buffer1, size_t
1659 buffer1_length, __u8&#x22C6; buffer2, size_t
1660 buffer2_length, dmx_section_filter_t&#x22C6; source,
1661 dmx_success_t success);</para>
1662</entry>
1663 </row></tbody></tgroup></informaltable>
1664<para>PARAMETERS
1665</para>
1666<informaltable><tgroup cols="2"><tbody><row><entry
1667 align="char">
1668<para>__u8* buffer1</para>
1669</entry><entry
1670 align="char">
1671<para>Pointer to the start of the filtered section, e.g. within the
1672 circular buffer of the demux driver.</para>
1673</entry>
1674 </row><row><entry
1675 align="char">
1676<para>size_t buffer1_length</para>
1677</entry><entry
1678 align="char">
1679<para>Length of the filtered section data in buffer1, including
1680 headers and CRC.</para>
1681</entry>
1682 </row><row><entry
1683 align="char">
1684<para>__u8* buffer2</para>
1685</entry><entry
1686 align="char">
1687<para>Pointer to the tail of the filtered section data, or NULL.
1688 Useful to handle the wrapping of a circular buffer.</para>
1689</entry>
1690 </row><row><entry
1691 align="char">
1692<para>size_t buffer2_length</para>
1693</entry><entry
1694 align="char">
1695<para>Length of the filtered section data in buffer2, including
1696 headers and CRC.</para>
1697</entry>
1698 </row><row><entry
1699 align="char">
1700<para>dmx_section_filter_t*
1701 filter</para>
1702</entry><entry
1703 align="char">
1704<para>Indicates the filter that triggered the callback.</para>
1705</entry>
1706 </row><row><entry
1707 align="char">
1708<para>dmx_success_t
1709 success</para>
1710</entry><entry
1711 align="char">
1712<para>Indicates if there was an error in section reception.</para>
1713</entry>
1714 </row></tbody></tgroup></informaltable>
1715<para>RETURNS
1716</para>
1717<informaltable><tgroup cols="2"><tbody><row><entry
1718 align="char">
1719<para>0</para>
1720</entry><entry
1721 align="char">
1722<para>Continue filtering.</para>
1723</entry>
1724 </row><row><entry
1725 align="char">
1726<para>-1</para>
1727</entry><entry
1728 align="char">
1729<para>Stop filtering - has the same effect as a call to
1730 stop_filtering() on the Section Feed API.</para>
1731</entry>
1732 </row></tbody></tgroup></informaltable>
1733 </section></section>
1734<section id="ts_feed_api">
1735<title>TS Feed API</title>
1736<para>A TS feed is typically mapped to a hardware PID filter on the demux chip.
1737Using this API, the client can set the filtering properties to start/stop filtering TS
1738packets on a particular TS feed. The API is defined as an abstract interface of the type
1739dmx_ts_feed_t.
1740</para>
1741<para>The functions that implement the interface should be defined static or module private. The
1742client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the
1743demux API.
1744</para>
1745
1746<section
1747role="subsection"><title>set()</title>
1748<para>DESCRIPTION
1749</para>
1750<informaltable><tgroup cols="1"><tbody><row><entry
1751 align="char">
1752<para>This function sets the parameters of a TS feed. Any filtering in progress on the
1753 TS feed must be stopped before calling this function.</para>
1754</entry>
1755 </row></tbody></tgroup></informaltable>
1756<para>SYNOPSIS
1757</para>
1758<informaltable><tgroup cols="1"><tbody><row><entry
1759 align="char">
1760<para>int set ( dmx_ts_feed_t&#x22C6; feed, __u16 pid, size_t
1761 callback_length, size_t circular_buffer_size, int
1762 descramble, struct timespec timeout);</para>
1763</entry>
1764 </row></tbody></tgroup></informaltable>
1765<para>PARAMETERS
1766</para>
1767<informaltable><tgroup cols="2"><tbody><row><entry
1768 align="char">
1769<para>dmx_ts_feed_t* feed</para>
1770</entry><entry
1771 align="char">
1772<para>Pointer to the TS feed API and instance data.</para>
1773</entry>
1774 </row><row><entry
1775 align="char">
1776<para>__u16 pid</para>
1777</entry><entry
1778 align="char">
1779<para>PID value to filter. Only the TS packets carrying the
1780 specified PID will be passed to the API client.</para>
1781</entry>
1782 </row><row><entry
1783 align="char">
1784<para>size_t
1785 callback_length</para>
1786</entry><entry
1787 align="char">
1788<para>Number of bytes to deliver with each call to the
1789 dmx_ts_cb() callback function. The value of this
1790 parameter should be a multiple of 188.</para>
1791</entry>
1792 </row><row><entry
1793 align="char">
1794<para>size_t
1795 circular_buffer_size</para>
1796</entry><entry
1797 align="char">
1798<para>Size of the circular buffer for the filtered TS packets.</para>
1799</entry>
1800 </row><row><entry
1801 align="char">
1802<para>int descramble</para>
1803</entry><entry
1804 align="char">
1805<para>If non-zero, descramble the filtered TS packets.</para>
1806</entry>
1807 </row><row><entry
1808 align="char">
1809<para>struct timespec
1810 timeout</para>
1811</entry><entry
1812 align="char">
1813<para>Maximum time to wait before delivering received TS
1814 packets to the client.</para>
1815</entry>
1816 </row></tbody></tgroup></informaltable>
1817<para>RETURNS
1818</para>
1819<informaltable><tgroup cols="2"><tbody><row><entry
1820 align="char">
1821<para>0</para>
1822</entry><entry
1823 align="char">
1824<para>The function was completed without errors.</para>
1825</entry>
1826 </row><row><entry
1827 align="char">
1828<para>-ENOMEM</para>
1829</entry><entry
1830 align="char">
1831<para>Not enough memory for the requested buffer size.</para>
1832</entry>
1833 </row><row><entry
1834 align="char">
1835<para>-ENOSYS</para>
1836</entry><entry
1837 align="char">
1838<para>No descrambling facility available for TS.</para>
1839</entry>
1840 </row><row><entry
1841 align="char">
1842<para>-EINVAL</para>
1843</entry><entry
1844 align="char">
1845<para>Bad parameter.</para>
1846</entry>
1847 </row></tbody></tgroup></informaltable>
1848
1849</section><section
1850role="subsection"><title>start_filtering()</title>
1851<para>DESCRIPTION
1852</para>
1853<informaltable><tgroup cols="1"><tbody><row><entry
1854 align="char">
1855<para>Starts filtering TS packets on this TS feed, according to its settings. The PID
1856 value to filter can be set by the API client. All matching TS packets are
1857 delivered asynchronously to the client, using the callback function registered
1858 with allocate_ts_feed().</para>
1859</entry>
1860 </row></tbody></tgroup></informaltable>
1861<para>SYNOPSIS
1862</para>
1863<informaltable><tgroup cols="1"><tbody><row><entry
1864 align="char">
1865<para>int start_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
1866</entry>
1867 </row></tbody></tgroup></informaltable>
1868<para>PARAMETERS
1869</para>
1870<informaltable><tgroup cols="2"><tbody><row><entry
1871 align="char">
1872<para>dmx_ts_feed_t* feed</para>
1873</entry><entry
1874 align="char">
1875<para>Pointer to the TS feed API and instance data.</para>
1876</entry>
1877 </row></tbody></tgroup></informaltable>
1878<para>RETURNS
1879</para>
1880<informaltable><tgroup cols="2"><tbody><row><entry
1881 align="char">
1882<para>0</para>
1883</entry><entry
1884 align="char">
1885<para>The function was completed without errors.</para>
1886</entry>
1887 </row><row><entry
1888 align="char">
1889<para>-EINVAL</para>
1890</entry><entry
1891 align="char">
1892<para>Bad parameter.</para>
1893</entry>
1894 </row></tbody></tgroup></informaltable>
1895
1896</section><section
1897role="subsection"><title>stop_filtering()</title>
1898<para>DESCRIPTION
1899</para>
1900<informaltable><tgroup cols="1"><tbody><row><entry
1901 align="char">
1902<para>Stops filtering TS packets on this TS feed.</para>
1903</entry>
1904 </row></tbody></tgroup></informaltable>
1905<para>SYNOPSIS
1906</para>
1907<informaltable><tgroup cols="1"><tbody><row><entry
1908 align="char">
1909<para>int stop_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
1910</entry>
1911 </row></tbody></tgroup></informaltable>
1912<para>PARAMETERS
1913</para>
1914<informaltable><tgroup cols="2"><tbody><row><entry
1915 align="char">
1916<para>dmx_ts_feed_t* feed</para>
1917</entry><entry
1918 align="char">
1919<para>Pointer to the TS feed API and instance data.</para>
1920</entry>
1921 </row></tbody></tgroup></informaltable>
1922<para>RETURNS
1923</para>
1924<informaltable><tgroup cols="2"><tbody><row><entry
1925 align="char">
1926<para>0</para>
1927</entry><entry
1928 align="char">
1929<para>The function was completed without errors.</para>
1930</entry>
1931 </row><row><entry
1932 align="char">
1933<para>-EINVAL</para>
1934</entry><entry
1935 align="char">
1936<para>Bad parameter.</para>
1937</entry>
1938 </row></tbody></tgroup></informaltable>
1939 </section></section>
1940<section id="section_feed_api">
1941<title>Section Feed API</title>
1942<para>A section feed is a resource consisting of a PID filter and a set of section filters. Using this
1943API, the client can set the properties of a section feed and to start/stop filtering. The API is
1944defined as an abstract interface of the type dmx_section_feed_t. The functions that implement
1945the interface should be defined static or module private. The client can get the handle of
1946a section feed API by calling the function allocate_section_feed() in the demux
1947API.
1948</para>
1949<para>On demux platforms that provide section filtering in hardware, the Section Feed API
1950implementation provides a software wrapper for the demux hardware. Other platforms may
1951support only PID filtering in hardware, requiring that TS packets are converted to sections in
1952software. In the latter case the Section Feed API implementation can be a client of the TS
1953Feed API.
1954</para>
1955
1956</section>
1957<section id="kdapi_set">
1958<title>set()</title>
1959<para>DESCRIPTION
1960</para>
1961<informaltable><tgroup cols="1"><tbody><row><entry
1962 align="char">
1963<para>This function sets the parameters of a section feed. Any filtering in progress on
1964 the section feed must be stopped before calling this function. If descrambling
1965 is enabled, the payload_scrambling_control and address_scrambling_control
1966 fields of received DVB datagram sections should be observed. If either one is
1967 non-zero, the section should be descrambled either in hardware or using the
1968 functions descramble_mac_address() and descramble_section_payload() of the
1969 demux API. Note that according to the MPEG-2 Systems specification, only
1970 the payloads of private sections can be scrambled while the rest of the section
1971 data must be sent in the clear.</para>
1972</entry>
1973 </row></tbody></tgroup></informaltable>
1974<para>SYNOPSIS
1975</para>
1976<informaltable><tgroup cols="1"><tbody><row><entry
1977 align="char">
1978<para>int set(dmx_section_feed_t&#x22C6; feed, __u16 pid, size_t
1979 circular_buffer_size, int descramble, int
1980 check_crc);</para>
1981</entry>
1982 </row></tbody></tgroup></informaltable>
1983<para>PARAMETERS
1984</para>
1985<informaltable><tgroup cols="2"><tbody><row><entry
1986 align="char">
1987<para>dmx_section_feed_t*
1988 feed</para>
1989</entry><entry
1990 align="char">
1991<para>Pointer to the section feed API and instance data.</para>
1992</entry>
1993 </row><row><entry
1994 align="char">
1995<para>__u16 pid</para>
1996</entry><entry
1997 align="char">
1998<para>PID value to filter; only the TS packets carrying the
1999 specified PID will be accepted.</para>
2000</entry>
2001 </row><row><entry
2002 align="char">
2003<para>size_t
2004 circular_buffer_size</para>
2005</entry><entry
2006 align="char">
2007<para>Size of the circular buffer for filtered sections.</para>
2008</entry>
2009 </row><row><entry
2010 align="char">
2011<para>int descramble</para>
2012</entry><entry
2013 align="char">
2014<para>If non-zero, descramble any sections that are scrambled.</para>
2015</entry>
2016 </row><row><entry
2017 align="char">
2018<para>int check_crc</para>
2019</entry><entry
2020 align="char">
2021<para>If non-zero, check the CRC values of filtered sections.</para>
2022</entry>
2023 </row></tbody></tgroup></informaltable>
2024<para>RETURNS
2025</para>
2026<informaltable><tgroup cols="2"><tbody><row><entry
2027 align="char">
2028<para>0</para>
2029</entry><entry
2030 align="char">
2031<para>The function was completed without errors.</para>
2032</entry>
2033 </row><row><entry
2034 align="char">
2035<para>-ENOMEM</para>
2036</entry><entry
2037 align="char">
2038<para>Not enough memory for the requested buffer size.</para>
2039</entry>
2040 </row><row><entry
2041 align="char">
2042<para>-ENOSYS</para>
2043</entry><entry
2044 align="char">
2045<para>No descrambling facility available for sections.</para>
2046</entry>
2047 </row><row><entry
2048 align="char">
2049<para>-EINVAL</para>
2050</entry><entry
2051 align="char">
2052<para>Bad parameters.</para>
2053</entry>
2054 </row></tbody></tgroup></informaltable>
2055
2056</section><section
2057role="subsection"><title>allocate_filter()</title>
2058<para>DESCRIPTION
2059</para>
2060<informaltable><tgroup cols="1"><tbody><row><entry
2061 align="char">
2062<para>This function is used to allocate a section filter on the demux. It should only be
2063 called when no filtering is in progress on this section feed. If a filter cannot be
2064 allocated, the function fails with -ENOSPC. See in section ?? for the format of
2065 the section filter.</para>
2066</entry>
2067 </row><row><entry
2068 align="char">
2069<para>The bitfields filter_mask and filter_value should only be modified when no
2070 filtering is in progress on this section feed. filter_mask controls which bits of
2071 filter_value are compared with the section headers/payload. On a binary value
2072 of 1 in filter_mask, the corresponding bits are compared. The filter only accepts
2073 sections that are equal to filter_value in all the tested bit positions. Any changes
2074 to the values of filter_mask and filter_value are guaranteed to take effect only
2075 when the start_filtering() function is called next time. The parent pointer in
2076 the struct is initialized by the API implementation to the value of the feed
2077 parameter. The priv pointer is not used by the API implementation, and can
2078 thus be freely utilized by the caller of this function. Any data pointed to by the
2079 priv pointer is available to the recipient of the dmx_section_cb() function call.</para>
2080</entry>
2081 </row><row><entry
2082 align="char">
2083<para>While the maximum section filter length (DMX_MAX_FILTER_SIZE) is
2084 currently set at 16 bytes, hardware filters of that size are not available on all
2085 platforms. Therefore, section filtering will often take place first in hardware,
2086 followed by filtering in software for the header bytes that were not covered
2087 by a hardware filter. The filter_mask field can be checked to determine how
2088 many bytes of the section filter are actually used, and if the hardware filter will
2089 suffice. Additionally, software-only section filters can optionally be allocated
2090 to clients when all hardware section filters are in use. Note that on most demux
2091 hardware it is not possible to filter on the section_length field of the section
2092 header &#8211; thus this field is ignored, even though it is included in filter_value and
2093 filter_mask fields.</para>
2094</entry>
2095 </row></tbody></tgroup></informaltable>
2096<para>SYNOPSIS
2097</para>
2098<informaltable><tgroup cols="1"><tbody><row><entry
2099 align="char">
2100<para>int allocate_filter(dmx_section_feed_t&#x22C6; feed,
2101 dmx_section_filter_t&#x22C6;&#x22C6; filter);</para>
2102</entry>
2103 </row></tbody></tgroup></informaltable>
2104<para>PARAMETERS
2105</para>
2106<informaltable><tgroup cols="2"><tbody><row><entry
2107 align="char">
2108<para>dmx_section_feed_t*
2109 feed</para>
2110</entry><entry
2111 align="char">
2112<para>Pointer to the section feed API and instance data.</para>
2113</entry>
2114 </row><row><entry
2115 align="char">
2116<para>dmx_section_filter_t**
2117 filter</para>
2118</entry><entry
2119 align="char">
2120<para>Pointer to the allocated filter.</para>
2121</entry>
2122 </row></tbody></tgroup></informaltable>
2123<para>RETURNS
2124</para>
2125<informaltable><tgroup cols="2"><tbody><row><entry
2126 align="char">
2127<para>0</para>
2128</entry><entry
2129 align="char">
2130<para>The function was completed without errors.</para>
2131</entry>
2132 </row><row><entry
2133 align="char">
2134<para>-ENOSPC</para>
2135</entry><entry
2136 align="char">
2137<para>No filters of given type and length available.</para>
2138</entry>
2139 </row><row><entry
2140 align="char">
2141<para>-EINVAL</para>
2142</entry><entry
2143 align="char">
2144<para>Bad parameters.</para>
2145</entry>
2146 </row></tbody></tgroup></informaltable>
2147
2148</section><section
2149role="subsection"><title>release_filter()</title>
2150<para>DESCRIPTION
2151</para>
2152<informaltable><tgroup cols="1"><tbody><row><entry
2153 align="char">
2154<para>This function releases all the resources of a previously allocated section filter.
2155 The function should not be called while filtering is in progress on this section
2156 feed. After calling this function, the caller should not try to dereference the
2157 filter pointer.</para>
2158</entry>
2159 </row></tbody></tgroup></informaltable>
2160<para>SYNOPSIS
2161</para>
2162<informaltable><tgroup cols="1"><tbody><row><entry
2163 align="char">
2164<para>int release_filter ( dmx_section_feed_t&#x22C6; feed,
2165 dmx_section_filter_t&#x22C6; filter);</para>
2166</entry>
2167 </row></tbody></tgroup></informaltable>
2168<para>PARAMETERS
2169</para>
2170<informaltable><tgroup cols="2"><tbody><row><entry
2171 align="char">
2172<para>dmx_section_feed_t*
2173 feed</para>
2174</entry><entry
2175 align="char">
2176<para>Pointer to the section feed API and instance data.</para>
2177</entry>
2178 </row><row><entry
2179 align="char">
2180<para>dmx_section_filter_t*
2181 filter</para>
2182</entry><entry
2183 align="char">
2184<para>I/O Pointer to the instance data of a section filter.</para>
2185</entry>
2186 </row></tbody></tgroup></informaltable>
2187<para>RETURNS
2188</para>
2189<informaltable><tgroup cols="2"><tbody><row><entry
2190 align="char">
2191<para>0</para>
2192</entry><entry
2193 align="char">
2194<para>The function was completed without errors.</para>
2195</entry>
2196 </row><row><entry
2197 align="char">
2198<para>-ENODEV</para>
2199</entry><entry
2200 align="char">
2201<para>No such filter allocated.</para>
2202</entry>
2203 </row><row><entry
2204 align="char">
2205<para>-EINVAL</para>
2206</entry><entry
2207 align="char">
2208<para>Bad parameter.</para>
2209</entry>
2210 </row></tbody></tgroup></informaltable>
2211
2212</section><section
2213role="subsection"><title>start_filtering()</title>
2214<para>DESCRIPTION
2215</para>
2216<informaltable><tgroup cols="1"><tbody><row><entry
2217 align="char">
2218<para>Starts filtering sections on this section feed, according to its settings. Sections
2219 are first filtered based on their PID and then matched with the section
2220 filters allocated for this feed. If the section matches the PID filter and
2221 at least one section filter, it is delivered to the API client. The section
2222 is delivered asynchronously using the callback function registered with
2223 allocate_section_feed().</para>
2224</entry>
2225 </row></tbody></tgroup></informaltable>
2226<para>SYNOPSIS
2227</para>
2228<informaltable><tgroup cols="1"><tbody><row><entry
2229 align="char">
2230<para>int start_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
2231</entry>
2232 </row></tbody></tgroup></informaltable>
2233<para>PARAMETERS
2234</para>
2235<informaltable><tgroup cols="2"><tbody><row><entry
2236 align="char">
2237<para>dmx_section_feed_t*
2238 feed</para>
2239</entry><entry
2240 align="char">
2241<para>Pointer to the section feed API and instance data.</para>
2242</entry>
2243 </row></tbody></tgroup></informaltable>
2244<para>RETURNS
2245</para>
2246<informaltable><tgroup cols="2"><tbody><row><entry
2247 align="char">
2248<para>0</para>
2249</entry><entry
2250 align="char">
2251<para>The function was completed without errors.</para>
2252</entry>
2253 </row><row><entry
2254 align="char">
2255<para>-EINVAL</para>
2256</entry><entry
2257 align="char">
2258<para>Bad parameter.</para>
2259</entry>
2260 </row></tbody></tgroup></informaltable>
2261
2262</section><section
2263role="subsection"><title>stop_filtering()</title>
2264<para>DESCRIPTION
2265</para>
2266<informaltable><tgroup cols="1"><tbody><row><entry
2267 align="char">
2268<para>Stops filtering sections on this section feed. Note that any changes to the
2269 filtering parameters (filter_value, filter_mask, etc.) should only be made when
2270 filtering is stopped.</para>
2271</entry>
2272 </row></tbody></tgroup></informaltable>
2273<para>SYNOPSIS
2274</para>
2275<informaltable><tgroup cols="1"><tbody><row><entry
2276 align="char">
2277<para>int stop_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
2278</entry>
2279 </row></tbody></tgroup></informaltable>
2280<para>PARAMETERS
2281</para>
2282<informaltable><tgroup cols="2"><tbody><row><entry
2283 align="char">
2284<para>dmx_section_feed_t*
2285 feed</para>
2286</entry><entry
2287 align="char">
2288<para>Pointer to the section feed API and instance data.</para>
2289</entry>
2290 </row></tbody></tgroup></informaltable>
2291<para>RETURNS
2292</para>
2293<informaltable><tgroup cols="2"><tbody><row><entry
2294 align="char">
2295<para>0</para>
2296</entry><entry
2297 align="char">
2298<para>The function was completed without errors.</para>
2299</entry>
2300 </row><row><entry
2301 align="char">
2302<para>-EINVAL</para>
2303</entry><entry
2304 align="char">
2305<para>Bad parameter.</para>
2306</entry>
2307 </row></tbody></tgroup></informaltable>
2308
2309</section>
diff --git a/Documentation/DocBook/media/dvb/net.xml b/Documentation/DocBook/media/dvb/net.xml
new file mode 100644
index 00000000000..a193e86941b
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/net.xml
@@ -0,0 +1,156 @@
1<title>DVB Network API</title>
2<para>The DVB net device enables feeding of MPE (multi protocol encapsulation) packets
3received via DVB into the Linux network protocol stack, e.g. for internet via satellite
4applications. It can be accessed through <emphasis role="tt">/dev/dvb/adapter0/net0</emphasis>. Data types and
5and ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/net.h</emphasis> in your
6application.
7</para>
8<section id="dvb_net_types">
9<title>DVB Net Data Types</title>
10
11<section id="dvb-net-if">
12<title>struct dvb_net_if</title>
13<programlisting>
14struct dvb_net_if {
15 __u16 pid;
16 __u16 if_num;
17 __u8 feedtype;
18#define DVB_NET_FEEDTYPE_MPE 0 /&#x22C6; multi protocol encapsulation &#x22C6;/
19#define DVB_NET_FEEDTYPE_ULE 1 /&#x22C6; ultra lightweight encapsulation &#x22C6;/
20};
21</programlisting>
22</section>
23
24</section>
25<section id="net_fcalls">
26<title>DVB net Function Calls</title>
27<para>To be written&#x2026;
28</para>
29
30<section id="NET_ADD_IF"
31role="subsection"><title>NET_ADD_IF</title>
32<para>DESCRIPTION
33</para>
34<informaltable><tgroup cols="1"><tbody><row><entry
35 align="char">
36<para>This ioctl is undocumented. Documentation is welcome.</para>
37</entry>
38 </row></tbody></tgroup></informaltable>
39<para>SYNOPSIS
40</para>
41<informaltable><tgroup cols="1"><tbody><row><entry
42 align="char">
43<para>int ioctl(fd, int request = NET_ADD_IF,
44 struct dvb_net_if *if);</para>
45</entry>
46 </row></tbody></tgroup></informaltable>
47<para>PARAMETERS
48</para>
49<informaltable><tgroup cols="2"><tbody><row><entry
50 align="char">
51<para>int fd</para>
52</entry><entry
53 align="char">
54<para>File descriptor returned by a previous call to open().</para>
55</entry>
56 </row><row><entry
57 align="char">
58<para>int request</para>
59</entry><entry
60 align="char">
61<para>Equals NET_ADD_IF for this command.</para>
62</entry>
63 </row><row><entry
64 align="char">
65<para>struct dvb_net_if *if
66</para>
67</entry><entry
68 align="char">
69<para>Undocumented.</para>
70</entry>
71 </row></tbody></tgroup></informaltable>
72&return-value-dvb;
73</section>
74
75<section id="NET_REMOVE_IF"
76role="subsection"><title>NET_REMOVE_IF</title>
77<para>DESCRIPTION
78</para>
79<informaltable><tgroup cols="1"><tbody><row><entry
80 align="char">
81<para>This ioctl is undocumented. Documentation is welcome.</para>
82</entry>
83 </row></tbody></tgroup></informaltable>
84<para>SYNOPSIS
85</para>
86<informaltable><tgroup cols="1"><tbody><row><entry
87 align="char">
88<para>int ioctl(fd, int request = NET_REMOVE_IF);
89</para>
90</entry>
91 </row></tbody></tgroup></informaltable>
92<para>PARAMETERS
93</para>
94<informaltable><tgroup cols="2"><tbody><row><entry
95 align="char">
96<para>int fd</para>
97</entry><entry
98 align="char">
99<para>File descriptor returned by a previous call to open().</para>
100</entry>
101 </row><row><entry
102 align="char">
103<para>int request</para>
104</entry><entry
105 align="char">
106<para>Equals NET_REMOVE_IF for this command.</para>
107</entry>
108 </row></tbody></tgroup></informaltable>
109&return-value-dvb;
110</section>
111
112<section id="NET_GET_IF"
113role="subsection"><title>NET_GET_IF</title>
114<para>DESCRIPTION
115</para>
116<informaltable><tgroup cols="1"><tbody><row><entry
117 align="char">
118<para>This ioctl is undocumented. Documentation is welcome.</para>
119</entry>
120 </row></tbody></tgroup></informaltable>
121<para>SYNOPSIS
122</para>
123<informaltable><tgroup cols="1"><tbody><row><entry
124 align="char">
125<para>int ioctl(fd, int request = NET_GET_IF,
126 struct dvb_net_if *if);</para>
127</entry>
128 </row></tbody></tgroup></informaltable>
129<para>PARAMETERS
130</para>
131<informaltable><tgroup cols="2"><tbody><row><entry
132 align="char">
133<para>int fd</para>
134</entry><entry
135 align="char">
136<para>File descriptor returned by a previous call to open().</para>
137</entry>
138 </row><row><entry
139 align="char">
140<para>int request</para>
141</entry><entry
142 align="char">
143<para>Equals NET_GET_IF for this command.</para>
144</entry>
145 </row><row><entry
146 align="char">
147<para>struct dvb_net_if *if
148</para>
149</entry><entry
150 align="char">
151<para>Undocumented.</para>
152</entry>
153 </row></tbody></tgroup></informaltable>
154&return-value-dvb;
155</section>
156</section>
diff --git a/Documentation/DocBook/media/dvb/video.xml b/Documentation/DocBook/media/dvb/video.xml
new file mode 100644
index 00000000000..3ea1ca7e785
--- /dev/null
+++ b/Documentation/DocBook/media/dvb/video.xml
@@ -0,0 +1,1968 @@
1<title>DVB Video Device</title>
2<para>The DVB video device controls the MPEG2 video decoder of the DVB hardware. It
3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/video0</emphasis>. Data types and and
4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your
5application.
6</para>
7<para>Note that the DVB video device only controls decoding of the MPEG video stream, not
8its presentation on the TV or computer screen. On PCs this is typically handled by an
9associated video4linux device, e.g. <emphasis role="tt">/dev/video</emphasis>, which allows scaling and defining output
10windows.
11</para>
12<para>Some DVB cards don&#8217;t have their own MPEG decoder, which results in the omission of
13the audio and video device as well as the video4linux device.
14</para>
15<para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only
16supported on some MPEG decoders made for DVD playback.
17</para>
18<para>
19These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use
20of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls
21have been created to replace that functionality.</para>
22<section id="video_types">
23<title>Video Data Types</title>
24
25<section id="video-format-t">
26<title>video_format_t</title>
27<para>The <emphasis role="tt">video_format_t</emphasis> data type defined by
28</para>
29<programlisting>
30typedef enum {
31 VIDEO_FORMAT_4_3, /&#x22C6; Select 4:3 format &#x22C6;/
32 VIDEO_FORMAT_16_9, /&#x22C6; Select 16:9 format. &#x22C6;/
33 VIDEO_FORMAT_221_1 /&#x22C6; 2.21:1 &#x22C6;/
34} video_format_t;
35</programlisting>
36<para>is used in the VIDEO_SET_FORMAT function (??) to tell the driver which aspect ratio
37the output hardware (e.g. TV) has. It is also used in the data structures video_status
38(??) returned by VIDEO_GET_STATUS (??) and video_event (??) returned by
39VIDEO_GET_EVENT (??) which report about the display format of the current video
40stream.
41</para>
42</section>
43
44<section id="video-displayformat-t">
45<title>video_displayformat_t</title>
46<para>In case the display format of the video stream and of the display hardware differ the
47application has to specify how to handle the cropping of the picture. This can be done using
48the VIDEO_SET_DISPLAY_FORMAT call (??) which accepts
49</para>
50<programlisting>
51typedef enum {
52 VIDEO_PAN_SCAN, /&#x22C6; use pan and scan format &#x22C6;/
53 VIDEO_LETTER_BOX, /&#x22C6; use letterbox format &#x22C6;/
54 VIDEO_CENTER_CUT_OUT /&#x22C6; use center cut out format &#x22C6;/
55} video_displayformat_t;
56</programlisting>
57<para>as argument.
58</para>
59</section>
60
61<section id="video-stream-source-t">
62<title>video_stream_source_t</title>
63<para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take
64the following values, depending on whether we are replaying from an internal (demuxer) or
65external (user write) source.
66</para>
67<programlisting>
68typedef enum {
69 VIDEO_SOURCE_DEMUX, /&#x22C6; Select the demux as the main source &#x22C6;/
70 VIDEO_SOURCE_MEMORY /&#x22C6; If this source is selected, the stream
71 comes from the user through the write
72 system call &#x22C6;/
73} video_stream_source_t;
74</programlisting>
75<para>VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
76DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY
77is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
78call.
79</para>
80</section>
81
82<section id="video-play-state-t">
83<title>video_play_state_t</title>
84<para>The following values can be returned by the VIDEO_GET_STATUS call representing the
85state of video playback.
86</para>
87<programlisting>
88typedef enum {
89 VIDEO_STOPPED, /&#x22C6; Video is stopped &#x22C6;/
90 VIDEO_PLAYING, /&#x22C6; Video is currently playing &#x22C6;/
91 VIDEO_FREEZED /&#x22C6; Video is freezed &#x22C6;/
92} video_play_state_t;
93</programlisting>
94</section>
95
96<section id="video-command">
97<title>struct video_command</title>
98<para>The structure must be zeroed before use by the application
99This ensures it can be extended safely in the future.</para>
100<programlisting>
101struct video_command {
102 __u32 cmd;
103 __u32 flags;
104 union {
105 struct {
106 __u64 pts;
107 } stop;
108
109 struct {
110 /&#x22C6; 0 or 1000 specifies normal speed,
111 1 specifies forward single stepping,
112 -1 specifies backward single stepping,
113 &gt;>1: playback at speed/1000 of the normal speed,
114 &lt;-1: reverse playback at (-speed/1000) of the normal speed. &#x22C6;/
115 __s32 speed;
116 __u32 format;
117 } play;
118
119 struct {
120 __u32 data[16];
121 } raw;
122 };
123};
124</programlisting>
125</section>
126
127<section id="video-size-t">
128<title>video_size_t</title>
129<programlisting>
130typedef struct {
131 int w;
132 int h;
133 video_format_t aspect_ratio;
134} video_size_t;
135</programlisting>
136</section>
137
138
139<section id="video-event">
140<title>struct video_event</title>
141<para>The following is the structure of a video event as it is returned by the VIDEO_GET_EVENT
142call.
143</para>
144<programlisting>
145struct video_event {
146 __s32 type;
147#define VIDEO_EVENT_SIZE_CHANGED 1
148#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
149#define VIDEO_EVENT_DECODER_STOPPED 3
150#define VIDEO_EVENT_VSYNC 4
151 __kernel_time_t timestamp;
152 union {
153 video_size_t size;
154 unsigned int frame_rate; /&#x22C6; in frames per 1000sec &#x22C6;/
155 unsigned char vsync_field; /&#x22C6; unknown/odd/even/progressive &#x22C6;/
156 } u;
157};
158</programlisting>
159</section>
160
161<section id="video-status">
162<title>struct video_status</title>
163<para>The VIDEO_GET_STATUS call returns the following structure informing about various
164states of the playback operation.
165</para>
166<programlisting>
167struct video_status {
168 int video_blank; /&#x22C6; blank video on freeze? &#x22C6;/
169 video_play_state_t play_state; /&#x22C6; current state of playback &#x22C6;/
170 video_stream_source_t stream_source; /&#x22C6; current source (demux/memory) &#x22C6;/
171 video_format_t video_format; /&#x22C6; current aspect ratio of stream &#x22C6;/
172 video_displayformat_t display_format;/&#x22C6; selected cropping mode &#x22C6;/
173};
174</programlisting>
175<para>If video_blank is set video will be blanked out if the channel is changed or if playback is
176stopped. Otherwise, the last picture will be displayed. play_state indicates if the video is
177currently frozen, stopped, or being played back. The stream_source corresponds to the seleted
178source for the video stream. It can come either from the demultiplexer or from memory.
179The video_format indicates the aspect ratio (one of 4:3 or 16:9) of the currently
180played video stream. Finally, display_format corresponds to the selected cropping
181mode in case the source video format is not the same as the format of the output
182device.
183</para>
184</section>
185
186<section id="video-still-picture">
187<title>struct video_still_picture</title>
188<para>An I-frame displayed via the VIDEO_STILLPICTURE call is passed on within the
189following structure.
190</para>
191<programlisting>
192/&#x22C6; pointer to and size of a single iframe in memory &#x22C6;/
193struct video_still_picture {
194 char &#x22C6;iFrame; /&#x22C6; pointer to a single iframe in memory &#x22C6;/
195 int32_t size;
196};
197</programlisting>
198</section>
199
200<section id="video_caps">
201<title>video capabilities</title>
202<para>A call to VIDEO_GET_CAPABILITIES returns an unsigned integer with the following
203bits set according to the hardwares capabilities.
204</para>
205<programlisting>
206 /&#x22C6; bit definitions for capabilities: &#x22C6;/
207 /&#x22C6; can the hardware decode MPEG1 and/or MPEG2? &#x22C6;/
208 #define VIDEO_CAP_MPEG1 1
209 #define VIDEO_CAP_MPEG2 2
210 /&#x22C6; can you send a system and/or program stream to video device?
211 (you still have to open the video and the audio device but only
212 send the stream to the video device) &#x22C6;/
213 #define VIDEO_CAP_SYS 4
214 #define VIDEO_CAP_PROG 8
215 /&#x22C6; can the driver also handle SPU, NAVI and CSS encoded data?
216 (CSS API is not present yet) &#x22C6;/
217 #define VIDEO_CAP_SPU 16
218 #define VIDEO_CAP_NAVI 32
219 #define VIDEO_CAP_CSS 64
220</programlisting>
221</section>
222
223<section id="video-system">
224<title>video_system_t</title>
225<para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The
226following system types can be set:
227</para>
228<programlisting>
229typedef enum {
230 VIDEO_SYSTEM_PAL,
231 VIDEO_SYSTEM_NTSC,
232 VIDEO_SYSTEM_PALN,
233 VIDEO_SYSTEM_PALNc,
234 VIDEO_SYSTEM_PALM,
235 VIDEO_SYSTEM_NTSC60,
236 VIDEO_SYSTEM_PAL60,
237 VIDEO_SYSTEM_PALM60
238} video_system_t;
239</programlisting>
240</section>
241
242<section id="video-highlight">
243<title>struct video_highlight</title>
244<para>Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight information. The
245call expects the following format for that information:
246</para>
247<programlisting>
248 typedef
249 struct video_highlight {
250 boolean active; /&#x22C6; 1=show highlight, 0=hide highlight &#x22C6;/
251 uint8_t contrast1; /&#x22C6; 7- 4 Pattern pixel contrast &#x22C6;/
252 /&#x22C6; 3- 0 Background pixel contrast &#x22C6;/
253 uint8_t contrast2; /&#x22C6; 7- 4 Emphasis pixel-2 contrast &#x22C6;/
254 /&#x22C6; 3- 0 Emphasis pixel-1 contrast &#x22C6;/
255 uint8_t color1; /&#x22C6; 7- 4 Pattern pixel color &#x22C6;/
256 /&#x22C6; 3- 0 Background pixel color &#x22C6;/
257 uint8_t color2; /&#x22C6; 7- 4 Emphasis pixel-2 color &#x22C6;/
258 /&#x22C6; 3- 0 Emphasis pixel-1 color &#x22C6;/
259 uint32_t ypos; /&#x22C6; 23-22 auto action mode &#x22C6;/
260 /&#x22C6; 21-12 start y &#x22C6;/
261 /&#x22C6; 9- 0 end y &#x22C6;/
262 uint32_t xpos; /&#x22C6; 23-22 button color number &#x22C6;/
263 /&#x22C6; 21-12 start x &#x22C6;/
264 /&#x22C6; 9- 0 end x &#x22C6;/
265 } video_highlight_t;
266</programlisting>
267
268</section>
269<section id="video-spu">
270<title>struct video_spu</title>
271<para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the
272following format:
273</para>
274<programlisting>
275 typedef
276 struct video_spu {
277 boolean active;
278 int stream_id;
279 } video_spu_t;
280</programlisting>
281
282</section>
283<section id="video-spu-palette">
284<title>struct video_spu_palette</title>
285<para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE:
286</para>
287<programlisting>
288 typedef
289 struct video_spu_palette {
290 int length;
291 uint8_t &#x22C6;palette;
292 } video_spu_palette_t;
293</programlisting>
294
295</section>
296<section id="video-navi-pack">
297<title>struct video_navi_pack</title>
298<para>In order to get the navigational data the following structure has to be passed to the ioctl
299VIDEO_GET_NAVI:
300</para>
301<programlisting>
302 typedef
303 struct video_navi_pack {
304 int length; /&#x22C6; 0 ... 1024 &#x22C6;/
305 uint8_t data[1024];
306 } video_navi_pack_t;
307</programlisting>
308</section>
309
310
311<section id="video-attributes-t">
312<title>video_attributes_t</title>
313<para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
314</para>
315<programlisting>
316 typedef uint16_t video_attributes_t;
317 /&#x22C6; bits: descr. &#x22C6;/
318 /&#x22C6; 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) &#x22C6;/
319 /&#x22C6; 13-12 TV system (0=525/60, 1=625/50) &#x22C6;/
320 /&#x22C6; 11-10 Aspect ratio (0=4:3, 3=16:9) &#x22C6;/
321 /&#x22C6; 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca &#x22C6;/
322 /&#x22C6; 7 line 21-1 data present in GOP (1=yes, 0=no) &#x22C6;/
323 /&#x22C6; 6 line 21-2 data present in GOP (1=yes, 0=no) &#x22C6;/
324 /&#x22C6; 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 &#x22C6;/
325 /&#x22C6; 2 source letterboxed (1=yes, 0=no) &#x22C6;/
326 /&#x22C6; 0 film/camera mode (0=camera, 1=film (625/50 only)) &#x22C6;/
327</programlisting>
328</section></section>
329
330
331<section id="video_function_calls">
332<title>Video Function Calls</title>
333
334
335<section id="video_fopen">
336<title>open()</title>
337<para>DESCRIPTION
338</para>
339<informaltable><tgroup cols="1"><tbody><row><entry
340 align="char">
341<para>This system call opens a named video device (e.g. /dev/dvb/adapter0/video0)
342 for subsequent use.</para>
343<para>When an open() call has succeeded, the device will be ready for use.
344 The significance of blocking or non-blocking mode is described in the
345 documentation for functions where there is a difference. It does not affect the
346 semantics of the open() call itself. A device opened in blocking mode can later
347 be put into non-blocking mode (and vice versa) using the F_SETFL command
348 of the fcntl system call. This is a standard system call, documented in the Linux
349 manual page for fcntl. Only one user can open the Video Device in O_RDWR
350 mode. All other attempts to open the device in this mode will fail, and an
351 error-code will be returned. If the Video Device is opened in O_RDONLY
352 mode, the only ioctl call that can be used is VIDEO_GET_STATUS. All other
353 call will return an error code.</para>
354</entry>
355 </row></tbody></tgroup></informaltable>
356
357<para>SYNOPSIS
358</para>
359<informaltable><tgroup cols="1"><tbody><row><entry
360 align="char">
361<para>int open(const char &#x22C6;deviceName, int flags);</para>
362</entry>
363 </row></tbody></tgroup></informaltable>
364<para>PARAMETERS
365</para>
366<informaltable><tgroup cols="2"><tbody><row><entry
367 align="char">
368<para>const char
369 *deviceName</para>
370</entry><entry
371 align="char">
372<para>Name of specific video device.</para>
373</entry>
374 </row><row><entry
375 align="char">
376<para>int flags</para>
377</entry><entry
378 align="char">
379<para>A bit-wise OR of the following flags:</para>
380</entry>
381 </row><row><entry
382 align="char">
383</entry><entry
384 align="char">
385<para>O_RDONLY read-only access</para>
386</entry>
387 </row><row><entry
388 align="char">
389</entry><entry
390 align="char">
391<para>O_RDWR read/write access</para>
392</entry>
393 </row><row><entry
394 align="char">
395</entry><entry
396 align="char">
397<para>O_NONBLOCK open in non-blocking mode</para>
398</entry>
399 </row><row><entry
400 align="char">
401</entry><entry
402 align="char">
403<para>(blocking mode is the default)</para>
404</entry>
405 </row></tbody></tgroup></informaltable>
406<para>RETURN VALUE</para>
407<informaltable><tgroup cols="2"><tbody><row><entry
408 align="char">
409<para>ENODEV</para>
410</entry><entry
411 align="char">
412<para>Device driver not loaded/available.</para>
413</entry>
414 </row><row><entry
415 align="char">
416<para>EINTERNAL</para>
417</entry><entry
418 align="char">
419<para>Internal error.</para>
420</entry>
421 </row><row><entry
422 align="char">
423<para>EBUSY</para>
424</entry><entry
425 align="char">
426<para>Device or resource busy.</para>
427</entry>
428 </row><row><entry
429 align="char">
430<para>EINVAL</para>
431</entry><entry
432 align="char">
433<para>Invalid argument.</para>
434</entry>
435 </row></tbody></tgroup></informaltable>
436
437</section>
438<section id="video_fclose">
439<title>close()</title>
440<para>DESCRIPTION
441</para>
442<informaltable><tgroup cols="1"><tbody><row><entry
443 align="char">
444<para>This system call closes a previously opened video device.</para>
445</entry>
446 </row></tbody></tgroup></informaltable>
447<para>SYNOPSIS
448</para>
449<informaltable><tgroup cols="1"><tbody><row><entry
450 align="char">
451<para>int close(int fd);</para>
452</entry>
453 </row></tbody></tgroup></informaltable>
454<para>PARAMETERS
455</para>
456<informaltable><tgroup cols="2"><tbody><row><entry
457 align="char">
458<para>int fd</para>
459</entry><entry
460 align="char">
461<para>File descriptor returned by a previous call to open().</para>
462</entry>
463 </row></tbody></tgroup></informaltable>
464<para>RETURN VALUE</para>
465<informaltable><tgroup cols="2"><tbody><row><entry
466 align="char">
467<para>EBADF</para>
468</entry><entry
469 align="char">
470<para>fd is not a valid open file descriptor.</para>
471</entry>
472 </row></tbody></tgroup></informaltable>
473
474</section>
475<section id="video_fwrite">
476<title>write()</title>
477<para>DESCRIPTION
478</para>
479<informaltable><tgroup cols="1"><tbody><row><entry
480 align="char">
481<para>This system call can only be used if VIDEO_SOURCE_MEMORY is selected
482 in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
483 PES format, unless the capability allows other formats. If O_NONBLOCK is
484 not specified the function will block until buffer space is available. The amount
485 of data to be transferred is implied by count.</para>
486</entry>
487 </row></tbody></tgroup></informaltable>
488<para>SYNOPSIS
489</para>
490<informaltable><tgroup cols="1"><tbody><row><entry
491 align="char">
492<para>size_t write(int fd, const void &#x22C6;buf, size_t count);</para>
493</entry>
494 </row></tbody></tgroup></informaltable>
495<para>PARAMETERS
496</para>
497<informaltable><tgroup cols="2"><tbody><row><entry
498 align="char">
499<para>int fd</para>
500</entry><entry
501 align="char">
502<para>File descriptor returned by a previous call to open().</para>
503</entry>
504 </row><row><entry
505 align="char">
506<para>void *buf</para>
507</entry><entry
508 align="char">
509<para>Pointer to the buffer containing the PES data.</para>
510</entry>
511 </row><row><entry
512 align="char">
513<para>size_t count</para>
514</entry><entry
515 align="char">
516<para>Size of buf.</para>
517</entry>
518 </row></tbody></tgroup></informaltable>
519<para>RETURN VALUE</para>
520<informaltable><tgroup cols="2"><tbody><row><entry
521 align="char">
522<para>EPERM</para>
523</entry><entry
524 align="char">
525<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
526</entry>
527 </row><row><entry
528 align="char">
529<para>ENOMEM</para>
530</entry><entry
531 align="char">
532<para>Attempted to write more data than the internal buffer can
533 hold.</para>
534</entry>
535 </row><row><entry
536 align="char">
537<para>EBADF</para>
538</entry><entry
539 align="char">
540<para>fd is not a valid open file descriptor.</para>
541</entry>
542 </row></tbody></tgroup></informaltable>
543
544</section><section id="VIDEO_STOP"
545role="subsection"><title>VIDEO_STOP</title>
546<para>DESCRIPTION
547</para>
548<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
549&VIDIOC-DECODER-CMD; instead.</para>
550<informaltable><tgroup cols="1"><tbody><row><entry
551 align="char">
552<para>This ioctl call asks the Video Device to stop playing the current stream.
553 Depending on the input parameter, the screen can be blanked out or displaying
554 the last decoded frame.</para>
555</entry>
556 </row></tbody></tgroup></informaltable>
557<para>SYNOPSIS
558</para>
559<informaltable><tgroup cols="1"><tbody><row><entry
560 align="char">
561<para>int ioctl(fd, int request = VIDEO_STOP, boolean
562 mode);</para>
563</entry>
564 </row></tbody></tgroup></informaltable>
565<para>PARAMETERS
566</para>
567<informaltable><tgroup cols="2"><tbody><row><entry
568 align="char">
569<para>int fd</para>
570</entry><entry
571 align="char">
572<para>File descriptor returned by a previous call to open().</para>
573</entry>
574 </row><row><entry
575 align="char">
576<para>int request</para>
577</entry><entry
578 align="char">
579<para>Equals VIDEO_STOP for this command.</para>
580</entry>
581 </row><row><entry
582 align="char">
583<para>Boolean mode</para>
584</entry><entry
585 align="char">
586<para>Indicates how the screen shall be handled.</para>
587</entry>
588 </row><row><entry
589 align="char">
590</entry><entry
591 align="char">
592<para>TRUE: Blank screen when stop.</para>
593</entry>
594 </row><row><entry
595 align="char">
596</entry><entry
597 align="char">
598<para>FALSE: Show last decoded frame.</para>
599</entry>
600 </row></tbody></tgroup></informaltable>
601&return-value-dvb;
602
603</section><section id="VIDEO_PLAY"
604role="subsection"><title>VIDEO_PLAY</title>
605<para>DESCRIPTION
606</para>
607<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
608&VIDIOC-DECODER-CMD; instead.</para>
609<informaltable><tgroup cols="1"><tbody><row><entry
610 align="char">
611<para>This ioctl call asks the Video Device to start playing a video stream from the
612 selected source.</para>
613</entry>
614 </row></tbody></tgroup></informaltable>
615<para>SYNOPSIS
616</para>
617<informaltable><tgroup cols="1"><tbody><row><entry
618 align="char">
619<para>int ioctl(fd, int request = VIDEO_PLAY);</para>
620</entry>
621 </row></tbody></tgroup></informaltable>
622<para>PARAMETERS
623</para>
624<informaltable><tgroup cols="2"><tbody><row><entry
625 align="char">
626<para>int fd</para>
627</entry><entry
628 align="char">
629<para>File descriptor returned by a previous call to open().</para>
630</entry>
631 </row><row><entry
632 align="char">
633<para>int request</para>
634</entry><entry
635 align="char">
636<para>Equals VIDEO_PLAY for this command.</para>
637</entry>
638 </row></tbody></tgroup></informaltable>
639&return-value-dvb;
640
641</section><section id="VIDEO_FREEZE"
642role="subsection"><title>VIDEO_FREEZE</title>
643<para>DESCRIPTION
644</para>
645<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
646&VIDIOC-DECODER-CMD; instead.</para>
647<informaltable><tgroup cols="1"><tbody><row><entry
648 align="char">
649<para>This ioctl call suspends the live video stream being played. Decoding
650 and playing are frozen. It is then possible to restart the decoding
651 and playing process of the video stream using the VIDEO_CONTINUE
652 command. If VIDEO_SOURCE_MEMORY is selected in the ioctl call
653 VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more
654 data until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.</para>
655</entry>
656 </row></tbody></tgroup></informaltable>
657<para>SYNOPSIS
658</para>
659<informaltable><tgroup cols="1"><tbody><row><entry
660 align="char">
661<para>int ioctl(fd, int request = VIDEO_FREEZE);</para>
662</entry>
663 </row></tbody></tgroup></informaltable>
664<para>PARAMETERS
665</para>
666<informaltable><tgroup cols="2"><tbody><row><entry
667 align="char">
668<para>int fd</para>
669</entry><entry
670 align="char">
671<para>File descriptor returned by a previous call to open().</para>
672</entry>
673 </row><row><entry
674 align="char">
675<para>int request</para>
676</entry><entry
677 align="char">
678<para>Equals VIDEO_FREEZE for this command.</para>
679</entry>
680 </row></tbody></tgroup></informaltable>
681&return-value-dvb;
682
683</section><section id="VIDEO_CONTINUE"
684role="subsection"><title>VIDEO_CONTINUE</title>
685<para>DESCRIPTION
686</para>
687<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
688&VIDIOC-DECODER-CMD; instead.</para>
689<informaltable><tgroup cols="1"><tbody><row><entry
690 align="char">
691<para>This ioctl call restarts decoding and playing processes of the video stream
692 which was played before a call to VIDEO_FREEZE was made.</para>
693</entry>
694 </row></tbody></tgroup></informaltable>
695<para>SYNOPSIS
696</para>
697<informaltable><tgroup cols="1"><tbody><row><entry
698 align="char">
699<para>int ioctl(fd, int request = VIDEO_CONTINUE);</para>
700</entry>
701 </row></tbody></tgroup></informaltable>
702<para>PARAMETERS
703</para>
704<informaltable><tgroup cols="2"><tbody><row><entry
705 align="char">
706<para>int fd</para>
707</entry><entry
708 align="char">
709<para>File descriptor returned by a previous call to open().</para>
710</entry>
711 </row><row><entry
712 align="char">
713<para>int request</para>
714</entry><entry
715 align="char">
716<para>Equals VIDEO_CONTINUE for this command.</para>
717</entry>
718 </row></tbody></tgroup></informaltable>
719&return-value-dvb;
720
721</section><section id="VIDEO_SELECT_SOURCE"
722role="subsection"><title>VIDEO_SELECT_SOURCE</title>
723<para>DESCRIPTION
724</para>
725<para>This ioctl is for DVB devices only. This ioctl was also supported by the
726V4L2 ivtv driver, but that has been replaced by the ivtv-specific
727<constant>IVTV_IOC_PASSTHROUGH_MODE</constant> ioctl.</para>
728<informaltable><tgroup cols="1"><tbody><row><entry
729 align="char">
730<para>This ioctl call informs the video device which source shall be used for the input
731 data. The possible sources are demux or memory. If memory is selected, the
732 data is fed to the video device through the write command.</para>
733</entry>
734 </row></tbody></tgroup></informaltable>
735<para>SYNOPSIS
736</para>
737<informaltable><tgroup cols="1"><tbody><row><entry
738 align="char">
739<para>int ioctl(fd, int request = VIDEO_SELECT_SOURCE,
740 video_stream_source_t source);</para>
741</entry>
742 </row></tbody></tgroup></informaltable>
743<para>PARAMETERS
744</para>
745<informaltable><tgroup cols="2"><tbody><row><entry
746 align="char">
747<para>int fd</para>
748</entry><entry
749 align="char">
750<para>File descriptor returned by a previous call to open().</para>
751</entry>
752 </row><row><entry
753 align="char">
754<para>int request</para>
755</entry><entry
756 align="char">
757<para>Equals VIDEO_SELECT_SOURCE for this command.</para>
758</entry>
759 </row><row><entry
760 align="char">
761<para>video_stream_source_t
762 source</para>
763</entry><entry
764 align="char">
765<para>Indicates which source shall be used for the Video stream.</para>
766</entry>
767 </row></tbody></tgroup></informaltable>
768&return-value-dvb;
769
770</section><section id="VIDEO_SET_BLANK"
771role="subsection"><title>VIDEO_SET_BLANK</title>
772<para>DESCRIPTION
773</para>
774<informaltable><tgroup cols="1"><tbody><row><entry
775 align="char">
776<para>This ioctl call asks the Video Device to blank out the picture.</para>
777</entry>
778 </row></tbody></tgroup></informaltable>
779<para>SYNOPSIS
780</para>
781<informaltable><tgroup cols="1"><tbody><row><entry
782 align="char">
783<para>int ioctl(fd, int request = VIDEO_SET_BLANK, boolean
784 mode);</para>
785</entry>
786 </row></tbody></tgroup></informaltable>
787<para>PARAMETERS
788</para>
789<informaltable><tgroup cols="2"><tbody><row><entry
790 align="char">
791<para>int fd</para>
792</entry><entry
793 align="char">
794<para>File descriptor returned by a previous call to open().</para>
795</entry>
796 </row><row><entry
797 align="char">
798<para>int request</para>
799</entry><entry
800 align="char">
801<para>Equals VIDEO_SET_BLANK for this command.</para>
802</entry>
803 </row><row><entry
804 align="char">
805<para>boolean mode</para>
806</entry><entry
807 align="char">
808<para>TRUE: Blank screen when stop.</para>
809</entry>
810 </row><row><entry
811 align="char">
812</entry><entry
813 align="char">
814<para>FALSE: Show last decoded frame.</para>
815</entry>
816 </row></tbody></tgroup></informaltable>
817&return-value-dvb;
818
819</section><section id="VIDEO_GET_STATUS"
820role="subsection"><title>VIDEO_GET_STATUS</title>
821<para>DESCRIPTION
822</para>
823<informaltable><tgroup cols="1"><tbody><row><entry
824 align="char">
825<para>This ioctl call asks the Video Device to return the current status of the device.</para>
826</entry>
827 </row></tbody></tgroup></informaltable>
828<para>SYNOPSIS
829</para>
830<informaltable><tgroup cols="1"><tbody><row><entry
831 align="char">
832<para> int ioctl(fd, int request = VIDEO_GET_STATUS, struct
833 video_status &#x22C6;status);</para>
834</entry>
835 </row></tbody></tgroup></informaltable>
836<para>PARAMETERS
837</para>
838<informaltable><tgroup cols="2"><tbody><row><entry
839 align="char">
840<para>int fd</para>
841</entry><entry
842 align="char">
843<para>File descriptor returned by a previous call to open().</para>
844</entry>
845 </row><row><entry
846 align="char">
847<para>int request</para>
848</entry><entry
849 align="char">
850<para>Equals VIDEO_GET_STATUS for this command.</para>
851</entry>
852 </row><row><entry
853 align="char">
854<para>struct video_status
855 *status</para>
856</entry><entry
857 align="char">
858<para>Returns the current status of the Video Device.</para>
859</entry>
860 </row></tbody></tgroup></informaltable>
861&return-value-dvb;
862
863</section><section id="VIDEO_GET_FRAME_COUNT"
864role="subsection"><title>VIDEO_GET_FRAME_COUNT</title>
865<para>DESCRIPTION
866</para>
867<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
868ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_FRAME</constant> control.</para>
869<informaltable><tgroup cols="1"><tbody><row><entry
870 align="char">
871<para>This ioctl call asks the Video Device to return the number of displayed frames
872since the decoder was started.</para>
873</entry>
874 </row></tbody></tgroup></informaltable>
875<para>SYNOPSIS
876</para>
877<informaltable><tgroup cols="1"><tbody><row><entry
878 align="char">
879<para>int ioctl(int fd, int request =
880 VIDEO_GET_FRAME_COUNT, __u64 *pts);</para>
881</entry>
882 </row></tbody></tgroup></informaltable>
883<para>PARAMETERS
884</para>
885<informaltable><tgroup cols="2"><tbody><row><entry
886 align="char">
887<para>int fd</para>
888</entry><entry
889 align="char">
890<para>File descriptor returned by a previous call to open().</para>
891</entry>
892 </row><row><entry
893 align="char">
894<para>int request</para>
895</entry><entry
896 align="char">
897<para>Equals VIDEO_GET_FRAME_COUNT for this
898 command.</para>
899</entry>
900 </row><row><entry
901 align="char">
902<para>__u64 *pts
903</para>
904</entry><entry
905 align="char">
906<para>Returns the number of frames displayed since the decoder was started.
907</para>
908</entry>
909 </row></tbody></tgroup></informaltable>
910&return-value-dvb;
911
912</section><section id="VIDEO_GET_PTS"
913role="subsection"><title>VIDEO_GET_PTS</title>
914<para>DESCRIPTION
915</para>
916<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
917ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_PTS</constant> control.</para>
918<informaltable><tgroup cols="1"><tbody><row><entry
919 align="char">
920<para>This ioctl call asks the Video Device to return the current PTS timestamp.</para>
921</entry>
922 </row></tbody></tgroup></informaltable>
923<para>SYNOPSIS
924</para>
925<informaltable><tgroup cols="1"><tbody><row><entry
926 align="char">
927<para>int ioctl(int fd, int request =
928 VIDEO_GET_PTS, __u64 *pts);</para>
929</entry>
930 </row></tbody></tgroup></informaltable>
931<para>PARAMETERS
932</para>
933<informaltable><tgroup cols="2"><tbody><row><entry
934 align="char">
935<para>int fd</para>
936</entry><entry
937 align="char">
938<para>File descriptor returned by a previous call to open().</para>
939</entry>
940 </row><row><entry
941 align="char">
942<para>int request</para>
943</entry><entry
944 align="char">
945<para>Equals VIDEO_GET_PTS for this
946 command.</para>
947</entry>
948 </row><row><entry
949 align="char">
950<para>__u64 *pts
951</para>
952</entry><entry
953 align="char">
954<para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
955</para>
956<para>
957The PTS should belong to the currently played
958frame if possible, but may also be a value close to it
959like the PTS of the last decoded frame or the last PTS
960extracted by the PES parser.</para>
961</entry>
962 </row></tbody></tgroup></informaltable>
963&return-value-dvb;
964
965</section><section id="VIDEO_GET_FRAME_RATE"
966role="subsection"><title>VIDEO_GET_FRAME_RATE</title>
967<para>DESCRIPTION
968</para>
969<informaltable><tgroup cols="1"><tbody><row><entry
970 align="char">
971<para>This ioctl call asks the Video Device to return the current framerate.</para>
972</entry>
973 </row></tbody></tgroup></informaltable>
974<para>SYNOPSIS
975</para>
976<informaltable><tgroup cols="1"><tbody><row><entry
977 align="char">
978<para>int ioctl(int fd, int request =
979 VIDEO_GET_FRAME_RATE, unsigned int *rate);</para>
980</entry>
981 </row></tbody></tgroup></informaltable>
982<para>PARAMETERS
983</para>
984<informaltable><tgroup cols="2"><tbody><row><entry
985 align="char">
986<para>int fd</para>
987</entry><entry
988 align="char">
989<para>File descriptor returned by a previous call to open().</para>
990</entry>
991 </row><row><entry
992 align="char">
993<para>int request</para>
994</entry><entry
995 align="char">
996<para>Equals VIDEO_GET_FRAME_RATE for this
997 command.</para>
998</entry>
999 </row><row><entry
1000 align="char">
1001<para>unsigned int *rate
1002</para>
1003</entry><entry
1004 align="char">
1005<para>Returns the framerate in number of frames per 1000 seconds.
1006</para>
1007</entry>
1008 </row></tbody></tgroup></informaltable>
1009&return-value-dvb;
1010
1011</section><section id="VIDEO_GET_EVENT"
1012role="subsection"><title>VIDEO_GET_EVENT</title>
1013<para>DESCRIPTION
1014</para>
1015<para>This ioctl is for DVB devices only. To get events from a V4L2 decoder use the V4L2
1016&VIDIOC-DQEVENT; ioctl instead.</para>
1017<informaltable><tgroup cols="1"><tbody><row><entry
1018 align="char">
1019<para>This ioctl call returns an event of type video_event if available. If an event is
1020 not available, the behavior depends on whether the device is in blocking or
1021 non-blocking mode. In the latter case, the call fails immediately with errno
1022 set to EWOULDBLOCK. In the former case, the call blocks until an event
1023 becomes available. The standard Linux poll() and/or select() system calls can
1024 be used with the device file descriptor to watch for new events. For select(),
1025 the file descriptor should be included in the exceptfds argument, and for
1026 poll(), POLLPRI should be specified as the wake-up condition. Read-only
1027 permissions are sufficient for this ioctl call.</para>
1028</entry>
1029 </row></tbody></tgroup></informaltable>
1030<para>SYNOPSIS
1031</para>
1032<informaltable><tgroup cols="1"><tbody><row><entry
1033 align="char">
1034<para> int ioctl(fd, int request = VIDEO_GET_EVENT, struct
1035 video_event &#x22C6;ev);</para>
1036</entry>
1037 </row></tbody></tgroup></informaltable>
1038<para>PARAMETERS
1039</para>
1040<informaltable><tgroup cols="2"><tbody><row><entry
1041 align="char">
1042<para>int fd</para>
1043</entry><entry
1044 align="char">
1045<para>File descriptor returned by a previous call to open().</para>
1046</entry>
1047 </row><row><entry
1048 align="char">
1049<para>int request</para>
1050</entry><entry
1051 align="char">
1052<para>Equals VIDEO_GET_EVENT for this command.</para>
1053</entry>
1054 </row><row><entry
1055 align="char">
1056<para>struct video_event
1057 *ev</para>
1058</entry><entry
1059 align="char">
1060<para>Points to the location where the event, if any, is to be
1061 stored.</para>
1062</entry>
1063 </row></tbody></tgroup></informaltable>
1064&return-value-dvb;
1065<informaltable><tgroup cols="2"><tbody><row><entry
1066 align="char">
1067<para>EWOULDBLOCK</para>
1068</entry><entry
1069 align="char">
1070<para>There is no event pending, and the device is in
1071 non-blocking mode.</para>
1072</entry>
1073 </row><row><entry
1074 align="char">
1075<para>EOVERFLOW</para>
1076</entry><entry
1077 align="char">
1078<para>Overflow in event queue - one or more events were lost.</para>
1079</entry>
1080 </row></tbody></tgroup></informaltable>
1081
1082</section><section id="VIDEO_COMMAND"
1083role="subsection"><title>VIDEO_COMMAND</title>
1084<para>DESCRIPTION
1085</para>
1086<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1087ioctl has been replaced by the &VIDIOC-DECODER-CMD; ioctl.</para>
1088<informaltable><tgroup cols="1"><tbody><row><entry
1089 align="char">
1090<para>This ioctl commands the decoder. The <constant>video_command</constant> struct
1091is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1092&VIDIOC-DECODER-CMD; documentation for more information.</para>
1093</entry>
1094 </row></tbody></tgroup></informaltable>
1095<para>SYNOPSIS
1096</para>
1097<informaltable><tgroup cols="1"><tbody><row><entry
1098 align="char">
1099<para>int ioctl(int fd, int request =
1100 VIDEO_COMMAND, struct video_command *cmd);</para>
1101</entry>
1102 </row></tbody></tgroup></informaltable>
1103<para>PARAMETERS
1104</para>
1105<informaltable><tgroup cols="2"><tbody><row><entry
1106 align="char">
1107<para>int fd</para>
1108</entry><entry
1109 align="char">
1110<para>File descriptor returned by a previous call to open().</para>
1111</entry>
1112 </row><row><entry
1113 align="char">
1114<para>int request</para>
1115</entry><entry
1116 align="char">
1117<para>Equals VIDEO_COMMAND for this
1118 command.</para>
1119</entry>
1120 </row><row><entry
1121 align="char">
1122<para>struct video_command *cmd
1123</para>
1124</entry><entry
1125 align="char">
1126<para>Commands the decoder.
1127</para>
1128</entry>
1129 </row></tbody></tgroup></informaltable>
1130&return-value-dvb;
1131
1132</section><section id="VIDEO_TRY_COMMAND"
1133role="subsection"><title>VIDEO_TRY_COMMAND</title>
1134<para>DESCRIPTION
1135</para>
1136<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1137ioctl has been replaced by the &VIDIOC-TRY-DECODER-CMD; ioctl.</para>
1138<informaltable><tgroup cols="1"><tbody><row><entry
1139 align="char">
1140<para>This ioctl tries a decoder command. The <constant>video_command</constant> struct
1141is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1142&VIDIOC-TRY-DECODER-CMD; documentation for more information.</para>
1143</entry>
1144 </row></tbody></tgroup></informaltable>
1145<para>SYNOPSIS
1146</para>
1147<informaltable><tgroup cols="1"><tbody><row><entry
1148 align="char">
1149<para>int ioctl(int fd, int request =
1150 VIDEO_TRY_COMMAND, struct video_command *cmd);</para>
1151</entry>
1152 </row></tbody></tgroup></informaltable>
1153<para>PARAMETERS
1154</para>
1155<informaltable><tgroup cols="2"><tbody><row><entry
1156 align="char">
1157<para>int fd</para>
1158</entry><entry
1159 align="char">
1160<para>File descriptor returned by a previous call to open().</para>
1161</entry>
1162 </row><row><entry
1163 align="char">
1164<para>int request</para>
1165</entry><entry
1166 align="char">
1167<para>Equals VIDEO_TRY_COMMAND for this
1168 command.</para>
1169</entry>
1170 </row><row><entry
1171 align="char">
1172<para>struct video_command *cmd
1173</para>
1174</entry><entry
1175 align="char">
1176<para>Try a decoder command.
1177</para>
1178</entry>
1179 </row></tbody></tgroup></informaltable>
1180&return-value-dvb;
1181
1182</section><section id="VIDEO_GET_SIZE"
1183role="subsection"><title>VIDEO_GET_SIZE</title>
1184<para>DESCRIPTION
1185</para>
1186<informaltable><tgroup cols="1"><tbody><row><entry
1187 align="char">
1188<para>This ioctl returns the size and aspect ratio.</para>
1189</entry>
1190 </row></tbody></tgroup></informaltable>
1191<para>SYNOPSIS
1192</para>
1193<informaltable><tgroup cols="1"><tbody><row><entry
1194 align="char">
1195<para>int ioctl(int fd, int request =
1196 VIDEO_GET_SIZE, video_size_t *size);</para>
1197</entry>
1198 </row></tbody></tgroup></informaltable>
1199<para>PARAMETERS
1200</para>
1201<informaltable><tgroup cols="2"><tbody><row><entry
1202 align="char">
1203<para>int fd</para>
1204</entry><entry
1205 align="char">
1206<para>File descriptor returned by a previous call to open().</para>
1207</entry>
1208 </row><row><entry
1209 align="char">
1210<para>int request</para>
1211</entry><entry
1212 align="char">
1213<para>Equals VIDEO_GET_SIZE for this
1214 command.</para>
1215</entry>
1216 </row><row><entry
1217 align="char">
1218<para>video_size_t *size
1219</para>
1220</entry><entry
1221 align="char">
1222<para>Returns the size and aspect ratio.
1223</para>
1224</entry>
1225 </row></tbody></tgroup></informaltable>
1226&return-value-dvb;
1227
1228</section><section id="VIDEO_SET_DISPLAY_FORMAT"
1229role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
1230<para>DESCRIPTION
1231</para>
1232<informaltable><tgroup cols="1"><tbody><row><entry
1233 align="char">
1234<para>This ioctl call asks the Video Device to select the video format to be applied
1235 by the MPEG chip on the video.</para>
1236</entry>
1237 </row></tbody></tgroup></informaltable>
1238<para>SYNOPSIS
1239</para>
1240<informaltable><tgroup cols="1"><tbody><row><entry
1241 align="char">
1242<para> int ioctl(fd, int request =
1243 VIDEO_SET_DISPLAY_FORMAT, video_display_format_t
1244 format);</para>
1245</entry>
1246 </row></tbody></tgroup></informaltable>
1247<para>PARAMETERS
1248</para>
1249<informaltable><tgroup cols="2"><tbody><row><entry
1250 align="char">
1251<para>int fd</para>
1252</entry><entry
1253 align="char">
1254<para>File descriptor returned by a previous call to open().</para>
1255</entry>
1256 </row><row><entry
1257 align="char">
1258<para>int request</para>
1259</entry><entry
1260 align="char">
1261<para>Equals VIDEO_SET_DISPLAY_FORMAT for this
1262 command.</para>
1263</entry>
1264 </row><row><entry
1265 align="char">
1266<para>video_display_format_t
1267 format</para>
1268</entry><entry
1269 align="char">
1270<para>Selects the video format to be used.</para>
1271</entry>
1272 </row></tbody></tgroup></informaltable>
1273&return-value-dvb;
1274
1275</section><section id="VIDEO_STILLPICTURE"
1276role="subsection"><title>VIDEO_STILLPICTURE</title>
1277<para>DESCRIPTION
1278</para>
1279<informaltable><tgroup cols="1"><tbody><row><entry
1280 align="char">
1281<para>This ioctl call asks the Video Device to display a still picture (I-frame). The
1282 input data shall contain an I-frame. If the pointer is NULL, then the current
1283 displayed still picture is blanked.</para>
1284</entry>
1285 </row></tbody></tgroup></informaltable>
1286<para>SYNOPSIS
1287</para>
1288<informaltable><tgroup cols="1"><tbody><row><entry
1289 align="char">
1290<para>int ioctl(fd, int request = VIDEO_STILLPICTURE,
1291 struct video_still_picture &#x22C6;sp);</para>
1292</entry>
1293 </row></tbody></tgroup></informaltable>
1294<para>PARAMETERS
1295</para>
1296<informaltable><tgroup cols="2"><tbody><row><entry
1297 align="char">
1298<para>int fd</para>
1299</entry><entry
1300 align="char">
1301<para>File descriptor returned by a previous call to open().</para>
1302</entry>
1303 </row><row><entry
1304 align="char">
1305<para>int request</para>
1306</entry><entry
1307 align="char">
1308<para>Equals VIDEO_STILLPICTURE for this command.</para>
1309</entry>
1310 </row><row><entry
1311 align="char">
1312<para>struct
1313 video_still_picture
1314 *sp</para>
1315</entry><entry
1316 align="char">
1317<para>Pointer to a location where an I-frame and size is stored.</para>
1318</entry>
1319 </row></tbody></tgroup></informaltable>
1320&return-value-dvb;
1321
1322</section><section id="VIDEO_FAST_FORWARD"
1323role="subsection"><title>VIDEO_FAST_FORWARD</title>
1324<para>DESCRIPTION
1325</para>
1326<informaltable><tgroup cols="1"><tbody><row><entry
1327 align="char">
1328<para>This ioctl call asks the Video Device to skip decoding of N number of I-frames.
1329 This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1330</entry>
1331 </row></tbody></tgroup></informaltable>
1332<para>SYNOPSIS
1333</para>
1334<informaltable><tgroup cols="1"><tbody><row><entry
1335 align="char">
1336<para>int ioctl(fd, int request = VIDEO_FAST_FORWARD, int
1337 nFrames);</para>
1338</entry>
1339 </row></tbody></tgroup></informaltable>
1340<para>PARAMETERS
1341</para>
1342<informaltable><tgroup cols="2"><tbody><row><entry
1343 align="char">
1344<para>int fd</para>
1345</entry><entry
1346 align="char">
1347<para>File descriptor returned by a previous call to open().</para>
1348</entry>
1349 </row><row><entry
1350 align="char">
1351<para>int request</para>
1352</entry><entry
1353 align="char">
1354<para>Equals VIDEO_FAST_FORWARD for this command.</para>
1355</entry>
1356 </row><row><entry
1357 align="char">
1358<para>int nFrames</para>
1359</entry><entry
1360 align="char">
1361<para>The number of frames to skip.</para>
1362</entry>
1363 </row></tbody></tgroup></informaltable>
1364&return-value-dvb;
1365<informaltable><tgroup cols="2"><tbody><row><entry
1366 align="char">
1367<para>EPERM</para>
1368</entry><entry
1369 align="char">
1370<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1371</entry>
1372 </row></tbody></tgroup></informaltable>
1373
1374</section><section id="VIDEO_SLOWMOTION"
1375role="subsection"><title>VIDEO_SLOWMOTION</title>
1376<para>DESCRIPTION
1377</para>
1378<informaltable><tgroup cols="1"><tbody><row><entry
1379 align="char">
1380<para>This ioctl call asks the video device to repeat decoding frames N number of
1381 times. This call can only be used if VIDEO_SOURCE_MEMORY is selected.</para>
1382</entry>
1383 </row></tbody></tgroup></informaltable>
1384<para>SYNOPSIS
1385</para>
1386<informaltable><tgroup cols="1"><tbody><row><entry
1387 align="char">
1388<para>int ioctl(fd, int request = VIDEO_SLOWMOTION, int
1389 nFrames);</para>
1390</entry>
1391 </row></tbody></tgroup></informaltable>
1392<para>PARAMETERS
1393</para>
1394<informaltable><tgroup cols="2"><tbody><row><entry
1395 align="char">
1396<para>int fd</para>
1397</entry><entry
1398 align="char">
1399<para>File descriptor returned by a previous call to open().</para>
1400</entry>
1401 </row><row><entry
1402 align="char">
1403<para>int request</para>
1404</entry><entry
1405 align="char">
1406<para>Equals VIDEO_SLOWMOTION for this command.</para>
1407</entry>
1408 </row><row><entry
1409 align="char">
1410<para>int nFrames</para>
1411</entry><entry
1412 align="char">
1413<para>The number of times to repeat each frame.</para>
1414</entry>
1415 </row></tbody></tgroup></informaltable>
1416&return-value-dvb;
1417<informaltable><tgroup cols="2"><tbody><row><entry
1418 align="char">
1419<para>EPERM</para>
1420</entry><entry
1421 align="char">
1422<para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
1423</entry>
1424 </row></tbody></tgroup></informaltable>
1425
1426</section><section id="VIDEO_GET_CAPABILITIES"
1427role="subsection"><title>VIDEO_GET_CAPABILITIES</title>
1428<para>DESCRIPTION
1429</para>
1430<informaltable><tgroup cols="1"><tbody><row><entry
1431 align="char">
1432<para>This ioctl call asks the video device about its decoding capabilities. On success
1433 it returns and integer which has bits set according to the defines in section ??.</para>
1434</entry>
1435 </row></tbody></tgroup></informaltable>
1436<para>SYNOPSIS
1437</para>
1438<informaltable><tgroup cols="1"><tbody><row><entry
1439 align="char">
1440<para>int ioctl(fd, int request = VIDEO_GET_CAPABILITIES,
1441 unsigned int &#x22C6;cap);</para>
1442</entry>
1443 </row></tbody></tgroup></informaltable>
1444<para>PARAMETERS
1445</para>
1446<informaltable><tgroup cols="2"><tbody><row><entry
1447 align="char">
1448<para>int fd</para>
1449</entry><entry
1450 align="char">
1451<para>File descriptor returned by a previous call to open().</para>
1452</entry>
1453 </row><row><entry
1454 align="char">
1455<para>int request</para>
1456</entry><entry
1457 align="char">
1458<para>Equals VIDEO_GET_CAPABILITIES for this
1459 command.</para>
1460</entry>
1461 </row><row><entry
1462 align="char">
1463<para>unsigned int *cap</para>
1464</entry><entry
1465 align="char">
1466<para>Pointer to a location where to store the capability
1467 information.</para>
1468</entry>
1469 </row></tbody></tgroup></informaltable>
1470&return-value-dvb;
1471
1472</section><section id="VIDEO_SET_ID"
1473role="subsection"><title>VIDEO_SET_ID</title>
1474<para>DESCRIPTION
1475</para>
1476<informaltable><tgroup cols="1"><tbody><row><entry
1477 align="char">
1478<para>This ioctl selects which sub-stream is to be decoded if a program or system
1479 stream is sent to the video device.</para>
1480</entry>
1481 </row></tbody></tgroup></informaltable>
1482<para>SYNOPSIS
1483</para>
1484<informaltable><tgroup cols="1"><tbody><row><entry
1485 align="char">
1486<para>int ioctl(int fd, int request = VIDEO_SET_ID, int
1487 id);</para>
1488</entry>
1489 </row></tbody></tgroup></informaltable>
1490<para>PARAMETERS
1491</para>
1492<informaltable><tgroup cols="2"><tbody><row><entry
1493 align="char">
1494<para>int fd</para>
1495</entry><entry
1496 align="char">
1497<para>File descriptor returned by a previous call to open().</para>
1498</entry>
1499 </row><row><entry
1500 align="char">
1501<para>int request</para>
1502</entry><entry
1503 align="char">
1504<para>Equals VIDEO_SET_ID for this command.</para>
1505</entry>
1506 </row><row><entry
1507 align="char">
1508<para>int id</para>
1509</entry><entry
1510 align="char">
1511<para>video sub-stream id</para>
1512</entry>
1513 </row></tbody></tgroup></informaltable>
1514&return-value-dvb;
1515<informaltable><tgroup cols="2"><tbody><row><entry
1516 align="char">
1517<para>EINVAL</para>
1518</entry><entry
1519 align="char">
1520<para>Invalid sub-stream id.</para>
1521</entry>
1522 </row></tbody></tgroup></informaltable>
1523
1524</section><section id="VIDEO_CLEAR_BUFFER"
1525role="subsection"><title>VIDEO_CLEAR_BUFFER</title>
1526<para>DESCRIPTION
1527</para>
1528<informaltable><tgroup cols="1"><tbody><row><entry
1529 align="char">
1530<para>This ioctl call clears all video buffers in the driver and in the decoder hardware.</para>
1531</entry>
1532 </row></tbody></tgroup></informaltable>
1533<para>SYNOPSIS
1534</para>
1535<informaltable><tgroup cols="1"><tbody><row><entry
1536 align="char">
1537<para>int ioctl(fd, int request = VIDEO_CLEAR_BUFFER);</para>
1538</entry>
1539 </row></tbody></tgroup></informaltable>
1540<para>PARAMETERS
1541</para>
1542<informaltable><tgroup cols="2"><tbody><row><entry
1543 align="char">
1544<para>int fd</para>
1545</entry><entry
1546 align="char">
1547<para>File descriptor returned by a previous call to open().</para>
1548</entry>
1549 </row><row><entry
1550 align="char">
1551<para>int request</para>
1552</entry><entry
1553 align="char">
1554<para>Equals VIDEO_CLEAR_BUFFER for this command.</para>
1555</entry>
1556 </row></tbody></tgroup></informaltable>
1557&return-value-dvb;
1558
1559</section><section id="VIDEO_SET_STREAMTYPE"
1560role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
1561<para>DESCRIPTION
1562</para>
1563<informaltable><tgroup cols="1"><tbody><row><entry
1564 align="char">
1565<para>This ioctl tells the driver which kind of stream to expect being written to it. If
1566 this call is not used the default of video PES is used. Some drivers might not
1567 support this call and always expect PES.</para>
1568</entry>
1569 </row></tbody></tgroup></informaltable>
1570<para>SYNOPSIS
1571</para>
1572<informaltable><tgroup cols="1"><tbody><row><entry
1573 align="char">
1574<para>int ioctl(fd, int request = VIDEO_SET_STREAMTYPE,
1575 int type);</para>
1576</entry>
1577 </row></tbody></tgroup></informaltable>
1578<para>PARAMETERS
1579</para>
1580<informaltable><tgroup cols="2"><tbody><row><entry
1581 align="char">
1582<para>int fd</para>
1583</entry><entry
1584 align="char">
1585<para>File descriptor returned by a previous call to open().</para>
1586</entry>
1587 </row><row><entry
1588 align="char">
1589<para>int request</para>
1590</entry><entry
1591 align="char">
1592<para>Equals VIDEO_SET_STREAMTYPE for this command.</para>
1593</entry>
1594 </row><row><entry
1595 align="char">
1596<para>int type</para>
1597</entry><entry
1598 align="char">
1599<para>stream type</para>
1600</entry>
1601 </row></tbody></tgroup></informaltable>
1602&return-value-dvb;
1603
1604</section><section id="VIDEO_SET_FORMAT"
1605role="subsection"><title>VIDEO_SET_FORMAT</title>
1606<para>DESCRIPTION
1607</para>
1608<informaltable><tgroup cols="1"><tbody><row><entry
1609 align="char">
1610<para>This ioctl sets the screen format (aspect ratio) of the connected output device
1611 (TV) so that the output of the decoder can be adjusted accordingly.</para>
1612</entry>
1613 </row></tbody></tgroup></informaltable>
1614<para>SYNOPSIS
1615</para>
1616<informaltable><tgroup cols="1"><tbody><row><entry
1617 align="char">
1618<para> int ioctl(fd, int request = VIDEO_SET_FORMAT,
1619 video_format_t format);</para>
1620</entry>
1621 </row></tbody></tgroup></informaltable>
1622<para>PARAMETERS
1623</para>
1624<informaltable><tgroup cols="2"><tbody><row><entry
1625 align="char">
1626<para>int fd</para>
1627</entry><entry
1628 align="char">
1629<para>File descriptor returned by a previous call to open().</para>
1630</entry>
1631 </row><row><entry
1632 align="char">
1633<para>int request</para>
1634</entry><entry
1635 align="char">
1636<para>Equals VIDEO_SET_FORMAT for this command.</para>
1637</entry>
1638 </row><row><entry
1639 align="char">
1640<para>video_format_t
1641 format</para>
1642</entry><entry
1643 align="char">
1644<para>video format of TV as defined in section ??.</para>
1645</entry>
1646 </row></tbody></tgroup></informaltable>
1647&return-value-dvb;
1648<informaltable><tgroup cols="2"><tbody><row><entry
1649 align="char">
1650<para>EINVAL</para>
1651</entry><entry
1652 align="char">
1653<para>format is not a valid video format.</para>
1654</entry>
1655 </row></tbody></tgroup></informaltable>
1656
1657</section><section id="VIDEO_SET_SYSTEM"
1658role="subsection"><title>VIDEO_SET_SYSTEM</title>
1659<para>DESCRIPTION
1660</para>
1661<informaltable><tgroup cols="1"><tbody><row><entry
1662 align="char">
1663<para>This ioctl sets the television output format. The format (see section ??) may
1664 vary from the color format of the displayed MPEG stream. If the hardware is
1665 not able to display the requested format the call will return an error.</para>
1666</entry>
1667 </row></tbody></tgroup></informaltable>
1668<para>SYNOPSIS
1669</para>
1670<informaltable><tgroup cols="1"><tbody><row><entry
1671 align="char">
1672<para> int ioctl(fd, int request = VIDEO_SET_SYSTEM ,
1673 video_system_t system);</para>
1674</entry>
1675 </row></tbody></tgroup></informaltable>
1676<para>PARAMETERS
1677</para>
1678<informaltable><tgroup cols="2"><tbody><row><entry
1679 align="char">
1680<para>int fd</para>
1681</entry><entry
1682 align="char">
1683<para>File descriptor returned by a previous call to open().</para>
1684</entry>
1685 </row><row><entry
1686 align="char">
1687<para>int request</para>
1688</entry><entry
1689 align="char">
1690<para>Equals VIDEO_SET_FORMAT for this command.</para>
1691</entry>
1692 </row><row><entry
1693 align="char">
1694<para>video_system_t
1695 system</para>
1696</entry><entry
1697 align="char">
1698<para>video system of TV output.</para>
1699</entry>
1700 </row></tbody></tgroup></informaltable>
1701&return-value-dvb;
1702<informaltable><tgroup cols="2"><tbody><row><entry
1703 align="char">
1704<para>EINVAL</para>
1705</entry><entry
1706 align="char">
1707<para>system is not a valid or supported video system.</para>
1708</entry>
1709 </row></tbody></tgroup></informaltable>
1710
1711</section><section id="VIDEO_SET_HIGHLIGHT"
1712role="subsection"><title>VIDEO_SET_HIGHLIGHT</title>
1713<para>DESCRIPTION
1714</para>
1715<informaltable><tgroup cols="1"><tbody><row><entry
1716 align="char">
1717<para>This ioctl sets the SPU highlight information for the menu access of a DVD.</para>
1718</entry>
1719 </row></tbody></tgroup></informaltable>
1720<para>SYNOPSIS
1721</para>
1722<informaltable><tgroup cols="1"><tbody><row><entry
1723 align="char">
1724<para> int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT
1725 ,video_highlight_t &#x22C6;vhilite)</para>
1726</entry>
1727 </row></tbody></tgroup></informaltable>
1728<para>PARAMETERS
1729</para>
1730<informaltable><tgroup cols="2"><tbody><row><entry
1731 align="char">
1732<para>int fd</para>
1733</entry><entry
1734 align="char">
1735<para>File descriptor returned by a previous call to open().</para>
1736</entry>
1737 </row><row><entry
1738 align="char">
1739<para>int request</para>
1740</entry><entry
1741 align="char">
1742<para>Equals VIDEO_SET_HIGHLIGHT for this command.</para>
1743</entry>
1744 </row><row><entry
1745 align="char">
1746<para>video_highlight_t
1747 *vhilite</para>
1748</entry><entry
1749 align="char">
1750<para>SPU Highlight information according to section ??.</para>
1751</entry>
1752 </row></tbody></tgroup></informaltable>
1753&return-value-dvb;
1754
1755</section><section id="VIDEO_SET_SPU"
1756role="subsection"><title>VIDEO_SET_SPU</title>
1757<para>DESCRIPTION
1758</para>
1759<informaltable><tgroup cols="1"><tbody><row><entry
1760 align="char">
1761<para>This ioctl activates or deactivates SPU decoding in a DVD input stream. It can
1762 only be used, if the driver is able to handle a DVD stream.</para>
1763</entry>
1764 </row></tbody></tgroup></informaltable>
1765<para>SYNOPSIS
1766</para>
1767<informaltable><tgroup cols="1"><tbody><row><entry
1768 align="char">
1769<para> int ioctl(fd, int request = VIDEO_SET_SPU ,
1770 video_spu_t &#x22C6;spu)</para>
1771</entry>
1772 </row></tbody></tgroup></informaltable>
1773<para>PARAMETERS
1774</para>
1775<informaltable><tgroup cols="2"><tbody><row><entry
1776 align="char">
1777<para>int fd</para>
1778</entry><entry
1779 align="char">
1780<para>File descriptor returned by a previous call to open().</para>
1781</entry>
1782 </row><row><entry
1783 align="char">
1784<para>int request</para>
1785</entry><entry
1786 align="char">
1787<para>Equals VIDEO_SET_SPU for this command.</para>
1788</entry>
1789 </row><row><entry
1790 align="char">
1791<para>video_spu_t *spu</para>
1792</entry><entry
1793 align="char">
1794<para>SPU decoding (de)activation and subid setting according
1795 to section ??.</para>
1796</entry>
1797 </row></tbody></tgroup></informaltable>
1798&return-value-dvb;
1799<informaltable><tgroup cols="2"><tbody><row><entry
1800 align="char">
1801<para>EINVAL</para>
1802</entry><entry
1803 align="char">
1804<para>input is not a valid spu setting or driver cannot handle
1805 SPU.</para>
1806</entry>
1807 </row></tbody></tgroup></informaltable>
1808
1809</section><section id="VIDEO_SET_SPU_PALETTE"
1810role="subsection"><title>VIDEO_SET_SPU_PALETTE</title>
1811<para>DESCRIPTION
1812</para>
1813<informaltable><tgroup cols="1"><tbody><row><entry
1814 align="char">
1815<para>This ioctl sets the SPU color palette.</para>
1816</entry>
1817 </row></tbody></tgroup></informaltable>
1818<para>SYNOPSIS
1819</para>
1820<informaltable><tgroup cols="1"><tbody><row><entry
1821 align="char">
1822<para> int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE
1823 ,video_spu_palette_t &#x22C6;palette )</para>
1824</entry>
1825 </row></tbody></tgroup></informaltable>
1826<para>PARAMETERS
1827</para>
1828<informaltable><tgroup cols="2"><tbody><row><entry
1829 align="char">
1830<para>int fd</para>
1831</entry><entry
1832 align="char">
1833<para>File descriptor returned by a previous call to open().</para>
1834</entry>
1835 </row><row><entry
1836 align="char">
1837<para>int request</para>
1838</entry><entry
1839 align="char">
1840<para>Equals VIDEO_SET_SPU_PALETTE for this command.</para>
1841</entry>
1842 </row><row><entry
1843 align="char">
1844<para>video_spu_palette_t
1845 *palette</para>
1846</entry><entry
1847 align="char">
1848<para>SPU palette according to section ??.</para>
1849</entry>
1850 </row></tbody></tgroup></informaltable>
1851&return-value-dvb;
1852<informaltable><tgroup cols="2"><tbody><row><entry
1853 align="char">
1854<para>EINVAL</para>
1855</entry><entry
1856 align="char">
1857<para>input is not a valid palette or driver doesn&#8217;t handle SPU.</para>
1858</entry>
1859 </row></tbody></tgroup></informaltable>
1860
1861</section><section id="VIDEO_GET_NAVI"
1862role="subsection"><title>VIDEO_GET_NAVI</title>
1863<para>DESCRIPTION
1864</para>
1865<informaltable><tgroup cols="1"><tbody><row><entry
1866 align="char">
1867<para>This ioctl returns navigational information from the DVD stream. This is
1868 especially needed if an encoded stream has to be decoded by the hardware.</para>
1869</entry>
1870 </row></tbody></tgroup></informaltable>
1871<para>SYNOPSIS
1872</para>
1873<informaltable><tgroup cols="1"><tbody><row><entry
1874 align="char">
1875<para> int ioctl(fd, int request = VIDEO_GET_NAVI ,
1876 video_navi_pack_t &#x22C6;navipack)</para>
1877</entry>
1878 </row></tbody></tgroup></informaltable>
1879<para>PARAMETERS
1880</para>
1881<informaltable><tgroup cols="2"><tbody><row><entry
1882 align="char">
1883<para>int fd</para>
1884</entry><entry
1885 align="char">
1886<para>File descriptor returned by a previous call to open().</para>
1887</entry>
1888 </row><row><entry
1889 align="char">
1890<para>int request</para>
1891</entry><entry
1892 align="char">
1893<para>Equals VIDEO_GET_NAVI for this command.</para>
1894</entry>
1895 </row><row><entry
1896 align="char">
1897<para>video_navi_pack_t
1898 *navipack</para>
1899</entry><entry
1900 align="char">
1901<para>PCI or DSI pack (private stream 2) according to section
1902 ??.</para>
1903</entry>
1904 </row></tbody></tgroup></informaltable>
1905&return-value-dvb;
1906<informaltable><tgroup cols="2"><tbody><row><entry
1907 align="char">
1908<para>EFAULT</para>
1909</entry><entry
1910 align="char">
1911<para>driver is not able to return navigational information</para>
1912</entry>
1913 </row></tbody></tgroup></informaltable>
1914
1915</section><section id="VIDEO_SET_ATTRIBUTES"
1916role="subsection"><title>VIDEO_SET_ATTRIBUTES</title>
1917<para>DESCRIPTION
1918</para>
1919<informaltable><tgroup cols="1"><tbody><row><entry
1920 align="char">
1921<para>This ioctl is intended for DVD playback and allows you to set certain
1922 information about the stream. Some hardware may not need this information,
1923 but the call also tells the hardware to prepare for DVD playback.</para>
1924</entry>
1925 </row></tbody></tgroup></informaltable>
1926<para>SYNOPSIS
1927</para>
1928<informaltable><tgroup cols="1"><tbody><row><entry
1929 align="char">
1930<para> int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE
1931 ,video_attributes_t vattr)</para>
1932</entry>
1933 </row></tbody></tgroup></informaltable>
1934<para>PARAMETERS
1935</para>
1936<informaltable><tgroup cols="2"><tbody><row><entry
1937 align="char">
1938<para>int fd</para>
1939</entry><entry
1940 align="char">
1941<para>File descriptor returned by a previous call to open().</para>
1942</entry>
1943 </row><row><entry
1944 align="char">
1945<para>int request</para>
1946</entry><entry
1947 align="char">
1948<para>Equals VIDEO_SET_ATTRIBUTE for this command.</para>
1949</entry>
1950 </row><row><entry
1951 align="char">
1952<para>video_attributes_t
1953 vattr</para>
1954</entry><entry
1955 align="char">
1956<para>video attributes according to section ??.</para>
1957</entry>
1958 </row></tbody></tgroup></informaltable>
1959&return-value-dvb;
1960<informaltable><tgroup cols="2"><tbody><row><entry
1961 align="char">
1962<para>EINVAL</para>
1963</entry><entry
1964 align="char">
1965<para>input is not a valid attribute setting.</para>
1966</entry>
1967 </row></tbody></tgroup></informaltable>
1968 </section></section>
diff --git a/Documentation/DocBook/media/dvbstb.png.b64 b/Documentation/DocBook/media/dvbstb.png.b64
new file mode 100644
index 00000000000..e8b52fde3d1
--- /dev/null
+++ b/Documentation/DocBook/media/dvbstb.png.b64
@@ -0,0 +1,398 @@
1iVBORw0KGgoAAAANSUhEUgAAAzMAAAGaCAYAAAA7Jx25AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBI
2WXMAAA3XAAANiQFmEOuiAAAgAElEQVR42uzdd1RU18I28GdgKFZUBE0saFA0KoqFFkEhKhbAQmxJ
3bIkNNEpMEUwsMZarJMZrw4KxRExQczUqil0jRBA1GAjGQqLYC4TemdnfH76cj3HodYDntxaLmTll
4zuw57Zmz9z4yIYQAkYZzcnJCSkoKGjZsyMIgIiIiquPS09PRoEEDyBhmqCaQyWRo06YN3nvvPRYG
5ERERUR137Ngx/Pnnn5CzKKgmMDAwwKpVqxhmiIiIiAj29vZ4//33ocWiICIiIiKimohhhoiIiIiI
6GGaIiIiIiIgYZoiIiIiIiBhmiIiIiIiIYYaIiIiIiIhhhoiIiIiIiGGGiIiIiIgYZoiIiIiIiBhm
7iIiIiIiIGGaIiIiIiIgYZoiIiIiIiGGGiIiIiIiIYYaIiIiIiIhhhoiIiIiIGGaIiIiIiIgYZoiI
8iIiIiBhmiIiIiIiIYYaIiIiIiIhhhoiIiIiIqFLIWQRElSMsLAy2trZo1KgR5HJualTxEhIS8P33
93+PDDz+sM5+5bdu2ePDgAZo2bcoVgCplm3J0dMS5c+fqzGf++uuvsWTJEm5TVClSU1ORk5ODBw8e
10oHXr1gwzRDVJbm4uAGDRokUwMDBggVCFmzlzJrKysurUZ3727BksLCzg4eHBFYAq3IIFC5CQkFCn
11PnNGRgYAYNWqVVwBqMJFRUVh48aNUCqVlfYeDDNElWzGjBkMM1QpNm7cWOc+c8uWLTFjxgzMmDGD
12KwBVuLt37yIkJKTOfW5nZ2duU1SpYaYysc0MERERERHVSAwzRERERETEMENERERERMQwQ0RERERE
13xDBDREREREQMM0RERERERAwzREREREREDDNERERERMQwQ0RERERExDBDRERERETEMENERERERMQw
14Q0REREREDDNEREREREQMM0RERERERAwzRERERETEMENERERERMQwQ0RERERExDBDREREREQMM0RE
15RERERAwzREREREREDDNEREREREQMM0RERERExDBDRERERETEMENERERERMQwQ0REREREDDNERERE
16REQMM0RERERERAwzRERERETEMENERERERMQwQ0REREREVGnkLAKimunBgwdISkoq8/SGhoZ47bXX
17WJCV6NmzZwgMDMS5c+ewd+9eFgiVSVZWFkJCQnD16lU8evQICoUChoaG6NChA2xsbNCxY0fIZDI8
18efIEp06dwuTJk0s876CgIJiYmKBLly4saKq2Y5Wuri6aNm0KQ0NDaGnxd3ZimCGqE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VQvVdfsrOzsWrVKqxa
75tarWbDf516979+5h69atUkifOnVqpVyx0ARNmjSRrmoCQExMTIXOPyMjA35+flAoFCq/yL66nefZ
76sGED5s2bp3LSVlfcuHGjxpzkl/RYlNcrV3JyMg4fPiz9GOPo6CiFA01269Yt6XHv3r2rbd9flbS0
77tODn5wdzc3NkZGTg1KlTmDVrVoFX1mp7WTDMEFWDFy9eYPny5Rq3XD179sTGjRtLPV3+E8i8k/jC
78GBoaSo+rYoeaF7KEELh//36JbzJYHvl/Nc/MzKy271NPTw/ffvttodUHq4uZmVmZryzo6ekhKysL
79enp6sLS0hJOTE/r37w8bGxvo6uoiMDCw1u437OzscPDgQQAvu+KtSAEBAUhNTYWPj0+Rv8quWLEC
80T58+xYMHD3Do0CGVX3Prip49exZYFa86ffbZZ/jhhx9KddUzj46ODpRKJZRKJTp06IChQ4fCwcEB
81ffv2hbGxMRYsWIDExESNPp5GRUVJz11cXKpt31/V0tLSpOPvkSNHsG/fPowfP14jjoMMM0S12Llz
825zBgwABMnTq11nym5s2bQ0dHBzk5OYiOjoYQotB61/lv0PXGG29U+rLVr19fehwSElIlO3E9PT3p
838d9//11t34tMJkP9+vU1rm1Daerk6+vrIzMzUyW8ODo6Ftk2q7YaO3asFGbu3LmDqKgo6f5H5SGE
84wIYNGzBmzBjMnTu3yHHj4+Px1VdfAXh5E826GGby7jOiSfLvc4qjq6sLhUIBpVKJjh07YsiQIXBw
85cIC9vX2R1YQ11c6dO6WaDi4uLmjXrl217furUlZWFiZMmIClS5di48aNePToEebMmYMBAwao3YOq
86tpdFcXjTTKIKolQqsXz5cgwYMAAAMHz48Fp1cM+7sV5cXBxu3LhR6Lh59XVbtWqFjh07VvqymZqa
87SifPfn5+RVbvS01NxcyZM8v9nq1bt5YaTF64cIF3TS+FvPZcenp6sLOzwxdffIHg4GAkJycjODgY
88ixYtgp2dXZ0LMgDg5uamchLy3XffVch8L168iIiICEyfPr3YcWfOnCmt25cuXUJ4eDhXWg2nq6sL
89bW1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iIgYZog0z6pVq9CsWTO4uLhAW1tbel1XVxeTJ0/Ga6+9xkIiIiIiYpgh0izr
1321q1DQEAA/ve//+Hw4cNYvnw5tLS0IJPJkJ2dDS8vLxYSEREREcMMkWa5cOECPvvsM/j6+sLGxgYy
133mQze3t4IDAyEEAI2Njbo2LEjC4qIiIioGvE+M0SvuH//PsaOHYtp06Zh6tSpKsOGDh2KW7duISsr
134iwVFRERExDBDpDnS09Ph5uYGMzMzrFu3rsBxzMzMWFBEREREDDNEmsXDwwNPnz7F1atXeSNMIiIi
135IoYZopohr8H/r7/+ipYtW7JAiIiIiBhmiDRfXoP/LVu2wMbGhgVCREREVAOwNzOq84pq8E9ERERE
136DDNEGqkkDf6JiIiISDOxmhnVaWzwT0RERFQLwsz333+P77//Hg0aNGCpUIVTKBTIycnB//73Pxgb
137G2vEMrHBPxEREVEtCTMxMTEIDQ2Fl5cXS4UqXFRUFM6fP4/MzEyNWB42+CciIiKqRWEGAJydnbFq
1381SqWClVKmDl+/LhGLAsb/BMRERHVDuwAgOoUNvgnIiIiqj3YAQDVKWzwT0RERMQwQ1TjsME/ERER
139EcMMUY3DBv9EREREtQ/bzFCtxwb/RERERAwzRDUOG/wTERER1V6sZka1Ghv8ExERETHMENU4bPBP
140RERExDBDVOOwwT8RERFR7cc2M1TrsME/EREREcMMUY3DBv9EREREdQermVGtwgb/RERERAwzRDWO
141pjb4X716NQwMDPgFUYWLioqqc5/54cOHWL16NZKTk7kCUKXsr83Nzevc5z527BhWr17NFaAYycnJ
142uH//Ptq1a4eGDRuyQDTkOMUwQ7WCJjb4b9iwIUxMTHDixAloabFGJ1W8Nm3awMjIqE59ZkdHR9y/
143fx8HDhzgCkAVrl27dujZs2ed+sytWrVCmzZtuE29QqlUIi0tTeUvJycHMpkM+vr66NKlCwupBLKz
144s2FqalqptWUYZqjG09QG/xYWFrh37x6/IKIKdObMGRYCUQX66KOP8NFHH9XpMlAoFIiOjkZ4eDgu
145X76My5cv48aNGxBCoHPnznBycoKVlRVsbGwQFRWFhQsX4urVq1x5NATDDNVobPBPREREpfHo0SMp
146tFy+fBnXrhOJlUQAACAASURBVF1DamoqWrZsCWtra4wfPx42Njbo06cPGjdurDLtjRs3WIAMM0QV
147hw3+iYiIqDCpqam4evUqwsPDERYWhvDwcDx69Aj169dH7969YWVlhdmzZ8Pa2hpt27ZlgTHMEFUd
148TW3wT0RERFWvuOpi1tbWWLhwIWxsbNCtWzfI5TwNZpghqiaa2OCfiIiIqk55qosRwwxRtdHUBv9E
149RERUOVhdjBhmqFZgg38iIqLajdXFiGGGai02+CciIqpdWF2MGGaoTjhx4gT27dvHBv9EREQ1FKuL
150EcMM1Um5ubn48ccfsXXrVjb4JyIiqgFYXYwYZojwssF/eno63n77bTb4JyIi0lCsLkYMM0SvyGvw
151r6WlhUmTJrFAiIiINACrixHDDFEJeHh44NmzZ2jQoAEvPxMREVUDVhcjhhmiMli3bh0CAgLw66+/
152YsiQISwQIiKiKlCS6mLW1tawtLRkdTFimCEqyIULF/DZZ59hy5YtbPBPRERUSVhdjBhmiCrY/fv3
153MXbsWEybNo0N/omIiCoIq4sRw0wVCAoKgomJCbp06cJvpw7Ka/BvZmaGdevWsUCIiIjKiNXFiGGm
154iimVSsydOxc2NjbYs2cPv506KK/B/5UrV6Crq8sCISIiKgFWFyOGGQ1w8uRJxMTEIDY2FqtXr8br
155r7/Ob6gOyd/gv2XLliwQIiKiAigUCty4cUPlqgurixHDjAbYsGEDACAnJwe+vr5Yvnx5lb7/qVOn
1564OTkxLWiGrDBPxERUcFYXYyoBoSZO3fuICgoCNra2lAoFNiyZQu+/PJL1KtXr0re/8CBA9i7dy/D
157TDVgg38iIqKXWF2MqIaGGV9fX1hZWeHNN9/E7t27ER8fj71792LatGlVEqSmT58OBwcHrhFVjA3+
158iYiormJ1Mc329OlThISEYPTo0UWOFxMTg3/++Yc/iNflMJOamoqdO3di/fr1UpgBgP/+97+YOnUq
159ZDJZieclhFAbX6lUQktLq8Dxnz17BmdnZyQlJZV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Ztl69esHExASTJk2Cn58f280QEVG5sboYVaa8djPBwcEqr7O9
188jGaolt7MLl68iIiICEyfPr3YcWfOnAkdHR0AwKVLlxAeHl6ly2pqaio1mvfz8yuyfUtqaqpKL2zV
189ZeXKlYiIiICJiYlGBRkAcHZ2BgD88MMPePPNN3HixAluhUREVGLsXYyqWv52M3ny2ss4ODiwgOpi
190mFm9ejXMzMxKVMewZcuWGD16tPR87dq1ZXrPokJIXljJzs5WG9aoUSNYW1sDAIKDg7Fnz54C55Gb
191m4spU6aUqj1KWRr+l2TavN7h9PT01Ibl5ORU+0oXFRUF4GV7JGdnZ4wcORL//PMPt0YiIlKhUCgQ
192FRWF7du3Y/r06VKVngEDBmD37t1o0qQJFi5ciIiICCQlJeHixYv49ttvMWbMGFZnpgrl4OCA8+fP
193S8/DwsLYXqauhpkrV64gKCgIY8aMUbtnS2Hee+896fGBAwfw999/F7jDK0reSXxBISCvy+fbt29L
194w7Ozs/H48WMAgKenpzTutGnTsH79emRlZUmv3blzBy4uLsjOzoabm1uFLFN5ps3rpezOnTv4888/
195pdczMzOxe/dulV8VyhuqyqJbt2745JNPYGBgAF1dXcTExKBbt2746quvpGUiIiLNdP36ddy5c6dS
1965v3o0SMcPHgQXl5ecHBwQJMmTdC9e3csWrQIL168wPjx43Hy5EkkJCQgOjoaO3bsgLu7OywsLNju
197hSpV3v1m0tPTAbysYtajRw+2l6lrYSYzMxOzZs0CgFLtdPLfUFOhUGDevHlq3QrnDzjPnz9XGSaE
198kE7qk5KSkJycrDLc1tZWmsf8+fNx8OBBvPPOO/j3338BAOPGjcO4ceOkEOHp6YnmzZujR48eMDU1
199hZmZGZKSkuDv768S0MqzTOWZNu/qkBACgwYNwsKFCzF79mz06NEDXbt2lcZbtWoVlixZgh9++KHK
200V7wlS5ZAX18fPXr0wN27dzFr1ixs3rwZXbp0waFDh7hlEhFpmN9//x0jR45Er169EBAQUO75sboY
2011SR57WZu3rwphRlWMdMQ4v94e3sLZ2dnUVn2798vOnfuLAAIAEIul4tRo0aJ48ePFzrNX3/9JSZP
202nizatWsnTZf317t3b/HLL7+I0NBQMX78eJVhXbp0EV9++aUQQoiTJ08KJycnleE9e/YU27Ztk94n
203NjZWtG7dWhr++uuvi/Pnz6ssS05OjliyZIlo1KiRyrwMDAzEwoULRUZGhjRueZapIj5PUlKScHBw
204UBnH2dlZxMTECIVCIczNzaXXR40aJdLT00Vli4yMFABEbGys9NquXbuEvr6+mDx5sqhfv744dOiQ
205mDt3rpDL5WLIkCHi1q1b0rgGBgZi7969goiIqtaVK1eEq6urkMlkwsnJSYSEhJR6Hrm5uSIyMlL4
206+fmJadOmCXNzc6GtrS20tLREly5dxAcffCA2b94sIiIiRE5ODgudNFK/fv3EsGHDRJs2bYSenp44
207cuQIC6UaBQYGCgMDAyET/1fHaMGCBYiKikJgYGCdDHVpaWkICwuDnp4eLC0tC2xvArysmnX9+nUk
208JCTAyMgI3bt3L3Tcag6piIyMxJMnT/Dmm2/CxMREGpaSkoLQ0FA0b94cPXv2LHF1v/KIiopC9+7d
209ERsbK9VjFkLA3t4eTZo0QYcOHeDn54fDhw+jRYsWmDNnDkJDQ/HJJ5/gyy+/ROvWreHr66tS5ZCI
210iCpPeHg4vv76axw7dgxDhgzB4sWLpZoMxSmudzErKyv2LkY1zpIlS+Dv74/U1FTEx8cjLi6O1cyq
2110bFjx/D++++DFUz/T4MGDTBgwIBix6tXr16Jd+bVSSaToUePHujRo4fasEaNGlXrjTPzL+PGjRvR
212p08f/PLLLwCAESNG4PDhwzh//jwCAgLw6aefwt/fXyM6LiAiqgvCwsLw9ddfIygoCMOGDUNYWJjU
213EU5BeDNKqivy7jfToEEDtpfRIAwzVK0sLCwwY8YMzJs3D5GRkSqB5t1334Wrqyu+/vprfPPNN1i+
214fLlaux8iIqoYv/32G77++mucPn0azs7OCA8Ph6Wlpco4vBkl1WXW1taQy+VISUlhexmGGaL/b9my
215Zfj555/x7bffSl1v5wWagQMHwsfHB1u2bIFcLoeFhQXmzJmDxYsX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S9OABx8+bNYudjampaaJgRQggTE5NCw8yiRYsK3XYeP34s
272GjRooHZClpqaKjIzM8Xu3buLPOFTKpVi7NixAkCB301KSoro3LmzACA6deokUlJSGGYYZsrswYMH
273UrAHIMLCwtTGuXLligAg/P39C5xHSdftsm47Qry8fUGfPn3EqFGjhFKpVBm2f/9+6X29vb1r5bZU
274lWGG1cyIWOWsSD179sS1a9fUuq3cs2cPOnfujG3btpWqHr2bmxtsbW1V/vr37w93d3fcu3evwGni
2754uJUnjds2JArHdUYGzduhIuLC9q1aye9pqenh5kzZ6pU4yyOXC4v0/C//voLK1euhKGhYYG9Or32
2762msYMGCA2usNGjSAnp4e7O3ti3zfoKAg7N+/H02bNsXUqVPVhjds2BA+Pj4AgFu3buE///kPVwoq
277s9atW2PcuHHS8++++05tnK1bt6Jp06Z45513CpxHSdftsm47ALBz505cvXoVc+bMUesEZ/jw4dKt
278DrZu3Yrc3FxuS+XAMENUSYHm6tWrteaztW3bFmfOnMG+ffvwxhtvSK+npqZi5syZRd4X5lU3b95E
279RkaG9Jeeno6kpCRcvXoVffv2LdE8imr0SaRJYmNjcfjwYZVG/3lmzpwpddO8a9cuJCQkVMoyrFu3
280DgqFAgMHDoSurm6B4zRq1KjQ6V+9h9Or8u6XY2VlVej8hw0bBmNjY7WTN6Ky+OSTT6THP//8M2Jj
281Y6XnycnJ+OmnnzBx4kSVe6OVZd0uz7bj5+cH4GX30Bs3blT58/PzQ7NmzQAACQkJuHHjBrclhhki
282zQs0RfX+VVM/29ixY3Hjxg0sXbpU5VfgPXv2YPLkySW6QqOnpwd9fX3pr169emjcuDF69+6NzZs3
283FzhN06ZNVZ6/eqWGSFNt2bIFb7zxhkpnGnlatWoFNzc3AC9v6Lp9+/YKf38hhNRIunPnzhU+f6VS
284iQsXLgAAmjdvXuh42tra6N+/P4CXXVJHR0dz5aAy69WrFxwcHKR1MP+VzZI0/K/sbSc5ORnXrl2D
285trY2njx5gpiYGLW/MWPGwNPTE56entDS0uK2VA5ybhJElRNoHj9+XKKeTmoaPT09LF68GEOGDMGI
286ESPw9OlTAMBPP/2EUaNGYcyYMWWed7du3dCqVSu115s0aQJjY2M8f/4cABATE8MVjTReRkYG/Pz8
287oFAoCr1LeHx8vPR4w4YNmDdvXrHVyUrjxYsX0jZa1NWXsoqPj5duXljcL8SdOnWSHj98+BA9evTg
288SkJl9umnn0on/35+fliyZAkaNWqErVu3wtbWFt26dau2befu3btSN8xr1qyRrsAW937clhhmiDQq
2890MyZM6dGh5nU1FQ0aNCg0BteWllZITg4GLa2ttKVEl9f33KFGZlMht9++63AYXZ2djh48CAAIDQ0
290lCsZDE9QJwAAGAdJREFUabyAgACkpqbCx8enyLuEr1ixAk+fPsWDBw9w6NChcm1Dr8p/FTMzM7PC
291P2P+Kp95J36FMTQ0lB6X5OSOqCjDhg1Dp06dcOvWLaSkpGD79u2wt7fH9evXK6Qb/vJsO3mhRAiB
292+/fvl+gGz9yWGGaINDLQ1GTu7u6YNWsW3nrrrULH6dChA3x8fPDhhx8CAP74448KXYaHDx/CyMgI
293enp6GDt2rBRm7ty5g6ioKJibm3NFI40khMCGDRswZswYzJ07t8hx4+Pj8dVXXwF4eRPNigwz+W8W
294+Pfff1f452zevDl0dHSQk5OD6OhoCCEK3fflv/Ff/rZ3RGWhpaWFTz75ROpIY926dYiMjETjxo0r
295ZBsqz7ZTv3596XFISEiJwgy3pXKsC9wciKiwoLJ8+fJix8t/o8yS3GW5pJKSkmBpaSldbndzc1M5
296IBTUgw2Rprh48SIiIiJKVG9/5syZUkPkS5cuITw8vMwB6lWtW7eW5n3hwoVS9TxYEnK5XLoBaFxc
297nNSQuSBPnjwB8LKtUMeOHbmSULlNnDhRal9y//597N69GxMmTECDBg3KPe/ybDumpqZSEPHz8yty
2982ryOdLgtMcwQUSWEmaCgoCLvsAy8bBeQx8bGpsQnWcVZtGgROnfuLB2UdHR0sGnTJmn4rl27cPr0
2996RLPLzExEa6urnj27Bm/XKp0q1evhpmZWbFdvwJAy5YtMXr0a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ha6fHFxcWLJkiXScgAQMplMGBoa
314imbNmgkAok2bNmLRokUiLi6uVm4X5ubmwtfXt07tC9q2bauxn3n//v2ic+fO0vool8vFqFGjxPHj
315xwud5q+//hKTJ08W7dq1U9sGevfuLX755ReVbXLp0qVCLpdL4zRr1kxs27ZNCCGEs7OzaN++vfD2
3169hahoaEq249CoRDffPONaNq0qcp7mJiYiHPnzon33/9/7d1/dNV1/cDxF9vdxgZzTn4VET/q2DIC
317A9EgEaxOBxI9kOmRUA6dOqEQET+UMDrQOXKC6mQHS4qAlHM8mgdPHTMMzBN4GHFU1CUJyVkonFJ+
318jDMYsrGN7dMfftnXxa8pG9y7PR5/7W73fnbv+3Mv7LnPfX12e9KtW7dk2rRpyebNm5OGhoZk06ZN
319yYwZM5Lu3bs3e41NnDgxeeyxx055LEeOHElmz56dFBYWJr17906mTp2afOMb30j69euX3HXXXRnx
320Opw/f34ycuTIDvWamj9/fjJu3LiMfgw7duxICgsLk6qqqhZd//08tz/Ia+ek+vr6ZNGiRUlhYeEp
321/7/94Ac/SGpqak57/9rDa+mkV199NYmIZM+ePa2+7T/96U9JUVFR0ilp7WlAaAOXXnppLF++vNlb
322MdJdaWlpXHfddXH48OGm39xkmqeffjpuuOGGk7/4iF27dkVZWVkcOnQo8vPzY9CgQTF06NCznnb2
323AvxCJnbt2hX/+Mc/oqKiIhobG6Nnz54xcODAKCkpadfvJx48eHBMmzat6TeHHUG/fv1i/vz5Heox
324/6+DBw9GWVlZ5Ofnx7Bhw5r+yvnu3bujf//+Z3091tbWRllZWVRUVETPnj1jyJAhkUqlory8PPr1
32563fOv4jeErW1tfH3v/89Kioqori4OK688spmZ3dKZ/fee2+UlpbG5s2bO8zz6d57743t27e36C27
3266ezll1+OoUOHttn2z+e1U1NTE2VlZVFZWRk9evSIwYMHt+iEOZn8Wjpp+/btMXjw4NizZ0/07du3
327Vbe9bt26uP32252aGTizkyET8e6ppktKSpr9sa50kK73C9pKjx49Tpkni2jZKVrz8vKaBpPf6+Tb
328SltDXl5eXHPNNXYUF1Rbhsz5vnby8/ObnfnTa6l1mZkBAADEDAAAgJgBAAAQMwAAgJgBAAAQMwAA
329AGIGAAAQMwAAAGIGAABAzAAAAIgZAABAzAAAAIgZAAAAMQMAAIgZAAAAMQMAACBmAAAAMQMAACBm
330AAAAxAwAAICYAQAAxAwAAICYAQAAEDMAAICYAQAAEDMAAABiBgAAEDMAAABiBgAAQMwAAACIGQAA
331QMwAAACIGQAAADEDAACIGQAAgDSTsgTQttauXRtFRUUWgla3ffv2DveYKyoqYu3atdG9e/cO85gb
332Ghri+PHj0aVLF096/163iXXr1sXatWs9AVqguro68vPzo1OnThYjTf6fEjPQVi+u1Lsvr9mzZ0dO
333To4FoU3k5eV1qMdbVFQUGzdujLKysg7zmOvq6qK6ujry8vKic+fOfohqQ5WVlTF69OgO9Zjz8/Mj
334IuLOO+/0BDiH2traqKmpiYKCgsjNzbUgLXDkyJGIiMjKars3g4kZaCPDhw+PJEksBLSit956q8M9
3355rq6uli1alUsXbo0qqqqYubMmTFr1qwoLi72hOC8LVy4MBYuXGghzmL9+vUxd+7c2Lt3b9x3330x
336Z86cpgjk4jMzAwBpLDc3N6ZPnx7l5eXxox/9KB566KEYMGBALFq0KCorKy0QtJHy8vIYP358jBs3
337LoYPHx67du2KBQsWCBkxAwCIGkhPhw8fjrvvvjsGDhwYVVVVsW3btli9enV8+MMftjhiBgAQNZB+
338Tpw4EcuXL4/LL7881q5dG2vWrImNGzfGkCFDLI6YAQBEDaSn9evXx5VXXhnf+973YtasWfHPf/4z
339Jk6caGHEDAAgaiA9mYsRMwCAqIGMYi5GzAAAogYyirkYMQMAiBrIOOZixAwAIGogo5iLETMAQDuN
340moULF4oa2iVzMWIGAGjnUfPwww+LGtoVczFiBgAQNZBxzMWIGQBA1IgaMkp5eXlMmDDBXIyYAQBE
341jaghM7x3LubIkSPmYsQMACBqRA3pzVwMYgYAEDVkHHMxiBkAQNSQUczFIGYAAFFDRjEXg5gBAFo9
342apYsW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0NDR9Pjc3NyZNmhRXX321uRjEDACAqPn/qLnzzjtj0KBBp7wNLTc3NwYMGBDPPPNM9O3bt03v
35715YtW2LMmDFx/PjxZiHzXgUFBfH973/fXAxiBgBA1LwbNQcPHoz6+vrTRkROTk5ccsklsWHDhrjq
358qqva5L5s2rQpvvzlL0ddXV00Njae9jpZWVkxZMiQ2LZtm52HmAEAIKKysjL69OkT1dXVZ7xOdnZ2
359pFKpePzxx1v9TGcbNmyI8ePHR319/RlD5r1B87vf/S5uvfVWO452y9nMAABaaNWqVU1zMmfS0NAQ
360dXV1cfPNN8eyZcta7Xs/9dRTceONN571iMx7JUkS3/3ud+P48eN2HGIGAKAjO3bsWCxZsuScMXMy
361JBobG2POnDnx7W9/+4xzLS31xBNPxM033xwnTpyIlr6pJkmSePvtty/6qaNBzAAAXGTLli2Lo0eP
362vq/bNDY2xsqVK+Omm26Kd9555wN930ceeSRuu+229xVEeXl50alTp4iIeO2118JUAe2VmRkAgHOo
363qamJgoKCiHj3rGV1dXXv6/a5ubnxiU98IjZs2BC9e/du8e1Wr14dU6dObdF8TCqVirq6uhgwYEBM
364mDAhxo4dG6NGjYrOnTvbgYgZAICObN++fbF169bYunVrPPfcc1FWVhZ1dXWRl5fXooH8nJycKC4u
365jmeffTYGDRp0zu/34IMPxne+850zHlXJy8uLurq6yM3NjS9+8Ytx0003xdixY6N///52FmIGAIAz
366q6+vj5dffjmef/75+Nvf/habNm2K/fv3RyqViuzs7KitrT3lNllZWZGXlxe///3vY+zYsWfc9s9+
3679rOYN29es0By9AXEDABAm/nPf/4TL7zwQmzZsiU2bdoUr776atTX10fnzp2jtra22VGWX/3qV3HX
368XXedso377rsvFi5cGBHvnua5sbHR0RcQMwAAF1ZdXV288sorsXXr1ti8eXOUlpbGgQMHmr7+pS99
369KdavXx9ZWe+ek2natGnx61//OiIi+vfvH1/5ylccfQExAwBcKPv27Ys//vGPFuIMDh8+HP/617/i
3706aefjoaGhujbt2/ccccdsX79+vj3v/8dH/rQh2L06NHRrVs3i3UWI0eOjE996lMWQsyIGQCg9ZSW
371lsZ1110XvXr1ii5duliQczj5N2mysrKaTqfM2e3evTuWL18e06ZNsxgdXMoSAABt4fXXX4+ioiIL
372QasbPHiwRSAi/NFMAABAzAAAAIgZAAAAMQMAAIgZAAAAMQMAACBmAAAAMQMAACBmAAAAxAwAAICY
373AQAAxAwAAICYAQAAEDMAAICYAQAAEDMAAABiBgAAEDMAAABiBgAAQMwAAACIGQAAQMwAAACIGQAA
374ADEDAACIGQAAADEDAAAgZgAAADEDAAAgZgAAAMQMAACAmAEAANqBlCUAADh/VVVVsXfv3vP7wSyV
375ik9+8pOxf//+OHjw4BmvV1xcHB/5yEdO+XySJPHaa6+d9jYDBgyILl262FGIGQAAmvvLX/4St9xy
376y3lto2fPnrF///7YvXt3rFy5Mh5++OFIkqTp6yUlJTFx4sQYNWrUGWPmz3/+c2zZsiWefPLJiIgo
377KiqK6dOnx4wZM8QMYgYAgFPV1NRERETv3r1jwYIF8dnPfjYuu+yySKVSUVpaGpMmTYqIiI997GPx
3783HPPRZIkcfz48XjrrbfiySefjGXLljVtY8SIETFixIi44oorYt68eU3f44c//GFMnDjxjPchKysr
3797rnnnrjnnnti4MCBsWPHjnj88cdjzJgxdhBiBgCA06uuro6cnJz461//GiUlJc2+1qNHj6aPc3Jy
380ok+fPk2XL7/88hg9enRceumlsXjx4ma3mz17djz00EOxc+fOiIgoLS09a8yclCRJVFRUxMiRI4UM
3817ZoTAAAAtIKampoYP378KSHTUjNmzIjGxsZoaGho+lwqlYqFCxc2XX7kkUfi2LFj59zWCy+8EAcO
382HIgZM2bYMYgZAADOHTPjxo37wLe/7LLLYtiwYXH8+PFmn7/llluiX79+ERFx5MiR+O1vf3vOba1e
383vTq6d+8eEyZMsGMQMwAAnN28efNiypQp57WNLVu2REFBQbPPpVKpmDVrVtPln//8582O3vyvo0eP
384xqOPPhpTpkyJvLw8OwYxAwDAOX6oysqKTp06ndc2srOzT7uNb37zm1FUVBQREW+88UbTmcpO59FH
385H41jx47Ft771LTsFMQMAwMVVWFgYU6dObbp8//33n/Z6SZLEihUrYtSoUR94dgfEDAAArWrmzJmR
386Sr17ItotW7bE888/f8p1XnrppXjllVeahQ+IGQAALqo+ffrEbbfd1nT5dEdnVqxYEcXFxfHVr37V
387giFmAABIH3PmzGn6+Iknnog9e/Y0Xa6qqorHHnssJk+eHJ07d7ZYiBkAANLH0KFD4/rrr4+IiMbG
388xnjggQeavmbwHzEDAEBamzt3btPHK1eujKqqqqbB/xEjRsSnP/1pi4SYAQAg/dxwww1NZyo7evRo
389rFq1KrZt2xZlZWUG/xEzAACk8Q9vWVnNZmeWLVsWDz74YFxyySVx6623WiDEDAAA6Wvy5MnRvXv3
390iIjYu3dvrFmzJu64447o0qWLxUHMAADQehobG1t1e/n5+TF9+vRmnzP4j5gBAKDVvfPOO00f19TU
391tMo2p0+fHnl5eRERMWzYsPjMZz5joREzAAC0rmeeeabp471798aOHTvOe5u9evWKyZMnR0QY/EfM
392AADQeg4dOhRTpkyJIUOGxIoVK5p97eqrr44bb7wxfvKTn5zX95gzZ04UFhbGxIkTLTgdUsoSAAC0
393vm7dusWaNWva9HtcccUVsWnTpigsLLTgdEiOzAAAZLChQ4daBMQMAACAmAEAABAzAAAAYgYAABAz
394AAAAYgYAAEDMAAAAYgYAAEDMAAAAiBkAAEDMAAAAiBkAAAAxAwAAIGYAAAAxAwAAIGYAAADEDAAA
395IGYAAADEDAAAgJgBAADEjCUAAADEDAAAgJgBAAAQMwAAgJgBAAAQMwAAAGIGAAAQMwAAAGIGAABA
396zAAAAIgZAABAzAAAAIgZAAAAMQMAAIgZAACA9JCyBABAW+jVq1cUFBRYCFpdZWWlRSAiIjolSZJY
397BgCgtVRUVMTGjRstBG1q6NCh8fGPf9xCiBkxAwAAZB4zMwAAQEZKvb79xaYLJYOutiIAAEBGcGQG
398AADISP8FpxZnWS0U37cAAAAASUVORK5CYII=
diff --git a/Documentation/DocBook/media/fieldseq_bt.gif.b64 b/Documentation/DocBook/media/fieldseq_bt.gif.b64
new file mode 100644
index 00000000000..b5b557b8815
--- /dev/null
+++ b/Documentation/DocBook/media/fieldseq_bt.gif.b64
@@ -0,0 +1,447 @@
1R0lGODlhcwKfAucAAAAAAElJDK+vr0gSElYMDC8kDV5bEBcHOwYGSEQODmEaGgoKOBkTVC0tVyAg
2aDcJC6Ojoys8DAAYGqSkxV9fFFtdEJmZmUA4EF0wMAAAcAoTHTZHJ0gYGAcMTwcSO29ISFUHB2AV
3FXd3YAcHMRUVQiIAGg4HT3t7eywOJ3d3dwcHSEEgABMuDnd3OGpkSQAAYlZGBzEEBGJlDCstCxwc
4WQcHSzkRGWBtYC0AACA3ABAKNhAQTTMwDA0VQD4AAEYVFVVVVSQMJQULOB8fQScnYBgYRD5VPmZm
5DEZRB2ZiDAoKSgAAVAwQOH5+lBwcS+7u7hoaST4+X3d3WACPADMzMyBRIDgAAGBgc0JCEHEAAEwN
6DRkwDAoKOR8kPZR7eyA1IABpABgNQBA9EABVAAsLRww/DAwMPgBNAENDCgc9B8zMzAUFQQBDAD4M
7DAwOKgAAcQA5AEtLFYqKAA0NTC8HBxEREQgfCAArAAApACIqMkkGBhoqKnwAAAsGQ6qqqkoKCg4O
8MlkcHAoZJCcrW6SkpFQAAAAAOBAOSwAVGh0ROgMPHWZmB00QEGUAAFQaGjEyC2w4OLe3n4qKioiI
9iBAVMC4uXhkZUGIAAHJYWHd3AAAAPhAQUQUGL0BAIGggIBgAGkIVFV9fEAwcJR8KJA8MU9EAAAcH
10VRoaYWhoaDcAALu7AGZmZnAAAGRkZGQVFVhqWD4KCgwOUzMzDAAAmgklBzEHBzExClhYWBMTPAYJ
11Qy8fCFpaB///////ACISRExUDUQrDAwMVhISSEYYGHd3IDhcOERERElJAAkPNTsHF1hYckgGBj05
12CFYAADg4OCAVO0hCDDAwMLu7ilpaDR8qCDg+EBxGHN3d3REGNjo9CDQ8DBwYRGZmHFMAABQ+FBE+
13ESIiIhs+BxU0FWVeBw04DY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bX
138GIK318VudrW72xFg1VV7TW14q6pZnZrTs6FFb3oTO93BPlW875XqavOKKvDC175gzSlnSUVY9fbX
139v0tlb2cbe18Cv1S+lBWIZQu8YHeQV7/WPO9/JRza0b5TnO5lMIMPnFWtEWEWHwZxiEU8YhKX2MQn
140RnGKVfzhDAgAuKoqTShUMWP+GtfYxjfGcY51vGMe99jHMw5FgPf7miWs2MhHRnKSVbwJ77bqNw14
141Q5SlPGUqV9nKV8ZylrW8ZS5HmR4uDmxwBRIHOZTZzGdGc5rVvGY2t9nNb4ZzmeMgZAiHRhNdxnOe
1429bxnLpOgyayqb4YJ7GAx88KsE0b0YSv81oRiWNAE3vB3UfroAhMaxhFOdKbTuuhCn5bS8I20kyf9
143aftamqOY1nSq2UpneDqa1OINNaC15oQa1NrWt8Z1rnW9a1732te/BnatVfDbMF86NGjYRbKVvWxm
144N9vZz4Z2tKU9bWonGw2svnBo1hBsbnfb298G9gL+vKpAvzq1pnZqaA6tanb+F5XTxq6Ip82N2liT
145e9TzPnd+C73udvcbqO8+9YDxTe9xS/PeA78suqmrbn83/N/YxqarEf7Yehu8shPHrMLby3CHOxzg
1466Y43xi9bcb3OGtwnR3nKfT3sFwe8IsiudsxlPnOaT/vabi30tlW+c56fXNx4RTAvFCzyvmpcwBXh
147d8fZ/fGFh5zojiU5fQ/+9MzqG94CSbrSU830jTud6nyNujen/vWvGn3IHNd6u7l+dIHIm+yqLXjJ
148KwJlPtfd7nfP8pdbDvIxx9nvfwd84OE8Z5xfnRd3xnviFV93PwOdwxXxsJIlP3nKn7jFe2+6QGT8
149Y8533vOf73GQC+9ygRT+ufKnR73kmex4SV/87XQ1e52RnvZ+r/3sXn893Fkvatfn3quxbzXaab91
150iMMV976vatjVOXbkSxX42Z798FVte9m3vfldVb49KzKEYHTf+98Hf/jFP37yl9/850d/95VA7M0W
151WhZHgH/85T9/+tff/vfHf/71v3/4y6L4jQ6NEUi/ASTAAjRA9HODuJO63ru+qXq+iBM+6Us06gu+
15242tAm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MRqjfeAEm5KiO7iiP9qiP/iiQBqmQ
262DimR6mjIVWh+hOgNvAKTNqmTPimURqmUTimVVqmVXimT3sCRJqiuXUORfimYhqmYFqkXyM+JAoiE
263ekIprCmbtqmbvimcxqmczimd1qmdruklbCmBhGgVTIGf/imgBqqgDiqhFqqhHiqiJqqfVoGeDkjR
2643QM+3KmkTiqlVqqdeoKZ5qffqKmldqqnfuqc5qn3ICl+8KminiqqpqqqJiqjjiqXQk+kgqqszmqn
265YqrvnOl/pCmt7iqv1qmo5hqp3oepriqxFquxGmqrAuv+q9pGrPaqsz5rKdjqmOCqf+gqtF7rrv5q
266jP7HsB6rt37rqibrtvrHozYrtp6rp0prjQaIhNpAMrwrvMarvM4rvdarvd4rvuarvr7rAzQqiKrc
267FoSDwA4swRaswR4swiaswi4swzaswG6BvwZI0RHCvlasxV4sxu6rDWRqgkioA7gDyIasyI4syZas
268yZ4syqasyq4syL5AxAJIiBJDL8wszdaszd4szuaszu4sz/asz84sMbwsjeraPcwCyx4t0iat0q6s
269A3Asgnjs0kat1E5tyrqsq+6pysnsz24t13at1/Zs0F6toxKt0VKt2Z5t1DbtrWrqQHws2r4t3Fat
2700Pr+R8x+rd3eLd7ybNgqq4aSbdz+LeCGrNpOK9sKhNsGLuKirdXyrYjymdbmLeRG7tfu7biiqN8m
271LuZS7eCuK5r6DQqUAOiGruiOLumWrumeLuqmruquLuh+wtySqMrRAhvMLu3Wru3eLu7mru7uLu/2
272ru/OLi28Ln8UHQSwrvEeL/ImL+uigNMeiLWiK/RWqra+aICqXJ+CK/Zm76GKK/XqR7lGL/hOqrpS
273a388b/ier5xOb7DaR7dqr/u+L/eub318L/rWL5yOb+HyAqfaL//iqfBWL59d7/sOcPbG77IGirn2
274b/3ib8d6rvI+MARHcOq6rtj+K59RQw5ksAZvMAf+d7AHfzAIh7AIjzAJZzA1/K/36lrxSjALtzAE
275M+/aNnDbZi4NR+3iVi6MZq3k7jAPgy0K58ejlm0NDzHLbi758gfUErESy20Fu6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vwoMhZ1XrmG1fy5fjDqUbmfPZvAId
304ZRE9mnRp06dRp1a9mnVr0T6qBu48u2VhcWdw59a9m3dv37+BBxc+HLe42LSRs5wsoJtr58+hR2/t
305SHNy6y0/8zo1i3t379/Bhxc/nnx58+e5Lzl+nX3DwhVUxZc/n359+/fx59e/n3/+/Arr2wsQoeUy
306QM/AAxFM8LxTqhPQQYWyc8CdCSms0MILMcxQww057NDDCV8A8MH2CiOmlxNRTFHFFVls0cUXYYxR
307xhOJEXHE6ya7Z5YPeezRxx89dKDBGx+MEMgjkUySwxABI5LEsngxccYpqazSyhhrbNJJHDfTUckv
308wURSyLm2dNDIMNFMc0kby+ysxCvhjFNOGLN0DMo2Z8txRzX57HPCMXmZDE/rsjvkhUMRTVTRRRlt
3091NFHIY1U0kMNYXPQwQrLJpNNOe3U009BDVXUUUkt1dRNs7H00rsmg2CJSWGNVdZZJT1kyFVpy64p
310zHjtlaa/7JQNV8EKO2yxY5H+Dauxx4ZltcvKfI2WL7kC3axZznSVVtu9gGX2WrSKTVbccUVa9s5v
3110coR2m3ZfYpaQdEVLNt26XWq23PjzSpccvnttyRV8z1K3XoJ9uldawOua96CGcbpXmETRmpffylO
3121lyIIzZq4IY5rungjO3K7pkwSC7Z5JNRTlnllVlu2eWXSdYBYJBXKqyaX3DOWeedee7Z55+BDlro
313oXGuZmaaU5qMEJiZbtrpp2F+5lakrzrTz6vDZDJYqo96c86vwYazTm+5TqvLPbFOO0lA4S27KKvV
314jttHrcl2OyKvw85b7xfHxtfuiPSUW/Ae2Ub4b5bgHlzxDOn2+3CH8N5b8sn++8b48YYCX1xzDAu/
315PKmlBJJw89EpbNxyzxWKfPLVw64cdcDPJl32zl9XKbsmlMld9915793334EPXvjhidf96NoLE0GK
3165Zlv3vnnoY9e+umpr9765UU4/vXJrine++/BD7/4Jqau/aHszF+o7vS3Zl99x9lv230y53cI/frb
317x19L/fPXX/75/6e/+9VvfekroPkOWLsAxs9w/OMFAMBhDAlOkIIVtOAFMZh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yt5l5bUYNPbr06aZVI6e8PDvP17GLe/8+PDev3drL8/zNKzj49eyNrzYPH2Tz59Tr278/
4012jrs5PH7b+QuW3sCDkiYeOT5h2BG6O1gSoMOPghhhBJOSGGFFl6IYYMIvJdgh83Vs0uIIo5IYokm
402nohiiiquyGKI9XDYIYKvEZJhjTbeiGOGO/AVY48WoacegUKCd9x+2PkI33z4Lcmkffo1hyR8AA5J
403pXcG9hVlgkBWyaVwRUKZpXZKNklmmaU9yV+Y2k3ZZZuzXakmglu6Sad718VZ3phm7slnL2geiSdv
404bNZJKGJwBgrfnIUuGhn+jIi2pmefkjL556PKDcpooYdamh16wuQIaqiiWsiJo5xW1pwsi6zKaquu
405vgprrLLOSmuttq4qi6mn/vUaBAiMCmywoQrD467KKZopoV+maexfkU4KbX2VNlsZpsnSuSm1lyF7
406rZvLAqotVs9GSy5004YLl7Xddpktun9xuy6X37oL17jl3kvaufRepW68VLa7r1vonZJXwQYfzFRU
407dwZ8VXNxyAFxxBJPTHHFFl+MccYabwxxHLoynNNrAtCFcMkmF3xKsSALDFRElrwBc8wyz0xzzTbf
408jHPOOu8MsyYfrywffxSkRXTRRh+NFgU/Ay0SlgLQw3PUUk9N9c6WqMz+dGAtp+evt0tnvZG9+I79
409mb5gg9Rv1wQCfDZO8KpN4LxtZ8UffWTfXfbXc6vcHdxVsr23R2/73Z7cgXckNt5jm314RmkTvh7g
410jfu0dRFmXI555ppvznnnnn8OeuiiX86O3oE390gAqq/Oeuuuvw577LLPTnvtqj9i+t69cjF6777/
411DrzoRWA9eUeDQ05k7nMnrvi9jBevG5Z9Iz+g5ND/uHWQ1BeufNvMN0/u89A/vj1x1l/Py/HlD2c4
412+gs7B37z4hdP/vq3nX+9+vbb1r7738c/qflNrn77ow3+oIceEsxhgQxsoAMfCMEISnCCFKygBRdo
413j+6drTlYmIYHPwj+whCKcIQkLKEJT4jCFHoQCxoE24wuCMMYynCGFyQB8dx3Ef0VcDb9Q9//ANgn
414ATaOgDvEzQ1xGB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ng2
442KCaLaqWK3vN8rchhrxhLcjiHdah7aHiLaJWLG7SLvJhkm4gkYyiLwph8xFiMTChd7ZaMyshlzOgj
443zhiMtAg26PEBkCCO40iO5WiO54iO6aiO68iO7SiOGKCNPdIcRlAM9WiP94iP+aiP+8iP/eiP/wiQ
4449WgE8Rgjr6EG7oiQCamQC+mOH+CNWYMe1nhlfzeTkc5XkVOYUOGFcJlmY1HHkRcZhxlpYon3kSWZ
445ah1JfCIZZeljDCngki8JkzEpkzNJkzVpkzeJkzlpk6uAkn+3CjoJlEEplENJlC7JkyAZR0WplEvJ
446lEFpDCMpXgAglVNJlVVplVeJlVmplVvJlV3ZlUiZUl4plmNJlmVpllUJlr90lmvJlm1plisJl3Ep
447l3O5NwEBADs=
diff --git a/Documentation/DocBook/media/fieldseq_tb.gif.b64 b/Documentation/DocBook/media/fieldseq_tb.gif.b64
new file mode 100644
index 00000000000..7b4c1766b40
--- /dev/null
+++ b/Documentation/DocBook/media/fieldseq_tb.gif.b64
@@ -0,0 +1,445 @@
1R0lGODlhdQKaAucAAAAAAElJDK+vr1YMDBUVZC8kDQAAVkYQEBcHOwYGSCEJHSAgaKOjoys8DDMz
2CgAYGp+fn19fFJmZmQoKO10wMA0VIAAAcDsICCsMDAcMT1MMD2ZmAAcSO29ISFUHByIAGoiIAA4H
3T0pKDJaFhXd3d0EgABoaVGYyAC4AKXd3ODs7BwAAN1MAKQAAYlZGB2JlDBwcWWBtYCA3ABAQTQAA
4ZQ0VQD4AAFVVVUhjSCQMJQAAfBMHMkQgIEtLSzAyDD5VPmZmDEZRB2FhEWZiDFo2ETkdCwAAVEUt
5Gu7u7js7Ozc3N3d3WACPADU1NTMzMyBRIDgAAEJCEHEAAEwNDZeXAABpAEQFBSMjIxgNQDooCBA9
6EEhIbwBVAAw/DAwMPgBNAENDCgc9B8zMzABDAD4MDAwOKjwKCkQWKUscHAAAcUtLFRMTEwohCoqK
7AA0NTBEREQgfCBUqIgApADIAAA4ULzg+DEEfH3wAAAc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SIadlsnEAEsMlP4kToJDliaRkEHWIEkopSeCPSPwfYvIAoLNI
36JpUEwcz7mgIxBqmnQjDsUi89N8lniRIWwIQklKSJyyRxUJokygmhbMm/I6otbH3RijFp5J4JFkR7
37BJFU3rJXwUa6UySgemddxHPEhZBLnij+AVRDVEm097XmBtTBp0AHOrx7ukUeZXOIQQk6klFYqCBj
38QgISbsBBuOiToRjNaHgWCieOarQjhVnIRGsCzriE5aMoTalKV8rSlrr0pTCNqUxnStOa2vSmOM2p
39TnfK05769KdADapQh0rUohr1qEhNqlKXipARSOKpUI2qVKdK1apa9apYzapWocolgxwiGGANq1jH
40StaymvWsaE2rWtca1oTE4BRwjatc50rXutr1rnjNq173CtcYJEQYSwisYAdL2MIa9rCITaxiF8vY
41wAojIVuNrGQnS9mtAgMh0GCrZjfL2c6y9RAOYUQnRkva0pr2tKhNrWpXy9rWuna09Hj+6ALIQdva
422va2uM2tbnfL29769re0bUFCnsCE4hr3uMhNrnKXy9zmOve50C3uExKSi1hY97rYza52t8vd7nr3
43u+ANr3VzkRBIvPa86E2vel17icesArjwja985/vbBYR2vfjNr35ZG1uEzJa+AA6wgHkrXIQQN7oI
44TrCCF/zc6SKkuuKNsIQnTGHwkhch5t2vhjeM3/YeRB7vHbCIRwxg+zZEtBxOsYr5K1sSu/jFvi3w
45QQ7M4Brb+MbMdfBBIFzhHvv4x9298EEyvOIiG7kTHjYIiGHM5CbX1sQMQfGRp8zh/h7kv07OMoll
46bBAa4/jLYF6wjg3CYyCb+cwUFrL+QYhM5TbnN8lFCbGW5yxgKC/EDlPIs573zOc++/nPgA60oAdN
47aD3zASF+cIOiF83oRjv60ZCOtKQnTelKK9oLCfFGNzbN6U57+tOgDrWoR03qUpt6095ISBSawepW
48u/rVsI61rGdN61rb+tasjkJCzFDoXvv618Am9B4QwgdLG/vYyE62pf1wXzc7e71WNgiW6Uxt+XK5
49IF4Os7a3vdwxF6TMaA63uLmr5oKw+dnobi2cPyTnaru7vs1Ot7xXG+2CTP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B/BTTIEVRhAaAGg9K8w0uiyzokRwfnTMzJx4x
119iIQcAXjkTIFGecTPQF+FFToKV3Wsl0fYc3QgElTFdMy+IMWyTIJcldPFUeqbFEs/5wJWTmyMhOWN
120SpOMtVprj3PyvzegnRXXYN0k4Q1qFRxMWMJESlbHcd1LF1SDmPVVTqyoPHXca+/FtzcE81BVHk3f
121E7bTN3q5FMz4fo03TCwrLVjdgVoVI0poH/6Ux3dFJbXTesU4k9Vi8wU55N0euVAojTBTdFd73VXY
1224pZfzojXi4dds00X4aR5ZoHEuxMWJPL+NOpZaT8WuWijY6v0WUkTDVbihpolOsWlB1oRzcweGQ8W
123GWm0EUeHv171R4GCHNIoUz8l9mi11x7NCZmlBjCwXuQDzOqpiSyXbvXko88+wZyYWD/+4Ow5apep
124NhCAUd11MuO02YY8csknp7xyyy/HPPNYSeilc897mRgmCT73PEHNT0c9ddVXZ71111+HPXbZZ6e9
125dttvxz133XeHXB7ffwc+eOGHJ754449HPnnlC08OCeWfhz566acXnnnkoKE+e+23n7460L4HP/zA
126ViaObvHPR38x8oc7OX333y/M+1G4p7/++ltdXziIbrW/f/+hx59zNPI/AhaweHLxXpz+lKOU5TBw
127gY8jjlSaI0HpmKWBEByOA5OjQeRQcDkehI4FH5i/4HDwOCY0DgiTo0LnmEUQC4BhDGU4QxrW0IY3
128xGEOdbhDGNYgRSQEjlJQkQsiFtGIR0RiEpW4RCY20YlPJCIqfihA+MgDBjzEYha1uMUdCkJX33qO
129WRZADjKW0YxnRGMa1bhGNrbRjW8kYwum2Byl5CIWd8RjHvW4Rz720Y9/BGQgBXnHXMyRORKUxyrg
130uEhGNtKRb1zAFxM4kDE+0pKXxCQb5XglIP6mjoMEZShFOUpBFpKTVDyRIjO5SlZaMpIZAWMLHVPJ
131VtbSlpo05AUzY0dS9tKXv/yjKd/+00nfIFKVt0RmMsnxSliwsDlmMUEapDlNalbTmtfEZja1uU1u
132dlOalMjlCAeihjaU05znRGc61blOdrbTne+EZznVEM4VwkcA7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DscJ53bTw8Spc
216tdHpGJS3uG407IHWjtgUEgZuNMr+iOkhitS8Pca7q62+clTrtfty65+UQH7bi2383nbuKOnWye6h
217/r2blK0Y71kyosXey1G+vJVHrsHF/stUqxzBulHMTPEqL7SI8urwRhDrSGB06f34LXMXCzvxxhx1
218TJXAYrgqj0aI3qffjiQerN1GWhI13LobSUDtq1A9smyN+9640XPRzTwyoFmPDGV1G6kYtn/3ct31
219DSciccORAqPoMb6Hhtd11cXdACDWWmu999yNE8cR3mPD1+5TN4x4sxiJByUPuW+nDPfoVX5d9n76
220WQ432KoTKjg2hLNsuH7Mwb24sXLHPbnjdJ+eYd/MAn55yE1F7WrncIPudt2P667+m9dZwypP8H9j
221yDrlrt8Gu+xFjZJe2H//6TTqz5MOOYLDcT3czU6FGDDOtheHnnrYDTmk45jzjgTZI0MeIUeg0bHv
222ledpTknRit4jvpF5aSOCc9y7IBcm/cltfWwrHlMsVzN0wY0EwKEg9rbGu4NFMISlG10vCNiq7jnw
223RMjykO3C1EAUNU9MI5wgBrUGQLZtSDcgXAoB8WbA4nhQPTncG/789zvc7FA950Lf5FKYnhVSpWYm
2242g+9SKgiWvEmWrDY2QnTB8HmWEtyTEGWhVS0tqBY6FkuO1kXT0hCXL0BQ1B0HHt6ITUIHekp60LC
225zTw4vqD8sGS6Cpqt5ChG7Nn+ChuiUwr8SJCeR+RhkGxcGSLppLA43lEoEMOGjUbYyT3tcRR9dMof
226b9Y3S16wOomEoyZvuMj78caRULHiiSjJyvhx0WS6mVcYsRUdUCZxlM0p5SmnAsoHyYNsxeEfCYBW
227uiSGaZEorMrZCAaLtK0RR5g8nwjzd0S7wcqYTqOUE3EDq3I+5UPKypAzg4KEUViphiUcYwBzqEQb
228TkVzsPobh4SioW9O03yke9eHgonHKG6JnU5xJ5lIYEe4zbOeutuTQY1YFN00UYAkfMoyhRfQz42C
229oEjM6HZ086GOPlGUDF3nR51CT9scrVaI0txueEdN6J1LbpXrn1QcdDNbTan+OBqSpgh36jQzqi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6aRl4pnpi4p+OqKopX6I6qppxPqipbWuyOmuIboaa7GrJltqrsGWMm2YAGjb7bfh
314jlvuuemu2+678c4b27UXytvvvwEPXHC49077psERT1zxwNfOiITHIY9c8sn+Ka/c8ssxz1zzzaFp
315PCJoNg9d9NFJL33yzj232vTVWW+99NRhj1322Wmv3fbbcc9d9915793334EPXvjhiS/e+OORT175
3165Zlv3vnnoY9e+umpr97667HvXQwAUE9olBseygP1hZCK26ms+n7bKfIhgvuG7iVCHwAJHmLocMLT
317d7uh/AHoBecbsbU98D0ECaN4AwCwEakbwa0XCXEf/ML2QP61TYFGgeDUjkUR8rEvWrB4X/ZAmDQn
318POIhb6BfQrbHEQ46JA9OaNsokGChZ8lPIit0IEcK+IYYTkR+OnRIbVZoQ6w4BAk3aCAAJXK4HcIC
319CU4YRefk8QYSIjEikcn+4RIj6BBoOOGIN5zIFi8COpiQT4xc2WAXQ5jGkj3CCSwEwBJ7ERkbQkOK
320sNgiGts3w/1lUIi06kUF8wiZP/4QLUHko3bY9zNYmNCERkGjBLDhxSouZ5A11E4etKPIzgCSXhns
321ZEKw8T81jhJc0OCeTQbYmUfIcUpi6KIQCTlJyFhSlg6BpAwhs73/ARGRh7RaJKkYvjd+zyEjJCBH
322FEmrW9KShWjUJDYaIobHUZAEB1zfXaqJwP9lExv02+BdHoENBOahgf4TZzcTkodz5gGFccTGKO4y
323Ck6Skp6jMiYssMFOWIghkqysCAmAGT89zhKDtRwiD/fYmSPy0mq+TEj+AZH5LGJicoeaTOZyYElQ
324O5IAi4pEwikXMgpYYPIGSMCkxXCSQlg8ooHywEbnjvLNlb50pW27US86Z8DBvGGPnXNCSbcITjzW
325k6iEYuM+31DMhvhTIjkUZRXfttA9Ek6jsaQNLsmHBHQylDZww8rbQinJEuqzjsFsH9wiRauMTvCE
326Ym3oQanIEPJt7xFYnJBM0ZkQF97ohOSTp0NuQILtoU4Cd8loURELpI+CTqSdGSBTEfSGJ3ptoLDs
32743KWKVCCRvGjhewlM5l4g8b2CpNvayMs7mlBs1o1IZnN4kN1ytq3ajQycr0LOQHgBHaK4QZv6EUc
328Z0m+2sCTiuSLo/r+OMi+wyaWuSC6QTj1edy3VTUhN3DCUxEqS8sey4/z9CIHA8tVuM7WJlKFyCga
329O9JTAlSYMbzoQypZ0KvKdr4crC1KIYJJMbwhUjIlX15hAVx//vUhpiSsYT3ZXAUfCJJJraUN8+DD
330i/yMhvKtHw4NaNcLaxQJB/QseUFMAvMS8Q36TEgdtfpBeTghrdiyYoYnwsECpnK1P8SZfSNKvnBC
331kXt1hEYcZYYT8gG0c6vEiT+juD+eBhioe13pUBccZfl8NL0bhoz67uc2XAZygi1F6wLd9kGsameV
332H+6q+qoaxc7FTQIOdsgoTptDBCpQbg58m5gteeeO7k23tM0xTgr+2DZ0QnLOb+CpkLEpThYfWYV3
333IXRekRBHEx5xFFOU8qUxbbRHeJcrYuhem5fyhgtmmtSlRlYTDUNkO7JYKRKosqlhjaffznrWkxEx
334rX+L3ZfhutZJecSouYKEbPJXwzArdqyRnWxlL5vZzXb2s6EdbWlPm9rVtva1sZ1tbfOa29329rfB
335HW5xj5vcbYWdK8mdbnWvm93s1nXj0N1uec+b3urWHQLrnW997/trjVsIF/cdcIGn24WFA9u/B55w
336hXdbnPfmdNr6zTdNps1sT6s409AGu4ivbeMHn7jHDd61iyct46nrONhOrrWRG23lQ2s50EruOe+M
337QBI1t/nNcZ7+c53vnOc99/nPgW7z7qV8bLWJwSmQnnSlL53pTXf606EedalPHekxcBnFaxN0rW+d
338610POjBydjvvMCJNZc8QPdBC9LLVpj5hcvvb/zOmj4u8NpAw+90btKYEx27sePf7etD+w4fTHS1t
339h/vhEc8EuYdc5XX/++PPo3eHO4TskLe8eALvwME3vvCJ9/zbFz87wtj98peXfO76XnrLZ/5Gmy96
3405z8feyOFXnajV73lT48774jCBb33/e+BH3zhD5/4xTf+8ZHvez4IXvS1oQMHoB996U+f+tW3/vWx
341n33tbx/6dLg6yB0ChuSPn/zlNz/yTRF223knBdV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ecvi2u6cLrnbfm13u+lCt6U3veMmL1bnWN73rBat74Qvgvso3rd/dL3jv
425S17m8EIcDG6wgx8M4QhLeMIUrrCFL8zgT1jXX9lRwSQ+DOIQi3jEJC6xiU+M4hSr+MMq2PC9MLMC
426DMt4xjSu8YV5gVv/6dbA1O3v97Ab4CAndcDPoy+Pp4vguEr+98jT9fHzgCzkKC/VxesyMpN5m+To
4277vjKu3Uy76As5TCXlMjHKzCXC5vlxOaLADpos5vfDOc4y3nOdK6zne+M5zYbgMrXyo4QqADoQAt6
4280IQutKEPjehEK3rRgBYCn4eFKxrkedKUrrSl8UyAHDcwX6BYhac/DepQi3rUpC61qU+N6lR72giP
429tlV2IhCKWMt61rSuta1vjetc63rXvI51BFotKlxZQNXELraxj51qUGjaiVs+s129TMf/innaYwZ2
430o6zs7LqmOZbNzjZboQ3cqwiX2uQOKZlnh21vr3XbOu22urcK7nVKu9zlPrcfzfxurrI7twe5hSf+
431DfCAC3z+4AQvuMEPjvCEK/zfxbD2obIDhldIfOIUr7jFL47xjGt84xzvuMTB4HBAYSYBCy+5yU+O
432coXfYtlddHe+pRpvos6b3tS2d3K7styXb3XfOtavzrka8/aKm+b0trl3lftzfbN8jS5Pek+DXr6Z
433Ez3MRncq0p0+VZ5v2udYjyrU6Sf1qUe56gjEd9epuvRf5svfKW+7299+8IY3NepXcQAg7o73vOt9
43473zvu9//DvjAC/7uDgi5nkYO98Qr3u0rt6qauX52n359gGEXe5DJnkSzR56mWmc25Ddf08kTceiW
435FzPmsah50Ds37cxsuuorKvopkr70Uj79LlP/+op2vuX+B+k0sn8P/OCbmtVzB/tV1NCG5Ct/+cxv
436vvOfD/3oS3/61E++Ggw/J2ELf/vcB76yHc/tg7D50uQvv/nrvOfiU/4qQui1+98P//jz2tHqv/1B
437BCDp8+t//+TPNPjb/Xm5d1GxJ0aVR3vvZXvIhHsCKFG7x3QByIBBhX1rAmYHiIATWCbpFoET5YBq
438B4EbGFEEOEwGaIHFlYAztIAg6Fasl035Ug9eAIMxKIMzSIM1aIM3iIM5qIM7CIOJgIFekh3rEABD
439SIRFaIRHiIRJqIRLyIRN6IRDuA4/aCWYMQE8aIVXiIVZuIP1wIKIs2QqKIH1J3sHMW4lCGAneEYp
440CIb+Hdh6HwiGDSWC0DR7ZghfaKg1GviGK/h//GZeeThRcWg0FUiHw2WHpqSGKsiGLeiGeQiItkSC
441g8hXhSgzeOiHieiF+bIF9qCJm8iJneiJnwiKoSiKo0iKpaiJgiCFTpIdrpACreiKrwiLsSiLs0iL
442tWiLt4iLregKqUgkZiEGpgiMwSiMw2iKW9CFgsMcX4ZcMsdedDdf0IVu0Bh+P7aMQudfzZh5h4RY
4430/hk1eiM1IiNqKeN0qhTvUAC54iO6aiO68iO7eiO7wiP8SiP7zgK3gh2ozCP+aiP+8iP/XiO9RiO
444t+ePA0mQBamPvUCO7wMAC8mQDemQDwmRESmRE0kokRVpkRYZkFN0kRvJkR3pkR/pkBmJgiBJkiVp
445kh6JXympkivJkm4TEAA7
diff --git a/Documentation/DocBook/media/nv12mt.gif.b64 b/Documentation/DocBook/media/nv12mt.gif.b64
new file mode 100644
index 00000000000..083a7c85d10
--- /dev/null
+++ b/Documentation/DocBook/media/nv12mt.gif.b64
@@ -0,0 +1,37 @@
1R0lGODlhFgFnAMZnAAAAAAYCAgAASAwFBQAAdEgAACQODkgASCoQEEgAdHQAADATEjUVFHQASDsX
2F3QAdE0eHVMhIABISABInEhIAIM0Mok2NI84Nk9PT5o9O5xIAHRInFlZWaxEQbhJRgB0v75LSLhQ
3TbRTUcBRTrBXVatcWsJWVKdfXW9vb6VhX0h0v8RcWZhpaJJubpBwb8ZiX8ZiYI5zc4t1dYd4eMhn
4Zb90AIN8fH9/f8pracpta8ttasxzcM51dM52dM53dc94dkic39F+fNOEgpmZmdWJh9ePjdiTkt+c
5SNuamd2gnt6lo3S//5y/nOCqqeKwr+S1tOa7uv+/dOjBwOrGxuzKye3KyuzMy5zf/7/fnO/S0fHX
61//fnPPd3fTe3vXj4vfo6Pnu7r////v09N////35+f//v///3///////////////////////////
7/////////////////////////////////////////////////////////////////////////yH+
8FE5WMTJNVCBtZW1vcnkgbGF5b3V0ACwAAAAAFgFnAAAH/oBngoOEhYaHiImKi4yNjo+QkZKTlJWW
9l5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGmkM3ysvMzc7P
100NHS0CjT1tfY19XZ3N3Y297h4sxDlQDj6OLn6ezZ6+3w0u/x9M0A5r/3vvq9/Lz+kQDqEpiLIC6D
11txAyUliLIS2HsyDKkniIIiyLrzC60tiKoyCPq0CqEpmKJCqQJk+lNLWyVEtSKPPJ3Ddz0stRN0Xl
12DLUTVEyaQPvVlNTzU1FPRzsl5fRTaNB/QwNGHTi1IL6nu5Zu0qqpKVSsVME+4pqJLCazl9Ba8oqp
13jAIA/gTCIOXkVsAVo52OAABgV6kmMxr2Cgbil9LLGh/OIJ6r6QgBLAfuMm48YYzPT1siF7a5qUyD
14u1HibtaUWfLoS55NT+a0+DSklqXPxK5EJkuhm7NdV8pMYW9i3YJsT8q99Wqm2MQn/cihZRBuzasv
15RenrdgnwM8uFQzpSOfrrTcihW5KyogiYM89VF9cUWq7i3+sRTVlB5Lyj6ngNd/58pn0mMUmY4ER6
16+R2nGWCEMbUIGQE2QUYj3Fnm3VibIPgeJ178kEFz4Imn4F8aEJbcWY18EcQLViziVoITOvLSFgXA
175R4iVvxg44045oijByAU0QMIQAYppJAwPHhIFILx/qUeieDFCIB1igjBg45U4nhBlVSaAEIQYiTi
182IzXLbTKF1mUaeaZaJr5RAc5aKeIFStw0RErVehARZp4mrlAnmlCscILU8yp3y5iILECBI7AKaeg
19q3DxQ5cuMgLgCg5uZBwuTpiAhBgQKZqRK45CKqYiftZ30aW1WEFDEF58xIinn4L6aCMIabHDDhye
20OqgtYgSRonOLwBqrrKImglAQUjyEalg0xjlRLKEuotayFIoliLC6whKtsVVFai222Wo7KyLT7kpU
21VeCGK26xhJTLmbl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l35Up0blKVJjyT6lNvUgW/TfUp+6jzkhJhWqBqxfJQ+4Pqd6FXZXrepUv8rHsWK1q2e1qlnF
36SlVbsKWt4wurW6O6saxKFa5gZCn+5mrXiijNZn8FWmDTEbTBuqMSHDDsODCgWHEwtrHeeCxkucGB
37Y1j2spjNrGY3y9nOevazoA2taEdL2tKa9rSoTa1qV8va1rr2tbCNrWxnS9va2va2uM3tLQIBADs=
diff --git a/Documentation/DocBook/media/nv12mt_example.gif.b64 b/Documentation/DocBook/media/nv12mt_example.gif.b64
new file mode 100644
index 00000000000..a512078c7f2
--- /dev/null
+++ b/Documentation/DocBook/media/nv12mt_example.gif.b64
@@ -0,0 +1,121 @@
1R0lGODlhoAHkAOe1AAAAAAAASAAAdEgAAEgASEgAdBgYGHQAABoaGnQASHQAdC0eHigoKEIlJEYm
2JS4uLlssKzY2NgBISFIyMQBInEBAQEhBQUhIAFBBQVhCQkhISF5DQ2NDQmdDQ3NEQ05OToNGRHhJ
3SJxIAItHRY9HRXRInJdIRlpaWppLSaJJRqpJR7BIRa5KR2NfX7JKR2BgYGxdXWleXmZfX31ZWXJc
4XHpaWQB0v29dXLZKSHhbWolXVpVUU5JVU55SUJhUUqdQTrpLSK9OTKRRT6FSULRNS7hMSrVNSr5L
5SL9MSr1OS7xQTsBRTrtTUL5WU7lYVsJWVEh0v7deW4pqab5dW8RcWbdgXrZjYcZgXnd3d8ZiX8Zi
6YL9lY7RoZshnZb90ALJubLFwb8prabBzccpta79wbsttaqx6ecxzcKt8e4aGhr93dc10cs51dM52
7dImJib97ec53dc94dqiEhKeHhkic39F+fKeKiaWPj9OEgqSSkb6PjtWJh5qamqGamqCcnNePjZ+f
8n9iTkr6amtiUktmVk9+cSL6enduamb+jo92gnr+pqd6lo7Ozs7+wsHS//7W1tZy/nOCqqbm5ub+4
9uOKwr+S1tL+/v9+/dOa7uv+/dOjBwOrGxuzKye3KyuzMy5zf/7/fnO/S0d/fnPHX1+Dg4P/fnPPd
103fTe3vXj4vfo6L//v+/v7/nu7r///9//v/v09N//39////35+f//v///3///////////////////
11////////////////////////////////////////////////////////////////////////////
12////////////////////////////////////////////////////////////////////////////
13////////////////////////////////////////////////////////////////////////////
14/////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBH
15SU1QACwAAAAAoAHkAAAI/gBrCRxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjyBDihxJ
16sqTJkyhTqlzJsqXLlzBjypxJs6bNmzhz6tzJs6fPn0CDCh1KtKjRo0iTKl3KtKnTp1CjSp1KtapV
17h6QkWdrKtavXr2DDih0rlpFWsmjTqkVrdq3bt27bwp1L16vcunjn3s3LNy2jVRU/MKhAuLDhw4gT
18K17MeDGCwY0jS54c+THly5gvW87MufPhzZ5DcwYturRkBGkqvgAEdPVP169Z+4Q9W3ZP2hJx89St
19k3dv27uBB4+tWvhO3ziRJzeeU/lN5zWhK5ROk7pM69eZL2+t/Xl3hthj/oZ/OZ789+jn0ROnWN5l
20e5bv4aefGX9l/ZTx7+Ofn537+tr/5cZffwAGeNyA4iFoXnH+FejgcAb+xmCEzSm44IMQ3mbhQPqh
211KFJH4K4oXwNajghhhJSuJ2K3p1oIoopvgjjihOFWJKNI+GY44j28dgji+D5qJKOIRFZpJAeIpkk
22kAvZOMsBAAjQykdOHhDAJ1QqSVAhAABwpUcf0iJCl2TS0ZGNmZDpSJYcpekllmfyaKMXNtRCZ0av
23jEJQiIUIAAoBcMbJUSEUxHJkQa+wglEpgGKUJ4da1vLkmn1OiZEsoUC6USkDrJmJlIKyF+ksCWD5
24qaUWydJFHagIhCOj/oFyFCKpsYIp3CZPRCKLRXdeumqrs5Zay6kaxTGGniESS2uoNUYKay3PZhQJ
25FYnI8mqjtm5KwAVd1pltQangkYUnFEUrLbUtRGqnAKocsOZGmlDxRwyRZvLlpMwKqC2W5mLEyh5U
26zKAutNjme5G9WOJr8ECerJqKRIQautG/RsjRkRcAFNrRK4kUYQZHGHt5wbsb5edso/1mFEoQVrS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ldeco4vMx1xmR0b8QMvAFj039lqLW/VkRlf3tjvw9GQ+g
1102Q9uQ8OcGvH94V8Rdj2dqY/vo5+YBlqpSkKgio3IACGgVS2CBQ0eRFiQUhEwrxI+hOiFQqyCtETQ
111qVWKwCeIHWtRenLIYa0XgDyeJCiRYsFZBzCi9AjykAyTMDuqLJgpAEeNHG1CXNjw50OcB1vaGAqx
112ZNKCS5kaLDUAwFQAEwn2fErQU5c6qEjWzJpRKlUKosZaDbu1zg2wWaNSrRrrLQBHTNV6bdr26dyp
113EwsJDFvr7tfAYuH6pVo3sFq2hflWdXVgKtLCBJ0yvVxZs0FUYzzl/t0cmrNnwqIrd/58MLPpwKhB
114sw7tejVszbNt2qZdGHfurLt5P/X9e2hw4T+JF0d5/KFy5B6ZN1+uF3rS59NVS7d+G3v2k9UNeude
115Orz28cO3l08Inrt66+zZtz+P/rp8mO+h278fn75l/R3xN/+vuAAF7I++AYU7kDf3CjSQQfQSVNDB
1168iDMjULYFtyvOwnHs/DCDcPrkLUQRcMwQ/8+XA/FFE1USsXsRgytRBbTc3E6GGOsMb8Zo9sRIRl7
117fA1I/oT8LkcAjTySyCGBQxK5G2trkkAlxSPyycp+FNJK3aJEkMsIp6QSSCzF9LLCMs2cUsst03RR
118zcDc7O1M2uBksRJMOjFz8QQsLOGzTz//BDRQQQcldFAN9iw0UUUXTfRQRh+F9FFHI6W00j8ntTRT
119SjHVtFNFNeAjKzciqKBUU09FNVVVV2W1VVYfINVVWWelVVZYa8U1V1xv1bVXX1Hl9Vdhew12WGNn
120feARMJdltllnn4U2WmmnpbZaa6/FNlttt+W2W2+/BTdcccclt1xzz0U3XXXXZbddd9+FN15556W3
121XnvvxTdfffflt19//+03IAA7
diff --git a/Documentation/DocBook/media/pipeline.png.b64 b/Documentation/DocBook/media/pipeline.png.b64
new file mode 100644
index 00000000000..97d9ac00747
--- /dev/null
+++ b/Documentation/DocBook/media/pipeline.png.b64
@@ -0,0 +1,213 @@
1iVBORw0KGgoAAAANSUh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fg1g0XYBx/hjLv6xpE5v1n1CP8iqhua1RTZmeeMffyknOZsW2VI/2Z
209994N2fxeofZ8RB4raLG+ZDoyDKr2Z9P9Px5v9S7HqEmddYr6HsXcNo0+KlbaZ5GB66EbWJD9tPlh
210Eqz+YqxdOvUKHaJXGL0G6cxgDdJj/F5hDm+39XRfgyruoyO8mSfvP3oq8CgU8iDB24YH6bah8jRL
211PVhtnkax0OjhSavelmZPc1vYKlONnhb+1xC96PV6dpsjFl5vbqL9Xvd46Kazr8lDHY4DYiXpIG4b
212NOroECVJkRe5R/QKvUabHPB6ml45FbbKkPHSbApPB/+pPa8YHu5gcxMfvOD1eGj31zweDNNagi1t
213iM9GbfE0p2V0g5QUk2BJSbCkJFhSUoPW/wfr5tj8wgE+HwAAAABJRU5ErkJggg==
diff --git a/Documentation/DocBook/media/v4l/.gitignore b/Documentation/DocBook/media/v4l/.gitignore
new file mode 100644
index 00000000000..d7ec32eafac
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/.gitignore
@@ -0,0 +1 @@
!*.xml
diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml
new file mode 100644
index 00000000000..d2eb79e41a0
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/biblio.xml
@@ -0,0 +1,269 @@
1 <bibliography>
2 <title>References</title>
3
4 <biblioentry id="eia608">
5 <abbrev>EIA&nbsp;608-B</abbrev>
6 <authorgroup>
7 <corpauthor>Electronic Industries Alliance (<ulink
8url="http://www.eia.org">http://www.eia.org</ulink>)</corpauthor>
9 </authorgroup>
10 <title>EIA 608-B "Recommended Practice for Line 21 Data
11Service"</title>
12 </biblioentry>
13
14 <biblioentry id="en300294">
15 <abbrev>EN&nbsp;300&nbsp;294</abbrev>
16 <authorgroup>
17 <corpauthor>European Telecommunication Standards Institute
18(<ulink url="http://www.etsi.org">http://www.etsi.org</ulink>)</corpauthor>
19 </authorgroup>
20 <title>EN 300 294 "625-line television Wide Screen Signalling
21(WSS)"</title>
22 </biblioentry>
23
24 <biblioentry id="ets300231">
25 <abbrev>ETS&nbsp;300&nbsp;231</abbrev>
26 <authorgroup>
27 <corpauthor>European Telecommunication Standards Institute
28(<ulink
29url="http://www.etsi.org">http://www.etsi.org</ulink>)</corpauthor>
30 </authorgroup>
31 <title>ETS 300 231 "Specification of the domestic video
32Programme Delivery Control system (PDC)"</title>
33 </biblioentry>
34
35 <biblioentry id="ets300706">
36 <abbrev>ETS&nbsp;300&nbsp;706</abbrev>
37 <authorgroup>
38 <corpauthor>European Telecommunication Standards Institute
39(<ulink url="http://www.etsi.org">http://www.etsi.org</ulink>)</corpauthor>
40 </authorgroup>
41 <title>ETS 300 706 "Enhanced Teletext specification"</title>
42 </biblioentry>
43
44 <biblioentry id="mpeg2part1">
45 <abbrev>ISO&nbsp;13818-1</abbrev>
46 <authorgroup>
47 <corpauthor>International Telecommunication Union (<ulink
48url="http://www.itu.ch">http://www.itu.ch</ulink>), International
49Organisation for Standardisation (<ulink
50url="http://www.iso.ch">http://www.iso.ch</ulink>)</corpauthor>
51 </authorgroup>
52 <title>ITU-T Rec. H.222.0 | ISO/IEC 13818-1 "Information
53technology &mdash; Generic coding of moving pictures and associated
54audio information: Systems"</title>
55 </biblioentry>
56
57 <biblioentry id="mpeg2part2">
58 <abbrev>ISO&nbsp;13818-2</abbrev>
59 <authorgroup>
60 <corpauthor>International Telecommunication Union (<ulink
61url="http://www.itu.ch">http://www.itu.ch</ulink>), International
62Organisation for Standardisation (<ulink
63url="http://www.iso.ch">http://www.iso.ch</ulink>)</corpauthor>
64 </authorgroup>
65 <title>ITU-T Rec. H.262 | ISO/IEC 13818-2 "Information
66technology &mdash; Generic coding of moving pictures and associated
67audio information: Video"</title>
68 </biblioentry>
69
70 <biblioentry id="itu470">
71 <abbrev>ITU&nbsp;BT.470</abbrev>
72 <authorgroup>
73 <corpauthor>International Telecommunication Union (<ulink
74url="http://www.itu.ch">http://www.itu.ch</ulink>)</corpauthor>
75 </authorgroup>
76 <title>ITU-R Recommendation BT.470-6 "Conventional Television
77Systems"</title>
78 </biblioentry>
79
80 <biblioentry id="itu601">
81 <abbrev>ITU&nbsp;BT.601</abbrev>
82 <authorgroup>
83 <corpauthor>International Telecommunication Union (<ulink
84url="http://www.itu.ch">http://www.itu.ch</ulink>)</corpauthor>
85 </authorgroup>
86 <title>ITU-R Recommendation BT.601-5 "Studio Encoding Parameters
87of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect
88Ratios"</title>
89 </biblioentry>
90
91 <biblioentry id="itu653">
92 <abbrev>ITU&nbsp;BT.653</abbrev>
93 <authorgroup>
94 <corpauthor>International Telecommunication Union (<ulink
95url="http://www.itu.ch">http://www.itu.ch</ulink>)</corpauthor>
96 </authorgroup>
97 <title>ITU-R Recommendation BT.653-3 "Teletext systems"</title>
98 </biblioentry>
99
100 <biblioentry id="itu709">
101 <abbrev>ITU&nbsp;BT.709</abbrev>
102 <authorgroup>
103 <corpauthor>International Telecommunication Union (<ulink
104url="http://www.itu.ch">http://www.itu.ch</ulink>)</corpauthor>
105 </authorgroup>
106 <title>ITU-R Recommendation BT.709-5 "Parameter values for the
107HDTV standards for production and international programme
108exchange"</title>
109 </biblioentry>
110
111 <biblioentry id="itu1119">
112 <abbrev>ITU&nbsp;BT.1119</abbrev>
113 <authorgroup>
114 <corpauthor>International Telecommunication Union (<ulink
115url="http://www.itu.ch">http://www.itu.ch</ulink>)</corpauthor>
116 </authorgroup>
117 <title>ITU-R Recommendation BT.1119 "625-line
118television Wide Screen Signalling (WSS)"</title>
119 </biblioentry>
120
121 <biblioentry id="jfif">
122 <abbrev>JFIF</abbrev>
123 <authorgroup>
124 <corpauthor>Independent JPEG Group (<ulink
125url="http://www.ijg.org">http://www.ijg.org</ulink>)</corpauthor>
126 </authorgroup>
127 <title>JPEG File Interchange Format</title>
128 <subtitle>Version 1.02</subtitle>
129 </biblioentry>
130
131 <biblioentry id="itu-t81">
132 <abbrev>ITU-T.81</abbrev>
133 <authorgroup>
134 <corpauthor>International Telecommunication Union
135(<ulink url="http://www.itu.int">http://www.itu.int</ulink>)</corpauthor>
136 </authorgroup>
137 <title>ITU-T Recommendation T.81
138"Information Technology &mdash; Digital Compression and Coding of Continous-Tone
139Still Images &mdash; Requirements and Guidelines"</title>
140 </biblioentry>
141
142 <biblioentry id="w3c-jpeg-jfif">
143 <abbrev>W3C JPEG JFIF</abbrev>
144 <authorgroup>
145 <corpauthor>The World Wide Web Consortium (<ulink
146url="http://www.w3.org/Graphics/JPEG">http://www.w3.org</ulink>)</corpauthor>
147 </authorgroup>
148 <title>JPEG JFIF</title>
149 </biblioentry>
150
151 <biblioentry id="smpte12m">
152 <abbrev>SMPTE&nbsp;12M</abbrev>
153 <authorgroup>
154 <corpauthor>Society of Motion Picture and Television Engineers
155(<ulink url="http://www.smpte.org">http://www.smpte.org</ulink>)</corpauthor>
156 </authorgroup>
157 <title>SMPTE 12M-1999 "Television, Audio and Film - Time and
158Control Code"</title>
159 </biblioentry>
160
161 <biblioentry id="smpte170m">
162 <abbrev>SMPTE&nbsp;170M</abbrev>
163 <authorgroup>
164 <corpauthor>Society of Motion Picture and Television Engineers
165(<ulink url="http://www.smpte.org">http://www.smpte.org</ulink>)</corpauthor>
166 </authorgroup>
167 <title>SMPTE 170M-1999 "Television - Composite Analog Video
168Signal - NTSC for Studio Applications"</title>
169 </biblioentry>
170
171 <biblioentry id="smpte240m">
172 <abbrev>SMPTE&nbsp;240M</abbrev>
173 <authorgroup>
174 <corpauthor>Society of Motion Picture and Television Engineers
175(<ulink url="http://www.smpte.org">http://www.smpte.org</ulink>)</corpauthor>
176 </authorgroup>
177 <title>SMPTE 240M-1999 "Television - Signal Parameters -
1781125-Line High-Definition Production"</title>
179 </biblioentry>
180
181 <biblioentry id="iec62106">
182 <abbrev>IEC&nbsp;62106</abbrev>
183 <authorgroup>
184 <corpauthor>International Electrotechnical Commission
185(<ulink url="http://www.iec.ch">http://www.iec.ch</ulink>)</corpauthor>
186 </authorgroup>
187 <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting
188in the frequency range from 87,5 to 108,0 MHz</title>
189 </biblioentry>
190
191 <biblioentry id="nrsc4">
192 <abbrev>NRSC-4-B</abbrev>
193 <authorgroup>
194 <corpauthor>National Radio Systems Committee
195(<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor>
196 </authorgroup>
197 <title>NRSC-4-B: United States RBDS Standard</title>
198 </biblioentry>
199
200 <biblioentry id="iso12232">
201 <abbrev>ISO&nbsp;12232:2006</abbrev>
202 <authorgroup>
203 <corpauthor>International Organization for Standardization
204(<ulink url="http://www.iso.org">http://www.iso.org</ulink>)</corpauthor>
205 </authorgroup>
206 <title>Photography &mdash; Digital still cameras &mdash; Determination
207 of exposure index, ISO speed ratings, standard output sensitivity, and
208 recommended exposure index</title>
209 </biblioentry>
210
211 <biblioentry id="cea861">
212 <abbrev>CEA-861-E</abbrev>
213 <authorgroup>
214 <corpauthor>Consumer Electronics Association
215(<ulink url="http://www.ce.org">http://www.ce.org</ulink>)</corpauthor>
216 </authorgroup>
217 <title>A DTV Profile for Uncompressed High Speed Digital Interfaces</title>
218 </biblioentry>
219
220 <biblioentry id="vesadmt">
221 <abbrev>VESA&nbsp;DMT</abbrev>
222 <authorgroup>
223 <corpauthor>Video Electronics Standards Association
224(<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor>
225 </authorgroup>
226 <title>VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)</title>
227 </biblioentry>
228
229 <biblioentry id="vesaedid">
230 <abbrev>EDID</abbrev>
231 <authorgroup>
232 <corpauthor>Video Electronics Standards Association
233(<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor>
234 </authorgroup>
235 <title>VESA Enhanced Extended Display Identification Data Standard</title>
236 <subtitle>Release A, Revision 2</subtitle>
237 </biblioentry>
238
239 <biblioentry id="hdcp">
240 <abbrev>HDCP</abbrev>
241 <authorgroup>
242 <corpauthor>Digital Content Protection LLC
243(<ulink url="http://www.digital-cp.com">http://www.digital-cp.com</ulink>)</corpauthor>
244 </authorgroup>
245 <title>High-bandwidth Digital Content Protection System</title>
246 <subtitle>Revision 1.3</subtitle>
247 </biblioentry>
248
249 <biblioentry id="hdmi">
250 <abbrev>HDMI</abbrev>
251 <authorgroup>
252 <corpauthor>HDMI Licensing LLC
253(<ulink url="http://www.hdmi.org">http://www.hdmi.org</ulink>)</corpauthor>
254 </authorgroup>
255 <title>High-Definition Multimedia Interface</title>
256 <subtitle>Specification Version 1.4a</subtitle>
257 </biblioentry>
258
259 <biblioentry id="dp">
260 <abbrev>DP</abbrev>
261 <authorgroup>
262 <corpauthor>Video Electronics Standards Association
263(<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor>
264 </authorgroup>
265 <title>VESA DisplayPort Standard</title>
266 <subtitle>Version 1, Revision 2</subtitle>
267 </biblioentry>
268
269 </bibliography>
diff --git a/Documentation/DocBook/media/v4l/capture.c.xml b/Documentation/DocBook/media/v4l/capture.c.xml
new file mode 100644
index 00000000000..1c5c49a2de5
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/capture.c.xml
@@ -0,0 +1,659 @@
1<programlisting>
2/*
3 * V4L2 video capture example
4 *
5 * This program can be used and distributed without restrictions.
6 *
7 * This program is provided with the V4L2 API
8 * see http://linuxtv.org/docs.php for more information
9 */
10
11#include &lt;stdio.h&gt;
12#include &lt;stdlib.h&gt;
13#include &lt;string.h&gt;
14#include &lt;assert.h&gt;
15
16#include &lt;getopt.h&gt; /* getopt_long() */
17
18#include &lt;fcntl.h&gt; /* low-level i/o */
19#include &lt;unistd.h&gt;
20#include &lt;errno.h&gt;
21#include &lt;sys/stat.h&gt;
22#include &lt;sys/types.h&gt;
23#include &lt;sys/time.h&gt;
24#include &lt;sys/mman.h&gt;
25#include &lt;sys/ioctl.h&gt;
26
27#include &lt;linux/videodev2.h&gt;
28
29#define CLEAR(x) memset(&amp;(x), 0, sizeof(x))
30
31enum io_method {
32 IO_METHOD_READ,
33 IO_METHOD_MMAP,
34 IO_METHOD_USERPTR,
35};
36
37struct buffer {
38 void *start;
39 size_t length;
40};
41
42static char *dev_name;
43static enum io_method io = IO_METHOD_MMAP;
44static int fd = -1;
45struct buffer *buffers;
46static unsigned int n_buffers;
47static int out_buf;
48static int force_format;
49static int frame_count = 70;
50
51static void errno_exit(const char *s)
52{
53 fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno));
54 exit(EXIT_FAILURE);
55}
56
57static int xioctl(int fh, int request, void *arg)
58{
59 int r;
60
61 do {
62 r = ioctl(fh, request, arg);
63 } while (-1 == r &amp;&amp; EINTR == errno);
64
65 return r;
66}
67
68static void process_image(const void *p, int size)
69{
70 if (out_buf)
71 fwrite(p, size, 1, stdout);
72
73 fflush(stderr);
74 fprintf(stderr, ".");
75 fflush(stdout);
76}
77
78static int read_frame(void)
79{
80 struct <link linkend="v4l2-buffer">v4l2_buffer</link> buf;
81 unsigned int i;
82
83 switch (io) {
84 case IO_METHOD_READ:
85 if (-1 == read(fd, buffers[0].start, buffers[0].length)) {
86 switch (errno) {
87 case EAGAIN:
88 return 0;
89
90 case EIO:
91 /* Could ignore EIO, see spec. */
92
93 /* fall through */
94
95 default:
96 errno_exit("read");
97 }
98 }
99
100 process_image(buffers[0].start, buffers[0].length);
101 break;
102
103 case IO_METHOD_MMAP:
104 CLEAR(buf);
105
106 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
107 buf.memory = V4L2_MEMORY_MMAP;
108
109 if (-1 == xioctl(fd, VIDIOC_DQBUF, &amp;buf)) {
110 switch (errno) {
111 case EAGAIN:
112 return 0;
113
114 case EIO:
115 /* Could ignore EIO, see spec. */
116
117 /* fall through */
118
119 default:
120 errno_exit("VIDIOC_DQBUF");
121 }
122 }
123
124 assert(buf.index &lt; n_buffers);
125
126 process_image(buffers[buf.index].start, buf.bytesused);
127
128 if (-1 == xioctl(fd, VIDIOC_QBUF, &amp;buf))
129 errno_exit("VIDIOC_QBUF");
130 break;
131
132 case IO_METHOD_USERPTR:
133 CLEAR(buf);
134
135 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
136 buf.memory = V4L2_MEMORY_USERPTR;
137
138 if (-1 == xioctl(fd, VIDIOC_DQBUF, &amp;buf)) {
139 switch (errno) {
140 case EAGAIN:
141 return 0;
142
143 case EIO:
144 /* Could ignore EIO, see spec. */
145
146 /* fall through */
147
148 default:
149 errno_exit("VIDIOC_DQBUF");
150 }
151 }
152
153 for (i = 0; i &lt; n_buffers; ++i)
154 if (buf.m.userptr == (unsigned long)buffers[i].start
155 &amp;&amp; buf.length == buffers[i].length)
156 break;
157
158 assert(i &lt; n_buffers);
159
160 process_image((void *)buf.m.userptr, buf.bytesused);
161
162 if (-1 == xioctl(fd, VIDIOC_QBUF, &amp;buf))
163 errno_exit("VIDIOC_QBUF");
164 break;
165 }
166
167 return 1;
168}
169
170static void mainloop(void)
171{
172 unsigned int count;
173
174 count = frame_count;
175
176 while (count-- &gt; 0) {
177 for (;;) {
178 fd_set fds;
179 struct timeval tv;
180 int r;
181
182 FD_ZERO(&amp;fds);
183 FD_SET(fd, &amp;fds);
184
185 /* Timeout. */
186 tv.tv_sec = 2;
187 tv.tv_usec = 0;
188
189 r = select(fd + 1, &amp;fds, NULL, NULL, &amp;tv);
190
191 if (-1 == r) {
192 if (EINTR == errno)
193 continue;
194 errno_exit("select");
195 }
196
197 if (0 == r) {
198 fprintf(stderr, "select timeout\n");
199 exit(EXIT_FAILURE);
200 }
201
202 if (read_frame())
203 break;
204 /* EAGAIN - continue select loop. */
205 }
206 }
207}
208
209static void stop_capturing(void)
210{
211 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type;
212
213 switch (io) {
214 case IO_METHOD_READ:
215 /* Nothing to do. */
216 break;
217
218 case IO_METHOD_MMAP:
219 case IO_METHOD_USERPTR:
220 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
221 if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &amp;type))
222 errno_exit("VIDIOC_STREAMOFF");
223 break;
224 }
225}
226
227static void start_capturing(void)
228{
229 unsigned int i;
230 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type;
231
232 switch (io) {
233 case IO_METHOD_READ:
234 /* Nothing to do. */
235 break;
236
237 case IO_METHOD_MMAP:
238 for (i = 0; i &lt; n_buffers; ++i) {
239 struct <link linkend="v4l2-buffer">v4l2_buffer</link> buf;
240
241 CLEAR(buf);
242 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
243 buf.memory = V4L2_MEMORY_MMAP;
244 buf.index = i;
245
246 if (-1 == xioctl(fd, VIDIOC_QBUF, &amp;buf))
247 errno_exit("VIDIOC_QBUF");
248 }
249 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
250 if (-1 == xioctl(fd, VIDIOC_STREAMON, &amp;type))
251 errno_exit("VIDIOC_STREAMON");
252 break;
253
254 case IO_METHOD_USERPTR:
255 for (i = 0; i &lt; n_buffers; ++i) {
256 struct <link linkend="v4l2-buffer">v4l2_buffer</link> buf;
257
258 CLEAR(buf);
259 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
260 buf.memory = V4L2_MEMORY_USERPTR;
261 buf.index = i;
262 buf.m.userptr = (unsigned long)buffers[i].start;
263 buf.length = buffers[i].length;
264
265 if (-1 == xioctl(fd, VIDIOC_QBUF, &amp;buf))
266 errno_exit("VIDIOC_QBUF");
267 }
268 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
269 if (-1 == xioctl(fd, VIDIOC_STREAMON, &amp;type))
270 errno_exit("VIDIOC_STREAMON");
271 break;
272 }
273}
274
275static void uninit_device(void)
276{
277 unsigned int i;
278
279 switch (io) {
280 case IO_METHOD_READ:
281 free(buffers[0].start);
282 break;
283
284 case IO_METHOD_MMAP:
285 for (i = 0; i &lt; n_buffers; ++i)
286 if (-1 == munmap(buffers[i].start, buffers[i].length))
287 errno_exit("munmap");
288 break;
289
290 case IO_METHOD_USERPTR:
291 for (i = 0; i &lt; n_buffers; ++i)
292 free(buffers[i].start);
293 break;
294 }
295
296 free(buffers);
297}
298
299static void init_read(unsigned int buffer_size)
300{
301 buffers = calloc(1, sizeof(*buffers));
302
303 if (!buffers) {
304 fprintf(stderr, "Out of memory\n");
305 exit(EXIT_FAILURE);
306 }
307
308 buffers[0].length = buffer_size;
309 buffers[0].start = malloc(buffer_size);
310
311 if (!buffers[0].start) {
312 fprintf(stderr, "Out of memory\n");
313 exit(EXIT_FAILURE);
314 }
315}
316
317static void init_mmap(void)
318{
319 struct <link linkend="v4l2-requestbuffers">v4l2_requestbuffers</link> req;
320
321 CLEAR(req);
322
323 req.count = 4;
324 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
325 req.memory = V4L2_MEMORY_MMAP;
326
327 if (-1 == xioctl(fd, VIDIOC_REQBUFS, &amp;req)) {
328 if (EINVAL == errno) {
329 fprintf(stderr, "%s does not support "
330 "memory mapping\n", dev_name);
331 exit(EXIT_FAILURE);
332 } else {
333 errno_exit("VIDIOC_REQBUFS");
334 }
335 }
336
337 if (req.count &lt; 2) {
338 fprintf(stderr, "Insufficient buffer memory on %s\n",
339 dev_name);
340 exit(EXIT_FAILURE);
341 }
342
343 buffers = calloc(req.count, sizeof(*buffers));
344
345 if (!buffers) {
346 fprintf(stderr, "Out of memory\n");
347 exit(EXIT_FAILURE);
348 }
349
350 for (n_buffers = 0; n_buffers &lt; req.count; ++n_buffers) {
351 struct <link linkend="v4l2-buffer">v4l2_buffer</link> buf;
352
353 CLEAR(buf);
354
355 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
356 buf.memory = V4L2_MEMORY_MMAP;
357 buf.index = n_buffers;
358
359 if (-1 == xioctl(fd, VIDIOC_QUERYBUF, &amp;buf))
360 errno_exit("VIDIOC_QUERYBUF");
361
362 buffers[n_buffers].length = buf.length;
363 buffers[n_buffers].start =
364 mmap(NULL /* start anywhere */,
365 buf.length,
366 PROT_READ | PROT_WRITE /* required */,
367 MAP_SHARED /* recommended */,
368 fd, buf.m.offset);
369
370 if (MAP_FAILED == buffers[n_buffers].start)
371 errno_exit("mmap");
372 }
373}
374
375static void init_userp(unsigned int buffer_size)
376{
377 struct <link linkend="v4l2-requestbuffers">v4l2_requestbuffers</link> req;
378
379 CLEAR(req);
380
381 req.count = 4;
382 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
383 req.memory = V4L2_MEMORY_USERPTR;
384
385 if (-1 == xioctl(fd, VIDIOC_REQBUFS, &amp;req)) {
386 if (EINVAL == errno) {
387 fprintf(stderr, "%s does not support "
388 "user pointer i/o\n", dev_name);
389 exit(EXIT_FAILURE);
390 } else {
391 errno_exit("VIDIOC_REQBUFS");
392 }
393 }
394
395 buffers = calloc(4, sizeof(*buffers));
396
397 if (!buffers) {
398 fprintf(stderr, "Out of memory\n");
399 exit(EXIT_FAILURE);
400 }
401
402 for (n_buffers = 0; n_buffers &lt; 4; ++n_buffers) {
403 buffers[n_buffers].length = buffer_size;
404 buffers[n_buffers].start = malloc(buffer_size);
405
406 if (!buffers[n_buffers].start) {
407 fprintf(stderr, "Out of memory\n");
408 exit(EXIT_FAILURE);
409 }
410 }
411}
412
413static void init_device(void)
414{
415 struct <link linkend="v4l2-capability">v4l2_capability</link> cap;
416 struct <link linkend="v4l2-cropcap">v4l2_cropcap</link> cropcap;
417 struct <link linkend="v4l2-crop">v4l2_crop</link> crop;
418 struct <link linkend="v4l2-format">v4l2_format</link> fmt;
419 unsigned int min;
420
421 if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &amp;cap)) {
422 if (EINVAL == errno) {
423 fprintf(stderr, "%s is no V4L2 device\n",
424 dev_name);
425 exit(EXIT_FAILURE);
426 } else {
427 errno_exit("VIDIOC_QUERYCAP");
428 }
429 }
430
431 if (!(cap.capabilities &amp; V4L2_CAP_VIDEO_CAPTURE)) {
432 fprintf(stderr, "%s is no video capture device\n",
433 dev_name);
434 exit(EXIT_FAILURE);
435 }
436
437 switch (io) {
438 case IO_METHOD_READ:
439 if (!(cap.capabilities &amp; V4L2_CAP_READWRITE)) {
440 fprintf(stderr, "%s does not support read i/o\n",
441 dev_name);
442 exit(EXIT_FAILURE);
443 }
444 break;
445
446 case IO_METHOD_MMAP:
447 case IO_METHOD_USERPTR:
448 if (!(cap.capabilities &amp; V4L2_CAP_STREAMING)) {
449 fprintf(stderr, "%s does not support streaming i/o\n",
450 dev_name);
451 exit(EXIT_FAILURE);
452 }
453 break;
454 }
455
456
457 /* Select video input, video standard and tune here. */
458
459
460 CLEAR(cropcap);
461
462 cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
463
464 if (0 == xioctl(fd, VIDIOC_CROPCAP, &amp;cropcap)) {
465 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
466 crop.c = cropcap.defrect; /* reset to default */
467
468 if (-1 == xioctl(fd, VIDIOC_S_CROP, &amp;crop)) {
469 switch (errno) {
470 case EINVAL:
471 /* Cropping not supported. */
472 break;
473 default:
474 /* Errors ignored. */
475 break;
476 }
477 }
478 } else {
479 /* Errors ignored. */
480 }
481
482
483 CLEAR(fmt);
484
485 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
486 if (force_format) {
487 fmt.fmt.pix.width = 640;
488 fmt.fmt.pix.height = 480;
489 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
490 fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
491
492 if (-1 == xioctl(fd, VIDIOC_S_FMT, &amp;fmt))
493 errno_exit("VIDIOC_S_FMT");
494
495 /* Note VIDIOC_S_FMT may change width and height. */
496 } else {
497 /* Preserve original settings as set by v4l2-ctl for example */
498 if (-1 == xioctl(fd, VIDIOC_G_FMT, &amp;fmt))
499 errno_exit("VIDIOC_G_FMT");
500 }
501
502 /* Buggy driver paranoia. */
503 min = fmt.fmt.pix.width * 2;
504 if (fmt.fmt.pix.bytesperline &lt; min)
505 fmt.fmt.pix.bytesperline = min;
506 min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
507 if (fmt.fmt.pix.sizeimage &lt; min)
508 fmt.fmt.pix.sizeimage = min;
509
510 switch (io) {
511 case IO_METHOD_READ:
512 init_read(fmt.fmt.pix.sizeimage);
513 break;
514
515 case IO_METHOD_MMAP:
516 init_mmap();
517 break;
518
519 case IO_METHOD_USERPTR:
520 init_userp(fmt.fmt.pix.sizeimage);
521 break;
522 }
523}
524
525static void close_device(void)
526{
527 if (-1 == close(fd))
528 errno_exit("close");
529
530 fd = -1;
531}
532
533static void open_device(void)
534{
535 struct stat st;
536
537 if (-1 == stat(dev_name, &amp;st)) {
538 fprintf(stderr, "Cannot identify '%s': %d, %s\n",
539 dev_name, errno, strerror(errno));
540 exit(EXIT_FAILURE);
541 }
542
543 if (!S_ISCHR(st.st_mode)) {
544 fprintf(stderr, "%s is no device\n", dev_name);
545 exit(EXIT_FAILURE);
546 }
547
548 fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
549
550 if (-1 == fd) {
551 fprintf(stderr, "Cannot open '%s': %d, %s\n",
552 dev_name, errno, strerror(errno));
553 exit(EXIT_FAILURE);
554 }
555}
556
557static void usage(FILE *fp, int argc, char **argv)
558{
559 fprintf(fp,
560 "Usage: %s [options]\n\n"
561 "Version 1.3\n"
562 "Options:\n"
563 "-d | --device name Video device name [%s]\n"
564 "-h | --help Print this message\n"
565 "-m | --mmap Use memory mapped buffers [default]\n"
566 "-r | --read Use read() calls\n"
567 "-u | --userp Use application allocated buffers\n"
568 "-o | --output Outputs stream to stdout\n"
569 "-f | --format Force format to 640x480 YUYV\n"
570 "-c | --count Number of frames to grab [%i]\n"
571 "",
572 argv[0], dev_name, frame_count);
573}
574
575static const char short_options[] = "d:hmruofc:";
576
577static const struct option
578long_options[] = {
579 { "device", required_argument, NULL, 'd' },
580 { "help", no_argument, NULL, 'h' },
581 { "mmap", no_argument, NULL, 'm' },
582 { "read", no_argument, NULL, 'r' },
583 { "userp", no_argument, NULL, 'u' },
584 { "output", no_argument, NULL, 'o' },
585 { "format", no_argument, NULL, 'f' },
586 { "count", required_argument, NULL, 'c' },
587 { 0, 0, 0, 0 }
588};
589
590int main(int argc, char **argv)
591{
592 dev_name = "/dev/video0";
593
594 for (;;) {
595 int idx;
596 int c;
597
598 c = getopt_long(argc, argv,
599 short_options, long_options, &amp;idx);
600
601 if (-1 == c)
602 break;
603
604 switch (c) {
605 case 0: /* getopt_long() flag */
606 break;
607
608 case 'd':
609 dev_name = optarg;
610 break;
611
612 case 'h':
613 usage(stdout, argc, argv);
614 exit(EXIT_SUCCESS);
615
616 case 'm':
617 io = IO_METHOD_MMAP;
618 break;
619
620 case 'r':
621 io = IO_METHOD_READ;
622 break;
623
624 case 'u':
625 io = IO_METHOD_USERPTR;
626 break;
627
628 case 'o':
629 out_buf++;
630 break;
631
632 case 'f':
633 force_format++;
634 break;
635
636 case 'c':
637 errno = 0;
638 frame_count = strtol(optarg, NULL, 0);
639 if (errno)
640 errno_exit(optarg);
641 break;
642
643 default:
644 usage(stderr, argc, argv);
645 exit(EXIT_FAILURE);
646 }
647 }
648
649 open_device();
650 init_device();
651 start_capturing();
652 mainloop();
653 stop_capturing();
654 uninit_device();
655 close_device();
656 fprintf(stderr, "\n");
657 return 0;
658}
659</programlisting>
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml
new file mode 100644
index 00000000000..73c6847436c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/common.xml
@@ -0,0 +1,1214 @@
1 <title>Common API Elements</title>
2
3 <para>Programming a V4L2 device consists of these
4steps:</para>
5
6 <itemizedlist>
7 <listitem>
8 <para>Opening the device</para>
9 </listitem>
10 <listitem>
11 <para>Changing device properties, selecting a video and audio
12input, video standard, picture brightness a.&nbsp;o.</para>
13 </listitem>
14 <listitem>
15 <para>Negotiating a data format</para>
16 </listitem>
17 <listitem>
18 <para>Negotiating an input/output method</para>
19 </listitem>
20 <listitem>
21 <para>The actual input/output loop</para>
22 </listitem>
23 <listitem>
24 <para>Closing the device</para>
25 </listitem>
26 </itemizedlist>
27
28 <para>In practice most steps are optional and can be executed out of
29order. It depends on the V4L2 device type, you can read about the
30details in <xref linkend="devices" />. In this chapter we will discuss
31the basic concepts applicable to all devices.</para>
32
33 <section id="open">
34 <title>Opening and Closing Devices</title>
35
36 <section>
37 <title>Device Naming</title>
38
39 <para>V4L2 drivers are implemented as kernel modules, loaded
40manually by the system administrator or automatically when a device is
41first opened. The driver modules plug into the "videodev" kernel
42module. It provides helper functions and a common application
43interface specified in this document.</para>
44
45 <para>Each driver thus loaded registers one or more device nodes
46with major number 81 and a minor number between 0 and 255. Assigning
47minor numbers to V4L2 devices is entirely up to the system administrator,
48this is primarily intended to solve conflicts between devices.<footnote>
49 <para>Access permissions are associated with character
50device special files, hence we must ensure device numbers cannot
51change with the module load order. To this end minor numbers are no
52longer automatically assigned by the "videodev" module as in V4L but
53requested by the driver. The defaults will suffice for most people
54unless two drivers compete for the same minor numbers.</para>
55 </footnote> The module options to select minor numbers are named
56after the device special file with a "_nr" suffix. For example "video_nr"
57for <filename>/dev/video</filename> video capture devices. The number is
58an offset to the base minor number associated with the device type.
59<footnote>
60 <para>In earlier versions of the V4L2 API the module options
61where named after the device special file with a "unit_" prefix, expressing
62the minor number itself, not an offset. Rationale for this change is unknown.
63Lastly the naming and semantics are just a convention among driver writers,
64the point to note is that minor numbers are not supposed to be hardcoded
65into drivers.</para>
66 </footnote> When the driver supports multiple devices of the same
67type more than one minor number can be assigned, separated by commas:
68<informalexample>
69 <screen>
70&gt; insmod mydriver.o video_nr=0,1 radio_nr=0,1</screen>
71 </informalexample></para>
72
73 <para>In <filename>/etc/modules.conf</filename> this may be
74written as: <informalexample>
75 <screen>
76alias char-major-81-0 mydriver
77alias char-major-81-1 mydriver
78alias char-major-81-64 mydriver <co id="alias" />
79options mydriver video_nr=0,1 radio_nr=0,1 <co id="options" />
80 </screen>
81 <calloutlist>
82 <callout arearefs="alias">
83 <para>When an application attempts to open a device
84special file with major number 81 and minor number 0, 1, or 64, load
85"mydriver" (and the "videodev" module it depends upon).</para>
86 </callout>
87 <callout arearefs="options">
88 <para>Register the first two video capture devices with
89minor number 0 and 1 (base number is 0), the first two radio device
90with minor number 64 and 65 (base 64).</para>
91 </callout>
92 </calloutlist>
93 </informalexample> When no minor number is given as module
94option the driver supplies a default. <xref linkend="devices" />
95recommends the base minor numbers to be used for the various device
96types. Obviously minor numbers must be unique. When the number is
97already in use the <emphasis>offending device</emphasis> will not be
98registered. <!-- Blessed by Linus Torvalds on
99linux-kernel@vger.kernel.org, 2002-11-20. --></para>
100
101 <para>By convention system administrators create various
102character device special files with these major and minor numbers in
103the <filename>/dev</filename> directory. The names recommended for the
104different V4L2 device types are listed in <xref linkend="devices" />.
105</para>
106
107 <para>The creation of character special files (with
108<application>mknod</application>) is a privileged operation and
109devices cannot be opened by major and minor number. That means
110applications cannot <emphasis>reliable</emphasis> scan for loaded or
111installed drivers. The user must enter a device name, or the
112application can try the conventional device names.</para>
113
114 <para>Under the device filesystem (devfs) the minor number
115options are ignored. V4L2 drivers (or by proxy the "videodev" module)
116automatically create the required device files in the
117<filename>/dev/v4l</filename> directory using the conventional device
118names above.</para>
119 </section>
120
121 <section id="related">
122 <title>Related Devices</title>
123
124 <para>Devices can support several related functions. For example
125video capturing, video overlay and VBI capturing are related because
126these functions share, amongst other, the same video input and tuner
127frequency. V4L and earlier versions of V4L2 used the same device name
128and minor number for video capturing and overlay, but different ones
129for VBI. Experience showed this approach has several problems<footnote>
130 <para>Given a device file name one cannot reliable find
131related devices. For once names are arbitrary and in a system with
132multiple devices, where only some support VBI capturing, a
133<filename>/dev/video2</filename> is not necessarily related to
134<filename>/dev/vbi2</filename>. The V4L
135<constant>VIDIOCGUNIT</constant> ioctl would require a search for a
136device file with a particular major and minor number.</para>
137 </footnote>, and to make things worse the V4L videodev module
138used to prohibit multiple opens of a device.</para>
139
140 <para>As a remedy the present version of the V4L2 API relaxed the
141concept of device types with specific names and minor numbers. For
142compatibility with old applications drivers must still register different
143minor numbers to assign a default function to the device. But if related
144functions are supported by the driver they must be available under all
145registered minor numbers. The desired function can be selected after
146opening the device as described in <xref linkend="devices" />.</para>
147
148 <para>Imagine a driver supporting video capturing, video
149overlay, raw VBI capturing, and FM radio reception. It registers three
150devices with minor number 0, 64 and 224 (this numbering scheme is
151inherited from the V4L API). Regardless if
152<filename>/dev/video</filename> (81, 0) or
153<filename>/dev/vbi</filename> (81, 224) is opened the application can
154select any one of the video capturing, overlay or VBI capturing
155functions. Without programming (e.&nbsp;g. reading from the device
156with <application>dd</application> or <application>cat</application>)
157<filename>/dev/video</filename> captures video images, while
158<filename>/dev/vbi</filename> captures raw VBI data.
159<filename>/dev/radio</filename> (81, 64) is invariable a radio device,
160unrelated to the video functions. Being unrelated does not imply the
161devices can be used at the same time, however. The &func-open;
162function may very well return an &EBUSY;.</para>
163
164 <para>Besides video input or output the hardware may also
165support audio sampling or playback. If so, these functions are
166implemented as OSS or ALSA PCM devices and eventually OSS or ALSA
167audio mixer. The V4L2 API makes no provisions yet to find these
168related devices. If you have an idea please write to the linux-media
169mailing list: &v4l-ml;.</para>
170 </section>
171
172 <section>
173 <title>Multiple Opens</title>
174
175 <para>In general, V4L2 devices can be opened more than once.
176When this is supported by the driver, users can for example start a
177"panel" application to change controls like brightness or audio
178volume, while another application captures video and audio. In other words, panel
179applications are comparable to an OSS or ALSA audio mixer application.
180When a device supports multiple functions like capturing and overlay
181<emphasis>simultaneously</emphasis>, multiple opens allow concurrent
182use of the device by forked processes or specialized applications.</para>
183
184 <para>Multiple opens are optional, although drivers should
185permit at least concurrent accesses without data exchange, &ie; panel
186applications. This implies &func-open; can return an &EBUSY; when the
187device is already in use, as well as &func-ioctl; functions initiating
188data exchange (namely the &VIDIOC-S-FMT; ioctl), and the &func-read;
189and &func-write; functions.</para>
190
191 <para>Mere opening a V4L2 device does not grant exclusive
192access.<footnote>
193 <para>Drivers could recognize the
194<constant>O_EXCL</constant> open flag. Presently this is not required,
195so applications cannot know if it really works.</para>
196 </footnote> Initiating data exchange however assigns the right
197to read or write the requested type of data, and to change related
198properties, to this file descriptor. Applications can request
199additional access privileges using the priority mechanism described in
200<xref linkend="app-pri" />.</para>
201 </section>
202
203 <section>
204 <title>Shared Data Streams</title>
205
206 <para>V4L2 drivers should not support multiple applications
207reading or writing the same data stream on a device by copying
208buffers, time multiplexing or similar means. This is better handled by
209a proxy application in user space. When the driver supports stream
210sharing anyway it must be implemented transparently. The V4L2 API does
211not specify how conflicts are solved. <!-- For example O_EXCL when the
212application does not want to be preempted, PROT_READ mmapped buffers
213which can be mapped twice, what happens when image formats do not
214match etc.--></para>
215 </section>
216
217 <section>
218 <title>Functions</title>
219
220 <para>To open and close V4L2 devices applications use the
221&func-open; and &func-close; function, respectively. Devices are
222programmed using the &func-ioctl; function as explained in the
223following sections.</para>
224 </section>
225 </section>
226
227 <section id="querycap">
228 <title>Querying Capabilities</title>
229
230 <para>Because V4L2 covers a wide variety of devices not all
231aspects of the API are equally applicable to all types of devices.
232Furthermore devices of the same type have different capabilities and
233this specification permits the omission of a few complicated and less
234important parts of the API.</para>
235
236 <para>The &VIDIOC-QUERYCAP; ioctl is available to check if the kernel
237device is compatible with this specification, and to query the <link
238linkend="devices">functions</link> and <link linkend="io">I/O
239methods</link> supported by the device.</para>
240
241 <para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the
242V4L2 API version used by the driver, with generally matches the Kernel version.
243There's no need of using &VIDIOC-QUERYCAP; to check if an specific ioctl is
244supported, the V4L2 core now returns ENOIOCTLCMD if a driver doesn't provide
245support for an ioctl.</para>
246
247 <para>Other features can be queried
248by calling the respective ioctl, for example &VIDIOC-ENUMINPUT;
249to learn about the number, types and names of video connectors on the
250device. Although abstraction is a major objective of this API, the
251ioctl also allows driver specific applications to reliable identify
252the driver.</para>
253
254 <para>All V4L2 drivers must support
255<constant>VIDIOC_QUERYCAP</constant>. Applications should always call
256this ioctl after opening the device.</para>
257 </section>
258
259 <section id="app-pri">
260 <title>Application Priority</title>
261
262 <para>When multiple applications share a device it may be
263desirable to assign them different priorities. Contrary to the
264traditional "rm -rf /" school of thought a video recording application
265could for example block other applications from changing video
266controls or switching the current TV channel. Another objective is to
267permit low priority applications working in background, which can be
268preempted by user controlled applications and automatically regain
269control of the device at a later time.</para>
270
271 <para>Since these features cannot be implemented entirely in user
272space V4L2 defines the &VIDIOC-G-PRIORITY; and &VIDIOC-S-PRIORITY;
273ioctls to request and query the access priority associate with a file
274descriptor. Opening a device assigns a medium priority, compatible
275with earlier versions of V4L2 and drivers not supporting these ioctls.
276Applications requiring a different priority will usually call
277<constant>VIDIOC_S_PRIORITY</constant> after verifying the device with
278the &VIDIOC-QUERYCAP; ioctl.</para>
279
280 <para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;,
281return an &EBUSY; after another application obtained higher priority.
282An event mechanism to notify applications about asynchronous property
283changes has been proposed but not added yet.</para>
284 </section>
285
286 <section id="video">
287 <title>Video Inputs and Outputs</title>
288
289 <para>Video inputs and outputs are physical connectors of a
290device. These can be for example RF connectors (antenna/cable), CVBS
291a.k.a. Composite Video, S-Video or RGB connectors. Only video and VBI
292capture devices have inputs, output devices have outputs, at least one
293each. Radio devices have no video inputs or outputs.</para>
294
295 <para>To learn about the number and attributes of the
296available inputs and outputs applications can enumerate them with the
297&VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; ioctl, respectively. The
298&v4l2-input; returned by the <constant>VIDIOC_ENUMINPUT</constant>
299ioctl also contains signal status information applicable when the
300current video input is queried.</para>
301
302 <para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctl return the
303index of the current video input or output. To select a different
304input or output applications call the &VIDIOC-S-INPUT; and
305&VIDIOC-S-OUTPUT; ioctl. Drivers must implement all the input ioctls
306when the device has one or more inputs, all the output ioctls when the
307device has one or more outputs.</para>
308
309 <!--
310 <figure id=io-tree>
311 <title>Input and output enumeration is the root of most device properties.</title>
312 <mediaobject>
313 <imageobject>
314 <imagedata fileref="links.pdf" format="ps" />
315 </imageobject>
316 <imageobject>
317 <imagedata fileref="links.gif" format="gif" />
318 </imageobject>
319 <textobject>
320 <phrase>Links between various device property structures.</phrase>
321 </textobject>
322 </mediaobject>
323 </figure>
324 -->
325
326 <example>
327 <title>Information about the current video input</title>
328
329 <programlisting>
330&v4l2-input; input;
331int index;
332
333if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;index)) {
334 perror ("VIDIOC_G_INPUT");
335 exit (EXIT_FAILURE);
336}
337
338memset (&amp;input, 0, sizeof (input));
339input.index = index;
340
341if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
342 perror ("VIDIOC_ENUMINPUT");
343 exit (EXIT_FAILURE);
344}
345
346printf ("Current input: %s\n", input.name);
347 </programlisting>
348 </example>
349
350 <example>
351 <title>Switching to the first video input</title>
352
353 <programlisting>
354int index;
355
356index = 0;
357
358if (-1 == ioctl (fd, &VIDIOC-S-INPUT;, &amp;index)) {
359 perror ("VIDIOC_S_INPUT");
360 exit (EXIT_FAILURE);
361}
362 </programlisting>
363 </example>
364 </section>
365
366 <section id="audio">
367 <title>Audio Inputs and Outputs</title>
368
369 <para>Audio inputs and outputs are physical connectors of a
370device. Video capture devices have inputs, output devices have
371outputs, zero or more each. Radio devices have no audio inputs or
372outputs. They have exactly one tuner which in fact
373<emphasis>is</emphasis> an audio source, but this API associates
374tuners with video inputs or outputs only, and radio devices have
375none of these.<footnote>
376 <para>Actually &v4l2-audio; ought to have a
377<structfield>tuner</structfield> field like &v4l2-input;, not only
378making the API more consistent but also permitting radio devices with
379multiple tuners.</para>
380 </footnote> A connector on a TV card to loop back the received
381audio signal to a sound card is not considered an audio output.</para>
382
383 <para>Audio and video inputs and outputs are associated. Selecting
384a video source also selects an audio source. This is most evident when
385the video and audio source is a tuner. Further audio connectors can
386combine with more than one video input or output. Assumed two
387composite video inputs and two audio inputs exist, there may be up to
388four valid combinations. The relation of video and audio connectors
389is defined in the <structfield>audioset</structfield> field of the
390respective &v4l2-input; or &v4l2-output;, where each bit represents
391the index number, starting at zero, of one audio input or output.</para>
392
393 <para>To learn about the number and attributes of the
394available inputs and outputs applications can enumerate them with the
395&VIDIOC-ENUMAUDIO; and &VIDIOC-ENUMAUDOUT; ioctl, respectively. The
396&v4l2-audio; returned by the <constant>VIDIOC_ENUMAUDIO</constant> ioctl
397also contains signal status information applicable when the current
398audio input is queried.</para>
399
400 <para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctl report
401the current audio input and output, respectively. Note that, unlike
402&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure
403as <constant>VIDIOC_ENUMAUDIO</constant> and
404<constant>VIDIOC_ENUMAUDOUT</constant> do, not just an index.</para>
405
406 <para>To select an audio input and change its properties
407applications call the &VIDIOC-S-AUDIO; ioctl. To select an audio
408output (which presently has no changeable properties) applications
409call the &VIDIOC-S-AUDOUT; ioctl.</para>
410
411 <para>Drivers must implement all input ioctls when the device
412has one or more inputs, all output ioctls when the device has one
413or more outputs. When the device has any audio inputs or outputs the
414driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the
415&v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para>
416
417 <example>
418 <title>Information about the current audio input</title>
419
420 <programlisting>
421&v4l2-audio; audio;
422
423memset (&amp;audio, 0, sizeof (audio));
424
425if (-1 == ioctl (fd, &VIDIOC-G-AUDIO;, &amp;audio)) {
426 perror ("VIDIOC_G_AUDIO");
427 exit (EXIT_FAILURE);
428}
429
430printf ("Current input: %s\n", audio.name);
431 </programlisting>
432 </example>
433
434 <example>
435 <title>Switching to the first audio input</title>
436
437 <programlisting>
438&v4l2-audio; audio;
439
440memset (&amp;audio, 0, sizeof (audio)); /* clear audio.mode, audio.reserved */
441
442audio.index = 0;
443
444if (-1 == ioctl (fd, &VIDIOC-S-AUDIO;, &amp;audio)) {
445 perror ("VIDIOC_S_AUDIO");
446 exit (EXIT_FAILURE);
447}
448 </programlisting>
449 </example>
450 </section>
451
452 <section id="tuner">
453 <title>Tuners and Modulators</title>
454
455 <section>
456 <title>Tuners</title>
457
458 <para>Video input devices can have one or more tuners
459demodulating a RF signal. Each tuner is associated with one or more
460video inputs, depending on the number of RF connectors on the tuner.
461The <structfield>type</structfield> field of the respective
462&v4l2-input; returned by the &VIDIOC-ENUMINPUT; ioctl is set to
463<constant>V4L2_INPUT_TYPE_TUNER</constant> and its
464<structfield>tuner</structfield> field contains the index number of
465the tuner.</para>
466
467 <para>Radio input devices have exactly one tuner with index zero, no
468video inputs.</para>
469
470 <para>To query and change tuner properties applications use the
471&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The
472&v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also
473contains signal status information applicable when the tuner of the
474current video or radio input is queried. Note that
475<constant>VIDIOC_S_TUNER</constant> does not switch the current tuner,
476when there is more than one at all. The tuner is solely determined by
477the current video input. Drivers must support both ioctls and set the
478<constant>V4L2_CAP_TUNER</constant> flag in the &v4l2-capability;
479returned by the &VIDIOC-QUERYCAP; ioctl when the device has one or
480more tuners.</para>
481 </section>
482
483 <section>
484 <title>Modulators</title>
485
486 <para>Video output devices can have one or more modulators, uh,
487modulating a video signal for radiation or connection to the antenna
488input of a TV set or video recorder. Each modulator is associated with
489one or more video outputs, depending on the number of RF connectors on
490the modulator. The <structfield>type</structfield> field of the
491respective &v4l2-output; returned by the &VIDIOC-ENUMOUTPUT; ioctl is
492set to <constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> and its
493<structfield>modulator</structfield> field contains the index number
494of the modulator.</para>
495
496 <para>Radio output devices have exactly one modulator with index
497zero, no video outputs.</para>
498
499 <para>A video or radio device cannot support both a tuner and a
500modulator. Two separate device nodes will have to be used for such
501hardware, one that supports the tuner functionality and one that supports
502the modulator functionality. The reason is a limitation with the
503&VIDIOC-S-FREQUENCY; ioctl where you cannot specify whether the frequency
504is for a tuner or a modulator.</para>
505
506 <para>To query and change modulator properties applications use
507the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that
508<constant>VIDIOC_S_MODULATOR</constant> does not switch the current
509modulator, when there is more than one at all. The modulator is solely
510determined by the current video output. Drivers must support both
511ioctls and set the <constant>V4L2_CAP_MODULATOR</constant> flag in
512the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl when the
513device has one or more modulators.</para>
514 </section>
515
516 <section>
517 <title>Radio Frequency</title>
518
519 <para>To get and set the tuner or modulator radio frequency
520applications use the &VIDIOC-G-FREQUENCY; and &VIDIOC-S-FREQUENCY;
521ioctl which both take a pointer to a &v4l2-frequency;. These ioctls
522are used for TV and radio devices alike. Drivers must support both
523ioctls when the tuner or modulator ioctls are supported, or
524when the device is a radio device.</para>
525 </section>
526 </section>
527
528 <section id="standard">
529 <title>Video Standards</title>
530
531 <para>Video devices typically support one or more different video
532standards or variations of standards. Each video input and output may
533support another set of standards. This set is reported by the
534<structfield>std</structfield> field of &v4l2-input; and
535&v4l2-output; returned by the &VIDIOC-ENUMINPUT; and
536&VIDIOC-ENUMOUTPUT; ioctl, respectively.</para>
537
538 <para>V4L2 defines one bit for each analog video standard
539currently in use worldwide, and sets aside bits for driver defined
540standards, &eg; hybrid standards to watch NTSC video tapes on PAL TVs
541and vice versa. Applications can use the predefined bits to select a
542particular standard, although presenting the user a menu of supported
543standards is preferred. To enumerate and query the attributes of the
544supported standards applications use the &VIDIOC-ENUMSTD; ioctl.</para>
545
546 <para>Many of the defined standards are actually just variations
547of a few major standards. The hardware may in fact not distinguish
548between them, or do so internal and switch automatically. Therefore
549enumerated standards also contain sets of one or more standard
550bits.</para>
551
552 <para>Assume a hypothetic tuner capable of demodulating B/PAL,
553G/PAL and I/PAL signals. The first enumerated standard is a set of B
554and G/PAL, switched automatically depending on the selected radio
555frequency in UHF or VHF band. Enumeration gives a "PAL-B/G" or "PAL-I"
556choice. Similar a Composite input may collapse standards, enumerating
557"PAL-B/G/H/I", "NTSC-M" and "SECAM-D/K".<footnote>
558 <para>Some users are already confused by technical terms PAL,
559NTSC and SECAM. There is no point asking them to distinguish between
560B, G, D, or K when the software or hardware can do that
561automatically.</para>
562 </footnote></para>
563
564 <para>To query and select the standard used by the current video
565input or output applications call the &VIDIOC-G-STD; and
566&VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis>
567standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note that the parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote>
568 <para>An alternative to the current scheme is to use pointers
569to indices as arguments of <constant>VIDIOC_G_STD</constant> and
570<constant>VIDIOC_S_STD</constant>, the &v4l2-input; and
571&v4l2-output; <structfield>std</structfield> field would be a set of
572indices like <structfield>audioset</structfield>.</para>
573 <para>Indices are consistent with the rest of the API
574and identify the standard unambiguously. In the present scheme of
575things an enumerated standard is looked up by &v4l2-std-id;. Now the
576standards supported by the inputs of a device can overlap. Just
577assume the tuner and composite input in the example above both
578exist on a device. An enumeration of "PAL-B/G", "PAL-H/I" suggests
579a choice which does not exist. We cannot merge or omit sets, because
580applications would be unable to find the standards reported by
581<constant>VIDIOC_G_STD</constant>. That leaves separate enumerations
582for each input. Also selecting a standard by &v4l2-std-id; can be
583ambiguous. Advantage of this method is that applications need not
584identify the standard indirectly, after enumerating.</para><para>So in
585summary, the lookup itself is unavoidable. The difference is only
586whether the lookup is necessary to find an enumerated standard or to
587switch to a standard by &v4l2-std-id;.</para>
588 </footnote> Drivers must implement all video standard ioctls
589when the device has one or more video inputs or outputs.</para>
590
591 <para>Special rules apply to devices such as USB cameras where the notion of video
592standards makes little sense. More generally for any capture or output device
593which is: <itemizedlist>
594 <listitem>
595 <para>incapable of capturing fields or frames at the nominal
596rate of the video standard, or</para>
597 </listitem>
598 <listitem>
599 <para>that does not support the video standard formats at all.</para>
600 </listitem>
601 </itemizedlist> Here the driver shall set the
602<structfield>std</structfield> field of &v4l2-input; and &v4l2-output;
603to zero and the <constant>VIDIOC_G_STD</constant>,
604<constant>VIDIOC_S_STD</constant>,
605<constant>VIDIOC_QUERYSTD</constant> and
606<constant>VIDIOC_ENUMSTD</constant> ioctls shall return the
607&ENOTTY;.<footnote>
608 <para>See <xref linkend="buffer" /> for a rationale.</para>
609 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
610<xref linkend="output-capabilities"/> flags to determine whether the video standard ioctls
611are available for the device.</para>
612&ENOTTY;.
613 <para>See <xref linkend="buffer" /> for a rationale. Probably
614even USB cameras follow some well known video standard. It might have
615been better to explicitly indicate elsewhere if a device cannot live
616up to normal expectations, instead of this exception.</para>
617 </footnote></para>
618
619 <example>
620 <title>Information about the current video standard</title>
621
622 <programlisting>
623&v4l2-std-id; std_id;
624&v4l2-standard; standard;
625
626if (-1 == ioctl (fd, &VIDIOC-G-STD;, &amp;std_id)) {
627 /* Note when VIDIOC_ENUMSTD always returns ENOTTY this
628 is no video device or it falls under the USB exception,
629 and VIDIOC_G_STD returning ENOTTY is no error. */
630
631 perror ("VIDIOC_G_STD");
632 exit (EXIT_FAILURE);
633}
634
635memset (&amp;standard, 0, sizeof (standard));
636standard.index = 0;
637
638while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
639 if (standard.id &amp; std_id) {
640 printf ("Current video standard: %s\n", standard.name);
641 exit (EXIT_SUCCESS);
642 }
643
644 standard.index++;
645}
646
647/* EINVAL indicates the end of the enumeration, which cannot be
648 empty unless this device falls under the USB exception. */
649
650if (errno == EINVAL || standard.index == 0) {
651 perror ("VIDIOC_ENUMSTD");
652 exit (EXIT_FAILURE);
653}
654 </programlisting>
655 </example>
656
657 <example>
658 <title>Listing the video standards supported by the current
659input</title>
660
661 <programlisting>
662&v4l2-input; input;
663&v4l2-standard; standard;
664
665memset (&amp;input, 0, sizeof (input));
666
667if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;input.index)) {
668 perror ("VIDIOC_G_INPUT");
669 exit (EXIT_FAILURE);
670}
671
672if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
673 perror ("VIDIOC_ENUM_INPUT");
674 exit (EXIT_FAILURE);
675}
676
677printf ("Current input %s supports:\n", input.name);
678
679memset (&amp;standard, 0, sizeof (standard));
680standard.index = 0;
681
682while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
683 if (standard.id &amp; input.std)
684 printf ("%s\n", standard.name);
685
686 standard.index++;
687}
688
689/* EINVAL indicates the end of the enumeration, which cannot be
690 empty unless this device falls under the USB exception. */
691
692if (errno != EINVAL || standard.index == 0) {
693 perror ("VIDIOC_ENUMSTD");
694 exit (EXIT_FAILURE);
695}
696 </programlisting>
697 </example>
698
699 <example>
700 <title>Selecting a new video standard</title>
701
702 <programlisting>
703&v4l2-input; input;
704&v4l2-std-id; std_id;
705
706memset (&amp;input, 0, sizeof (input));
707
708if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;input.index)) {
709 perror ("VIDIOC_G_INPUT");
710 exit (EXIT_FAILURE);
711}
712
713if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
714 perror ("VIDIOC_ENUM_INPUT");
715 exit (EXIT_FAILURE);
716}
717
718if (0 == (input.std &amp; V4L2_STD_PAL_BG)) {
719 fprintf (stderr, "Oops. B/G PAL is not supported.\n");
720 exit (EXIT_FAILURE);
721}
722
723/* Note this is also supposed to work when only B
724 <emphasis>or</emphasis> G/PAL is supported. */
725
726std_id = V4L2_STD_PAL_BG;
727
728if (-1 == ioctl (fd, &VIDIOC-S-STD;, &amp;std_id)) {
729 perror ("VIDIOC_S_STD");
730 exit (EXIT_FAILURE);
731}
732 </programlisting>
733 </example>
734 </section>
735 <section id="dv-timings">
736 <title>Digital Video (DV) Timings</title>
737 <para>
738 The video standards discussed so far have been dealing with Analog TV and the
739corresponding video timings. Today there are many more different hardware interfaces
740such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry
741video signals and there is a need to extend the API to select the video timings
742for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to
743the limited bits available, a new set of IOCTLs was added to set/get video timings at
744the input and output: </para><itemizedlist>
745 <listitem>
746 <para>DV Timings: This will allow applications to define detailed
747video timings for the interface. This includes parameters such as width, height,
748polarities, frontporch, backporch etc. The <filename>linux/v4l2-dv-timings.h</filename>
749header can be used to get the timings of the formats in the <xref linkend="cea861" /> and
750<xref linkend="vesadmt" /> standards.
751 </para>
752 </listitem>
753 <listitem>
754 <para>DV Presets: Digital Video (DV) presets (<emphasis role="bold">deprecated</emphasis>).
755 These are IDs representing a
756video timing at the input/output. Presets are pre-defined timings implemented
757by the hardware according to video standards. A __u32 data type is used to represent
758a preset unlike the bit mask that is used in &v4l2-std-id; allowing future extensions
759to support as many different presets as needed. This API is deprecated in favor of the DV Timings
760API.</para>
761 </listitem>
762 </itemizedlist>
763 <para>To enumerate and query the attributes of the DV timings supported by a device,
764 applications use the &VIDIOC-ENUM-DV-TIMINGS; and &VIDIOC-DV-TIMINGS-CAP; ioctls.
765 To set DV timings for the device, applications use the
766&VIDIOC-S-DV-TIMINGS; ioctl and to get current DV timings they use the
767&VIDIOC-G-DV-TIMINGS; ioctl. To detect the DV timings as seen by the video receiver applications
768use the &VIDIOC-QUERY-DV-TIMINGS; ioctl.</para>
769 <para>To enumerate and query the attributes of DV presets supported by a device,
770applications use the &VIDIOC-ENUM-DV-PRESETS; ioctl. To get the current DV preset,
771applications use the &VIDIOC-G-DV-PRESET; ioctl and to set a preset they use the
772&VIDIOC-S-DV-PRESET; ioctl. To detect the preset as seen by the video receiver applications
773use the &VIDIOC-QUERY-DV-PRESET; ioctl.</para>
774 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
775<xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the
776video timings for the device.</para>
777 </section>
778
779 &sub-controls;
780
781 <section id="format">
782 <title>Data Formats</title>
783
784 <section>
785 <title>Data Format Negotiation</title>
786
787 <para>Different devices exchange different kinds of data with
788applications, for example video images, raw or sliced VBI data, RDS
789datagrams. Even within one kind many different formats are possible,
790in particular an abundance of image formats. Although drivers must
791provide a default and the selection persists across closing and
792reopening a device, applications should always negotiate a data format
793before engaging in data exchange. Negotiation means the application
794asks for a particular format and the driver selects and reports the
795best the hardware can do to satisfy the request. Of course
796applications can also just query the current selection.</para>
797
798 <para>A single mechanism exists to negotiate all data formats
799using the aggregate &v4l2-format; and the &VIDIOC-G-FMT; and
800&VIDIOC-S-FMT; ioctls. Additionally the &VIDIOC-TRY-FMT; ioctl can be
801used to examine what the hardware <emphasis>could</emphasis> do,
802without actually selecting a new data format. The data formats
803supported by the V4L2 API are covered in the respective device section
804in <xref linkend="devices" />. For a closer look at image formats see
805<xref linkend="pixfmt" />.</para>
806
807 <para>The <constant>VIDIOC_S_FMT</constant> ioctl is a major
808turning-point in the initialization sequence. Prior to this point
809multiple panel applications can access the same device concurrently to
810select the current input, change controls or modify other properties.
811The first <constant>VIDIOC_S_FMT</constant> assigns a logical stream
812(video data, VBI data etc.) exclusively to one file descriptor.</para>
813
814 <para>Exclusive means no other application, more precisely no
815other file descriptor, can grab this stream or change device
816properties inconsistent with the negotiated parameters. A video
817standard change for example, when the new standard uses a different
818number of scan lines, can invalidate the selected image format.
819Therefore only the file descriptor owning the stream can make
820invalidating changes. Accordingly multiple file descriptors which
821grabbed different logical streams prevent each other from interfering
822with their settings. When for example video overlay is about to start
823or already in progress, simultaneous video capturing may be restricted
824to the same cropping and image size.</para>
825
826 <para>When applications omit the
827<constant>VIDIOC_S_FMT</constant> ioctl its locking side effects are
828implied by the next step, the selection of an I/O method with the
829&VIDIOC-REQBUFS; ioctl or implicit with the first &func-read; or
830&func-write; call.</para>
831
832 <para>Generally only one logical stream can be assigned to a
833file descriptor, the exception being drivers permitting simultaneous
834video capturing and overlay using the same file descriptor for
835compatibility with V4L and earlier versions of V4L2. Switching the
836logical stream or returning into "panel mode" is possible by closing
837and reopening the device. Drivers <emphasis>may</emphasis> support a
838switch using <constant>VIDIOC_S_FMT</constant>.</para>
839
840 <para>All drivers exchanging data with
841applications must support the <constant>VIDIOC_G_FMT</constant> and
842<constant>VIDIOC_S_FMT</constant> ioctl. Implementation of the
843<constant>VIDIOC_TRY_FMT</constant> is highly recommended but
844optional.</para>
845 </section>
846
847 <section>
848 <title>Image Format Enumeration</title>
849
850 <para>Apart of the generic format negotiation functions
851a special ioctl to enumerate all image formats supported by video
852capture, overlay or output devices is available.<footnote>
853 <para>Enumerating formats an application has no a-priori
854knowledge of (otherwise it could explicitly ask for them and need not
855enumerate) seems useless, but there are applications serving as proxy
856between drivers and the actual video applications for which this is
857useful.</para>
858 </footnote></para>
859
860 <para>The &VIDIOC-ENUM-FMT; ioctl must be supported
861by all drivers exchanging image data with applications.</para>
862
863 <important>
864 <para>Drivers are not supposed to convert image formats in
865kernel space. They must enumerate only formats directly supported by
866the hardware. If necessary driver writers should publish an example
867conversion routine or library for integration into applications.</para>
868 </important>
869 </section>
870 </section>
871
872 &sub-planar-apis;
873
874 <section id="crop">
875 <title>Image Cropping, Insertion and Scaling</title>
876
877 <para>Some video capture devices can sample a subsection of the
878picture and shrink or enlarge it to an image of arbitrary size. We
879call these abilities cropping and scaling. Some video output devices
880can scale an image up or down and insert it at an arbitrary scan line
881and horizontal offset into a video signal.</para>
882
883 <para>Applications can use the following API to select an area in
884the video signal, query the default area and the hardware limits.
885<emphasis>Despite their name, the &VIDIOC-CROPCAP;, &VIDIOC-G-CROP;
886and &VIDIOC-S-CROP; ioctls apply to input as well as output
887devices.</emphasis></para>
888
889 <para>Scaling requires a source and a target. On a video capture
890or overlay device the source is the video signal, and the cropping
891ioctls determine the area actually sampled. The target are images
892read by the application or overlaid onto the graphics screen. Their
893size (and position for an overlay) is negotiated with the
894&VIDIOC-G-FMT; and &VIDIOC-S-FMT; ioctls.</para>
895
896 <para>On a video output device the source are the images passed in
897by the application, and their size is again negotiated with the
898<constant>VIDIOC_G/S_FMT</constant> ioctls, or may be encoded in a
899compressed video stream. The target is the video signal, and the
900cropping ioctls determine the area where the images are
901inserted.</para>
902
903 <para>Source and target rectangles are defined even if the device
904does not support scaling or the <constant>VIDIOC_G/S_CROP</constant>
905ioctls. Their size (and position where applicable) will be fixed in
906this case. <emphasis>All capture and output device must support the
907<constant>VIDIOC_CROPCAP</constant> ioctl such that applications can
908determine if scaling takes place.</emphasis></para>
909
910 <section>
911 <title>Cropping Structures</title>
912
913 <figure id="crop-scale">
914 <title>Image Cropping, Insertion and Scaling</title>
915 <mediaobject>
916 <imageobject>
917 <imagedata fileref="crop.pdf" format="PS" />
918 </imageobject>
919 <imageobject>
920 <imagedata fileref="crop.gif" format="GIF" />
921 </imageobject>
922 <textobject>
923 <phrase>The cropping, insertion and scaling process</phrase>
924 </textobject>
925 </mediaobject>
926 </figure>
927
928 <para>For capture devices the coordinates of the top left
929corner, width and height of the area which can be sampled is given by
930the <structfield>bounds</structfield> substructure of the
931&v4l2-cropcap; returned by the <constant>VIDIOC_CROPCAP</constant>
932ioctl. To support a wide range of hardware this specification does not
933define an origin or units. However by convention drivers should
934horizontally count unscaled samples relative to 0H (the leading edge
935of the horizontal sync pulse, see <xref linkend="vbi-hsync" />).
936Vertically ITU-R line
937numbers of the first field (<xref linkend="vbi-525" />, <xref
938linkend="vbi-625" />), multiplied by two if the driver can capture both
939fields.</para>
940
941 <para>The top left corner, width and height of the source
942rectangle, that is the area actually sampled, is given by &v4l2-crop;
943using the same coordinate system as &v4l2-cropcap;. Applications can
944use the <constant>VIDIOC_G_CROP</constant> and
945<constant>VIDIOC_S_CROP</constant> ioctls to get and set this
946rectangle. It must lie completely within the capture boundaries and
947the driver may further adjust the requested size and/or position
948according to hardware limitations.</para>
949
950 <para>Each capture device has a default source rectangle, given
951by the <structfield>defrect</structfield> substructure of
952&v4l2-cropcap;. The center of this rectangle shall align with the
953center of the active picture area of the video signal, and cover what
954the driver writer considers the complete picture. Drivers shall reset
955the source rectangle to the default when the driver is first loaded,
956but not later.</para>
957
958 <para>For output devices these structures and ioctls are used
959accordingly, defining the <emphasis>target</emphasis> rectangle where
960the images will be inserted into the video signal.</para>
961
962 </section>
963
964 <section>
965 <title>Scaling Adjustments</title>
966
967 <para>Video hardware can have various cropping, insertion and
968scaling limitations. It may only scale up or down, support only
969discrete scaling factors, or have different scaling abilities in
970horizontal and vertical direction. Also it may not support scaling at
971all. At the same time the &v4l2-crop; rectangle may have to be
972aligned, and both the source and target rectangles may have arbitrary
973upper and lower size limits. In particular the maximum
974<structfield>width</structfield> and <structfield>height</structfield>
975in &v4l2-crop; may be smaller than the
976&v4l2-cropcap;.<structfield>bounds</structfield> area. Therefore, as
977usual, drivers are expected to adjust the requested parameters and
978return the actual values selected.</para>
979
980 <para>Applications can change the source or the target rectangle
981first, as they may prefer a particular image size or a certain area in
982the video signal. If the driver has to adjust both to satisfy hardware
983limitations, the last requested rectangle shall take priority, and the
984driver should preferably adjust the opposite one. The &VIDIOC-TRY-FMT;
985ioctl however shall not change the driver state and therefore only
986adjust the requested rectangle.</para>
987
988 <para>Suppose scaling on a video capture device is restricted to
989a factor 1:1 or 2:1 in either direction and the target image size must
990be a multiple of 16&nbsp;&times;&nbsp;16 pixels. The source cropping
991rectangle is set to defaults, which are also the upper limit in this
992example, of 640&nbsp;&times;&nbsp;400 pixels at offset 0,&nbsp;0. An
993application requests an image size of 300&nbsp;&times;&nbsp;225
994pixels, assuming video will be scaled down from the "full picture"
995accordingly. The driver sets the image size to the closest possible
996values 304&nbsp;&times;&nbsp;224, then chooses the cropping rectangle
997closest to the requested size, that is 608&nbsp;&times;&nbsp;224
998(224&nbsp;&times;&nbsp;2:1 would exceed the limit 400). The offset
9990,&nbsp;0 is still valid, thus unmodified. Given the default cropping
1000rectangle reported by <constant>VIDIOC_CROPCAP</constant> the
1001application can easily propose another offset to center the cropping
1002rectangle.</para>
1003
1004 <para>Now the application may insist on covering an area using a
1005picture aspect ratio closer to the original request, so it asks for a
1006cropping rectangle of 608&nbsp;&times;&nbsp;456 pixels. The present
1007scaling factors limit cropping to 640&nbsp;&times;&nbsp;384, so the
1008driver returns the cropping size 608&nbsp;&times;&nbsp;384 and adjusts
1009the image size to closest possible 304&nbsp;&times;&nbsp;192.</para>
1010
1011 </section>
1012
1013 <section>
1014 <title>Examples</title>
1015
1016 <para>Source and target rectangles shall remain unchanged across
1017closing and reopening a device, such that piping data into or out of a
1018device will work without special preparations. More advanced
1019applications should ensure the parameters are suitable before starting
1020I/O.</para>
1021
1022 <example>
1023 <title>Resetting the cropping parameters</title>
1024
1025 <para>(A video capture device is assumed; change
1026<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> for other
1027devices.)</para>
1028
1029 <programlisting>
1030&v4l2-cropcap; cropcap;
1031&v4l2-crop; crop;
1032
1033memset (&amp;cropcap, 0, sizeof (cropcap));
1034cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1035
1036if (-1 == ioctl (fd, &VIDIOC-CROPCAP;, &amp;cropcap)) {
1037 perror ("VIDIOC_CROPCAP");
1038 exit (EXIT_FAILURE);
1039}
1040
1041memset (&amp;crop, 0, sizeof (crop));
1042crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1043crop.c = cropcap.defrect;
1044
1045/* Ignore if cropping is not supported (EINVAL). */
1046
1047if (-1 == ioctl (fd, &VIDIOC-S-CROP;, &amp;crop)
1048 &amp;&amp; errno != EINVAL) {
1049 perror ("VIDIOC_S_CROP");
1050 exit (EXIT_FAILURE);
1051}
1052 </programlisting>
1053 </example>
1054
1055 <example>
1056 <title>Simple downscaling</title>
1057
1058 <para>(A video capture device is assumed.)</para>
1059
1060 <programlisting>
1061&v4l2-cropcap; cropcap;
1062&v4l2-format; format;
1063
1064reset_cropping_parameters ();
1065
1066/* Scale down to 1/4 size of full picture. */
1067
1068memset (&amp;format, 0, sizeof (format)); /* defaults */
1069
1070format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1071
1072format.fmt.pix.width = cropcap.defrect.width &gt;&gt; 1;
1073format.fmt.pix.height = cropcap.defrect.height &gt;&gt; 1;
1074format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
1075
1076if (-1 == ioctl (fd, &VIDIOC-S-FMT;, &amp;format)) {
1077 perror ("VIDIOC_S_FORMAT");
1078 exit (EXIT_FAILURE);
1079}
1080
1081/* We could check the actual image size now, the actual scaling factor
1082 or if the driver can scale at all. */
1083 </programlisting>
1084 </example>
1085
1086 <example>
1087 <title>Selecting an output area</title>
1088
1089 <programlisting>
1090&v4l2-cropcap; cropcap;
1091&v4l2-crop; crop;
1092
1093memset (&amp;cropcap, 0, sizeof (cropcap));
1094cropcap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
1095
1096if (-1 == ioctl (fd, VIDIOC_CROPCAP;, &amp;cropcap)) {
1097 perror ("VIDIOC_CROPCAP");
1098 exit (EXIT_FAILURE);
1099}
1100
1101memset (&amp;crop, 0, sizeof (crop));
1102
1103crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
1104crop.c = cropcap.defrect;
1105
1106/* Scale the width and height to 50 % of their original size
1107 and center the output. */
1108
1109crop.c.width /= 2;
1110crop.c.height /= 2;
1111crop.c.left += crop.c.width / 2;
1112crop.c.top += crop.c.height / 2;
1113
1114/* Ignore if cropping is not supported (EINVAL). */
1115
1116if (-1 == ioctl (fd, VIDIOC_S_CROP, &amp;crop)
1117 &amp;&amp; errno != EINVAL) {
1118 perror ("VIDIOC_S_CROP");
1119 exit (EXIT_FAILURE);
1120}
1121</programlisting>
1122 </example>
1123
1124 <example>
1125 <title>Current scaling factor and pixel aspect</title>
1126
1127 <para>(A video capture device is assumed.)</para>
1128
1129 <programlisting>
1130&v4l2-cropcap; cropcap;
1131&v4l2-crop; crop;
1132&v4l2-format; format;
1133double hscale, vscale;
1134double aspect;
1135int dwidth, dheight;
1136
1137memset (&amp;cropcap, 0, sizeof (cropcap));
1138cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1139
1140if (-1 == ioctl (fd, &VIDIOC-CROPCAP;, &amp;cropcap)) {
1141 perror ("VIDIOC_CROPCAP");
1142 exit (EXIT_FAILURE);
1143}
1144
1145memset (&amp;crop, 0, sizeof (crop));
1146crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1147
1148if (-1 == ioctl (fd, &VIDIOC-G-CROP;, &amp;crop)) {
1149 if (errno != EINVAL) {
1150 perror ("VIDIOC_G_CROP");
1151 exit (EXIT_FAILURE);
1152 }
1153
1154 /* Cropping not supported. */
1155 crop.c = cropcap.defrect;
1156}
1157
1158memset (&amp;format, 0, sizeof (format));
1159format.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1160
1161if (-1 == ioctl (fd, &VIDIOC-G-FMT;, &amp;format)) {
1162 perror ("VIDIOC_G_FMT");
1163 exit (EXIT_FAILURE);
1164}
1165
1166/* The scaling applied by the driver. */
1167
1168hscale = format.fmt.pix.width / (double) crop.c.width;
1169vscale = format.fmt.pix.height / (double) crop.c.height;
1170
1171aspect = cropcap.pixelaspect.numerator /
1172 (double) cropcap.pixelaspect.denominator;
1173aspect = aspect * hscale / vscale;
1174
1175/* Devices following ITU-R BT.601 do not capture
1176 square pixels. For playback on a computer monitor
1177 we should scale the images to this size. */
1178
1179dwidth = format.fmt.pix.width / aspect;
1180dheight = format.fmt.pix.height;
1181 </programlisting>
1182 </example>
1183 </section>
1184 </section>
1185
1186 &sub-selection-api;
1187
1188 <section id="streaming-par">
1189 <title>Streaming Parameters</title>
1190
1191 <para>Streaming parameters are intended to optimize the video
1192capture process as well as I/O. Presently applications can request a
1193high quality capture mode with the &VIDIOC-S-PARM; ioctl.</para>
1194
1195 <para>The current video standard determines a nominal number of
1196frames per second. If less than this number of frames is to be
1197captured or output, applications can request frame skipping or
1198duplicating on the driver side. This is especially useful when using
1199the &func-read; or &func-write;, which are not augmented by timestamps
1200or sequence counters, and to avoid unnecessary data copying.</para>
1201
1202 <para>Finally these ioctls can be used to determine the number of
1203buffers used internally by a driver in read/write mode. For
1204implications see the section discussing the &func-read;
1205function.</para>
1206
1207 <para>To get and set the streaming parameters applications call
1208the &VIDIOC-G-PARM; and &VIDIOC-S-PARM; ioctl, respectively. They take
1209a pointer to a &v4l2-streamparm;, which contains a union holding
1210separate parameters for input and output devices.</para>
1211
1212 <para>These ioctls are optional, drivers need not implement
1213them. If so, they return the &EINVAL;.</para>
1214 </section>
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml
new file mode 100644
index 00000000000..3dd9e78815d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -0,0 +1,2624 @@
1 <title>Changes</title>
2
3 <para>The following chapters document the evolution of the V4L2 API,
4errata or extensions. They are also intended to help application and
5driver writers to port or update their code.</para>
6
7 <section id="diff-v4l">
8 <title>Differences between V4L and V4L2</title>
9
10 <para>The Video For Linux API was first introduced in Linux 2.1 to
11unify and replace various TV and radio device related interfaces,
12developed independently by driver writers in prior years. Starting
13with Linux 2.5 the much improved V4L2 API replaces the V4L API.
14The support for the old V4L calls were removed from Kernel, but the
15library <xref linkend="libv4l" /> supports the conversion of a V4L
16API system call into a V4L2 one.</para>
17
18 <section>
19 <title>Opening and Closing Devices</title>
20
21 <para>For compatibility reasons the character device file names
22recommended for V4L2 video capture, overlay, radio and raw
23vbi capture devices did not change from those used by V4L. They are
24listed in <xref linkend="devices" /> and below in <xref
25 linkend="v4l-dev" />.</para>
26
27 <para>The teletext devices (minor range 192-223) have been removed in
28V4L2 and no longer exist. There is no hardware available anymore for handling
29pure teletext. Instead raw or sliced VBI is used.</para>
30
31 <para>The V4L <filename>videodev</filename> module automatically
32assigns minor numbers to drivers in load order, depending on the
33registered device type. We recommend that V4L2 drivers by default
34register devices with the same numbers, but the system administrator
35can assign arbitrary minor numbers using driver module options. The
36major device number remains 81.</para>
37
38 <table id="v4l-dev">
39 <title>V4L Device Types, Names and Numbers</title>
40 <tgroup cols="3">
41 <thead>
42 <row>
43 <entry>Device Type</entry>
44 <entry>File Name</entry>
45 <entry>Minor Numbers</entry>
46 </row>
47 </thead>
48 <tbody valign="top">
49 <row>
50 <entry>Video capture and overlay</entry>
51 <entry><para><filename>/dev/video</filename> and
52<filename>/dev/bttv0</filename><footnote> <para>According to
53Documentation/devices.txt these should be symbolic links to
54<filename>/dev/video0</filename>. Note the original bttv interface is
55not compatible with V4L or V4L2.</para> </footnote>,
56<filename>/dev/video0</filename> to
57<filename>/dev/video63</filename></para></entry>
58 <entry>0-63</entry>
59 </row>
60 <row>
61 <entry>Radio receiver</entry>
62 <entry><para><filename>/dev/radio</filename><footnote>
63 <para>According to
64<filename>Documentation/devices.txt</filename> a symbolic link to
65<filename>/dev/radio0</filename>.</para>
66 </footnote>, <filename>/dev/radio0</filename> to
67<filename>/dev/radio63</filename></para></entry>
68 <entry>64-127</entry>
69 </row>
70 <row>
71 <entry>Raw VBI capture</entry>
72 <entry><para><filename>/dev/vbi</filename>,
73<filename>/dev/vbi0</filename> to
74<filename>/dev/vbi31</filename></para></entry>
75 <entry>224-255</entry>
76 </row>
77 </tbody>
78 </tgroup>
79 </table>
80
81 <para>V4L prohibits (or used to prohibit) multiple opens of a
82device file. V4L2 drivers <emphasis>may</emphasis> support multiple
83opens, see <xref linkend="open" /> for details and consequences.</para>
84
85 <para>V4L drivers respond to V4L2 ioctls with an &EINVAL;.</para>
86 </section>
87
88 <section>
89 <title>Querying Capabilities</title>
90
91 <para>The V4L <constant>VIDIOCGCAP</constant> ioctl is
92equivalent to V4L2's &VIDIOC-QUERYCAP;.</para>
93
94 <para>The <structfield>name</structfield> field in struct
95<structname>video_capability</structname> became
96<structfield>card</structfield> in &v4l2-capability;,
97<structfield>type</structfield> was replaced by
98<structfield>capabilities</structfield>. Note V4L2 does not
99distinguish between device types like this, better think of basic
100video input, video output and radio devices supporting a set of
101related functions like video capturing, video overlay and VBI
102capturing. See <xref linkend="open" /> for an
103introduction.<informaltable>
104 <tgroup cols="3">
105 <thead>
106 <row>
107 <entry>struct
108<structname>video_capability</structname>
109<structfield>type</structfield></entry>
110 <entry>&v4l2-capability;
111<structfield>capabilities</structfield> flags</entry>
112 <entry>Purpose</entry>
113 </row>
114 </thead>
115 <tbody valign="top">
116 <row>
117 <entry><constant>VID_TYPE_CAPTURE</constant></entry>
118 <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
119 <entry>The <link linkend="capture">video
120capture</link> interface is supported.</entry>
121 </row>
122 <row>
123 <entry><constant>VID_TYPE_TUNER</constant></entry>
124 <entry><constant>V4L2_CAP_TUNER</constant></entry>
125 <entry>The device has a <link linkend="tuner">tuner or
126modulator</link>.</entry>
127 </row>
128 <row>
129 <entry><constant>VID_TYPE_TELETEXT</constant></entry>
130 <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
131 <entry>The <link linkend="raw-vbi">raw VBI
132capture</link> interface is supported.</entry>
133 </row>
134 <row>
135 <entry><constant>VID_TYPE_OVERLAY</constant></entry>
136 <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
137 <entry>The <link linkend="overlay">video
138overlay</link> interface is supported.</entry>
139 </row>
140 <row>
141 <entry><constant>VID_TYPE_CHROMAKEY</constant></entry>
142 <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant> in
143field <structfield>capability</structfield> of
144&v4l2-framebuffer;</entry>
145 <entry>Whether chromakey overlay is supported. For
146more information on overlay see
147<xref linkend="overlay" />.</entry>
148 </row>
149 <row>
150 <entry><constant>VID_TYPE_CLIPPING</constant></entry>
151 <entry><constant>V4L2_FBUF_CAP_LIST_CLIPPING</constant>
152and <constant>V4L2_FBUF_CAP_BITMAP_CLIPPING</constant> in field
153<structfield>capability</structfield> of &v4l2-framebuffer;</entry>
154 <entry>Whether clipping the overlaid image is
155supported, see <xref linkend="overlay" />.</entry>
156 </row>
157 <row>
158 <entry><constant>VID_TYPE_FRAMERAM</constant></entry>
159 <entry><constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant>
160<emphasis>not set</emphasis> in field
161<structfield>capability</structfield> of &v4l2-framebuffer;</entry>
162 <entry>Whether overlay overwrites frame buffer memory,
163see <xref linkend="overlay" />.</entry>
164 </row>
165 <row>
166 <entry><constant>VID_TYPE_SCALES</constant></entry>
167 <entry><constant>-</constant></entry>
168 <entry>This flag indicates if the hardware can scale
169images. The V4L2 API implies the scale factor by setting the cropping
170dimensions and image size with the &VIDIOC-S-CROP; and &VIDIOC-S-FMT;
171ioctl, respectively. The driver returns the closest sizes possible.
172For more information on cropping and scaling see <xref
173 linkend="crop" />.</entry>
174 </row>
175 <row>
176 <entry><constant>VID_TYPE_MONOCHROME</constant></entry>
177 <entry><constant>-</constant></entry>
178 <entry>Applications can enumerate the supported image
179formats with the &VIDIOC-ENUM-FMT; ioctl to determine if the device
180supports grey scale capturing only. For more information on image
181formats see <xref linkend="pixfmt" />.</entry>
182 </row>
183 <row>
184 <entry><constant>VID_TYPE_SUBCAPTURE</constant></entry>
185 <entry><constant>-</constant></entry>
186 <entry>Applications can call the &VIDIOC-G-CROP; ioctl
187to determine if the device supports capturing a subsection of the full
188picture ("cropping" in V4L2). If not, the ioctl returns the &EINVAL;.
189For more information on cropping and scaling see <xref
190 linkend="crop" />.</entry>
191 </row>
192 <row>
193 <entry><constant>VID_TYPE_MPEG_DECODER</constant></entry>
194 <entry><constant>-</constant></entry>
195 <entry>Applications can enumerate the supported image
196formats with the &VIDIOC-ENUM-FMT; ioctl to determine if the device
197supports MPEG streams.</entry>
198 </row>
199 <row>
200 <entry><constant>VID_TYPE_MPEG_ENCODER</constant></entry>
201 <entry><constant>-</constant></entry>
202 <entry>See above.</entry>
203 </row>
204 <row>
205 <entry><constant>VID_TYPE_MJPEG_DECODER</constant></entry>
206 <entry><constant>-</constant></entry>
207 <entry>See above.</entry>
208 </row>
209 <row>
210 <entry><constant>VID_TYPE_MJPEG_ENCODER</constant></entry>
211 <entry><constant>-</constant></entry>
212 <entry>See above.</entry>
213 </row>
214 </tbody>
215 </tgroup>
216 </informaltable></para>
217
218 <para>The <structfield>audios</structfield> field was replaced
219by <structfield>capabilities</structfield> flag
220<constant>V4L2_CAP_AUDIO</constant>, indicating
221<emphasis>if</emphasis> the device has any audio inputs or outputs. To
222determine their number applications can enumerate audio inputs with
223the &VIDIOC-G-AUDIO; ioctl. The audio ioctls are described in <xref
224 linkend="audio" />.</para>
225
226 <para>The <structfield>maxwidth</structfield>,
227<structfield>maxheight</structfield>,
228<structfield>minwidth</structfield> and
229<structfield>minheight</structfield> fields were removed. Calling the
230&VIDIOC-S-FMT; or &VIDIOC-TRY-FMT; ioctl with the desired dimensions
231returns the closest size possible, taking into account the current
232video standard, cropping and scaling limitations.</para>
233 </section>
234
235 <section>
236 <title>Video Sources</title>
237
238 <para>V4L provides the <constant>VIDIOCGCHAN</constant> and
239<constant>VIDIOCSCHAN</constant> ioctl using struct
240<structname>video_channel</structname> to enumerate
241the video inputs of a V4L device. The equivalent V4L2 ioctls
242are &VIDIOC-ENUMINPUT;, &VIDIOC-G-INPUT; and &VIDIOC-S-INPUT;
243using &v4l2-input; as discussed in <xref linkend="video" />.</para>
244
245 <para>The <structfield>channel</structfield> field counting
246inputs was renamed to <structfield>index</structfield>, the video
247input types were renamed as follows: <informaltable>
248 <tgroup cols="2">
249 <thead>
250 <row>
251 <entry>struct <structname>video_channel</structname>
252<structfield>type</structfield></entry>
253 <entry>&v4l2-input;
254<structfield>type</structfield></entry>
255 </row>
256 </thead>
257 <tbody valign="top">
258 <row>
259 <entry><constant>VIDEO_TYPE_TV</constant></entry>
260 <entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
261 </row>
262 <row>
263 <entry><constant>VIDEO_TYPE_CAMERA</constant></entry>
264 <entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
265 </row>
266 </tbody>
267 </tgroup>
268 </informaltable></para>
269
270 <para>Unlike the <structfield>tuners</structfield> field
271expressing the number of tuners of this input, V4L2 assumes each video
272input is connected to at most one tuner. However a tuner can have more
273than one input, &ie; RF connectors, and a device can have multiple
274tuners. The index number of the tuner associated with the input, if
275any, is stored in field <structfield>tuner</structfield> of
276&v4l2-input;. Enumeration of tuners is discussed in <xref
277 linkend="tuner" />.</para>
278
279 <para>The redundant <constant>VIDEO_VC_TUNER</constant> flag was
280dropped. Video inputs associated with a tuner are of type
281<constant>V4L2_INPUT_TYPE_TUNER</constant>. The
282<constant>VIDEO_VC_AUDIO</constant> flag was replaced by the
283<structfield>audioset</structfield> field. V4L2 considers devices with
284up to 32 audio inputs. Each set bit in the
285<structfield>audioset</structfield> field represents one audio input
286this video input combines with. For information about audio inputs and
287how to switch between them see <xref linkend="audio" />.</para>
288
289 <para>The <structfield>norm</structfield> field describing the
290supported video standards was replaced by
291<structfield>std</structfield>. The V4L specification mentions a flag
292<constant>VIDEO_VC_NORM</constant> indicating whether the standard can
293be changed. This flag was a later addition together with the
294<structfield>norm</structfield> field and has been removed in the
295meantime. V4L2 has a similar, albeit more comprehensive approach
296to video standards, see <xref linkend="standard" /> for more
297information.</para>
298 </section>
299
300 <section>
301 <title>Tuning</title>
302
303 <para>The V4L <constant>VIDIOCGTUNER</constant> and
304<constant>VIDIOCSTUNER</constant> ioctl and struct
305<structname>video_tuner</structname> can be used to enumerate the
306tuners of a V4L TV or radio device. The equivalent V4L2 ioctls are
307&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; using &v4l2-tuner;. Tuners are
308covered in <xref linkend="tuner" />.</para>
309
310 <para>The <structfield>tuner</structfield> field counting tuners
311was renamed to <structfield>index</structfield>. The fields
312<structfield>name</structfield>, <structfield>rangelow</structfield>
313and <structfield>rangehigh</structfield> remained unchanged.</para>
314
315 <para>The <constant>VIDEO_TUNER_PAL</constant>,
316<constant>VIDEO_TUNER_NTSC</constant> and
317<constant>VIDEO_TUNER_SECAM</constant> flags indicating the supported
318video standards were dropped. This information is now contained in the
319associated &v4l2-input;. No replacement exists for the
320<constant>VIDEO_TUNER_NORM</constant> flag indicating whether the
321video standard can be switched. The <structfield>mode</structfield>
322field to select a different video standard was replaced by a whole new
323set of ioctls and structures described in <xref linkend="standard" />.
324Due to its ubiquity it should be mentioned the BTTV driver supports
325several standards in addition to the regular
326<constant>VIDEO_MODE_PAL</constant> (0),
327<constant>VIDEO_MODE_NTSC</constant>,
328<constant>VIDEO_MODE_SECAM</constant> and
329<constant>VIDEO_MODE_AUTO</constant> (3). Namely N/PAL Argentina,
330M/PAL, N/PAL, and NTSC Japan with numbers 3-6 (sic).</para>
331
332 <para>The <constant>VIDEO_TUNER_STEREO_ON</constant> flag
333indicating stereo reception became
334<constant>V4L2_TUNER_SUB_STEREO</constant> in field
335<structfield>rxsubchans</structfield>. This field also permits the
336detection of monaural and bilingual audio, see the definition of
337&v4l2-tuner; for details. Presently no replacement exists for the
338<constant>VIDEO_TUNER_RDS_ON</constant> and
339<constant>VIDEO_TUNER_MBS_ON</constant> flags.</para>
340
341 <para> The <constant>VIDEO_TUNER_LOW</constant> flag was renamed
342to <constant>V4L2_TUNER_CAP_LOW</constant> in the &v4l2-tuner;
343<structfield>capability</structfield> field.</para>
344
345 <para>The <constant>VIDIOCGFREQ</constant> and
346<constant>VIDIOCSFREQ</constant> ioctl to change the tuner frequency
347where renamed to &VIDIOC-G-FREQUENCY; and &VIDIOC-S-FREQUENCY;. They
348take a pointer to a &v4l2-frequency; instead of an unsigned long
349integer.</para>
350 </section>
351
352 <section id="v4l-image-properties">
353 <title>Image Properties</title>
354
355 <para>V4L2 has no equivalent of the
356<constant>VIDIOCGPICT</constant> and <constant>VIDIOCSPICT</constant>
357ioctl and struct <structname>video_picture</structname>. The following
358fields where replaced by V4L2 controls accessible with the
359&VIDIOC-QUERYCTRL;, &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls:<informaltable>
360 <tgroup cols="2">
361 <thead>
362 <row>
363 <entry>struct <structname>video_picture</structname></entry>
364 <entry>V4L2 Control ID</entry>
365 </row>
366 </thead>
367 <tbody valign="top">
368 <row>
369 <entry><structfield>brightness</structfield></entry>
370 <entry><constant>V4L2_CID_BRIGHTNESS</constant></entry>
371 </row>
372 <row>
373 <entry><structfield>hue</structfield></entry>
374 <entry><constant>V4L2_CID_HUE</constant></entry>
375 </row>
376 <row>
377 <entry><structfield>colour</structfield></entry>
378 <entry><constant>V4L2_CID_SATURATION</constant></entry>
379 </row>
380 <row>
381 <entry><structfield>contrast</structfield></entry>
382 <entry><constant>V4L2_CID_CONTRAST</constant></entry>
383 </row>
384 <row>
385 <entry><structfield>whiteness</structfield></entry>
386 <entry><constant>V4L2_CID_WHITENESS</constant></entry>
387 </row>
388 </tbody>
389 </tgroup>
390 </informaltable></para>
391
392 <para>The V4L picture controls are assumed to range from 0 to
39365535 with no particular reset value. The V4L2 API permits arbitrary
394limits and defaults which can be queried with the &VIDIOC-QUERYCTRL;
395ioctl. For general information about controls see <xref
396linkend="control" />.</para>
397
398 <para>The <structfield>depth</structfield> (average number of
399bits per pixel) of a video image is implied by the selected image
400format. V4L2 does not explicitely provide such information assuming
401applications recognizing the format are aware of the image depth and
402others need not know. The <structfield>palette</structfield> field
403moved into the &v4l2-pix-format;:<informaltable>
404 <tgroup cols="2">
405 <thead>
406 <row>
407 <entry>struct <structname>video_picture</structname>
408<structfield>palette</structfield></entry>
409 <entry>&v4l2-pix-format;
410<structfield>pixfmt</structfield></entry>
411 </row>
412 </thead>
413 <tbody valign="top">
414 <row>
415 <entry><constant>VIDEO_PALETTE_GREY</constant></entry>
416 <entry><para><link
417linkend="V4L2-PIX-FMT-GREY"><constant>V4L2_PIX_FMT_GREY</constant></link></para></entry>
418 </row>
419 <row>
420 <entry><constant>VIDEO_PALETTE_HI240</constant></entry>
421 <entry><para><link
422linkend="pixfmt-reserved"><constant>V4L2_PIX_FMT_HI240</constant></link><footnote>
423 <para>This is a custom format used by the BTTV
424driver, not one of the V4L2 standard formats.</para>
425 </footnote></para></entry>
426 </row>
427 <row>
428 <entry><constant>VIDEO_PALETTE_RGB565</constant></entry>
429 <entry><para><link
430linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_RGB565</constant></link></para></entry>
431 </row>
432 <row>
433 <entry><constant>VIDEO_PALETTE_RGB555</constant></entry>
434 <entry><para><link
435linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_RGB555</constant></link></para></entry>
436 </row>
437 <row>
438 <entry><constant>VIDEO_PALETTE_RGB24</constant></entry>
439 <entry><para><link
440linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_BGR24</constant></link></para></entry>
441 </row>
442 <row>
443 <entry><constant>VIDEO_PALETTE_RGB32</constant></entry>
444 <entry><para><link
445linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_BGR32</constant></link><footnote>
446 <para>Presumably all V4L RGB formats are
447little-endian, although some drivers might interpret them according to machine endianness. V4L2 defines little-endian, big-endian and red/blue
448swapped variants. For details see <xref linkend="pixfmt-rgb" />.</para>
449 </footnote></para></entry>
450 </row>
451 <row>
452 <entry><constant>VIDEO_PALETTE_YUV422</constant></entry>
453 <entry><para><link
454linkend="V4L2-PIX-FMT-YUYV"><constant>V4L2_PIX_FMT_YUYV</constant></link></para></entry>
455 </row>
456 <row>
457 <entry><para><constant>VIDEO_PALETTE_YUYV</constant><footnote>
458 <para><constant>VIDEO_PALETTE_YUV422</constant>
459and <constant>VIDEO_PALETTE_YUYV</constant> are the same formats. Some
460V4L drivers respond to one, some to the other.</para>
461 </footnote></para></entry>
462 <entry><para><link
463linkend="V4L2-PIX-FMT-YUYV"><constant>V4L2_PIX_FMT_YUYV</constant></link></para></entry>
464 </row>
465 <row>
466 <entry><constant>VIDEO_PALETTE_UYVY</constant></entry>
467 <entry><para><link
468linkend="V4L2-PIX-FMT-UYVY"><constant>V4L2_PIX_FMT_UYVY</constant></link></para></entry>
469 </row>
470 <row>
471 <entry><constant>VIDEO_PALETTE_YUV420</constant></entry>
472 <entry>None</entry>
473 </row>
474 <row>
475 <entry><constant>VIDEO_PALETTE_YUV411</constant></entry>
476 <entry><para><link
477linkend="V4L2-PIX-FMT-Y41P"><constant>V4L2_PIX_FMT_Y41P</constant></link><footnote>
478 <para>Not to be confused with
479<constant>V4L2_PIX_FMT_YUV411P</constant>, which is a planar
480format.</para> </footnote></para></entry>
481 </row>
482 <row>
483 <entry><constant>VIDEO_PALETTE_RAW</constant></entry>
484 <entry><para>None<footnote> <para>V4L explains this
485as: "RAW capture (BT848)"</para> </footnote></para></entry>
486 </row>
487 <row>
488 <entry><constant>VIDEO_PALETTE_YUV422P</constant></entry>
489 <entry><para><link
490linkend="V4L2-PIX-FMT-YUV422P"><constant>V4L2_PIX_FMT_YUV422P</constant></link></para></entry>
491 </row>
492 <row>
493 <entry><constant>VIDEO_PALETTE_YUV411P</constant></entry>
494 <entry><para><link
495linkend="V4L2-PIX-FMT-YUV411P"><constant>V4L2_PIX_FMT_YUV411P</constant></link><footnote>
496 <para>Not to be confused with
497<constant>V4L2_PIX_FMT_Y41P</constant>, which is a packed
498format.</para> </footnote></para></entry>
499 </row>
500 <row>
501 <entry><constant>VIDEO_PALETTE_YUV420P</constant></entry>
502 <entry><para><link
503linkend="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></link></para></entry>
504 </row>
505 <row>
506 <entry><constant>VIDEO_PALETTE_YUV410P</constant></entry>
507 <entry><para><link
508linkend="V4L2-PIX-FMT-YVU410"><constant>V4L2_PIX_FMT_YVU410</constant></link></para></entry>
509 </row>
510 </tbody>
511 </tgroup>
512 </informaltable></para>
513
514 <para>V4L2 image formats are defined in <xref
515linkend="pixfmt" />. The image format can be selected with the
516&VIDIOC-S-FMT; ioctl.</para>
517 </section>
518
519 <section>
520 <title>Audio</title>
521
522 <para>The <constant>VIDIOCGAUDIO</constant> and
523<constant>VIDIOCSAUDIO</constant> ioctl and struct
524<structname>video_audio</structname> are used to enumerate the
525audio inputs of a V4L device. The equivalent V4L2 ioctls are
526&VIDIOC-G-AUDIO; and &VIDIOC-S-AUDIO; using &v4l2-audio; as
527discussed in <xref linkend="audio" />.</para>
528
529 <para>The <structfield>audio</structfield> "channel number"
530field counting audio inputs was renamed to
531<structfield>index</structfield>.</para>
532
533 <para>On <constant>VIDIOCSAUDIO</constant> the
534<structfield>mode</structfield> field selects <emphasis>one</emphasis>
535of the <constant>VIDEO_SOUND_MONO</constant>,
536<constant>VIDEO_SOUND_STEREO</constant>,
537<constant>VIDEO_SOUND_LANG1</constant> or
538<constant>VIDEO_SOUND_LANG2</constant> audio demodulation modes. When
539the current audio standard is BTSC
540<constant>VIDEO_SOUND_LANG2</constant> refers to SAP and
541<constant>VIDEO_SOUND_LANG1</constant> is meaningless. Also
542undocumented in the V4L specification, there is no way to query the
543selected mode. On <constant>VIDIOCGAUDIO</constant> the driver returns
544the <emphasis>actually received</emphasis> audio programmes in this
545field. In the V4L2 API this information is stored in the &v4l2-tuner;
546<structfield>rxsubchans</structfield> and
547<structfield>audmode</structfield> fields, respectively. See <xref
548linkend="tuner" /> for more information on tuners. Related to audio
549modes &v4l2-audio; also reports if this is a mono or stereo
550input, regardless if the source is a tuner.</para>
551
552 <para>The following fields where replaced by V4L2 controls
553accessible with the &VIDIOC-QUERYCTRL;, &VIDIOC-G-CTRL; and
554&VIDIOC-S-CTRL; ioctls:<informaltable>
555 <tgroup cols="2">
556 <thead>
557 <row>
558 <entry>struct
559<structname>video_audio</structname></entry>
560 <entry>V4L2 Control ID</entry>
561 </row>
562 </thead>
563 <tbody valign="top">
564 <row>
565 <entry><structfield>volume</structfield></entry>
566 <entry><constant>V4L2_CID_AUDIO_VOLUME</constant></entry>
567 </row>
568 <row>
569 <entry><structfield>bass</structfield></entry>
570 <entry><constant>V4L2_CID_AUDIO_BASS</constant></entry>
571 </row>
572 <row>
573 <entry><structfield>treble</structfield></entry>
574 <entry><constant>V4L2_CID_AUDIO_TREBLE</constant></entry>
575 </row>
576 <row>
577 <entry><structfield>balance</structfield></entry>
578 <entry><constant>V4L2_CID_AUDIO_BALANCE</constant></entry>
579 </row>
580 </tbody>
581 </tgroup>
582 </informaltable></para>
583
584 <para>To determine which of these controls are supported by a
585driver V4L provides the <structfield>flags</structfield>
586<constant>VIDEO_AUDIO_VOLUME</constant>,
587<constant>VIDEO_AUDIO_BASS</constant>,
588<constant>VIDEO_AUDIO_TREBLE</constant> and
589<constant>VIDEO_AUDIO_BALANCE</constant>. In the V4L2 API the
590&VIDIOC-QUERYCTRL; ioctl reports if the respective control is
591supported. Accordingly the <constant>VIDEO_AUDIO_MUTABLE</constant>
592and <constant>VIDEO_AUDIO_MUTE</constant> flags where replaced by the
593boolean <constant>V4L2_CID_AUDIO_MUTE</constant> control.</para>
594
595 <para>All V4L2 controls have a <structfield>step</structfield>
596attribute replacing the struct <structname>video_audio</structname>
597<structfield>step</structfield> field. The V4L audio controls are
598assumed to range from 0 to 65535 with no particular reset value. The
599V4L2 API permits arbitrary limits and defaults which can be queried
600with the &VIDIOC-QUERYCTRL; ioctl. For general information about
601controls see <xref linkend="control" />.</para>
602 </section>
603
604 <section>
605 <title>Frame Buffer Overlay</title>
606
607 <para>The V4L2 ioctls equivalent to
608<constant>VIDIOCGFBUF</constant> and <constant>VIDIOCSFBUF</constant>
609are &VIDIOC-G-FBUF; and &VIDIOC-S-FBUF;. The
610<structfield>base</structfield> field of struct
611<structname>video_buffer</structname> remained unchanged, except V4L2
612defines a flag to indicate non-destructive overlays instead of a
613<constant>NULL</constant> pointer. All other fields moved into the
614&v4l2-pix-format; <structfield>fmt</structfield> substructure of
615&v4l2-framebuffer;. The <structfield>depth</structfield> field was
616replaced by <structfield>pixelformat</structfield>. See <xref
617 linkend="pixfmt-rgb" /> for a list of RGB formats and their
618respective color depths.</para>
619
620 <para>Instead of the special ioctls
621<constant>VIDIOCGWIN</constant> and <constant>VIDIOCSWIN</constant>
622V4L2 uses the general-purpose data format negotiation ioctls
623&VIDIOC-G-FMT; and &VIDIOC-S-FMT;. They take a pointer to a
624&v4l2-format; as argument. Here the <structfield>win</structfield>
625member of the <structfield>fmt</structfield> union is used, a
626&v4l2-window;.</para>
627
628 <para>The <structfield>x</structfield>,
629<structfield>y</structfield>, <structfield>width</structfield> and
630<structfield>height</structfield> fields of struct
631<structname>video_window</structname> moved into &v4l2-rect;
632substructure <structfield>w</structfield> of struct
633<structname>v4l2_window</structname>. The
634<structfield>chromakey</structfield>,
635<structfield>clips</structfield>, and
636<structfield>clipcount</structfield> fields remained unchanged. Struct
637<structname>video_clip</structname> was renamed to &v4l2-clip;, also
638containing a struct <structname>v4l2_rect</structname>, but the
639semantics are still the same.</para>
640
641 <para>The <constant>VIDEO_WINDOW_INTERLACE</constant> flag was
642dropped. Instead applications must set the
643<structfield>field</structfield> field to
644<constant>V4L2_FIELD_ANY</constant> or
645<constant>V4L2_FIELD_INTERLACED</constant>. The
646<constant>VIDEO_WINDOW_CHROMAKEY</constant> flag moved into
647&v4l2-framebuffer;, under the new name
648<constant>V4L2_FBUF_FLAG_CHROMAKEY</constant>.</para>
649
650 <para>In V4L, storing a bitmap pointer in
651<structfield>clips</structfield> and setting
652<structfield>clipcount</structfield> to
653<constant>VIDEO_CLIP_BITMAP</constant> (-1) requests bitmap
654clipping, using a fixed size bitmap of 1024 &times; 625 bits. Struct
655<structname>v4l2_window</structname> has a separate
656<structfield>bitmap</structfield> pointer field for this purpose and
657the bitmap size is determined by <structfield>w.width</structfield> and
658<structfield>w.height</structfield>.</para>
659
660 <para>The <constant>VIDIOCCAPTURE</constant> ioctl to enable or
661disable overlay was renamed to &VIDIOC-OVERLAY;.</para>
662 </section>
663
664 <section>
665 <title>Cropping</title>
666
667 <para>To capture only a subsection of the full picture V4L
668defines the <constant>VIDIOCGCAPTURE</constant> and
669<constant>VIDIOCSCAPTURE</constant> ioctls using struct
670<structname>video_capture</structname>. The equivalent V4L2 ioctls are
671&VIDIOC-G-CROP; and &VIDIOC-S-CROP; using &v4l2-crop;, and the related
672&VIDIOC-CROPCAP; ioctl. This is a rather complex matter, see
673<xref linkend="crop" /> for details.</para>
674
675 <para>The <structfield>x</structfield>,
676<structfield>y</structfield>, <structfield>width</structfield> and
677<structfield>height</structfield> fields moved into &v4l2-rect;
678substructure <structfield>c</structfield> of struct
679<structname>v4l2_crop</structname>. The
680<structfield>decimation</structfield> field was dropped. In the V4L2
681API the scaling factor is implied by the size of the cropping
682rectangle and the size of the captured or overlaid image.</para>
683
684 <para>The <constant>VIDEO_CAPTURE_ODD</constant>
685and <constant>VIDEO_CAPTURE_EVEN</constant> flags to capture only the
686odd or even field, respectively, were replaced by
687<constant>V4L2_FIELD_TOP</constant> and
688<constant>V4L2_FIELD_BOTTOM</constant> in the field named
689<structfield>field</structfield> of &v4l2-pix-format; and
690&v4l2-window;. These structures are used to select a capture or
691overlay format with the &VIDIOC-S-FMT; ioctl.</para>
692 </section>
693
694 <section>
695 <title>Reading Images, Memory Mapping</title>
696
697 <section>
698 <title>Capturing using the read method</title>
699
700 <para>There is no essential difference between reading images
701from a V4L or V4L2 device using the &func-read; function, however V4L2
702drivers are not required to support this I/O method. Applications can
703determine if the function is available with the &VIDIOC-QUERYCAP;
704ioctl. All V4L2 devices exchanging data with applications must support
705the &func-select; and &func-poll; functions.</para>
706
707 <para>To select an image format and size, V4L provides the
708<constant>VIDIOCSPICT</constant> and <constant>VIDIOCSWIN</constant>
709ioctls. V4L2 uses the general-purpose data format negotiation ioctls
710&VIDIOC-G-FMT; and &VIDIOC-S-FMT;. They take a pointer to a
711&v4l2-format; as argument, here the &v4l2-pix-format; named
712<structfield>pix</structfield> of its <structfield>fmt</structfield>
713union is used.</para>
714
715 <para>For more information about the V4L2 read interface see
716<xref linkend="rw" />.</para>
717 </section>
718 <section>
719 <title>Capturing using memory mapping</title>
720
721 <para>Applications can read from V4L devices by mapping
722buffers in device memory, or more often just buffers allocated in
723DMA-able system memory, into their address space. This avoids the data
724copying overhead of the read method. V4L2 supports memory mapping as
725well, with a few differences.</para>
726
727 <informaltable>
728 <tgroup cols="2">
729 <thead>
730 <row>
731 <entry>V4L</entry>
732 <entry>V4L2</entry>
733 </row>
734 </thead>
735 <tbody valign="top">
736 <row>
737 <entry></entry>
738 <entry>The image format must be selected before
739buffers are allocated, with the &VIDIOC-S-FMT; ioctl. When no format
740is selected the driver may use the last, possibly by another
741application requested format.</entry>
742 </row>
743 <row>
744 <entry><para>Applications cannot change the number of
745buffers. The it is built into the driver, unless it has a module
746option to change the number when the driver module is
747loaded.</para></entry>
748 <entry><para>The &VIDIOC-REQBUFS; ioctl allocates the
749desired number of buffers, this is a required step in the initialization
750sequence.</para></entry>
751 </row>
752 <row>
753 <entry><para>Drivers map all buffers as one contiguous
754range of memory. The <constant>VIDIOCGMBUF</constant> ioctl is
755available to query the number of buffers, the offset of each buffer
756from the start of the virtual file, and the overall amount of memory
757used, which can be used as arguments for the &func-mmap;
758function.</para></entry>
759 <entry><para>Buffers are individually mapped. The
760offset and size of each buffer can be determined with the
761&VIDIOC-QUERYBUF; ioctl.</para></entry>
762 </row>
763 <row>
764 <entry><para>The <constant>VIDIOCMCAPTURE</constant>
765ioctl prepares a buffer for capturing. It also determines the image
766format for this buffer. The ioctl returns immediately, eventually with
767an &EAGAIN; if no video signal had been detected. When the driver
768supports more than one buffer applications can call the ioctl multiple
769times and thus have multiple outstanding capture
770requests.</para><para>The <constant>VIDIOCSYNC</constant> ioctl
771suspends execution until a particular buffer has been
772filled.</para></entry>
773 <entry><para>Drivers maintain an incoming and outgoing
774queue. &VIDIOC-QBUF; enqueues any empty buffer into the incoming
775queue. Filled buffers are dequeued from the outgoing queue with the
776&VIDIOC-DQBUF; ioctl. To wait until filled buffers become available this
777function, &func-select; or &func-poll; can be used. The
778&VIDIOC-STREAMON; ioctl must be called once after enqueuing one or
779more buffers to start capturing. Its counterpart
780&VIDIOC-STREAMOFF; stops capturing and dequeues all buffers from both
781queues. Applications can query the signal status, if known, with the
782&VIDIOC-ENUMINPUT; ioctl.</para></entry>
783 </row>
784 </tbody>
785 </tgroup>
786 </informaltable>
787
788 <para>For a more in-depth discussion of memory mapping and
789examples, see <xref linkend="mmap" />.</para>
790 </section>
791 </section>
792
793 <section>
794 <title>Reading Raw VBI Data</title>
795
796 <para>Originally the V4L API did not specify a raw VBI capture
797interface, only the device file <filename>/dev/vbi</filename> was
798reserved for this purpose. The only driver supporting this interface
799was the BTTV driver, de-facto defining the V4L VBI interface. Reading
800from the device yields a raw VBI image with the following
801parameters:<informaltable>
802 <tgroup cols="2">
803 <thead>
804 <row>
805 <entry>&v4l2-vbi-format;</entry>
806 <entry>V4L, BTTV driver</entry>
807 </row>
808 </thead>
809 <tbody valign="top">
810 <row>
811 <entry>sampling_rate</entry>
812 <entry>28636363&nbsp;Hz NTSC (or any other 525-line
813standard); 35468950&nbsp;Hz PAL and SECAM (625-line standards)</entry>
814 </row>
815 <row>
816 <entry>offset</entry>
817 <entry>?</entry>
818 </row>
819 <row>
820 <entry>samples_per_line</entry>
821 <entry>2048</entry>
822 </row>
823 <row>
824 <entry>sample_format</entry>
825 <entry>V4L2_PIX_FMT_GREY. The last four bytes (a
826machine endianness integer) contain a frame counter.</entry>
827 </row>
828 <row>
829 <entry>start[]</entry>
830 <entry>10, 273 NTSC; 22, 335 PAL and SECAM</entry>
831 </row>
832 <row>
833 <entry>count[]</entry>
834 <entry><para>16, 16<footnote><para>Old driver
835versions used different values, eventually the custom
836<constant>BTTV_VBISIZE</constant> ioctl was added to query the
837correct values.</para></footnote></para></entry>
838 </row>
839 <row>
840 <entry>flags</entry>
841 <entry>0</entry>
842 </row>
843 </tbody>
844 </tgroup>
845 </informaltable></para>
846
847 <para>Undocumented in the V4L specification, in Linux 2.3 the
848<constant>VIDIOCGVBIFMT</constant> and
849<constant>VIDIOCSVBIFMT</constant> ioctls using struct
850<structname>vbi_format</structname> were added to determine the VBI
851image parameters. These ioctls are only partially compatible with the
852V4L2 VBI interface specified in <xref linkend="raw-vbi" />.</para>
853
854 <para>An <structfield>offset</structfield> field does not
855exist, <structfield>sample_format</structfield> is supposed to be
856<constant>VIDEO_PALETTE_RAW</constant>, equivalent to
857<constant>V4L2_PIX_FMT_GREY</constant>. The remaining fields are
858probably equivalent to &v4l2-vbi-format;.</para>
859
860 <para>Apparently only the Zoran (ZR 36120) driver implements
861these ioctls. The semantics differ from those specified for V4L2 in two
862ways. The parameters are reset on &func-open; and
863<constant>VIDIOCSVBIFMT</constant> always returns an &EINVAL; if the
864parameters are invalid.</para>
865 </section>
866
867 <section>
868 <title>Miscellaneous</title>
869
870 <para>V4L2 has no equivalent of the
871<constant>VIDIOCGUNIT</constant> ioctl. Applications can find the VBI
872device associated with a video capture device (or vice versa) by
873reopening the device and requesting VBI data. For details see
874<xref linkend="open" />.</para>
875
876 <para>No replacement exists for <constant>VIDIOCKEY</constant>,
877and the V4L functions for microcode programming. A new interface for
878MPEG compression and playback devices is documented in <xref
879 linkend="extended-controls" />.</para>
880 </section>
881
882 </section>
883
884 <section id="hist-v4l2">
885 <title>Changes of the V4L2 API</title>
886
887 <para>Soon after the V4L API was added to the kernel it was
888criticised as too inflexible. In August 1998 Bill Dirks proposed a
889number of improvements and began to work on documentation, example
890drivers and applications. With the help of other volunteers this
891eventually became the V4L2 API, not just an extension but a
892replacement for the V4L API. However it took another four years and
893two stable kernel releases until the new API was finally accepted for
894inclusion into the kernel in its present form.</para>
895
896 <section>
897 <title>Early Versions</title>
898 <para>1998-08-20: First version.</para>
899
900 <para>1998-08-27: The &func-select; function was introduced.</para>
901
902 <para>1998-09-10: New video standard interface.</para>
903
904 <para>1998-09-18: The <constant>VIDIOC_NONCAP</constant> ioctl
905was replaced by the otherwise meaningless <constant>O_TRUNC</constant>
906&func-open; flag, and the aliases <constant>O_NONCAP</constant> and
907<constant>O_NOIO</constant> were defined. Applications can set this
908flag if they intend to access controls only, as opposed to capture
909applications which need exclusive access. The
910<constant>VIDEO_STD_XXX</constant> identifiers are now ordinals
911instead of flags, and the <function>video_std_construct()</function>
912helper function takes id and transmission arguments.</para>
913
914 <para>1998-09-28: Revamped video standard. Made video controls
915individually enumerable.</para>
916
917 <para>1998-10-02: The <structfield>id</structfield> field was
918removed from struct <structname>video_standard</structname> and the
919color subcarrier fields were renamed. The &VIDIOC-QUERYSTD; ioctl was
920renamed to &VIDIOC-ENUMSTD;, &VIDIOC-G-INPUT; to &VIDIOC-ENUMINPUT;. A
921first draft of the Codec API was released.</para>
922
923 <para>1998-11-08: Many minor changes. Most symbols have been
924renamed. Some material changes to &v4l2-capability;.</para>
925
926 <para>1998-11-12: The read/write directon of some ioctls was misdefined.</para>
927
928 <para>1998-11-14: <constant>V4L2_PIX_FMT_RGB24</constant>
929changed to <constant>V4L2_PIX_FMT_BGR24</constant>, and
930<constant>V4L2_PIX_FMT_RGB32</constant> changed to
931<constant>V4L2_PIX_FMT_BGR32</constant>. Audio controls are now
932accessible with the &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls under
933names starting with <constant>V4L2_CID_AUDIO</constant>. The
934<constant>V4L2_MAJOR</constant> define was removed from
935<filename>videodev.h</filename> since it was only used once in the
936<filename>videodev</filename> kernel module. The
937<constant>YUV422</constant> and <constant>YUV411</constant> planar
938image formats were added.</para>
939
940 <para>1998-11-28: A few ioctl symbols changed. Interfaces for codecs and
941video output devices were added.</para>
942
943 <para>1999-01-14: A raw VBI capture interface was added.</para>
944
945 <para>1999-01-19: The <constant>VIDIOC_NEXTBUF</constant> ioctl
946 was removed.</para>
947 </section>
948
949 <section>
950 <title>V4L2 Version 0.16 1999-01-31</title>
951 <para>1999-01-27: There is now one QBUF ioctl, VIDIOC_QWBUF and VIDIOC_QRBUF
952are gone. VIDIOC_QBUF takes a v4l2_buffer as a parameter. Added
953digital zoom (cropping) controls.</para>
954 </section>
955
956 <!-- Where's 0.17? mhs couldn't find that videodev.h, perhaps Bill
957 forgot to bump the version number or never released it. -->
958
959 <section>
960 <title>V4L2 Version 0.18 1999-03-16</title>
961 <para>Added a v4l to V4L2 ioctl compatibility layer to
962videodev.c. Driver writers, this changes how you implement your ioctl
963handler. See the Driver Writer's Guide. Added some more control id
964codes.</para>
965 </section>
966
967 <section>
968 <title>V4L2 Version 0.19 1999-06-05</title>
969 <para>1999-03-18: Fill in the category and catname fields of
970v4l2_queryctrl objects before passing them to the driver. Required a
971minor change to the VIDIOC_QUERYCTRL handlers in the sample
972drivers.</para>
973 <para>1999-03-31: Better compatibility for v4l memory capture
974ioctls. Requires changes to drivers to fully support new compatibility
975features, see Driver Writer's Guide and v4l2cap.c. Added new control
976IDs: V4L2_CID_HFLIP, _VFLIP. Changed V4L2_PIX_FMT_YUV422P to _YUV422P,
977and _YUV411P to _YUV411P.</para>
978 <para>1999-04-04: Added a few more control IDs.</para>
979 <para>1999-04-07: Added the button control type.</para>
980 <para>1999-05-02: Fixed a typo in videodev.h, and added the
981V4L2_CTRL_FLAG_GRAYED (later V4L2_CTRL_FLAG_GRABBED) flag.</para>
982 <para>1999-05-20: Definition of VIDIOC_G_CTRL was wrong causing
983a malfunction of this ioctl.</para>
984 <para>1999-06-05: Changed the value of
985V4L2_CID_WHITENESS.</para>
986 </section>
987
988 <section>
989 <title>V4L2 Version 0.20 (1999-09-10)</title>
990
991 <para>Version 0.20 introduced a number of changes which were
992<emphasis>not backward compatible</emphasis> with 0.19 and earlier
993versions. Purpose of these changes was to simplify the API, while
994making it more extensible and following common Linux driver API
995conventions.</para>
996
997 <orderedlist>
998 <listitem>
999 <para>Some typos in <constant>V4L2_FMT_FLAG</constant>
1000symbols were fixed. &v4l2-clip; was changed for compatibility with
1001v4l. (1999-08-30)</para>
1002 </listitem>
1003
1004 <listitem>
1005 <para><constant>V4L2_TUNER_SUB_LANG1</constant> was added.
1006(1999-09-05)</para>
1007 </listitem>
1008
1009 <listitem>
1010 <para>All ioctl() commands that used an integer argument now
1011take a pointer to an integer. Where it makes sense, ioctls will return
1012the actual new value in the integer pointed to by the argument, a
1013common convention in the V4L2 API. The affected ioctls are:
1014VIDIOC_PREVIEW, VIDIOC_STREAMON, VIDIOC_STREAMOFF, VIDIOC_S_FREQ,
1015VIDIOC_S_INPUT, VIDIOC_S_OUTPUT, VIDIOC_S_EFFECT. For example
1016<programlisting>
1017err = ioctl (fd, VIDIOC_XXX, V4L2_XXX);
1018</programlisting> becomes <programlisting>
1019int a = V4L2_XXX; err = ioctl(fd, VIDIOC_XXX, &amp;a);
1020</programlisting>
1021 </para>
1022 </listitem>
1023
1024 <listitem>
1025 <para>All the different get- and set-format commands were
1026swept into one &VIDIOC-G-FMT; and &VIDIOC-S-FMT; ioctl taking a union
1027and a type field selecting the union member as parameter. Purpose is to
1028simplify the API by eliminating several ioctls and to allow new and
1029driver private data streams without adding new ioctls.</para>
1030
1031 <para>This change obsoletes the following ioctls:
1032<constant>VIDIOC_S_INFMT</constant>,
1033<constant>VIDIOC_G_INFMT</constant>,
1034<constant>VIDIOC_S_OUTFMT</constant>,
1035<constant>VIDIOC_G_OUTFMT</constant>,
1036<constant>VIDIOC_S_VBIFMT</constant> and
1037<constant>VIDIOC_G_VBIFMT</constant>. The image format structure
1038<structname>v4l2_format</structname> was renamed to &v4l2-pix-format;,
1039while &v4l2-format; is now the envelopping structure for all format
1040negotiations.</para>
1041 </listitem>
1042
1043 <listitem>
1044 <para>Similar to the changes above, the
1045<constant>VIDIOC_G_PARM</constant> and
1046<constant>VIDIOC_S_PARM</constant> ioctls were merged with
1047<constant>VIDIOC_G_OUTPARM</constant> and
1048<constant>VIDIOC_S_OUTPARM</constant>. A
1049<structfield>type</structfield> field in the new &v4l2-streamparm;
1050selects the respective union member.</para>
1051
1052 <para>This change obsoletes the
1053<constant>VIDIOC_G_OUTPARM</constant> and
1054<constant>VIDIOC_S_OUTPARM</constant> ioctls.</para>
1055 </listitem>
1056
1057 <listitem>
1058 <para>Control enumeration was simplified, and two new
1059control flags were introduced and one dropped. The
1060<structfield>catname</structfield> field was replaced by a
1061<structfield>group</structfield> field.</para>
1062
1063 <para>Drivers can now flag unsupported and temporarily
1064unavailable controls with <constant>V4L2_CTRL_FLAG_DISABLED</constant>
1065and <constant>V4L2_CTRL_FLAG_GRABBED</constant> respectively. The
1066<structfield>group</structfield> name indicates a possibly narrower
1067classification than the <structfield>category</structfield>. In other
1068words, there may be multiple groups within a category. Controls within
1069a group would typically be drawn within a group box. Controls in
1070different categories might have a greater separation, or may even
1071appear in separate windows.</para>
1072 </listitem>
1073
1074 <listitem>
1075 <para>The &v4l2-buffer; <structfield>timestamp</structfield>
1076was changed to a 64 bit integer, containing the sampling or output
1077time of the frame in nanoseconds. Additionally timestamps will be in
1078absolute system time, not starting from zero at the beginning of a
1079stream. The data type name for timestamps is stamp_t, defined as a
1080signed 64-bit integer. Output devices should not send a buffer out
1081until the time in the timestamp field has arrived. I would like to
1082follow SGI's lead, and adopt a multimedia timestamping system like
1083their UST (Unadjusted System Time). See
1084http://web.archive.org/web/*/http://reality.sgi.com
1085/cpirazzi_engr/lg/time/intro.html.
1086UST uses timestamps that are 64-bit signed integers
1087(not struct timeval's) and given in nanosecond units. The UST clock
1088starts at zero when the system is booted and runs continuously and
1089uniformly. It takes a little over 292 years for UST to overflow. There
1090is no way to set the UST clock. The regular Linux time-of-day clock
1091can be changed periodically, which would cause errors if it were being
1092used for timestamping a multimedia stream. A real UST style clock will
1093require some support in the kernel that is not there yet. But in
1094anticipation, I will change the timestamp field to a 64-bit integer,
1095and I will change the v4l2_masterclock_gettime() function (used only
1096by drivers) to return a 64-bit integer.</para>
1097 </listitem>
1098
1099 <listitem>
1100 <para>A <structfield>sequence</structfield> field was added
1101to &v4l2-buffer;. The <structfield>sequence</structfield> field counts
1102captured frames, it is ignored by output devices. When a capture
1103driver drops a frame, the sequence number of that frame is
1104skipped.</para>
1105 </listitem>
1106 </orderedlist>
1107 </section>
1108
1109 <section>
1110 <title>V4L2 Version 0.20 incremental changes</title>
1111 <!-- Version number didn't change anymore, reason unknown. -->
1112
1113 <para>1999-12-23: In &v4l2-vbi-format; the
1114<structfield>reserved1</structfield> field became
1115<structfield>offset</structfield>. Previously drivers were required to
1116clear the <structfield>reserved1</structfield> field.</para>
1117
1118 <para>2000-01-13: The
1119 <constant>V4L2_FMT_FLAG_NOT_INTERLACED</constant> flag was added.</para>
1120
1121 <para>2000-07-31: The <filename>linux/poll.h</filename> header
1122is now included by <filename>videodev.h</filename> for compatibility
1123with the original <filename>videodev.h</filename> file.</para>
1124
1125 <para>2000-11-20: <constant>V4L2_TYPE_VBI_OUTPUT</constant> and
1126<constant>V4L2_PIX_FMT_Y41P</constant> were added.</para>
1127
1128 <para>2000-11-25: <constant>V4L2_TYPE_VBI_INPUT</constant> was
1129added.</para>
1130
1131 <para>2000-12-04: A couple typos in symbol names were fixed.</para>
1132
1133 <para>2001-01-18: To avoid namespace conflicts the
1134<constant>fourcc</constant> macro defined in the
1135<filename>videodev.h</filename> header file was renamed to
1136<constant>v4l2_fourcc</constant>.</para>
1137
1138 <para>2001-01-25: A possible driver-level compatibility problem
1139between the <filename>videodev.h</filename> file in Linux 2.4.0 and
1140the <filename>videodev.h</filename> file included in the
1141<filename>videodevX</filename> patch was fixed. Users of an earlier
1142version of <filename>videodevX</filename> on Linux 2.4.0 should
1143recompile their V4L and V4L2 drivers.</para>
1144
1145 <para>2001-01-26: A possible kernel-level incompatibility
1146between the <filename>videodev.h</filename> file in the
1147<filename>videodevX</filename> patch and the
1148<filename>videodev.h</filename> file in Linux 2.2.x with devfs patches
1149applied was fixed.</para>
1150
1151 <para>2001-03-02: Certain V4L ioctls which pass data in both
1152direction although they are defined with read-only parameter, did not
1153work correctly through the backward compatibility layer.
1154[Solution?]</para>
1155
1156 <para>2001-04-13: Big endian 16-bit RGB formats were added.</para>
1157
1158 <para>2001-09-17: New YUV formats and the &VIDIOC-G-FREQUENCY; and
1159&VIDIOC-S-FREQUENCY; ioctls were added. (The old
1160<constant>VIDIOC_G_FREQ</constant> and
1161<constant>VIDIOC_S_FREQ</constant> ioctls did not take multiple tuners
1162into account.)</para>
1163
1164 <para>2000-09-18: <constant>V4L2_BUF_TYPE_VBI</constant> was
1165added. This may <emphasis>break compatibility</emphasis> as the
1166&VIDIOC-G-FMT; and &VIDIOC-S-FMT; ioctls may fail now if the struct
1167<structname>v4l2_fmt</structname> <structfield>type</structfield>
1168field does not contain <constant>V4L2_BUF_TYPE_VBI</constant>. In the
1169documentation of the &v4l2-vbi-format;
1170<structfield>offset</structfield> field the ambiguous phrase "rising
1171edge" was changed to "leading edge".</para>
1172 </section>
1173
1174 <section>
1175 <title>V4L2 Version 0.20 2000-11-23</title>
1176
1177 <para>A number of changes were made to the raw VBI
1178interface.</para>
1179
1180 <orderedlist>
1181 <listitem>
1182 <para>Figures clarifying the line numbering scheme were
1183added to the V4L2 API specification. The
1184<structfield>start</structfield>[0] and
1185<structfield>start</structfield>[1] fields no longer count line
1186numbers beginning at zero. Rationale: a) The previous definition was
1187unclear. b) The <structfield>start</structfield>[] values are ordinal
1188numbers. c) There is no point in inventing a new line numbering
1189scheme. We now use line number as defined by ITU-R, period.
1190Compatibility: Add one to the start values. Applications depending on
1191the previous semantics may not function correctly.</para>
1192 </listitem>
1193
1194 <listitem>
1195 <para>The restriction "count[0] &gt; 0 and count[1] &gt; 0"
1196has been relaxed to "(count[0] + count[1]) &gt; 0". Rationale:
1197Drivers may allocate resources at scan line granularity and some data
1198services are transmitted only on the first field. The comment that
1199both <structfield>count</structfield> values will usually be equal is
1200misleading and pointless and has been removed. This change
1201<emphasis>breaks compatibility</emphasis> with earlier versions:
1202Drivers may return EINVAL, applications may not function
1203correctly.</para>
1204 </listitem>
1205
1206 <listitem>
1207 <para>Drivers are again permitted to return negative
1208(unknown) start values as proposed earlier. Why this feature was
1209dropped is unclear. This change may <emphasis>break
1210compatibility</emphasis> with applications depending on the start
1211values being positive. The use of <constant>EBUSY</constant> and
1212<constant>EINVAL</constant> error codes with the &VIDIOC-S-FMT; ioctl
1213was clarified. The &EBUSY; was finally documented, and the
1214<structfield>reserved2</structfield> field which was previously
1215mentioned only in the <filename>videodev.h</filename> header
1216file.</para>
1217 </listitem>
1218
1219 <listitem>
1220 <para>New buffer types
1221<constant>V4L2_TYPE_VBI_INPUT</constant> and
1222<constant>V4L2_TYPE_VBI_OUTPUT</constant> were added. The former is an
1223alias for the old <constant>V4L2_TYPE_VBI</constant>, the latter was
1224missing in the <filename>videodev.h</filename> file.</para>
1225 </listitem>
1226 </orderedlist>
1227 </section>
1228
1229 <section>
1230 <title>V4L2 Version 0.20 2002-07-25</title>
1231 <para>Added sliced VBI interface proposal.</para>
1232 </section>
1233
1234 <section>
1235 <title>V4L2 in Linux 2.5.46, 2002-10</title>
1236
1237 <para>Around October-November 2002, prior to an announced
1238feature freeze of Linux 2.5, the API was revised, drawing from
1239experience with V4L2 0.20. This unnamed version was finally merged
1240into Linux 2.5.46.</para>
1241
1242 <orderedlist>
1243 <listitem>
1244 <para>As specified in <xref linkend="related" />, drivers
1245must make related device functions available under all minor device
1246numbers.</para>
1247 </listitem>
1248
1249 <listitem>
1250 <para>The &func-open; function requires access mode
1251<constant>O_RDWR</constant> regardless of the device type. All V4L2
1252drivers exchanging data with applications must support the
1253<constant>O_NONBLOCK</constant> flag. The <constant>O_NOIO</constant>
1254flag, a V4L2 symbol which aliased the meaningless
1255<constant>O_TRUNC</constant> to indicate accesses without data
1256exchange (panel applications) was dropped. Drivers must stay in "panel
1257mode" until the application attempts to initiate a data exchange, see
1258<xref linkend="open" />.</para>
1259 </listitem>
1260
1261 <listitem>
1262 <para>The &v4l2-capability; changed dramatically. Note that
1263also the size of the structure changed, which is encoded in the ioctl
1264request code, thus older V4L2 devices will respond with an &EINVAL; to
1265the new &VIDIOC-QUERYCAP; ioctl.</para>
1266
1267 <para>There are new fields to identify the driver, a new RDS
1268device function <constant>V4L2_CAP_RDS_CAPTURE</constant>, the
1269<constant>V4L2_CAP_AUDIO</constant> flag indicates if the device has
1270any audio connectors, another I/O capability
1271<constant>V4L2_CAP_ASYNCIO</constant> can be flagged. In response to
1272these changes the <structfield>type</structfield> field became a bit
1273set and was merged into the <structfield>flags</structfield> field.
1274<constant>V4L2_FLAG_TUNER</constant> was renamed to
1275<constant>V4L2_CAP_TUNER</constant>,
1276<constant>V4L2_CAP_VIDEO_OVERLAY</constant> replaced
1277<constant>V4L2_FLAG_PREVIEW</constant> and
1278<constant>V4L2_CAP_VBI_CAPTURE</constant> and
1279<constant>V4L2_CAP_VBI_OUTPUT</constant> replaced
1280<constant>V4L2_FLAG_DATA_SERVICE</constant>.
1281<constant>V4L2_FLAG_READ</constant> and
1282<constant>V4L2_FLAG_WRITE</constant> were merged into
1283<constant>V4L2_CAP_READWRITE</constant>.</para>
1284
1285 <para>The redundant fields
1286<structfield>inputs</structfield>, <structfield>outputs</structfield>
1287and <structfield>audios</structfield> were removed. These properties
1288can be determined as described in <xref linkend="video" /> and <xref
1289linkend="audio" />.</para>
1290
1291 <para>The somewhat volatile and therefore barely useful
1292fields <structfield>maxwidth</structfield>,
1293<structfield>maxheight</structfield>,
1294<structfield>minwidth</structfield>,
1295<structfield>minheight</structfield>,
1296<structfield>maxframerate</structfield> were removed. This information
1297is available as described in <xref linkend="format" /> and
1298<xref linkend="standard" />.</para>
1299
1300 <para><constant>V4L2_FLAG_SELECT</constant> was removed. We
1301believe the select() function is important enough to require support
1302of it in all V4L2 drivers exchanging data with applications. The
1303redundant <constant>V4L2_FLAG_MONOCHROME</constant> flag was removed,
1304this information is available as described in <xref
1305 linkend="format" />.</para>
1306 </listitem>
1307
1308 <listitem>
1309 <para>In &v4l2-input; the
1310<structfield>assoc_audio</structfield> field and the
1311<structfield>capability</structfield> field and its only flag
1312<constant>V4L2_INPUT_CAP_AUDIO</constant> was replaced by the new
1313<structfield>audioset</structfield> field. Instead of linking one
1314video input to one audio input this field reports all audio inputs
1315this video input combines with.</para>
1316
1317 <para>New fields are <structfield>tuner</structfield>
1318(reversing the former link from tuners to video inputs),
1319<structfield>std</structfield> and
1320<structfield>status</structfield>.</para>
1321
1322 <para>Accordingly &v4l2-output; lost its
1323<structfield>capability</structfield> and
1324<structfield>assoc_audio</structfield> fields.
1325<structfield>audioset</structfield>,
1326<structfield>modulator</structfield> and
1327<structfield>std</structfield> where added instead.</para>
1328 </listitem>
1329
1330 <listitem>
1331 <para>The &v4l2-audio; field
1332<structfield>audio</structfield> was renamed to
1333<structfield>index</structfield>, for consistency with other
1334structures. A new capability flag
1335<constant>V4L2_AUDCAP_STEREO</constant> was added to indicated if the
1336audio input in question supports stereo sound.
1337<constant>V4L2_AUDCAP_EFFECTS</constant> and the corresponding
1338<constant>V4L2_AUDMODE</constant> flags where removed. This can be
1339easily implemented using controls. (However the same applies to AVL
1340which is still there.)</para>
1341
1342 <para>Again for consistency the &v4l2-audioout; field
1343<structfield>audio</structfield> was renamed to
1344<structfield>index</structfield>.</para>
1345 </listitem>
1346
1347 <listitem>
1348 <para>The &v4l2-tuner;
1349<structfield>input</structfield> field was replaced by an
1350<structfield>index</structfield> field, permitting devices with
1351multiple tuners. The link between video inputs and tuners is now
1352reversed, inputs point to their tuner. The
1353<structfield>std</structfield> substructure became a
1354simple set (more about this below) and moved into &v4l2-input;. A
1355<structfield>type</structfield> field was added.</para>
1356
1357 <para>Accordingly in &v4l2-modulator; the
1358<structfield>output</structfield> was replaced by an
1359<structfield>index</structfield> field.</para>
1360
1361 <para>In &v4l2-frequency; the
1362<structfield>port</structfield> field was replaced by a
1363<structfield>tuner</structfield> field containing the respective tuner
1364or modulator index number. A tuner <structfield>type</structfield>
1365field was added and the <structfield>reserved</structfield> field
1366became larger for future extensions (satellite tuners in
1367particular).</para>
1368 </listitem>
1369
1370 <listitem>
1371 <para>The idea of completely transparent video standards was
1372dropped. Experience showed that applications must be able to work with
1373video standards beyond presenting the user a menu. Instead of
1374enumerating supported standards with an ioctl applications can now
1375refer to standards by &v4l2-std-id; and symbols defined in the
1376<filename>videodev2.h</filename> header file. For details see <xref
1377 linkend="standard" />. The &VIDIOC-G-STD; and
1378&VIDIOC-S-STD; now take a pointer to this type as argument.
1379&VIDIOC-QUERYSTD; was added to autodetect the received standard, if
1380the hardware has this capability. In &v4l2-standard; an
1381<structfield>index</structfield> field was added for &VIDIOC-ENUMSTD;.
1382A &v4l2-std-id; field named <structfield>id</structfield> was added as
1383machine readable identifier, also replacing the
1384<structfield>transmission</structfield> field. The misleading
1385<structfield>framerate</structfield> field was renamed
1386to <structfield>frameperiod</structfield>. The now obsolete
1387<structfield>colorstandard</structfield> information, originally
1388needed to distguish between variations of standards, were
1389removed.</para>
1390
1391 <para>Struct <structname>v4l2_enumstd</structname> ceased to
1392be. &VIDIOC-ENUMSTD; now takes a pointer to a &v4l2-standard;
1393directly. The information which standards are supported by a
1394particular video input or output moved into &v4l2-input; and
1395&v4l2-output; fields named <structfield>std</structfield>,
1396respectively.</para>
1397 </listitem>
1398
1399 <listitem>
1400 <para>The &v4l2-queryctrl; fields
1401<structfield>category</structfield> and
1402<structfield>group</structfield> did not catch on and/or were not
1403implemented as expected and therefore removed.</para>
1404 </listitem>
1405
1406 <listitem>
1407 <para>The &VIDIOC-TRY-FMT; ioctl was added to negotiate data
1408formats as with &VIDIOC-S-FMT;, but without the overhead of
1409programming the hardware and regardless of I/O in progress.</para>
1410
1411 <para>In &v4l2-format; the <structfield>fmt</structfield>
1412union was extended to contain &v4l2-window;. All image format
1413negotiations are now possible with <constant>VIDIOC_G_FMT</constant>,
1414<constant>VIDIOC_S_FMT</constant> and
1415<constant>VIDIOC_TRY_FMT</constant>; ioctl. The
1416<constant>VIDIOC_G_WIN</constant> and
1417<constant>VIDIOC_S_WIN</constant> ioctls to prepare for a video
1418overlay were removed. The <structfield>type</structfield> field
1419changed to type &v4l2-buf-type; and the buffer type names changed as
1420follows.<informaltable>
1421 <tgroup cols="2">
1422 <thead>
1423 <row>
1424 <entry>Old defines</entry>
1425 <entry>&v4l2-buf-type;</entry>
1426 </row>
1427 </thead>
1428 <tbody valign="top">
1429 <row>
1430 <entry><constant>V4L2_BUF_TYPE_CAPTURE</constant></entry>
1431 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant></entry>
1432 </row>
1433 <row>
1434 <entry><constant>V4L2_BUF_TYPE_CODECIN</constant></entry>
1435 <entry>Omitted for now</entry>
1436 </row>
1437 <row>
1438 <entry><constant>V4L2_BUF_TYPE_CODECOUT</constant></entry>
1439 <entry>Omitted for now</entry>
1440 </row>
1441 <row>
1442 <entry><constant>V4L2_BUF_TYPE_EFFECTSIN</constant></entry>
1443 <entry>Omitted for now</entry>
1444 </row>
1445 <row>
1446 <entry><constant>V4L2_BUF_TYPE_EFFECTSIN2</constant></entry>
1447 <entry>Omitted for now</entry>
1448 </row>
1449 <row>
1450 <entry><constant>V4L2_BUF_TYPE_EFFECTSOUT</constant></entry>
1451 <entry>Omitted for now</entry>
1452 </row>
1453 <row>
1454 <entry><constant>V4L2_BUF_TYPE_VIDEOOUT</constant></entry>
1455 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant></entry>
1456 </row>
1457 <row>
1458 <entry><constant>-</constant></entry>
1459 <entry><constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant></entry>
1460 </row>
1461 <row>
1462 <entry><constant>-</constant></entry>
1463 <entry><constant>V4L2_BUF_TYPE_VBI_CAPTURE</constant></entry>
1464 </row>
1465 <row>
1466 <entry><constant>-</constant></entry>
1467 <entry><constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant></entry>
1468 </row>
1469 <row>
1470 <entry><constant>-</constant></entry>
1471 <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant></entry>
1472 </row>
1473 <row>
1474 <entry><constant>-</constant></entry>
1475 <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant></entry>
1476 </row>
1477 <row>
1478 <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry>
1479 <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant> (but this is deprecated)</entry>
1480 </row>
1481 </tbody>
1482 </tgroup>
1483 </informaltable></para>
1484 </listitem>
1485
1486 <listitem>
1487 <para>In &v4l2-fmtdesc; a &v4l2-buf-type; field named
1488<structfield>type</structfield> was added as in &v4l2-format;. The
1489<constant>VIDIOC_ENUM_FBUFFMT</constant> ioctl is no longer needed and
1490was removed. These calls can be replaced by &VIDIOC-ENUM-FMT; with
1491type <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>.</para>
1492 </listitem>
1493
1494 <listitem>
1495 <para>In &v4l2-pix-format; the
1496<structfield>depth</structfield> field was removed, assuming
1497applications which recognize the format by its four-character-code
1498already know the color depth, and others do not care about it. The
1499same rationale lead to the removal of the
1500<constant>V4L2_FMT_FLAG_COMPRESSED</constant> flag. The
1501<constant>V4L2_FMT_FLAG_SWCONVECOMPRESSED</constant> flag was removed
1502because drivers are not supposed to convert images in kernel space. A
1503user library of conversion functions should be provided instead. The
1504<constant>V4L2_FMT_FLAG_BYTESPERLINE</constant> flag was redundant.
1505Applications can set the <structfield>bytesperline</structfield> field
1506to zero to get a reasonable default. Since the remaining flags were
1507replaced as well, the <structfield>flags</structfield> field itself
1508was removed.</para>
1509 <para>The interlace flags were replaced by a &v4l2-field;
1510value in a newly added <structfield>field</structfield>
1511field.<informaltable>
1512 <tgroup cols="2">
1513 <thead>
1514 <row>
1515 <entry>Old flag</entry>
1516 <entry>&v4l2-field;</entry>
1517 </row>
1518 </thead>
1519 <tbody valign="top">
1520 <row>
1521 <entry><constant>V4L2_FMT_FLAG_NOT_INTERLACED</constant></entry>
1522 <entry>?</entry>
1523 </row>
1524 <row>
1525 <entry><constant>V4L2_FMT_FLAG_INTERLACED</constant>
1526= <constant>V4L2_FMT_FLAG_COMBINED</constant></entry>
1527 <entry><constant>V4L2_FIELD_INTERLACED</constant></entry>
1528 </row>
1529 <row>
1530 <entry><constant>V4L2_FMT_FLAG_TOPFIELD</constant>
1531= <constant>V4L2_FMT_FLAG_ODDFIELD</constant></entry>
1532 <entry><constant>V4L2_FIELD_TOP</constant></entry>
1533 </row>
1534 <row>
1535 <entry><constant>V4L2_FMT_FLAG_BOTFIELD</constant>
1536= <constant>V4L2_FMT_FLAG_EVENFIELD</constant></entry>
1537 <entry><constant>V4L2_FIELD_BOTTOM</constant></entry>
1538 </row>
1539 <row>
1540 <entry><constant>-</constant></entry>
1541 <entry><constant>V4L2_FIELD_SEQ_TB</constant></entry>
1542 </row>
1543 <row>
1544 <entry><constant>-</constant></entry>
1545 <entry><constant>V4L2_FIELD_SEQ_BT</constant></entry>
1546 </row>
1547 <row>
1548 <entry><constant>-</constant></entry>
1549 <entry><constant>V4L2_FIELD_ALTERNATE</constant></entry>
1550 </row>
1551 </tbody>
1552 </tgroup>
1553 </informaltable></para>
1554
1555 <para>The color space flags were replaced by a
1556&v4l2-colorspace; value in a newly added
1557<structfield>colorspace</structfield> field, where one of
1558<constant>V4L2_COLORSPACE_SMPTE170M</constant>,
1559<constant>V4L2_COLORSPACE_BT878</constant>,
1560<constant>V4L2_COLORSPACE_470_SYSTEM_M</constant> or
1561<constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant> replaces
1562<constant>V4L2_FMT_CS_601YUV</constant>.</para>
1563 </listitem>
1564
1565 <listitem>
1566 <para>In &v4l2-requestbuffers; the
1567<structfield>type</structfield> field was properly defined as
1568&v4l2-buf-type;. Buffer types changed as mentioned above. A new
1569<structfield>memory</structfield> field of type &v4l2-memory; was
1570added to distinguish between I/O methods using buffers allocated
1571by the driver or the application. See <xref linkend="io" /> for
1572details.</para>
1573 </listitem>
1574
1575 <listitem>
1576 <para>In &v4l2-buffer; the <structfield>type</structfield>
1577field was properly defined as &v4l2-buf-type;. Buffer types changed as
1578mentioned above. A <structfield>field</structfield> field of type
1579&v4l2-field; was added to indicate if a buffer contains a top or
1580bottom field. The old field flags were removed. Since no unadjusted
1581system time clock was added to the kernel as planned, the
1582<structfield>timestamp</structfield> field changed back from type
1583stamp_t, an unsigned 64 bit integer expressing the sample time in
1584nanoseconds, to struct <structname>timeval</structname>. With the
1585addition of a second memory mapping method the
1586<structfield>offset</structfield> field moved into union
1587<structfield>m</structfield>, and a new
1588<structfield>memory</structfield> field of type &v4l2-memory; was
1589added to distinguish between I/O methods. See <xref linkend="io" />
1590for details.</para>
1591
1592 <para>The <constant>V4L2_BUF_REQ_CONTIG</constant>
1593flag was used by the V4L compatibility layer, after changes to this
1594code it was no longer needed. The
1595<constant>V4L2_BUF_ATTR_DEVICEMEM</constant> flag would indicate if
1596the buffer was indeed allocated in device memory rather than DMA-able
1597system memory. It was barely useful and so was removed.</para>
1598 </listitem>
1599
1600 <listitem>
1601 <para>In &v4l2-framebuffer; the
1602<structfield>base[3]</structfield> array anticipating double- and
1603triple-buffering in off-screen video memory, however without defining
1604a synchronization mechanism, was replaced by a single pointer. The
1605<constant>V4L2_FBUF_CAP_SCALEUP</constant> and
1606<constant>V4L2_FBUF_CAP_SCALEDOWN</constant> flags were removed.
1607Applications can determine this capability more accurately using the
1608new cropping and scaling interface. The
1609<constant>V4L2_FBUF_CAP_CLIPPING</constant> flag was replaced by
1610<constant>V4L2_FBUF_CAP_LIST_CLIPPING</constant> and
1611<constant>V4L2_FBUF_CAP_BITMAP_CLIPPING</constant>.</para>
1612 </listitem>
1613
1614 <listitem>
1615 <para>In &v4l2-clip; the <structfield>x</structfield>,
1616<structfield>y</structfield>, <structfield>width</structfield> and
1617<structfield>height</structfield> field moved into a
1618<structfield>c</structfield> substructure of type &v4l2-rect;. The
1619<structfield>x</structfield> and <structfield>y</structfield> fields
1620were renamed to <structfield>left</structfield> and
1621<structfield>top</structfield>, &ie; offsets to a context dependent
1622origin.</para>
1623 </listitem>
1624
1625 <listitem>
1626 <para>In &v4l2-window; the <structfield>x</structfield>,
1627<structfield>y</structfield>, <structfield>width</structfield> and
1628<structfield>height</structfield> field moved into a
1629<structfield>w</structfield> substructure as above. A
1630<structfield>field</structfield> field of type %v4l2-field; was added
1631to distinguish between field and frame (interlaced) overlay.</para>
1632 </listitem>
1633
1634 <listitem>
1635 <para>The digital zoom interface, including struct
1636<structname>v4l2_zoomcap</structname>, struct
1637<structname>v4l2_zoom</structname>,
1638<constant>V4L2_ZOOM_NONCAP</constant> and
1639<constant>V4L2_ZOOM_WHILESTREAMING</constant> was replaced by a new
1640cropping and scaling interface. The previously unused struct
1641<structname>v4l2_cropcap</structname> and
1642<structname>v4l2_crop</structname> where redefined for this purpose.
1643See <xref linkend="crop" /> for details.</para>
1644 </listitem>
1645
1646 <listitem>
1647 <para>In &v4l2-vbi-format; the
1648<structfield>SAMPLE_FORMAT</structfield> field now contains a
1649four-character-code as used to identify video image formats and
1650<constant>V4L2_PIX_FMT_GREY</constant> replaces the
1651<constant>V4L2_VBI_SF_UBYTE</constant> define. The
1652<structfield>reserved</structfield> field was extended.</para>
1653 </listitem>
1654
1655 <listitem>
1656 <para>In &v4l2-captureparm; the type of the
1657<structfield>timeperframe</structfield> field changed from unsigned
1658long to &v4l2-fract;. This allows the accurate expression of multiples
1659of the NTSC-M frame rate 30000 / 1001. A new field
1660<structfield>readbuffers</structfield> was added to control the driver
1661behaviour in read I/O mode.</para>
1662
1663 <para>Similar changes were made to &v4l2-outputparm;.</para>
1664 </listitem>
1665
1666 <listitem>
1667 <para>The struct <structname>v4l2_performance</structname>
1668and <constant>VIDIOC_G_PERF</constant> ioctl were dropped. Except when
1669using the <link linkend="rw">read/write I/O method</link>, which is
1670limited anyway, this information is already available to
1671applications.</para>
1672 </listitem>
1673
1674 <listitem>
1675 <para>The example transformation from RGB to YCbCr color
1676space in the old V4L2 documentation was inaccurate, this has been
1677corrected in <xref linkend="pixfmt" />.<!-- 0.5670G should be
16780.587, and 127/112 != 255/224 --></para>
1679 </listitem>
1680 </orderedlist>
1681 </section>
1682
1683 <section>
1684 <title>V4L2 2003-06-19</title>
1685
1686 <orderedlist>
1687 <listitem>
1688 <para>A new capability flag
1689<constant>V4L2_CAP_RADIO</constant> was added for radio devices. Prior
1690to this change radio devices would identify solely by having exactly one
1691tuner whose type field reads <constant>V4L2_TUNER_RADIO</constant>.</para>
1692 </listitem>
1693
1694 <listitem>
1695 <para>An optional driver access priority mechanism was
1696added, see <xref linkend="app-pri" /> for details.</para>
1697 </listitem>
1698
1699 <listitem>
1700 <para>The audio input and output interface was found to be
1701incomplete.</para>
1702 <para>Previously the &VIDIOC-G-AUDIO;
1703ioctl would enumerate the available audio inputs. An ioctl to
1704determine the current audio input, if more than one combines with the
1705current video input, did not exist. So
1706<constant>VIDIOC_G_AUDIO</constant> was renamed to
1707<constant>VIDIOC_G_AUDIO_OLD</constant>, this ioctl was removed on
1708Kernel 2.6.39. The &VIDIOC-ENUMAUDIO; ioctl was added to enumerate
1709audio inputs, while &VIDIOC-G-AUDIO; now reports the current audio
1710input.</para>
1711 <para>The same changes were made to &VIDIOC-G-AUDOUT; and
1712&VIDIOC-ENUMAUDOUT;.</para>
1713 <para>Until further the "videodev" module will automatically
1714translate between the old and new ioctls, but drivers and applications
1715must be updated to successfully compile again.</para>
1716 </listitem>
1717
1718 <listitem>
1719 <para>The &VIDIOC-OVERLAY; ioctl was incorrectly defined with
1720write-read parameter. It was changed to write-only, while the write-read
1721version was renamed to <constant>VIDIOC_OVERLAY_OLD</constant>. The old
1722ioctl was removed on Kernel 2.6.39. Until further the "videodev"
1723kernel module will automatically translate to the new version, so drivers
1724must be recompiled, but not applications.</para>
1725 </listitem>
1726
1727 <listitem>
1728 <para><xref linkend="overlay" /> incorrectly stated that
1729clipping rectangles define regions where the video can be seen.
1730Correct is that clipping rectangles define regions where
1731<emphasis>no</emphasis> video shall be displayed and so the graphics
1732surface can be seen.</para>
1733 </listitem>
1734
1735 <listitem>
1736 <para>The &VIDIOC-S-PARM; and &VIDIOC-S-CTRL; ioctls were
1737defined with write-only parameter, inconsistent with other ioctls
1738modifying their argument. They were changed to write-read, while a
1739<constant>_OLD</constant> suffix was added to the write-only versions.
1740The old ioctls were removed on Kernel 2.6.39. Drivers and
1741applications assuming a constant parameter need an update.</para>
1742 </listitem>
1743 </orderedlist>
1744 </section>
1745
1746 <section>
1747 <title>V4L2 2003-11-05</title>
1748 <orderedlist>
1749 <listitem>
1750 <para>In <xref linkend="pixfmt-rgb" /> the following pixel
1751formats were incorrectly transferred from Bill Dirks' V4L2
1752specification. Descriptions below refer to bytes in memory, in
1753ascending address order.<informaltable>
1754 <tgroup cols="3">
1755 <thead>
1756 <row>
1757 <entry>Symbol</entry>
1758 <entry>In this document prior to revision
17590.5</entry>
1760 <entry>Corrected</entry>
1761 </row>
1762 </thead>
1763 <tbody valign="top">
1764 <row>
1765 <entry><constant>V4L2_PIX_FMT_RGB24</constant></entry>
1766 <entry>B, G, R</entry>
1767 <entry>R, G, B</entry>
1768 </row>
1769 <row>
1770 <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
1771 <entry>R, G, B</entry>
1772 <entry>B, G, R</entry>
1773 </row>
1774 <row>
1775 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
1776 <entry>B, G, R, X</entry>
1777 <entry>R, G, B, X</entry>
1778 </row>
1779 <row>
1780 <entry><constant>V4L2_PIX_FMT_BGR32</constant></entry>
1781 <entry>R, G, B, X</entry>
1782 <entry>B, G, R, X</entry>
1783 </row>
1784 </tbody>
1785 </tgroup>
1786 </informaltable> The
1787<constant>V4L2_PIX_FMT_BGR24</constant> example was always
1788correct.</para>
1789 <para>In <xref linkend="v4l-image-properties" /> the mapping
1790of the V4L <constant>VIDEO_PALETTE_RGB24</constant> and
1791<constant>VIDEO_PALETTE_RGB32</constant> formats to V4L2 pixel formats
1792was accordingly corrected.</para>
1793 </listitem>
1794
1795 <listitem>
1796 <para>Unrelated to the fixes above, drivers may still
1797interpret some V4L2 RGB pixel formats differently. These issues have
1798yet to be addressed, for details see <xref
1799 linkend="pixfmt-rgb" />.</para>
1800 </listitem>
1801 </orderedlist>
1802 </section>
1803
1804 <section>
1805 <title>V4L2 in Linux 2.6.6, 2004-05-09</title>
1806 <orderedlist>
1807 <listitem>
1808 <para>The &VIDIOC-CROPCAP; ioctl was incorrectly defined
1809with read-only parameter. It is now defined as write-read ioctl, while
1810the read-only version was renamed to
1811<constant>VIDIOC_CROPCAP_OLD</constant>. The old ioctl was removed
1812on Kernel 2.6.39.</para>
1813 </listitem>
1814 </orderedlist>
1815 </section>
1816
1817 <section>
1818 <title>V4L2 in Linux 2.6.8</title>
1819 <orderedlist>
1820 <listitem>
1821 <para>A new field <structfield>input</structfield> (former
1822<structfield>reserved[0]</structfield>) was added to the &v4l2-buffer;
1823structure. Purpose of this field is to alternate between video inputs
1824(&eg; cameras) in step with the video capturing process. This function
1825must be enabled with the new <constant>V4L2_BUF_FLAG_INPUT</constant>
1826flag. The <structfield>flags</structfield> field is no longer
1827read-only.</para>
1828 </listitem>
1829 </orderedlist>
1830 </section>
1831
1832 <section>
1833 <title>V4L2 spec erratum 2004-08-01</title>
1834
1835 <orderedlist>
1836 <listitem>
1837 <para>The return value of the
1838<xref linkend="func-open" /> function was incorrectly documented.</para>
1839 </listitem>
1840
1841 <listitem>
1842 <para>Audio output ioctls end in -AUDOUT, not -AUDIOOUT.</para>
1843 </listitem>
1844
1845 <listitem>
1846 <para>In the Current Audio Input example the
1847<constant>VIDIOC_G_AUDIO</constant> ioctl took the wrong
1848argument.</para>
1849 </listitem>
1850
1851 <listitem>
1852 <para>The documentation of the &VIDIOC-QBUF; and
1853&VIDIOC-DQBUF; ioctls did not mention the &v4l2-buffer;
1854<structfield>memory</structfield> field. It was also missing from
1855examples. Also on the <constant>VIDIOC_DQBUF</constant> page the &EIO;
1856was not documented.</para>
1857 </listitem>
1858 </orderedlist>
1859 </section>
1860
1861 <section>
1862 <title>V4L2 in Linux 2.6.14</title>
1863 <orderedlist>
1864 <listitem>
1865 <para>A new sliced VBI interface was added. It is documented
1866in <xref linkend="sliced" /> and replaces the interface first
1867proposed in V4L2 specification 0.8.</para>
1868 </listitem>
1869 </orderedlist>
1870 </section>
1871
1872 <section>
1873 <title>V4L2 in Linux 2.6.15</title>
1874 <orderedlist>
1875 <listitem>
1876 <para>The &VIDIOC-LOG-STATUS; ioctl was added.</para>
1877 </listitem>
1878
1879 <listitem>
1880 <para>New video standards
1881<constant>V4L2_STD_NTSC_443</constant>,
1882<constant>V4L2_STD_SECAM_LC</constant>,
1883<constant>V4L2_STD_SECAM_DK</constant> (a set of SECAM D, K and K1),
1884and <constant>V4L2_STD_ATSC</constant> (a set of
1885<constant>V4L2_STD_ATSC_8_VSB</constant> and
1886<constant>V4L2_STD_ATSC_16_VSB</constant>) were defined. Note the
1887<constant>V4L2_STD_525_60</constant> set now includes
1888<constant>V4L2_STD_NTSC_443</constant>. See also <xref
1889 linkend="v4l2-std-id" />.</para>
1890 </listitem>
1891
1892 <listitem>
1893 <para>The <constant>VIDIOC_G_COMP</constant> and
1894<constant>VIDIOC_S_COMP</constant> ioctl were renamed to
1895<constant>VIDIOC_G_MPEGCOMP</constant> and
1896<constant>VIDIOC_S_MPEGCOMP</constant> respectively. Their argument
1897was replaced by a struct
1898<structname>v4l2_mpeg_compression</structname> pointer. (The
1899<constant>VIDIOC_G_MPEGCOMP</constant> and
1900<constant>VIDIOC_S_MPEGCOMP</constant> ioctls where removed in Linux
19012.6.25.)</para>
1902 </listitem>
1903 </orderedlist>
1904 </section>
1905
1906 <section>
1907 <title>V4L2 spec erratum 2005-11-27</title>
1908 <para>The capture example in <xref linkend="capture-example" />
1909called the &VIDIOC-S-CROP; ioctl without checking if cropping is
1910supported. In the video standard selection example in
1911<xref linkend="standard" /> the &VIDIOC-S-STD; call used the wrong
1912argument type.</para>
1913 </section>
1914
1915 <section>
1916 <title>V4L2 spec erratum 2006-01-10</title>
1917 <orderedlist>
1918 <listitem>
1919 <para>The <constant>V4L2_IN_ST_COLOR_KILL</constant> flag in
1920&v4l2-input; not only indicates if the color killer is enabled, but
1921also if it is active. (The color killer disables color decoding when
1922it detects no color in the video signal to improve the image
1923quality.)</para>
1924 </listitem>
1925
1926 <listitem>
1927 <para>&VIDIOC-S-PARM; is a write-read ioctl, not write-only as
1928stated on its reference page. The ioctl changed in 2003 as noted above.</para>
1929 </listitem>
1930 </orderedlist>
1931 </section>
1932
1933 <section>
1934 <title>V4L2 spec erratum 2006-02-03</title>
1935 <orderedlist>
1936 <listitem>
1937 <para>In &v4l2-captureparm; and &v4l2-outputparm; the
1938<structfield>timeperframe</structfield> field gives the time in
1939seconds, not microseconds.</para>
1940 </listitem>
1941 </orderedlist>
1942 </section>
1943
1944 <section>
1945 <title>V4L2 spec erratum 2006-02-04</title>
1946 <orderedlist>
1947 <listitem>
1948 <para>The <structfield>clips</structfield> field in
1949&v4l2-window; must point to an array of &v4l2-clip;, not a linked
1950list, because drivers ignore the struct
1951<structname>v4l2_clip</structname>.<structfield>next</structfield>
1952pointer.</para>
1953 </listitem>
1954 </orderedlist>
1955 </section>
1956
1957 <section>
1958 <title>V4L2 in Linux 2.6.17</title>
1959 <orderedlist>
1960 <listitem>
1961 <para>New video standard macros were added:
1962<constant>V4L2_STD_NTSC_M_KR</constant> (NTSC M South Korea), and the
1963sets <constant>V4L2_STD_MN</constant>,
1964<constant>V4L2_STD_B</constant>, <constant>V4L2_STD_GH</constant> and
1965<constant>V4L2_STD_DK</constant>. The
1966<constant>V4L2_STD_NTSC</constant> and
1967<constant>V4L2_STD_SECAM</constant> sets now include
1968<constant>V4L2_STD_NTSC_M_KR</constant> and
1969<constant>V4L2_STD_SECAM_LC</constant> respectively.</para>
1970 </listitem>
1971
1972 <listitem>
1973 <para>A new <constant>V4L2_TUNER_MODE_LANG1_LANG2</constant>
1974was defined to record both languages of a bilingual program. The
1975use of <constant>V4L2_TUNER_MODE_STEREO</constant> for this purpose
1976is deprecated now. See the &VIDIOC-G-TUNER; section for
1977details.</para>
1978 </listitem>
1979 </orderedlist>
1980 </section>
1981
1982 <section>
1983 <title>V4L2 spec erratum 2006-09-23 (Draft 0.15)</title>
1984 <orderedlist>
1985 <listitem>
1986 <para>In various places
1987<constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant> and
1988<constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant> of the sliced VBI
1989interface were not mentioned along with other buffer types.</para>
1990 </listitem>
1991
1992 <listitem>
1993 <para>In <xref linkend="vidioc-g-audio" /> it was clarified
1994that the &v4l2-audio; <structfield>mode</structfield> field is a flags
1995field.</para>
1996 </listitem>
1997
1998 <listitem>
1999 <para><xref linkend="vidioc-querycap" /> did not mention the
2000sliced VBI and radio capability flags.</para>
2001 </listitem>
2002
2003 <listitem>
2004 <para>In <xref linkend="vidioc-g-frequency" /> it was
2005clarified that applications must initialize the tuner
2006<structfield>type</structfield> field of &v4l2-frequency; before
2007calling &VIDIOC-S-FREQUENCY;.</para>
2008 </listitem>
2009
2010 <listitem>
2011 <para>The <structfield>reserved</structfield> array
2012in &v4l2-requestbuffers; has 2 elements, not 32.</para>
2013 </listitem>
2014
2015 <listitem>
2016 <para>In <xref linkend="output" /> and <xref
2017 linkend="raw-vbi" /> the device file names
2018<filename>/dev/vout</filename> which never caught on were replaced
2019by <filename>/dev/video</filename>.</para>
2020 </listitem>
2021
2022 <listitem>
2023 <para>With Linux 2.6.15 the possible range for VBI device minor
2024numbers was extended from 224-239 to 224-255. Accordingly device file names
2025<filename>/dev/vbi0</filename> to <filename>/dev/vbi31</filename> are
2026possible now.</para>
2027 </listitem>
2028 </orderedlist>
2029 </section>
2030
2031 <section>
2032 <title>V4L2 in Linux 2.6.18</title>
2033 <orderedlist>
2034 <listitem>
2035 <para>New ioctls &VIDIOC-G-EXT-CTRLS;, &VIDIOC-S-EXT-CTRLS;
2036and &VIDIOC-TRY-EXT-CTRLS; were added, a flag to skip unsupported
2037controls with &VIDIOC-QUERYCTRL;, new control types
2038<constant>V4L2_CTRL_TYPE_INTEGER64</constant> and
2039<constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant> (<xref
2040 linkend="v4l2-ctrl-type" />), and new control flags
2041<constant>V4L2_CTRL_FLAG_READ_ONLY</constant>,
2042<constant>V4L2_CTRL_FLAG_UPDATE</constant>,
2043<constant>V4L2_CTRL_FLAG_INACTIVE</constant> and
2044<constant>V4L2_CTRL_FLAG_SLIDER</constant> (<xref
2045 linkend="control-flags" />). See <xref
2046 linkend="extended-controls" /> for details.</para>
2047 </listitem>
2048 </orderedlist>
2049 </section>
2050
2051 <section>
2052 <title>V4L2 in Linux 2.6.19</title>
2053 <orderedlist>
2054 <listitem>
2055 <para>In &v4l2-sliced-vbi-cap; a buffer type field was added
2056replacing a reserved field. Note on architectures where the size of
2057enum types differs from int types the size of the structure changed.
2058The &VIDIOC-G-SLICED-VBI-CAP; ioctl was redefined from being read-only
2059to write-read. Applications must initialize the type field and clear
2060the reserved fields now. These changes may <emphasis>break the
2061compatibility</emphasis> with older drivers and applications.</para>
2062 </listitem>
2063
2064 <listitem>
2065 <para>The ioctls &VIDIOC-ENUM-FRAMESIZES; and
2066&VIDIOC-ENUM-FRAMEINTERVALS; were added.</para>
2067 </listitem>
2068
2069 <listitem>
2070 <para>A new pixel format <constant>V4L2_PIX_FMT_RGB444</constant> (<xref
2071linkend="rgb-formats" />) was added.</para>
2072 </listitem>
2073 </orderedlist>
2074 </section>
2075
2076 <section>
2077 <title>V4L2 spec erratum 2006-10-12 (Draft 0.17)</title>
2078 <orderedlist>
2079 <listitem>
2080 <para><constant>V4L2_PIX_FMT_HM12</constant> (<xref
2081linkend="reserved-formats" />) is a YUV 4:2:0, not 4:2:2 format.</para>
2082 </listitem>
2083 </orderedlist>
2084 </section>
2085
2086 <section>
2087 <title>V4L2 in Linux 2.6.21</title>
2088 <orderedlist>
2089 <listitem>
2090 <para>The <filename>videodev2.h</filename> header file is
2091now dual licensed under GNU General Public License version two or
2092later, and under a 3-clause BSD-style license.</para>
2093 </listitem>
2094 </orderedlist>
2095 </section>
2096
2097 <section>
2098 <title>V4L2 in Linux 2.6.22</title>
2099 <orderedlist>
2100 <listitem>
2101 <para>Two new field orders
2102 <constant>V4L2_FIELD_INTERLACED_TB</constant> and
2103 <constant>V4L2_FIELD_INTERLACED_BT</constant> were
2104 added. See <xref linkend="v4l2-field" /> for details.</para>
2105 </listitem>
2106
2107 <listitem>
2108 <para>Three new clipping/blending methods with a global or
2109straight or inverted local alpha value were added to the video overlay
2110interface. See the description of the &VIDIOC-G-FBUF; and
2111&VIDIOC-S-FBUF; ioctls for details.</para>
2112 <para>A new <structfield>global_alpha</structfield> field
2113was added to <link
2114linkend="v4l2-window"><structname>v4l2_window</structname></link>,
2115extending the structure. This may <emphasis>break
2116compatibility</emphasis> with applications using a struct
2117<structname>v4l2_window</structname> directly. However the <link
2118linkend="vidioc-g-fmt">VIDIOC_G/S/TRY_FMT</link> ioctls, which take a
2119pointer to a <link linkend="v4l2-format">v4l2_format</link> parent
2120structure with padding bytes at the end, are not affected.</para>
2121 </listitem>
2122
2123 <listitem>
2124 <para>The format of the <structfield>chromakey</structfield>
2125field in &v4l2-window; changed from "host order RGB32" to a pixel
2126value in the same format as the framebuffer. This may <emphasis>break
2127compatibility</emphasis> with existing applications. Drivers
2128supporting the "host order RGB32" format are not known.</para>
2129 </listitem>
2130
2131 </orderedlist>
2132 </section>
2133
2134 <section>
2135 <title>V4L2 in Linux 2.6.24</title>
2136 <orderedlist>
2137 <listitem>
2138 <para>The pixel formats
2139<constant>V4L2_PIX_FMT_PAL8</constant>,
2140<constant>V4L2_PIX_FMT_YUV444</constant>,
2141<constant>V4L2_PIX_FMT_YUV555</constant>,
2142<constant>V4L2_PIX_FMT_YUV565</constant> and
2143<constant>V4L2_PIX_FMT_YUV32</constant> were added.</para>
2144 </listitem>
2145 </orderedlist>
2146 </section>
2147
2148 <section>
2149 <title>V4L2 in Linux 2.6.25</title>
2150 <orderedlist>
2151 <listitem>
2152 <para>The pixel formats <link linkend="V4L2-PIX-FMT-Y16">
2153<constant>V4L2_PIX_FMT_Y16</constant></link> and <link
2154linkend="V4L2-PIX-FMT-SBGGR16">
2155<constant>V4L2_PIX_FMT_SBGGR16</constant></link> were added.</para>
2156 </listitem>
2157 <listitem>
2158 <para>New <link linkend="control">controls</link>
2159<constant>V4L2_CID_POWER_LINE_FREQUENCY</constant>,
2160<constant>V4L2_CID_HUE_AUTO</constant>,
2161<constant>V4L2_CID_WHITE_BALANCE_TEMPERATURE</constant>,
2162<constant>V4L2_CID_SHARPNESS</constant> and
2163<constant>V4L2_CID_BACKLIGHT_COMPENSATION</constant> were added. The
2164controls <constant>V4L2_CID_BLACK_LEVEL</constant>,
2165<constant>V4L2_CID_WHITENESS</constant>,
2166<constant>V4L2_CID_HCENTER</constant> and
2167<constant>V4L2_CID_VCENTER</constant> were deprecated.
2168</para>
2169 </listitem>
2170 <listitem>
2171 <para>A <link linkend="camera-controls">Camera controls
2172class</link> was added, with the new controls
2173<constant>V4L2_CID_EXPOSURE_AUTO</constant>,
2174<constant>V4L2_CID_EXPOSURE_ABSOLUTE</constant>,
2175<constant>V4L2_CID_EXPOSURE_AUTO_PRIORITY</constant>,
2176<constant>V4L2_CID_PAN_RELATIVE</constant>,
2177<constant>V4L2_CID_TILT_RELATIVE</constant>,
2178<constant>V4L2_CID_PAN_RESET</constant>,
2179<constant>V4L2_CID_TILT_RESET</constant>,
2180<constant>V4L2_CID_PAN_ABSOLUTE</constant>,
2181<constant>V4L2_CID_TILT_ABSOLUTE</constant>,
2182<constant>V4L2_CID_FOCUS_ABSOLUTE</constant>,
2183<constant>V4L2_CID_FOCUS_RELATIVE</constant> and
2184<constant>V4L2_CID_FOCUS_AUTO</constant>.</para>
2185 </listitem>
2186 <listitem>
2187 <para>The <constant>VIDIOC_G_MPEGCOMP</constant> and
2188<constant>VIDIOC_S_MPEGCOMP</constant> ioctls, which were superseded
2189by the <link linkend="extended-controls">extended controls</link>
2190interface in Linux 2.6.18, where finally removed from the
2191<filename>videodev2.h</filename> header file.</para>
2192 </listitem>
2193 </orderedlist>
2194 </section>
2195
2196 <section>
2197 <title>V4L2 in Linux 2.6.26</title>
2198 <orderedlist>
2199 <listitem>
2200 <para>The pixel formats
2201<constant>V4L2_PIX_FMT_Y16</constant> and
2202<constant>V4L2_PIX_FMT_SBGGR16</constant> were added.</para>
2203 </listitem>
2204 <listitem>
2205 <para>Added user controls
2206<constant>V4L2_CID_CHROMA_AGC</constant> and
2207<constant>V4L2_CID_COLOR_KILLER</constant>.</para>
2208 </listitem>
2209 </orderedlist>
2210 </section>
2211
2212 <section>
2213 <title>V4L2 in Linux 2.6.27</title>
2214 <orderedlist>
2215 <listitem>
2216 <para>The &VIDIOC-S-HW-FREQ-SEEK; ioctl and the
2217<constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability were added.</para>
2218 </listitem>
2219 <listitem>
2220 <para>The pixel formats
2221<constant>V4L2_PIX_FMT_YVYU</constant>,
2222<constant>V4L2_PIX_FMT_PCA501</constant>,
2223<constant>V4L2_PIX_FMT_PCA505</constant>,
2224<constant>V4L2_PIX_FMT_PCA508</constant>,
2225<constant>V4L2_PIX_FMT_PCA561</constant>,
2226<constant>V4L2_PIX_FMT_SGBRG8</constant>,
2227<constant>V4L2_PIX_FMT_PAC207</constant> and
2228<constant>V4L2_PIX_FMT_PJPG</constant> were added.</para>
2229 </listitem>
2230 </orderedlist>
2231 </section>
2232
2233 <section>
2234 <title>V4L2 in Linux 2.6.28</title>
2235 <orderedlist>
2236 <listitem>
2237 <para>Added <constant>V4L2_MPEG_AUDIO_ENCODING_AAC</constant> and
2238<constant>V4L2_MPEG_AUDIO_ENCODING_AC3</constant> MPEG audio encodings.</para>
2239 </listitem>
2240 <listitem>
2241 <para>Added <constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC</constant> MPEG
2242video encoding.</para>
2243 </listitem>
2244 <listitem>
2245 <para>The pixel formats
2246<constant>V4L2_PIX_FMT_SGRBG10</constant> and
2247<constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant> were added.</para>
2248 </listitem>
2249 </orderedlist>
2250 </section>
2251
2252 <section>
2253 <title>V4L2 in Linux 2.6.29</title>
2254 <orderedlist>
2255 <listitem>
2256 <para>The <constant>VIDIOC_G_CHIP_IDENT</constant> ioctl was renamed
2257to <constant>VIDIOC_G_CHIP_IDENT_OLD</constant> and &VIDIOC-DBG-G-CHIP-IDENT;
2258was introduced in its place. The old struct <structname>v4l2_chip_ident</structname>
2259was renamed to <structname id="v4l2-chip-ident-old">v4l2_chip_ident_old</structname>.</para>
2260 </listitem>
2261 <listitem>
2262 <para>The pixel formats
2263<constant>V4L2_PIX_FMT_VYUY</constant>,
2264<constant>V4L2_PIX_FMT_NV16</constant> and
2265<constant>V4L2_PIX_FMT_NV61</constant> were added.</para>
2266 </listitem>
2267 <listitem>
2268 <para>Added camera controls
2269<constant>V4L2_CID_ZOOM_ABSOLUTE</constant>,
2270<constant>V4L2_CID_ZOOM_RELATIVE</constant>,
2271<constant>V4L2_CID_ZOOM_CONTINUOUS</constant> and
2272<constant>V4L2_CID_PRIVACY</constant>.</para>
2273 </listitem>
2274 </orderedlist>
2275 </section>
2276 <section>
2277 <title>V4L2 in Linux 2.6.30</title>
2278 <orderedlist>
2279 <listitem>
2280 <para>New control flag <constant>V4L2_CTRL_FLAG_WRITE_ONLY</constant> was added.</para>
2281 </listitem>
2282 <listitem>
2283 <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para>
2284 </listitem>
2285 </orderedlist>
2286 </section>
2287 <section>
2288 <title>V4L2 in Linux 2.6.32</title>
2289 <orderedlist>
2290 <listitem>
2291 <para>In order to be easier to compare a V4L2 API and a kernel
2292version, now V4L2 API is numbered using the Linux Kernel version numeration.</para>
2293 </listitem>
2294 <listitem>
2295 <para>Finalized the RDS capture API. See <xref linkend="rds" /> for
2296more information.</para>
2297 </listitem>
2298 <listitem>
2299 <para>Added new capabilities for modulators and RDS encoders.</para>
2300 </listitem>
2301 <listitem>
2302 <para>Add description for libv4l API.</para>
2303 </listitem>
2304 <listitem>
2305 <para>Added support for string controls via new type <constant>V4L2_CTRL_TYPE_STRING</constant>.</para>
2306 </listitem>
2307 <listitem>
2308 <para>Added <constant>V4L2_CID_BAND_STOP_FILTER</constant> documentation.</para>
2309 </listitem>
2310 <listitem>
2311 <para>Added FM Modulator (FM TX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_TX</constant> and their Control IDs.</para>
2312 </listitem>
2313 <listitem>
2314 <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para>
2315 </listitem>
2316 </orderedlist>
2317 </section>
2318 <section>
2319 <title>V4L2 in Linux 2.6.33</title>
2320 <orderedlist>
2321 <listitem>
2322 <para>Added support for Digital Video timings in order to support HDTV receivers and transmitters.</para>
2323 </listitem>
2324 </orderedlist>
2325 </section>
2326 <section>
2327 <title>V4L2 in Linux 2.6.34</title>
2328 <orderedlist>
2329 <listitem>
2330 <para>Added
2331<constant>V4L2_CID_IRIS_ABSOLUTE</constant> and
2332<constant>V4L2_CID_IRIS_RELATIVE</constant> controls to the
2333 <link linkend="camera-controls">Camera controls class</link>.
2334 </para>
2335 </listitem>
2336 </orderedlist>
2337 </section>
2338 <section>
2339 <title>V4L2 in Linux 2.6.37</title>
2340 <orderedlist>
2341 <listitem>
2342 <para>Remove the vtx (videotext/teletext) API. This API was no longer
2343used and no hardware exists to verify the API. Nor were any userspace applications found
2344that used it. It was originally scheduled for removal in 2.6.35.
2345 </para>
2346 </listitem>
2347 </orderedlist>
2348 </section>
2349 <section>
2350 <title>V4L2 in Linux 2.6.39</title>
2351 <orderedlist>
2352 <listitem>
2353 <para>The old VIDIOC_*_OLD symbols and V4L1 support were removed.</para>
2354 </listitem>
2355 <listitem>
2356 <para>Multi-planar API added. Does not affect the compatibility of
2357 current drivers and applications. See
2358 <link linkend="planar-apis">multi-planar API</link>
2359 for details.</para>
2360 </listitem>
2361 </orderedlist>
2362 </section>
2363 <section>
2364 <title>V4L2 in Linux 3.1</title>
2365 <orderedlist>
2366 <listitem>
2367 <para>VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.</para>
2368 <para>Standardize an error code for invalid ioctl.</para>
2369 <para>Added V4L2_CTRL_TYPE_BITMASK.</para>
2370 </listitem>
2371 </orderedlist>
2372 </section>
2373 <section>
2374 <title>V4L2 in Linux 3.2</title>
2375 <orderedlist>
2376 <listitem>
2377 <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
2378 </listitem>
2379 <listitem>
2380 <para>Add selection API for extended control over cropping
2381 and composing. Does not affect the compatibility of current
2382 drivers and applications. See <link
2383 linkend="selection-api"> selection API </link> for
2384 details.</para>
2385 </listitem>
2386 </orderedlist>
2387 </section>
2388
2389 <section>
2390 <title>V4L2 in Linux 3.3</title>
2391 <orderedlist>
2392 <listitem>
2393 <para>Added <constant>V4L2_CID_ALPHA_COMPONENT</constant> control
2394 to the <link linkend="control">User controls class</link>.
2395 </para>
2396 </listitem>
2397 <listitem>
2398 <para>Added the device_caps field to struct v4l2_capabilities and added the new
2399 V4L2_CAP_DEVICE_CAPS capability.</para>
2400 </listitem>
2401 </orderedlist>
2402 </section>
2403
2404 <section>
2405 <title>V4L2 in Linux 3.4</title>
2406 <orderedlist>
2407 <listitem>
2408 <para>Added <link linkend="jpeg-controls">JPEG compression control
2409 class</link>.</para>
2410 </listitem>
2411 <listitem>
2412 <para>Extended the DV Timings API:
2413 &VIDIOC-ENUM-DV-TIMINGS;, &VIDIOC-QUERY-DV-TIMINGS; and
2414 &VIDIOC-DV-TIMINGS-CAP;.</para>
2415 </listitem>
2416 </orderedlist>
2417 </section>
2418
2419 <section>
2420 <title>V4L2 in Linux 3.5</title>
2421 <orderedlist>
2422 <listitem>
2423 <para>Added integer menus, the new type will be
2424 V4L2_CTRL_TYPE_INTEGER_MENU.</para>
2425 </listitem>
2426 <listitem>
2427 <para>Added selection API for V4L2 subdev interface:
2428 &VIDIOC-SUBDEV-G-SELECTION; and
2429 &VIDIOC-SUBDEV-S-SELECTION;.</para>
2430 </listitem>
2431 <listitem>
2432 <para> Added <constant>V4L2_COLORFX_ANTIQUE</constant>,
2433 <constant>V4L2_COLORFX_ART_FREEZE</constant>,
2434 <constant>V4L2_COLORFX_AQUA</constant>,
2435 <constant>V4L2_COLORFX_SILHOUETTE</constant>,
2436 <constant>V4L2_COLORFX_SOLARIZATION</constant>,
2437 <constant>V4L2_COLORFX_VIVID</constant> and
2438 <constant>V4L2_COLORFX_ARBITRARY_CBCR</constant> menu items
2439 to the <constant>V4L2_CID_COLORFX</constant> control.</para>
2440 </listitem>
2441 <listitem>
2442 <para> Added <constant>V4L2_CID_COLORFX_CBCR</constant> control.</para>
2443 </listitem>
2444 <listitem>
2445 <para> Added camera controls <constant>V4L2_CID_AUTO_EXPOSURE_BIAS</constant>,
2446 <constant>V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE</constant>,
2447 <constant>V4L2_CID_IMAGE_STABILIZATION</constant>,
2448 <constant>V4L2_CID_ISO_SENSITIVITY</constant>,
2449 <constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>,
2450 <constant>V4L2_CID_EXPOSURE_METERING</constant>,
2451 <constant>V4L2_CID_SCENE_MODE</constant>,
2452 <constant>V4L2_CID_3A_LOCK</constant>,
2453 <constant>V4L2_CID_AUTO_FOCUS_START</constant>,
2454 <constant>V4L2_CID_AUTO_FOCUS_STOP</constant>,
2455 <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant> and
2456 <constant>V4L2_CID_AUTO_FOCUS_RANGE</constant>.
2457 </para>
2458 </listitem>
2459 </orderedlist>
2460 </section>
2461
2462 <section>
2463 <title>V4L2 in Linux 3.6</title>
2464 <orderedlist>
2465 <listitem>
2466 <para>Replaced <structfield>input</structfield> in
2467 <structname>v4l2_buffer</structname> by
2468 <structfield>reserved2</structfield> and removed
2469 <constant>V4L2_BUF_FLAG_INPUT</constant>.</para>
2470 </listitem>
2471 <listitem>
2472 <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para>
2473 </listitem>
2474 <listitem>
2475 <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para>
2476 </listitem>
2477 </orderedlist>
2478 </section>
2479
2480 <section id="other">
2481 <title>Relation of V4L2 to other Linux multimedia APIs</title>
2482
2483 <section id="xvideo">
2484 <title>X Video Extension</title>
2485
2486 <para>The X Video Extension (abbreviated XVideo or just Xv) is
2487an extension of the X Window system, implemented for example by the
2488XFree86 project. Its scope is similar to V4L2, an API to video capture
2489and output devices for X clients. Xv allows applications to display
2490live video in a window, send window contents to a TV output, and
2491capture or output still images in XPixmaps<footnote>
2492 <para>This is not implemented in XFree86.</para>
2493 </footnote>. With their implementation XFree86 makes the
2494extension available across many operating systems and
2495architectures.</para>
2496
2497 <para>Because the driver is embedded into the X server Xv has a
2498number of advantages over the V4L2 <link linkend="overlay">video
2499overlay interface</link>. The driver can easily determine the overlay
2500target, &ie; visible graphics memory or off-screen buffers for a
2501destructive overlay. It can program the RAMDAC for a non-destructive
2502overlay, scaling or color-keying, or the clipping functions of the
2503video capture hardware, always in sync with drawing operations or
2504windows moving or changing their stacking order.</para>
2505
2506 <para>To combine the advantages of Xv and V4L a special Xv
2507driver exists in XFree86 and XOrg, just programming any overlay capable
2508Video4Linux device it finds. To enable it
2509<filename>/etc/X11/XF86Config</filename> must contain these lines:</para>
2510 <para><screen>
2511Section "Module"
2512 Load "v4l"
2513EndSection</screen></para>
2514
2515 <para>As of XFree86 4.2 this driver still supports only V4L
2516ioctls, however it should work just fine with all V4L2 devices through
2517the V4L2 backward-compatibility layer. Since V4L2 permits multiple
2518opens it is possible (if supported by the V4L2 driver) to capture
2519video while an X client requested video overlay. Restrictions of
2520simultaneous capturing and overlay are discussed in <xref
2521 linkend="overlay" /> apply.</para>
2522
2523 <para>Only marginally related to V4L2, XFree86 extended Xv to
2524support hardware YUV to RGB conversion and scaling for faster video
2525playback, and added an interface to MPEG-2 decoding hardware. This API
2526is useful to display images captured with V4L2 devices.</para>
2527 </section>
2528
2529 <section>
2530 <title>Digital Video</title>
2531
2532 <para>V4L2 does not support digital terrestrial, cable or
2533satellite broadcast. A separate project aiming at digital receivers
2534exists. You can find its homepage at <ulink
2535url="http://linuxtv.org">http://linuxtv.org</ulink>. The Linux DVB API
2536has no connection to the V4L2 API except that drivers for hybrid
2537hardware may support both.</para>
2538 </section>
2539
2540 <section>
2541 <title>Audio Interfaces</title>
2542
2543 <para>[to do - OSS/ALSA]</para>
2544 </section>
2545 </section>
2546
2547 <section id="experimental">
2548 <title>Experimental API Elements</title>
2549
2550 <para>The following V4L2 API elements are currently experimental
2551and may change in the future.</para>
2552
2553 <itemizedlist>
2554 <listitem>
2555 <para>Video Output Overlay (OSD) Interface, <xref
2556 linkend="osd" />.</para>
2557 </listitem>
2558 <listitem>
2559 <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER;
2560ioctls.</para>
2561 </listitem>
2562 <listitem>
2563 <para>&VIDIOC-DBG-G-CHIP-IDENT; ioctl.</para>
2564 </listitem>
2565 <listitem>
2566 <para>&VIDIOC-ENUM-DV-TIMINGS;, &VIDIOC-QUERY-DV-TIMINGS; and
2567 &VIDIOC-DV-TIMINGS-CAP; ioctls.</para>
2568 </listitem>
2569 <listitem>
2570 <para>Flash API. <xref linkend="flash-controls" /></para>
2571 </listitem>
2572 <listitem>
2573 <para>&VIDIOC-CREATE-BUFS; and &VIDIOC-PREPARE-BUF; ioctls.</para>
2574 </listitem>
2575 <listitem>
2576 <para>Selection API. <xref linkend="selection-api" /></para>
2577 </listitem>
2578 <listitem>
2579 <para>Sub-device selection API: &VIDIOC-SUBDEV-G-SELECTION;
2580 and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para>
2581 </listitem>
2582 <listitem>
2583 <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para>
2584 </listitem>
2585 <listitem>
2586 <para>Vendor and device specific media bus pixel formats.
2587 <xref linkend="v4l2-mbus-vendor-spec-fmts" />.</para>
2588 </listitem>
2589 <listitem>
2590 <para>Importing DMABUF file descriptors as a new IO method described
2591 in <xref linkend="dmabuf" />.</para>
2592 </listitem>
2593 <listitem>
2594 <para>Exporting DMABUF files using &VIDIOC-EXPBUF; ioctl.</para>
2595 </listitem>
2596 </itemizedlist>
2597 </section>
2598
2599 <section id="obsolete">
2600 <title>Obsolete API Elements</title>
2601
2602 <para>The following V4L2 API elements were superseded by new
2603interfaces and should not be implemented in new drivers.</para>
2604
2605 <itemizedlist>
2606 <listitem>
2607 <para><constant>VIDIOC_G_MPEGCOMP</constant> and
2608<constant>VIDIOC_S_MPEGCOMP</constant> ioctls. Use Extended Controls,
2609<xref linkend="extended-controls" />.</para>
2610 </listitem>
2611 <listitem>
2612 <para>&VIDIOC-G-DV-PRESET;, &VIDIOC-S-DV-PRESET;, &VIDIOC-ENUM-DV-PRESETS; and
2613 &VIDIOC-QUERY-DV-PRESET; ioctls. Use the DV Timings API (<xref linkend="dv-timings" />).</para>
2614 </listitem>
2615 <listitem>
2616 <para><constant>VIDIOC_SUBDEV_G_CROP</constant> and
2617 <constant>VIDIOC_SUBDEV_S_CROP</constant> ioctls. Use
2618 <constant>VIDIOC_SUBDEV_G_SELECTION</constant> and
2619 <constant>VIDIOC_SUBDEV_S_SELECTION</constant>, <xref
2620 linkend="vidioc-subdev-g-selection" />.</para>
2621 </listitem>
2622 </itemizedlist>
2623 </section>
2624 </section>
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
new file mode 100644
index 00000000000..7fe5be1d3bb
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -0,0 +1,4713 @@
1 <section id="control">
2 <title>User Controls</title>
3
4 <para>Devices typically have a number of user-settable controls
5such as brightness, saturation and so on, which would be presented to
6the user on a graphical user interface. But, different devices
7will have different controls available, and furthermore, the range of
8possible values, and the default value will vary from device to
9device. The control ioctls provide the information and a mechanism to
10create a nice user interface for these controls that will work
11correctly with any device.</para>
12
13 <para>All controls are accessed using an ID value. V4L2 defines
14several IDs for specific purposes. Drivers can also implement their
15own custom controls using <constant>V4L2_CID_PRIVATE_BASE</constant>
16and higher values. The pre-defined control IDs have the prefix
17<constant>V4L2_CID_</constant>, and are listed in <xref
18linkend="control-id" />. The ID is used when querying the attributes of
19a control, and when getting or setting the current value.</para>
20
21 <para>Generally applications should present controls to the user
22without assumptions about their purpose. Each control comes with a
23name string the user is supposed to understand. When the purpose is
24non-intuitive the driver writer should provide a user manual, a user
25interface plug-in or a driver specific panel application. Predefined
26IDs were introduced to change a few controls programmatically, for
27example to mute a device during a channel switch.</para>
28
29 <para>Drivers may enumerate different controls after switching
30the current video input or output, tuner or modulator, or audio input
31or output. Different in the sense of other bounds, another default and
32current value, step size or other menu items. A control with a certain
33<emphasis>custom</emphasis> ID can also change name and
34type.<footnote>
35 <para>It will be more convenient for applications if drivers
36make use of the <constant>V4L2_CTRL_FLAG_DISABLED</constant> flag, but
37that was never required.</para>
38 </footnote> Control values are stored globally, they do not
39change when switching except to stay within the reported bounds. They
40also do not change &eg; when the device is opened or closed, when the
41tuner radio frequency is changed or generally never without
42application request. Since V4L2 specifies no event mechanism, panel
43applications intended to cooperate with other panel applications (be
44they built into a larger application, as a TV viewer) may need to
45regularly poll control values to update their user
46interface.<footnote>
47 <para>Applications could call an ioctl to request events.
48After another process called &VIDIOC-S-CTRL; or another ioctl changing
49shared properties the &func-select; function would indicate
50readability until any ioctl (querying the properties) is
51called.</para>
52 </footnote></para>
53
54 <para>
55 All controls use machine endianness.
56 </para>
57
58 <table pgwide="1" frame="none" id="control-id">
59 <title>Control IDs</title>
60 <tgroup cols="3">
61 &cs-def;
62 <thead>
63 <row>
64 <entry>ID</entry>
65 <entry>Type</entry>
66 <entry>Description</entry>
67 </row>
68 </thead>
69 <tbody valign="top">
70 <row>
71 <entry><constant>V4L2_CID_BASE</constant></entry>
72 <entry></entry>
73 <entry>First predefined ID, equal to
74<constant>V4L2_CID_BRIGHTNESS</constant>.</entry>
75 </row>
76 <row>
77 <entry><constant>V4L2_CID_USER_BASE</constant></entry>
78 <entry></entry>
79 <entry>Synonym of <constant>V4L2_CID_BASE</constant>.</entry>
80 </row>
81 <row>
82 <entry><constant>V4L2_CID_BRIGHTNESS</constant></entry>
83 <entry>integer</entry>
84 <entry>Picture brightness, or more precisely, the black
85level.</entry>
86 </row>
87 <row>
88 <entry><constant>V4L2_CID_CONTRAST</constant></entry>
89 <entry>integer</entry>
90 <entry>Picture contrast or luma gain.</entry>
91 </row>
92 <row>
93 <entry><constant>V4L2_CID_SATURATION</constant></entry>
94 <entry>integer</entry>
95 <entry>Picture color saturation or chroma gain.</entry>
96 </row>
97 <row>
98 <entry><constant>V4L2_CID_HUE</constant></entry>
99 <entry>integer</entry>
100 <entry>Hue or color balance.</entry>
101 </row>
102 <row>
103 <entry><constant>V4L2_CID_AUDIO_VOLUME</constant></entry>
104 <entry>integer</entry>
105 <entry>Overall audio volume. Note some drivers also
106provide an OSS or ALSA mixer interface.</entry>
107 </row>
108 <row>
109 <entry><constant>V4L2_CID_AUDIO_BALANCE</constant></entry>
110 <entry>integer</entry>
111 <entry>Audio stereo balance. Minimum corresponds to all
112the way left, maximum to right.</entry>
113 </row>
114 <row>
115 <entry><constant>V4L2_CID_AUDIO_BASS</constant></entry>
116 <entry>integer</entry>
117 <entry>Audio bass adjustment.</entry>
118 </row>
119 <row>
120 <entry><constant>V4L2_CID_AUDIO_TREBLE</constant></entry>
121 <entry>integer</entry>
122 <entry>Audio treble adjustment.</entry>
123 </row>
124 <row>
125 <entry><constant>V4L2_CID_AUDIO_MUTE</constant></entry>
126 <entry>boolean</entry>
127 <entry>Mute audio, &ie; set the volume to zero, however
128without affecting <constant>V4L2_CID_AUDIO_VOLUME</constant>. Like
129ALSA drivers, V4L2 drivers must mute at load time to avoid excessive
130noise. Actually the entire device should be reset to a low power
131consumption state.</entry>
132 </row>
133 <row>
134 <entry><constant>V4L2_CID_AUDIO_LOUDNESS</constant></entry>
135 <entry>boolean</entry>
136 <entry>Loudness mode (bass boost).</entry>
137 </row>
138 <row>
139 <entry><constant>V4L2_CID_BLACK_LEVEL</constant></entry>
140 <entry>integer</entry>
141 <entry>Another name for brightness (not a synonym of
142<constant>V4L2_CID_BRIGHTNESS</constant>). This control is deprecated
143and should not be used in new drivers and applications.</entry>
144 </row>
145 <row>
146 <entry><constant>V4L2_CID_AUTO_WHITE_BALANCE</constant></entry>
147 <entry>boolean</entry>
148 <entry>Automatic white balance (cameras).</entry>
149 </row>
150 <row>
151 <entry><constant>V4L2_CID_DO_WHITE_BALANCE</constant></entry>
152 <entry>button</entry>
153 <entry>This is an action control. When set (the value is
154ignored), the device will do a white balance and then hold the current
155setting. Contrast this with the boolean
156<constant>V4L2_CID_AUTO_WHITE_BALANCE</constant>, which, when
157activated, keeps adjusting the white balance.</entry>
158 </row>
159 <row>
160 <entry><constant>V4L2_CID_RED_BALANCE</constant></entry>
161 <entry>integer</entry>
162 <entry>Red chroma balance.</entry>
163 </row>
164 <row>
165 <entry><constant>V4L2_CID_BLUE_BALANCE</constant></entry>
166 <entry>integer</entry>
167 <entry>Blue chroma balance.</entry>
168 </row>
169 <row>
170 <entry><constant>V4L2_CID_GAMMA</constant></entry>
171 <entry>integer</entry>
172 <entry>Gamma adjust.</entry>
173 </row>
174 <row>
175 <entry><constant>V4L2_CID_WHITENESS</constant></entry>
176 <entry>integer</entry>
177 <entry>Whiteness for grey-scale devices. This is a synonym
178for <constant>V4L2_CID_GAMMA</constant>. This control is deprecated
179and should not be used in new drivers and applications.</entry>
180 </row>
181 <row>
182 <entry><constant>V4L2_CID_EXPOSURE</constant></entry>
183 <entry>integer</entry>
184 <entry>Exposure (cameras). [Unit?]</entry>
185 </row>
186 <row>
187 <entry><constant>V4L2_CID_AUTOGAIN</constant></entry>
188 <entry>boolean</entry>
189 <entry>Automatic gain/exposure control.</entry>
190 </row>
191 <row>
192 <entry><constant>V4L2_CID_GAIN</constant></entry>
193 <entry>integer</entry>
194 <entry>Gain control.</entry>
195 </row>
196 <row>
197 <entry><constant>V4L2_CID_HFLIP</constant></entry>
198 <entry>boolean</entry>
199 <entry>Mirror the picture horizontally.</entry>
200 </row>
201 <row>
202 <entry><constant>V4L2_CID_VFLIP</constant></entry>
203 <entry>boolean</entry>
204 <entry>Mirror the picture vertically.</entry>
205 </row>
206 <row>
207 <entry><constant>V4L2_CID_HCENTER_DEPRECATED</constant> (formerly <constant>V4L2_CID_HCENTER</constant>)</entry>
208 <entry>integer</entry>
209 <entry>Horizontal image centering. This control is
210deprecated. New drivers and applications should use the <link
211linkend="camera-controls">Camera class controls</link>
212<constant>V4L2_CID_PAN_ABSOLUTE</constant>,
213<constant>V4L2_CID_PAN_RELATIVE</constant> and
214<constant>V4L2_CID_PAN_RESET</constant> instead.</entry>
215 </row>
216 <row>
217 <entry><constant>V4L2_CID_VCENTER_DEPRECATED</constant>
218 (formerly <constant>V4L2_CID_VCENTER</constant>)</entry>
219 <entry>integer</entry>
220 <entry>Vertical image centering. Centering is intended to
221<emphasis>physically</emphasis> adjust cameras. For image cropping see
222<xref linkend="crop" />, for clipping <xref linkend="overlay" />. This
223control is deprecated. New drivers and applications should use the
224<link linkend="camera-controls">Camera class controls</link>
225<constant>V4L2_CID_TILT_ABSOLUTE</constant>,
226<constant>V4L2_CID_TILT_RELATIVE</constant> and
227<constant>V4L2_CID_TILT_RESET</constant> instead.</entry>
228 </row>
229 <row id="v4l2-power-line-frequency">
230 <entry><constant>V4L2_CID_POWER_LINE_FREQUENCY</constant></entry>
231 <entry>enum</entry>
232 <entry>Enables a power line frequency filter to avoid
233flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are:
234<constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0),
235<constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1),
236<constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2) and
237<constant>V4L2_CID_POWER_LINE_FREQUENCY_AUTO</constant> (3).</entry>
238 </row>
239 <row>
240 <entry><constant>V4L2_CID_HUE_AUTO</constant></entry>
241 <entry>boolean</entry>
242 <entry>Enables automatic hue control by the device. The
243effect of setting <constant>V4L2_CID_HUE</constant> while automatic
244hue control is enabled is undefined, drivers should ignore such
245request.</entry>
246 </row>
247 <row>
248 <entry><constant>V4L2_CID_WHITE_BALANCE_TEMPERATURE</constant></entry>
249 <entry>integer</entry>
250 <entry>This control specifies the white balance settings
251as a color temperature in Kelvin. A driver should have a minimum of
2522800 (incandescent) to 6500 (daylight). For more information about
253color temperature see <ulink
254url="http://en.wikipedia.org/wiki/Color_temperature">Wikipedia</ulink>.</entry>
255 </row>
256 <row>
257 <entry><constant>V4L2_CID_SHARPNESS</constant></entry>
258 <entry>integer</entry>
259 <entry>Adjusts the sharpness filters in a camera. The
260minimum value disables the filters, higher values give a sharper
261picture.</entry>
262 </row>
263 <row>
264 <entry><constant>V4L2_CID_BACKLIGHT_COMPENSATION</constant></entry>
265 <entry>integer</entry>
266 <entry>Adjusts the backlight compensation in a camera. The
267minimum value disables backlight compensation.</entry>
268 </row>
269 <row>
270 <entry><constant>V4L2_CID_CHROMA_AGC</constant></entry>
271 <entry>boolean</entry>
272 <entry>Chroma automatic gain control.</entry>
273 </row>
274 <row>
275 <entry><constant>V4L2_CID_CHROMA_GAIN</constant></entry>
276 <entry>integer</entry>
277 <entry>Adjusts the Chroma gain control (for use when chroma AGC
278 is disabled).</entry>
279 </row>
280 <row>
281 <entry><constant>V4L2_CID_COLOR_KILLER</constant></entry>
282 <entry>boolean</entry>
283 <entry>Enable the color killer (&ie; force a black &amp; white image in case of a weak video signal).</entry>
284 </row>
285 <row id="v4l2-colorfx">
286 <entry><constant>V4L2_CID_COLORFX</constant></entry>
287 <entry>enum</entry>
288 <entry>Selects a color effect. The following values are defined:
289 </entry>
290 </row><row>
291 <entry></entry>
292 <entry></entry>
293 <entrytbl spanname="descr" cols="2">
294 <tbody valign="top">
295 <row>
296 <entry><constant>V4L2_COLORFX_NONE</constant>&nbsp;</entry>
297 <entry>Color effect is disabled.</entry>
298 </row>
299 <row>
300 <entry><constant>V4L2_COLORFX_ANTIQUE</constant>&nbsp;</entry>
301 <entry>An aging (old photo) effect.</entry>
302 </row>
303 <row>
304 <entry><constant>V4L2_COLORFX_ART_FREEZE</constant>&nbsp;</entry>
305 <entry>Frost color effect.</entry>
306 </row>
307 <row>
308 <entry><constant>V4L2_COLORFX_AQUA</constant>&nbsp;</entry>
309 <entry>Water color, cool tone.</entry>
310 </row>
311 <row>
312 <entry><constant>V4L2_COLORFX_BW</constant>&nbsp;</entry>
313 <entry>Black and white.</entry>
314 </row>
315 <row>
316 <entry><constant>V4L2_COLORFX_EMBOSS</constant>&nbsp;</entry>
317 <entry>Emboss, the highlights and shadows replace light/dark boundaries
318 and low contrast areas are set to a gray background.</entry>
319 </row>
320 <row>
321 <entry><constant>V4L2_COLORFX_GRASS_GREEN</constant>&nbsp;</entry>
322 <entry>Grass green.</entry>
323 </row>
324 <row>
325 <entry><constant>V4L2_COLORFX_NEGATIVE</constant>&nbsp;</entry>
326 <entry>Negative.</entry>
327 </row>
328 <row>
329 <entry><constant>V4L2_COLORFX_SEPIA</constant>&nbsp;</entry>
330 <entry>Sepia tone.</entry>
331 </row>
332 <row>
333 <entry><constant>V4L2_COLORFX_SKETCH</constant>&nbsp;</entry>
334 <entry>Sketch.</entry>
335 </row>
336 <row>
337 <entry><constant>V4L2_COLORFX_SKIN_WHITEN</constant>&nbsp;</entry>
338 <entry>Skin whiten.</entry>
339 </row>
340 <row>
341 <entry><constant>V4L2_COLORFX_SKY_BLUE</constant>&nbsp;</entry>
342 <entry>Sky blue.</entry>
343 </row>
344 <row>
345 <entry><constant>V4L2_COLORFX_SOLARIZATION</constant>&nbsp;</entry>
346 <entry>Solarization, the image is partially reversed in tone,
347 only color values above or below a certain threshold are inverted.
348 </entry>
349 </row>
350 <row>
351 <entry><constant>V4L2_COLORFX_SILHOUETTE</constant>&nbsp;</entry>
352 <entry>Silhouette (outline).</entry>
353 </row>
354 <row>
355 <entry><constant>V4L2_COLORFX_VIVID</constant>&nbsp;</entry>
356 <entry>Vivid colors.</entry>
357 </row>
358 <row>
359 <entry><constant>V4L2_COLORFX_SET_CBCR</constant>&nbsp;</entry>
360 <entry>The Cb and Cr chroma components are replaced by fixed
361 coefficients determined by <constant>V4L2_CID_COLORFX_CBCR</constant>
362 control.</entry>
363 </row>
364 </tbody>
365 </entrytbl>
366 </row>
367 <row>
368 <entry><constant>V4L2_CID_COLORFX_CBCR</constant></entry>
369 <entry>integer</entry>
370 <entry>Determines the Cb and Cr coefficients for <constant>V4L2_COLORFX_SET_CBCR</constant>
371 color effect. Bits [7:0] of the supplied 32 bit value are interpreted as
372 Cr component, bits [15:8] as Cb component and bits [31:16] must be zero.
373 </entry>
374 </row>
375 <row>
376 <entry><constant>V4L2_CID_AUTOBRIGHTNESS</constant></entry>
377 <entry>boolean</entry>
378 <entry>Enable Automatic Brightness.</entry>
379 </row>
380 <row>
381 <entry><constant>V4L2_CID_ROTATE</constant></entry>
382 <entry>integer</entry>
383 <entry>Rotates the image by specified angle. Common angles are 90,
384 270 and 180. Rotating the image to 90 and 270 will reverse the height
385 and width of the display window. It is necessary to set the new height and
386 width of the picture using the &VIDIOC-S-FMT; ioctl according to
387 the rotation angle selected.</entry>
388 </row>
389 <row>
390 <entry><constant>V4L2_CID_BG_COLOR</constant></entry>
391 <entry>integer</entry>
392 <entry>Sets the background color on the current output device.
393 Background color needs to be specified in the RGB24 format. The
394 supplied 32 bit value is interpreted as bits 0-7 Red color information,
395 bits 8-15 Green color information, bits 16-23 Blue color
396 information and bits 24-31 must be zero.</entry>
397 </row>
398 <row>
399 <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
400 <constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
401 <entry>boolean</entry>
402 <entry>Switch on or off the illuminator 1 or 2 of the device
403 (usually a microscope).</entry>
404 </row>
405 <row>
406 <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry>
407 <entry>integer</entry>
408 <entry>This is a read-only control that can be read by the application
409and used as a hint to determine the number of CAPTURE buffers to pass to REQBUFS.
410The value is the minimum number of CAPTURE buffers that is necessary for hardware
411to work.</entry>
412 </row>
413 <row>
414 <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_OUTPUT</constant></entry>
415 <entry>integer</entry>
416 <entry>This is a read-only control that can be read by the application
417and used as a hint to determine the number of OUTPUT buffers to pass to REQBUFS.
418The value is the minimum number of OUTPUT buffers that is necessary for hardware
419to work.</entry>
420 </row>
421 <row id="v4l2-alpha-component">
422 <entry><constant>V4L2_CID_ALPHA_COMPONENT</constant></entry>
423 <entry>integer</entry>
424 <entry> Sets the alpha color component on the capture device or on
425 the capture buffer queue of a mem-to-mem device. When a mem-to-mem
426 device produces frame format that includes an alpha component
427 (e.g. <link linkend="rgb-formats">packed RGB image formats</link>)
428 and the alpha value is not defined by the mem-to-mem input data
429 this control lets you select the alpha component value of all
430 pixels. It is applicable to any pixel format that contains an alpha
431 component.
432 </entry>
433 </row>
434 <row>
435 <entry><constant>V4L2_CID_LASTP1</constant></entry>
436 <entry></entry>
437 <entry>End of the predefined control IDs (currently
438 <constant>V4L2_CID_ALPHA_COMPONENT</constant> + 1).</entry>
439 </row>
440 <row>
441 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
442 <entry></entry>
443 <entry>ID of the first custom (driver specific) control.
444Applications depending on particular custom controls should check the
445driver name and version, see <xref linkend="querycap" />.</entry>
446 </row>
447 </tbody>
448 </tgroup>
449 </table>
450
451 <para>Applications can enumerate the available controls with the
452&VIDIOC-QUERYCTRL; and &VIDIOC-QUERYMENU; ioctls, get and set a
453control value with the &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls.
454Drivers must implement <constant>VIDIOC_QUERYCTRL</constant>,
455<constant>VIDIOC_G_CTRL</constant> and
456<constant>VIDIOC_S_CTRL</constant> when the device has one or more
457controls, <constant>VIDIOC_QUERYMENU</constant> when it has one or
458more menu type controls.</para>
459
460 <example>
461 <title>Enumerating all controls</title>
462
463 <programlisting>
464&v4l2-queryctrl; queryctrl;
465&v4l2-querymenu; querymenu;
466
467static void
468enumerate_menu (void)
469{
470 printf (" Menu items:\n");
471
472 memset (&amp;querymenu, 0, sizeof (querymenu));
473 querymenu.id = queryctrl.id;
474
475 for (querymenu.index = queryctrl.minimum;
476 querymenu.index &lt;= queryctrl.maximum;
477 querymenu.index++) {
478 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) {
479 printf (" %s\n", querymenu.name);
480 }
481 }
482}
483
484memset (&amp;queryctrl, 0, sizeof (queryctrl));
485
486for (queryctrl.id = V4L2_CID_BASE;
487 queryctrl.id &lt; V4L2_CID_LASTP1;
488 queryctrl.id++) {
489 if (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
490 if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
491 continue;
492
493 printf ("Control %s\n", queryctrl.name);
494
495 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
496 enumerate_menu ();
497 } else {
498 if (errno == EINVAL)
499 continue;
500
501 perror ("VIDIOC_QUERYCTRL");
502 exit (EXIT_FAILURE);
503 }
504}
505
506for (queryctrl.id = V4L2_CID_PRIVATE_BASE;;
507 queryctrl.id++) {
508 if (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
509 if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
510 continue;
511
512 printf ("Control %s\n", queryctrl.name);
513
514 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
515 enumerate_menu ();
516 } else {
517 if (errno == EINVAL)
518 break;
519
520 perror ("VIDIOC_QUERYCTRL");
521 exit (EXIT_FAILURE);
522 }
523}
524</programlisting>
525 </example>
526
527 <example>
528 <title>Changing controls</title>
529
530 <programlisting>
531&v4l2-queryctrl; queryctrl;
532&v4l2-control; control;
533
534memset (&amp;queryctrl, 0, sizeof (queryctrl));
535queryctrl.id = V4L2_CID_BRIGHTNESS;
536
537if (-1 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
538 if (errno != EINVAL) {
539 perror ("VIDIOC_QUERYCTRL");
540 exit (EXIT_FAILURE);
541 } else {
542 printf ("V4L2_CID_BRIGHTNESS is not supported\n");
543 }
544} else if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED) {
545 printf ("V4L2_CID_BRIGHTNESS is not supported\n");
546} else {
547 memset (&amp;control, 0, sizeof (control));
548 control.id = V4L2_CID_BRIGHTNESS;
549 control.value = queryctrl.default_value;
550
551 if (-1 == ioctl (fd, &VIDIOC-S-CTRL;, &amp;control)) {
552 perror ("VIDIOC_S_CTRL");
553 exit (EXIT_FAILURE);
554 }
555}
556
557memset (&amp;control, 0, sizeof (control));
558control.id = V4L2_CID_CONTRAST;
559
560if (0 == ioctl (fd, &VIDIOC-G-CTRL;, &amp;control)) {
561 control.value += 1;
562
563 /* The driver may clamp the value or return ERANGE, ignored here */
564
565 if (-1 == ioctl (fd, &VIDIOC-S-CTRL;, &amp;control)
566 &amp;&amp; errno != ERANGE) {
567 perror ("VIDIOC_S_CTRL");
568 exit (EXIT_FAILURE);
569 }
570/* Ignore if V4L2_CID_CONTRAST is unsupported */
571} else if (errno != EINVAL) {
572 perror ("VIDIOC_G_CTRL");
573 exit (EXIT_FAILURE);
574}
575
576control.id = V4L2_CID_AUDIO_MUTE;
577control.value = TRUE; /* silence */
578
579/* Errors ignored */
580ioctl (fd, VIDIOC_S_CTRL, &amp;control);
581</programlisting>
582 </example>
583 </section>
584
585 <section id="extended-controls">
586 <title>Extended Controls</title>
587
588 <section>
589 <title>Introduction</title>
590
591 <para>The control mechanism as originally designed was meant
592to be used for user settings (brightness, saturation, etc). However,
593it turned out to be a very useful model for implementing more
594complicated driver APIs where each driver implements only a subset of
595a larger API.</para>
596
597 <para>The MPEG encoding API was the driving force behind
598designing and implementing this extended control mechanism: the MPEG
599standard is quite large and the currently supported hardware MPEG
600encoders each only implement a subset of this standard. Further more,
601many parameters relating to how the video is encoded into an MPEG
602stream are specific to the MPEG encoding chip since the MPEG standard
603only defines the format of the resulting MPEG stream, not how the
604video is actually encoded into that format.</para>
605
606 <para>Unfortunately, the original control API lacked some
607features needed for these new uses and so it was extended into the
608(not terribly originally named) extended control API.</para>
609
610 <para>Even though the MPEG encoding API was the first effort
611to use the Extended Control API, nowadays there are also other classes
612of Extended Controls, such as Camera Controls and FM Transmitter Controls.
613The Extended Controls API as well as all Extended Controls classes are
614described in the following text.</para>
615 </section>
616
617 <section>
618 <title>The Extended Control API</title>
619
620 <para>Three new ioctls are available: &VIDIOC-G-EXT-CTRLS;,
621&VIDIOC-S-EXT-CTRLS; and &VIDIOC-TRY-EXT-CTRLS;. These ioctls act on
622arrays of controls (as opposed to the &VIDIOC-G-CTRL; and
623&VIDIOC-S-CTRL; ioctls that act on a single control). This is needed
624since it is often required to atomically change several controls at
625once.</para>
626
627 <para>Each of the new ioctls expects a pointer to a
628&v4l2-ext-controls;. This structure contains a pointer to the control
629array, a count of the number of controls in that array and a control
630class. Control classes are used to group similar controls into a
631single class. For example, control class
632<constant>V4L2_CTRL_CLASS_USER</constant> contains all user controls
633(&ie; all controls that can also be set using the old
634<constant>VIDIOC_S_CTRL</constant> ioctl). Control class
635<constant>V4L2_CTRL_CLASS_MPEG</constant> contains all controls
636relating to MPEG encoding, etc.</para>
637
638 <para>All controls in the control array must belong to the
639specified control class. An error is returned if this is not the
640case.</para>
641
642 <para>It is also possible to use an empty control array (count
643== 0) to check whether the specified control class is
644supported.</para>
645
646 <para>The control array is a &v4l2-ext-control; array. The
647<structname>v4l2_ext_control</structname> structure is very similar to
648&v4l2-control;, except for the fact that it also allows for 64-bit
649values and pointers to be passed.</para>
650
651 <para>It is important to realize that due to the flexibility of
652controls it is necessary to check whether the control you want to set
653actually is supported in the driver and what the valid range of values
654is. So use the &VIDIOC-QUERYCTRL; and &VIDIOC-QUERYMENU; ioctls to
655check this. Also note that it is possible that some of the menu
656indices in a control of type <constant>V4L2_CTRL_TYPE_MENU</constant>
657may not be supported (<constant>VIDIOC_QUERYMENU</constant> will
658return an error). A good example is the list of supported MPEG audio
659bitrates. Some drivers only support one or two bitrates, others
660support a wider range.</para>
661
662 <para>
663 All controls use machine endianness.
664 </para>
665 </section>
666
667 <section>
668 <title>Enumerating Extended Controls</title>
669
670 <para>The recommended way to enumerate over the extended
671controls is by using &VIDIOC-QUERYCTRL; in combination with the
672<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> flag:</para>
673
674 <informalexample>
675 <programlisting>
676&v4l2-queryctrl; qctrl;
677
678qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
679while (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;qctrl)) {
680 /* ... */
681 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
682}
683</programlisting>
684 </informalexample>
685
686 <para>The initial control ID is set to 0 ORed with the
687<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> flag. The
688<constant>VIDIOC_QUERYCTRL</constant> ioctl will return the first
689control with a higher ID than the specified one. When no such controls
690are found an error is returned.</para>
691
692 <para>If you want to get all controls within a specific control
693class, then you can set the initial
694<structfield>qctrl.id</structfield> value to the control class and add
695an extra check to break out of the loop when a control of another
696control class is found:</para>
697
698 <informalexample>
699 <programlisting>
700qctrl.id = V4L2_CTRL_CLASS_MPEG | V4L2_CTRL_FLAG_NEXT_CTRL;
701while (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;qctrl)) {
702 if (V4L2_CTRL_ID2CLASS (qctrl.id) != V4L2_CTRL_CLASS_MPEG)
703 break;
704 /* ... */
705 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
706 }
707</programlisting>
708 </informalexample>
709
710 <para>The 32-bit <structfield>qctrl.id</structfield> value is
711subdivided into three bit ranges: the top 4 bits are reserved for
712flags (&eg; <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant>) and are not
713actually part of the ID. The remaining 28 bits form the control ID, of
714which the most significant 12 bits define the control class and the
715least significant 16 bits identify the control within the control
716class. It is guaranteed that these last 16 bits are always non-zero
717for controls. The range of 0x1000 and up are reserved for
718driver-specific controls. The macro
719<constant>V4L2_CTRL_ID2CLASS(id)</constant> returns the control class
720ID based on a control ID.</para>
721
722 <para>If the driver does not support extended controls, then
723<constant>VIDIOC_QUERYCTRL</constant> will fail when used in
724combination with <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant>. In
725that case the old method of enumerating control should be used (see
7261.8). But if it is supported, then it is guaranteed to enumerate over
727all controls, including driver-private controls.</para>
728 </section>
729
730 <section>
731 <title>Creating Control Panels</title>
732
733 <para>It is possible to create control panels for a graphical
734user interface where the user can select the various controls.
735Basically you will have to iterate over all controls using the method
736described above. Each control class starts with a control of type
737<constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant>.
738<constant>VIDIOC_QUERYCTRL</constant> will return the name of this
739control class which can be used as the title of a tab page within a
740control panel.</para>
741
742 <para>The flags field of &v4l2-queryctrl; also contains hints on
743the behavior of the control. See the &VIDIOC-QUERYCTRL; documentation
744for more details.</para>
745 </section>
746
747 <section id="mpeg-controls">
748 <title>MPEG Control Reference</title>
749
750 <para>Below all controls within the MPEG control class are
751described. First the generic controls, then controls specific for
752certain hardware.</para>
753
754 <section>
755 <title>Generic MPEG Controls</title>
756
757 <table pgwide="1" frame="none" id="mpeg-control-id">
758 <title>MPEG Control IDs</title>
759 <tgroup cols="4">
760 <colspec colname="c1" colwidth="1*" />
761 <colspec colname="c2" colwidth="6*" />
762 <colspec colname="c3" colwidth="2*" />
763 <colspec colname="c4" colwidth="6*" />
764 <spanspec namest="c1" nameend="c2" spanname="id" />
765 <spanspec namest="c2" nameend="c4" spanname="descr" />
766 <thead>
767 <row>
768 <entry spanname="id" align="left">ID</entry>
769 <entry align="left">Type</entry>
770 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
771 </row>
772 </thead>
773 <tbody valign="top">
774 <row><entry></entry></row>
775 <row>
776 <entry spanname="id"><constant>V4L2_CID_MPEG_CLASS</constant>&nbsp;</entry>
777 <entry>class</entry>
778 </row><row><entry spanname="descr">The MPEG class
779descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
780description of this control class. This description can be used as the
781caption of a Tab page in a GUI, for example.</entry>
782 </row>
783 <row><entry></entry></row>
784 <row id="v4l2-mpeg-stream-type">
785 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_TYPE</constant>&nbsp;</entry>
786 <entry>enum&nbsp;v4l2_mpeg_stream_type</entry>
787 </row><row><entry spanname="descr">The MPEG-1, -2 or -4
788output stream type. One cannot assume anything here. Each hardware
789MPEG encoder tends to support different subsets of the available MPEG
790stream types. This control is specific to multiplexed MPEG streams.
791The currently defined stream types are:</entry>
792 </row>
793 <row>
794 <entrytbl spanname="descr" cols="2">
795 <tbody valign="top">
796 <row>
797 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_PS</constant>&nbsp;</entry>
798 <entry>MPEG-2 program stream</entry>
799 </row>
800 <row>
801 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_TS</constant>&nbsp;</entry>
802 <entry>MPEG-2 transport stream</entry>
803 </row>
804 <row>
805 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG1_SS</constant>&nbsp;</entry>
806 <entry>MPEG-1 system stream</entry>
807 </row>
808 <row>
809 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_DVD</constant>&nbsp;</entry>
810 <entry>MPEG-2 DVD-compatible stream</entry>
811 </row>
812 <row>
813 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG1_VCD</constant>&nbsp;</entry>
814 <entry>MPEG-1 VCD-compatible stream</entry>
815 </row>
816 <row>
817 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD</constant>&nbsp;</entry>
818 <entry>MPEG-2 SVCD-compatible stream</entry>
819 </row>
820 </tbody>
821 </entrytbl>
822 </row>
823 <row><entry></entry></row>
824 <row>
825 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_PMT</constant>&nbsp;</entry>
826 <entry>integer</entry>
827 </row><row><entry spanname="descr">Program Map Table
828Packet ID for the MPEG transport stream (default 16)</entry>
829 </row>
830 <row><entry></entry></row>
831 <row>
832 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_AUDIO</constant>&nbsp;</entry>
833 <entry>integer</entry>
834 </row><row><entry spanname="descr">Audio Packet ID for
835the MPEG transport stream (default 256)</entry>
836 </row>
837 <row><entry></entry></row>
838 <row>
839 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_VIDEO</constant>&nbsp;</entry>
840 <entry>integer</entry>
841 </row><row><entry spanname="descr">Video Packet ID for
842the MPEG transport stream (default 260)</entry>
843 </row>
844 <row><entry></entry></row>
845 <row>
846 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_PCR</constant>&nbsp;</entry>
847 <entry>integer</entry>
848 </row><row><entry spanname="descr">Packet ID for the
849MPEG transport stream carrying PCR fields (default 259)</entry>
850 </row>
851 <row><entry></entry></row>
852 <row>
853 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PES_ID_AUDIO</constant>&nbsp;</entry>
854 <entry>integer</entry>
855 </row><row><entry spanname="descr">Audio ID for MPEG
856PES</entry>
857 </row>
858 <row><entry></entry></row>
859 <row>
860 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PES_ID_VIDEO</constant>&nbsp;</entry>
861 <entry>integer</entry>
862 </row><row><entry spanname="descr">Video ID for MPEG
863PES</entry>
864 </row>
865 <row><entry></entry></row>
866 <row id="v4l2-mpeg-stream-vbi-fmt">
867 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_VBI_FMT</constant>&nbsp;</entry>
868 <entry>enum&nbsp;v4l2_mpeg_stream_vbi_fmt</entry>
869 </row><row><entry spanname="descr">Some cards can embed
870VBI data (&eg; Closed Caption, Teletext) into the MPEG stream. This
871control selects whether VBI data should be embedded, and if so, what
872embedding method should be used. The list of possible VBI formats
873depends on the driver. The currently defined VBI format types
874are:</entry>
875 </row>
876 <row>
877 <entrytbl spanname="descr" cols="2">
878 <tbody valign="top">
879 <row>
880 <entry><constant>V4L2_MPEG_STREAM_VBI_FMT_NONE</constant>&nbsp;</entry>
881 <entry>No VBI in the MPEG stream</entry>
882 </row>
883 <row>
884 <entry><constant>V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant>&nbsp;</entry>
885 <entry>VBI in private packets, IVTV format (documented
886in the kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.vbi</filename>)</entry>
887 </row>
888 </tbody>
889 </entrytbl>
890 </row>
891 <row><entry></entry></row>
892 <row id="v4l2-mpeg-audio-sampling-freq">
893 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ</constant>&nbsp;</entry>
894 <entry>enum&nbsp;v4l2_mpeg_audio_sampling_freq</entry>
895 </row><row><entry spanname="descr">MPEG Audio sampling
896frequency. Possible values are:</entry>
897 </row>
898 <row>
899 <entrytbl spanname="descr" cols="2">
900 <tbody valign="top">
901 <row>
902 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100</constant>&nbsp;</entry>
903 <entry>44.1 kHz</entry>
904 </row>
905 <row>
906 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000</constant>&nbsp;</entry>
907 <entry>48 kHz</entry>
908 </row>
909 <row>
910 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000</constant>&nbsp;</entry>
911 <entry>32 kHz</entry>
912 </row>
913 </tbody>
914 </entrytbl>
915 </row>
916 <row><entry></entry></row>
917 <row id="v4l2-mpeg-audio-encoding">
918 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_ENCODING</constant>&nbsp;</entry>
919 <entry>enum&nbsp;v4l2_mpeg_audio_encoding</entry>
920 </row><row><entry spanname="descr">MPEG Audio encoding.
921This control is specific to multiplexed MPEG streams.
922Possible values are:</entry>
923 </row>
924 <row>
925 <entrytbl spanname="descr" cols="2">
926 <tbody valign="top">
927 <row>
928 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_1</constant>&nbsp;</entry>
929 <entry>MPEG-1/2 Layer I encoding</entry>
930 </row>
931 <row>
932 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_2</constant>&nbsp;</entry>
933 <entry>MPEG-1/2 Layer II encoding</entry>
934 </row>
935 <row>
936 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_3</constant>&nbsp;</entry>
937 <entry>MPEG-1/2 Layer III encoding</entry>
938 </row>
939 <row>
940 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_AAC</constant>&nbsp;</entry>
941 <entry>MPEG-2/4 AAC (Advanced Audio Coding)</entry>
942 </row>
943 <row>
944 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_AC3</constant>&nbsp;</entry>
945 <entry>AC-3 aka ATSC A/52 encoding</entry>
946 </row>
947 </tbody>
948 </entrytbl>
949 </row>
950 <row><entry></entry></row>
951 <row id="v4l2-mpeg-audio-l1-bitrate">
952 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L1_BITRATE</constant>&nbsp;</entry>
953 <entry>enum&nbsp;v4l2_mpeg_audio_l1_bitrate</entry>
954 </row><row><entry spanname="descr">MPEG-1/2 Layer I bitrate.
955Possible values are:</entry>
956 </row>
957 <row>
958 <entrytbl spanname="descr" cols="2">
959 <tbody valign="top">
960 <row>
961 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_32K</constant>&nbsp;</entry>
962 <entry>32 kbit/s</entry></row>
963 <row>
964 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_64K</constant>&nbsp;</entry>
965 <entry>64 kbit/s</entry>
966 </row>
967 <row>
968 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_96K</constant>&nbsp;</entry>
969 <entry>96 kbit/s</entry>
970 </row>
971 <row>
972 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_128K</constant>&nbsp;</entry>
973 <entry>128 kbit/s</entry>
974 </row>
975 <row>
976 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_160K</constant>&nbsp;</entry>
977 <entry>160 kbit/s</entry>
978 </row>
979 <row>
980 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_192K</constant>&nbsp;</entry>
981 <entry>192 kbit/s</entry>
982 </row>
983 <row>
984 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_224K</constant>&nbsp;</entry>
985 <entry>224 kbit/s</entry>
986 </row>
987 <row>
988 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_256K</constant>&nbsp;</entry>
989 <entry>256 kbit/s</entry>
990 </row>
991 <row>
992 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_288K</constant>&nbsp;</entry>
993 <entry>288 kbit/s</entry>
994 </row>
995 <row>
996 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_320K</constant>&nbsp;</entry>
997 <entry>320 kbit/s</entry>
998 </row>
999 <row>
1000 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_352K</constant>&nbsp;</entry>
1001 <entry>352 kbit/s</entry>
1002 </row>
1003 <row>
1004 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_384K</constant>&nbsp;</entry>
1005 <entry>384 kbit/s</entry>
1006 </row>
1007 <row>
1008 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_416K</constant>&nbsp;</entry>
1009 <entry>416 kbit/s</entry>
1010 </row>
1011 <row>
1012 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_448K</constant>&nbsp;</entry>
1013 <entry>448 kbit/s</entry>
1014 </row>
1015 </tbody>
1016 </entrytbl>
1017 </row>
1018 <row><entry></entry></row>
1019 <row id="v4l2-mpeg-audio-l2-bitrate">
1020 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L2_BITRATE</constant>&nbsp;</entry>
1021 <entry>enum&nbsp;v4l2_mpeg_audio_l2_bitrate</entry>
1022 </row><row><entry spanname="descr">MPEG-1/2 Layer II bitrate.
1023Possible values are:</entry>
1024 </row>
1025 <row>
1026 <entrytbl spanname="descr" cols="2">
1027 <tbody valign="top">
1028 <row>
1029 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_32K</constant>&nbsp;</entry>
1030 <entry>32 kbit/s</entry>
1031 </row>
1032 <row>
1033 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_48K</constant>&nbsp;</entry>
1034 <entry>48 kbit/s</entry>
1035 </row>
1036 <row>
1037 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_56K</constant>&nbsp;</entry>
1038 <entry>56 kbit/s</entry>
1039 </row>
1040 <row>
1041 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_64K</constant>&nbsp;</entry>
1042 <entry>64 kbit/s</entry>
1043 </row>
1044 <row>
1045 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_80K</constant>&nbsp;</entry>
1046 <entry>80 kbit/s</entry>
1047 </row>
1048 <row>
1049 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_96K</constant>&nbsp;</entry>
1050 <entry>96 kbit/s</entry>
1051 </row>
1052 <row>
1053 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_112K</constant>&nbsp;</entry>
1054 <entry>112 kbit/s</entry>
1055 </row>
1056 <row>
1057 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_128K</constant>&nbsp;</entry>
1058 <entry>128 kbit/s</entry>
1059 </row>
1060 <row>
1061 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_160K</constant>&nbsp;</entry>
1062 <entry>160 kbit/s</entry>
1063 </row>
1064 <row>
1065 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_192K</constant>&nbsp;</entry>
1066 <entry>192 kbit/s</entry>
1067 </row>
1068 <row>
1069 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_224K</constant>&nbsp;</entry>
1070 <entry>224 kbit/s</entry>
1071 </row>
1072 <row>
1073 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_256K</constant>&nbsp;</entry>
1074 <entry>256 kbit/s</entry>
1075 </row>
1076 <row>
1077 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_320K</constant>&nbsp;</entry>
1078 <entry>320 kbit/s</entry>
1079 </row>
1080 <row>
1081 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_384K</constant>&nbsp;</entry>
1082 <entry>384 kbit/s</entry>
1083 </row>
1084 </tbody>
1085 </entrytbl>
1086 </row>
1087 <row><entry></entry></row>
1088 <row id="v4l2-mpeg-audio-l3-bitrate">
1089 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L3_BITRATE</constant>&nbsp;</entry>
1090 <entry>enum&nbsp;v4l2_mpeg_audio_l3_bitrate</entry>
1091 </row><row><entry spanname="descr">MPEG-1/2 Layer III bitrate.
1092Possible values are:</entry>
1093 </row>
1094 <row>
1095 <entrytbl spanname="descr" cols="2">
1096 <tbody valign="top">
1097 <row>
1098 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_32K</constant>&nbsp;</entry>
1099 <entry>32 kbit/s</entry>
1100 </row>
1101 <row>
1102 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_40K</constant>&nbsp;</entry>
1103 <entry>40 kbit/s</entry>
1104 </row>
1105 <row>
1106 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_48K</constant>&nbsp;</entry>
1107 <entry>48 kbit/s</entry>
1108 </row>
1109 <row>
1110 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_56K</constant>&nbsp;</entry>
1111 <entry>56 kbit/s</entry>
1112 </row>
1113 <row>
1114 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_64K</constant>&nbsp;</entry>
1115 <entry>64 kbit/s</entry>
1116 </row>
1117 <row>
1118 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_80K</constant>&nbsp;</entry>
1119 <entry>80 kbit/s</entry>
1120 </row>
1121 <row>
1122 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_96K</constant>&nbsp;</entry>
1123 <entry>96 kbit/s</entry>
1124 </row>
1125 <row>
1126 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_112K</constant>&nbsp;</entry>
1127 <entry>112 kbit/s</entry>
1128 </row>
1129 <row>
1130 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_128K</constant>&nbsp;</entry>
1131 <entry>128 kbit/s</entry>
1132 </row>
1133 <row>
1134 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_160K</constant>&nbsp;</entry>
1135 <entry>160 kbit/s</entry>
1136 </row>
1137 <row>
1138 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_192K</constant>&nbsp;</entry>
1139 <entry>192 kbit/s</entry>
1140 </row>
1141 <row>
1142 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_224K</constant>&nbsp;</entry>
1143 <entry>224 kbit/s</entry>
1144 </row>
1145 <row>
1146 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_256K</constant>&nbsp;</entry>
1147 <entry>256 kbit/s</entry>
1148 </row>
1149 <row>
1150 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_320K</constant>&nbsp;</entry>
1151 <entry>320 kbit/s</entry>
1152 </row>
1153 </tbody>
1154 </entrytbl>
1155 </row>
1156 <row><entry></entry></row>
1157 <row>
1158 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_AAC_BITRATE</constant>&nbsp;</entry>
1159 <entry>integer</entry>
1160 </row><row><entry spanname="descr">AAC bitrate in bits per second.</entry>
1161 </row>
1162 <row><entry></entry></row>
1163 <row id="v4l2-mpeg-audio-ac3-bitrate">
1164 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_AC3_BITRATE</constant>&nbsp;</entry>
1165 <entry>enum&nbsp;v4l2_mpeg_audio_ac3_bitrate</entry>
1166 </row><row><entry spanname="descr">AC-3 bitrate.
1167Possible values are:</entry>
1168 </row>
1169 <row>
1170 <entrytbl spanname="descr" cols="2">
1171 <tbody valign="top">
1172 <row>
1173 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_32K</constant>&nbsp;</entry>
1174 <entry>32 kbit/s</entry>
1175 </row>
1176 <row>
1177 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_40K</constant>&nbsp;</entry>
1178 <entry>40 kbit/s</entry>
1179 </row>
1180 <row>
1181 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_48K</constant>&nbsp;</entry>
1182 <entry>48 kbit/s</entry>
1183 </row>
1184 <row>
1185 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_56K</constant>&nbsp;</entry>
1186 <entry>56 kbit/s</entry>
1187 </row>
1188 <row>
1189 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_64K</constant>&nbsp;</entry>
1190 <entry>64 kbit/s</entry>
1191 </row>
1192 <row>
1193 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_80K</constant>&nbsp;</entry>
1194 <entry>80 kbit/s</entry>
1195 </row>
1196 <row>
1197 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_96K</constant>&nbsp;</entry>
1198 <entry>96 kbit/s</entry>
1199 </row>
1200 <row>
1201 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_112K</constant>&nbsp;</entry>
1202 <entry>112 kbit/s</entry>
1203 </row>
1204 <row>
1205 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_128K</constant>&nbsp;</entry>
1206 <entry>128 kbit/s</entry>
1207 </row>
1208 <row>
1209 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_160K</constant>&nbsp;</entry>
1210 <entry>160 kbit/s</entry>
1211 </row>
1212 <row>
1213 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_192K</constant>&nbsp;</entry>
1214 <entry>192 kbit/s</entry>
1215 </row>
1216 <row>
1217 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_224K</constant>&nbsp;</entry>
1218 <entry>224 kbit/s</entry>
1219 </row>
1220 <row>
1221 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_256K</constant>&nbsp;</entry>
1222 <entry>256 kbit/s</entry>
1223 </row>
1224 <row>
1225 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_320K</constant>&nbsp;</entry>
1226 <entry>320 kbit/s</entry>
1227 </row>
1228 <row>
1229 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_384K</constant>&nbsp;</entry>
1230 <entry>384 kbit/s</entry>
1231 </row>
1232 <row>
1233 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_448K</constant>&nbsp;</entry>
1234 <entry>448 kbit/s</entry>
1235 </row>
1236 <row>
1237 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_512K</constant>&nbsp;</entry>
1238 <entry>512 kbit/s</entry>
1239 </row>
1240 <row>
1241 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_576K</constant>&nbsp;</entry>
1242 <entry>576 kbit/s</entry>
1243 </row>
1244 <row>
1245 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_640K</constant>&nbsp;</entry>
1246 <entry>640 kbit/s</entry>
1247 </row>
1248 </tbody>
1249 </entrytbl>
1250 </row>
1251 <row><entry></entry></row>
1252 <row id="v4l2-mpeg-audio-mode">
1253 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MODE</constant>&nbsp;</entry>
1254 <entry>enum&nbsp;v4l2_mpeg_audio_mode</entry>
1255 </row><row><entry spanname="descr">MPEG Audio mode.
1256Possible values are:</entry>
1257 </row>
1258 <row>
1259 <entrytbl spanname="descr" cols="2">
1260 <tbody valign="top">
1261 <row>
1262 <entry><constant>V4L2_MPEG_AUDIO_MODE_STEREO</constant>&nbsp;</entry>
1263 <entry>Stereo</entry>
1264 </row>
1265 <row>
1266 <entry><constant>V4L2_MPEG_AUDIO_MODE_JOINT_STEREO</constant>&nbsp;</entry>
1267 <entry>Joint Stereo</entry>
1268 </row>
1269 <row>
1270 <entry><constant>V4L2_MPEG_AUDIO_MODE_DUAL</constant>&nbsp;</entry>
1271 <entry>Bilingual</entry>
1272 </row>
1273 <row>
1274 <entry><constant>V4L2_MPEG_AUDIO_MODE_MONO</constant>&nbsp;</entry>
1275 <entry>Mono</entry>
1276 </row>
1277 </tbody>
1278 </entrytbl>
1279 </row>
1280 <row><entry></entry></row>
1281 <row id="v4l2-mpeg-audio-mode-extension">
1282 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MODE_EXTENSION</constant>&nbsp;</entry>
1283 <entry>enum&nbsp;v4l2_mpeg_audio_mode_extension</entry>
1284 </row><row><entry spanname="descr">Joint Stereo
1285audio mode extension. In Layer I and II they indicate which subbands
1286are in intensity stereo. All other subbands are coded in stereo. Layer
1287III is not (yet) supported. Possible values
1288are:</entry>
1289 </row>
1290 <row>
1291 <entrytbl spanname="descr" cols="2">
1292 <tbody valign="top">
1293 <row>
1294 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4</constant>&nbsp;</entry>
1295 <entry>Subbands 4-31 in intensity stereo</entry>
1296 </row>
1297 <row>
1298 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8</constant>&nbsp;</entry>
1299 <entry>Subbands 8-31 in intensity stereo</entry>
1300 </row>
1301 <row>
1302 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12</constant>&nbsp;</entry>
1303 <entry>Subbands 12-31 in intensity stereo</entry>
1304 </row>
1305 <row>
1306 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16</constant>&nbsp;</entry>
1307 <entry>Subbands 16-31 in intensity stereo</entry>
1308 </row>
1309 </tbody>
1310 </entrytbl>
1311 </row>
1312 <row><entry></entry></row>
1313 <row id="v4l2-mpeg-audio-emphasis">
1314 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_EMPHASIS</constant>&nbsp;</entry>
1315 <entry>enum&nbsp;v4l2_mpeg_audio_emphasis</entry>
1316 </row><row><entry spanname="descr">Audio Emphasis.
1317Possible values are:</entry>
1318 </row>
1319 <row>
1320 <entrytbl spanname="descr" cols="2">
1321 <tbody valign="top">
1322 <row>
1323 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_NONE</constant>&nbsp;</entry>
1324 <entry>None</entry>
1325 </row>
1326 <row>
1327 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS</constant>&nbsp;</entry>
1328 <entry>50/15 microsecond emphasis</entry>
1329 </row>
1330 <row>
1331 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17</constant>&nbsp;</entry>
1332 <entry>CCITT J.17</entry>
1333 </row>
1334 </tbody>
1335 </entrytbl>
1336 </row>
1337 <row><entry></entry></row>
1338 <row id="v4l2-mpeg-audio-crc">
1339 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_CRC</constant>&nbsp;</entry>
1340 <entry>enum&nbsp;v4l2_mpeg_audio_crc</entry>
1341 </row><row><entry spanname="descr">CRC method. Possible
1342values are:</entry>
1343 </row>
1344 <row>
1345 <entrytbl spanname="descr" cols="2">
1346 <tbody valign="top">
1347 <row>
1348 <entry><constant>V4L2_MPEG_AUDIO_CRC_NONE</constant>&nbsp;</entry>
1349 <entry>None</entry>
1350 </row>
1351 <row>
1352 <entry><constant>V4L2_MPEG_AUDIO_CRC_CRC16</constant>&nbsp;</entry>
1353 <entry>16 bit parity check</entry>
1354 </row>
1355 </tbody>
1356 </entrytbl>
1357 </row>
1358 <row><entry></entry></row>
1359 <row>
1360 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MUTE</constant>&nbsp;</entry>
1361 <entry>boolean</entry>
1362 </row><row><entry spanname="descr">Mutes the audio when
1363capturing. This is not done by muting audio hardware, which can still
1364produce a slight hiss, but in the encoder itself, guaranteeing a fixed
1365and reproducible audio bitstream. 0 = unmuted, 1 = muted.</entry>
1366 </row>
1367 <row><entry></entry></row>
1368 <row id="v4l2-mpeg-audio-dec-playback">
1369 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK</constant>&nbsp;</entry>
1370 <entry>enum&nbsp;v4l2_mpeg_audio_dec_playback</entry>
1371 </row><row><entry spanname="descr">Determines how monolingual audio should be played back.
1372Possible values are:</entry>
1373 </row>
1374 <row>
1375 <entrytbl spanname="descr" cols="2">
1376 <tbody valign="top">
1377 <row>
1378 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO</constant>&nbsp;</entry>
1379 <entry>Automatically determines the best playback mode.</entry>
1380 </row>
1381 <row>
1382 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO</constant>&nbsp;</entry>
1383 <entry>Stereo playback.</entry>
1384 </row>
1385 <row>
1386 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT</constant>&nbsp;</entry>
1387 <entry>Left channel playback.</entry>
1388 </row>
1389 <row>
1390 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT</constant>&nbsp;</entry>
1391 <entry>Right channel playback.</entry>
1392 </row>
1393 <row>
1394 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO</constant>&nbsp;</entry>
1395 <entry>Mono playback.</entry>
1396 </row>
1397 <row>
1398 <entry><constant>V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO</constant>&nbsp;</entry>
1399 <entry>Stereo playback with swapped left and right channels.</entry>
1400 </row>
1401 </tbody>
1402 </entrytbl>
1403 </row>
1404 <row><entry></entry></row>
1405 <row id="v4l2-mpeg-audio-dec-multilingual-playback">
1406 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK</constant>&nbsp;</entry>
1407 <entry>enum&nbsp;v4l2_mpeg_audio_dec_playback</entry>
1408 </row><row><entry spanname="descr">Determines how multilingual audio should be played back.</entry>
1409 </row>
1410 <row><entry></entry></row>
1411 <row id="v4l2-mpeg-video-encoding">
1412 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ENCODING</constant>&nbsp;</entry>
1413 <entry>enum&nbsp;v4l2_mpeg_video_encoding</entry>
1414 </row><row><entry spanname="descr">MPEG Video encoding
1415method. This control is specific to multiplexed MPEG streams.
1416Possible values are:</entry>
1417 </row>
1418 <row>
1419 <entrytbl spanname="descr" cols="2">
1420 <tbody valign="top">
1421 <row>
1422 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_1</constant>&nbsp;</entry>
1423 <entry>MPEG-1 Video encoding</entry>
1424 </row>
1425 <row>
1426 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_2</constant>&nbsp;</entry>
1427 <entry>MPEG-2 Video encoding</entry>
1428 </row>
1429 <row>
1430 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC</constant>&nbsp;</entry>
1431 <entry>MPEG-4 AVC (H.264) Video encoding</entry>
1432 </row>
1433 </tbody>
1434 </entrytbl>
1435 </row>
1436 <row><entry></entry></row>
1437 <row id="v4l2-mpeg-video-aspect">
1438 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ASPECT</constant>&nbsp;</entry>
1439 <entry>enum&nbsp;v4l2_mpeg_video_aspect</entry>
1440 </row><row><entry spanname="descr">Video aspect.
1441Possible values are:</entry>
1442 </row>
1443 <row>
1444 <entrytbl spanname="descr" cols="2">
1445 <tbody valign="top">
1446 <row>
1447 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_1x1</constant>&nbsp;</entry>
1448 </row>
1449 <row>
1450 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_4x3</constant>&nbsp;</entry>
1451 </row>
1452 <row>
1453 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_16x9</constant>&nbsp;</entry>
1454 </row>
1455 <row>
1456 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_221x100</constant>&nbsp;</entry>
1457 </row>
1458 </tbody>
1459 </entrytbl>
1460 </row>
1461 <row><entry></entry></row>
1462 <row>
1463 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_B_FRAMES</constant>&nbsp;</entry>
1464 <entry>integer</entry>
1465 </row><row><entry spanname="descr">Number of B-Frames
1466(default 2)</entry>
1467 </row>
1468 <row><entry></entry></row>
1469 <row>
1470 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_GOP_SIZE</constant>&nbsp;</entry>
1471 <entry>integer</entry>
1472 </row><row><entry spanname="descr">GOP size (default
147312)</entry>
1474 </row>
1475 <row><entry></entry></row>
1476 <row>
1477 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_GOP_CLOSURE</constant>&nbsp;</entry>
1478 <entry>boolean</entry>
1479 </row><row><entry spanname="descr">GOP closure (default
14801)</entry>
1481 </row>
1482 <row><entry></entry></row>
1483 <row>
1484 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_PULLDOWN</constant>&nbsp;</entry>
1485 <entry>boolean</entry>
1486 </row><row><entry spanname="descr">Enable 3:2 pulldown
1487(default 0)</entry>
1488 </row>
1489 <row><entry></entry></row>
1490 <row id="v4l2-mpeg-video-bitrate-mode">
1491 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE_MODE</constant>&nbsp;</entry>
1492 <entry>enum&nbsp;v4l2_mpeg_video_bitrate_mode</entry>
1493 </row><row><entry spanname="descr">Video bitrate mode.
1494Possible values are:</entry>
1495 </row>
1496 <row>
1497 <entrytbl spanname="descr" cols="2">
1498 <tbody valign="top">
1499 <row>
1500 <entry><constant>V4L2_MPEG_VIDEO_BITRATE_MODE_VBR</constant>&nbsp;</entry>
1501 <entry>Variable bitrate</entry>
1502 </row>
1503 <row>
1504 <entry><constant>V4L2_MPEG_VIDEO_BITRATE_MODE_CBR</constant>&nbsp;</entry>
1505 <entry>Constant bitrate</entry>
1506 </row>
1507 </tbody>
1508 </entrytbl>
1509 </row>
1510 <row><entry></entry></row>
1511 <row>
1512 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE</constant>&nbsp;</entry>
1513 <entry>integer</entry>
1514 </row><row><entry spanname="descr">Video bitrate in bits
1515per second.</entry>
1516 </row>
1517 <row><entry></entry></row>
1518 <row>
1519 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE_PEAK</constant>&nbsp;</entry>
1520 <entry>integer</entry>
1521 </row><row><entry spanname="descr">Peak video bitrate in
1522bits per second. Must be larger or equal to the average video bitrate.
1523It is ignored if the video bitrate mode is set to constant
1524bitrate.</entry>
1525 </row>
1526 <row><entry></entry></row>
1527 <row>
1528 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION</constant>&nbsp;</entry>
1529 <entry>integer</entry>
1530 </row><row><entry spanname="descr">For every captured
1531frame, skip this many subsequent frames (default 0).</entry>
1532 </row>
1533 <row><entry></entry></row>
1534 <row>
1535 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MUTE</constant>&nbsp;</entry>
1536 <entry>boolean</entry>
1537 </row>
1538 <row><entry spanname="descr">"Mutes" the video to a
1539fixed color when capturing. This is useful for testing, to produce a
1540fixed video bitstream. 0 = unmuted, 1 = muted.</entry>
1541 </row>
1542 <row><entry></entry></row>
1543 <row>
1544 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MUTE_YUV</constant>&nbsp;</entry>
1545 <entry>integer</entry>
1546 </row><row><entry spanname="descr">Sets the "mute" color
1547of the video. The supplied 32-bit integer is interpreted as follows (bit
15480 = least significant bit):</entry>
1549 </row>
1550 <row>
1551 <entrytbl spanname="descr" cols="2">
1552 <tbody valign="top">
1553 <row>
1554 <entry>Bit 0:7</entry>
1555 <entry>V chrominance information</entry>
1556 </row>
1557 <row>
1558 <entry>Bit 8:15</entry>
1559 <entry>U chrominance information</entry>
1560 </row>
1561 <row>
1562 <entry>Bit 16:23</entry>
1563 <entry>Y luminance information</entry>
1564 </row>
1565 <row>
1566 <entry>Bit 24:31</entry>
1567 <entry>Must be zero.</entry>
1568 </row>
1569 </tbody>
1570 </entrytbl>
1571 </row>
1572 <row><entry></entry></row>
1573 <row id="v4l2-mpeg-video-dec-pts">
1574 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DEC_PTS</constant>&nbsp;</entry>
1575 <entry>integer64</entry>
1576 </row><row><entry spanname="descr">This read-only control returns the
157733-bit video Presentation Time Stamp as defined in ITU T-REC-H.222.0 and ISO/IEC 13818-1 of
1578the currently displayed frame. This is the same PTS as is used in &VIDIOC-DECODER-CMD;.</entry>
1579 </row>
1580 <row><entry></entry></row>
1581 <row id="v4l2-mpeg-video-dec-frame">
1582 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DEC_FRAME</constant>&nbsp;</entry>
1583 <entry>integer64</entry>
1584 </row><row><entry spanname="descr">This read-only control returns the
1585frame counter of the frame that is currently displayed (decoded). This value is reset to 0 whenever
1586the decoder is started.</entry>
1587 </row>
1588
1589 <row><entry></entry></row>
1590 <row>
1591 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant>&nbsp;</entry>
1592 <entry>boolean</entry>
1593 </row>
1594 <row><entry spanname="descr">If enabled the decoder expects to receive a single slice per buffer, otherwise
1595the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs.
1596</entry>
1597 </row>
1598
1599 <row><entry></entry></row>
1600 <row>
1601 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE</constant>&nbsp;</entry>
1602 <entry>boolean</entry>
1603 </row>
1604 <row><entry spanname="descr">Enable writing sample aspect ratio in the Video Usability Information.
1605Applicable to the H264 encoder.</entry>
1606 </row>
1607
1608 <row><entry></entry></row>
1609 <row id="v4l2-mpeg-video-h264-vui-sar-idc">
1610 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC</constant>&nbsp;</entry>
1611 <entry>enum&nbsp;v4l2_mpeg_video_h264_vui_sar_idc</entry>
1612 </row>
1613 <row><entry spanname="descr">VUI sample aspect ratio indicator for H.264 encoding. The value
1614is defined in the table E-1 in the standard. Applicable to the H264 encoder.</entry>
1615 </row>
1616 <row>
1617 <entrytbl spanname="descr" cols="2">
1618 <tbody valign="top">
1619
1620 <row>
1621 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED</constant>&nbsp;</entry>
1622 <entry>Unspecified</entry>
1623 </row>
1624 <row>
1625 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1</constant>&nbsp;</entry>
1626 <entry>1x1</entry>
1627 </row>
1628 <row>
1629 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11</constant>&nbsp;</entry>
1630 <entry>12x11</entry>
1631 </row>
1632 <row>
1633 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11</constant>&nbsp;</entry>
1634 <entry>10x11</entry>
1635 </row>
1636 <row>
1637 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11</constant>&nbsp;</entry>
1638 <entry>16x11</entry>
1639 </row>
1640 <row>
1641 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33</constant>&nbsp;</entry>
1642 <entry>40x33</entry>
1643 </row>
1644 <row>
1645 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11</constant>&nbsp;</entry>
1646 <entry>24x11</entry>
1647 </row>
1648 <row>
1649 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11</constant>&nbsp;</entry>
1650 <entry>20x11</entry>
1651 </row>
1652 <row>
1653 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11</constant>&nbsp;</entry>
1654 <entry>32x11</entry>
1655 </row>
1656 <row>
1657 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33</constant>&nbsp;</entry>
1658 <entry>80x33</entry>
1659 </row>
1660 <row>
1661 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11</constant>&nbsp;</entry>
1662 <entry>18x11</entry>
1663 </row>
1664 <row>
1665 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11</constant>&nbsp;</entry>
1666 <entry>15x11</entry>
1667 </row>
1668 <row>
1669 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33</constant>&nbsp;</entry>
1670 <entry>64x33</entry>
1671 </row>
1672 <row>
1673 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99</constant>&nbsp;</entry>
1674 <entry>160x99</entry>
1675 </row>
1676 <row>
1677 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3</constant>&nbsp;</entry>
1678 <entry>4x3</entry>
1679 </row>
1680 <row>
1681 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2</constant>&nbsp;</entry>
1682 <entry>3x2</entry>
1683 </row>
1684 <row>
1685 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1</constant>&nbsp;</entry>
1686 <entry>2x1</entry>
1687 </row>
1688 <row>
1689 <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED</constant>&nbsp;</entry>
1690 <entry>Extended SAR</entry>
1691 </row>
1692 </tbody>
1693 </entrytbl>
1694 </row>
1695
1696 <row><entry></entry></row>
1697 <row>
1698 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH</constant>&nbsp;</entry>
1699 <entry>integer</entry>
1700 </row>
1701 <row><entry spanname="descr">Extended sample aspect ratio width for H.264 VUI encoding.
1702Applicable to the H264 encoder.</entry>
1703 </row>
1704
1705 <row><entry></entry></row>
1706 <row>
1707 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT</constant>&nbsp;</entry>
1708 <entry>integer</entry>
1709 </row>
1710 <row><entry spanname="descr">Extended sample aspect ratio height for H.264 VUI encoding.
1711Applicable to the H264 encoder.</entry>
1712 </row>
1713
1714 <row><entry></entry></row>
1715 <row id="v4l2-mpeg-video-h264-level">
1716 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LEVEL</constant>&nbsp;</entry>
1717 <entry>enum&nbsp;v4l2_mpeg_video_h264_level</entry>
1718 </row>
1719 <row><entry spanname="descr">The level information for the H264 video elementary stream.
1720Applicable to the H264 encoder.
1721Possible values are:</entry>
1722 </row>
1723 <row>
1724 <entrytbl spanname="descr" cols="2">
1725 <tbody valign="top">
1726 <row>
1727 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_0</constant>&nbsp;</entry>
1728 <entry>Level 1.0</entry>
1729 </row>
1730 <row>
1731 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1B</constant>&nbsp;</entry>
1732 <entry>Level 1B</entry>
1733 </row>
1734 <row>
1735 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_1</constant>&nbsp;</entry>
1736 <entry>Level 1.1</entry>
1737 </row>
1738 <row>
1739 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_2</constant>&nbsp;</entry>
1740 <entry>Level 1.2</entry>
1741 </row>
1742 <row>
1743 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_3</constant>&nbsp;</entry>
1744 <entry>Level 1.3</entry>
1745 </row>
1746 <row>
1747 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_0</constant>&nbsp;</entry>
1748 <entry>Level 2.0</entry>
1749 </row>
1750 <row>
1751 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_1</constant>&nbsp;</entry>
1752 <entry>Level 2.1</entry>
1753 </row>
1754 <row>
1755 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_2</constant>&nbsp;</entry>
1756 <entry>Level 2.2</entry>
1757 </row>
1758 <row>
1759 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_0</constant>&nbsp;</entry>
1760 <entry>Level 3.0</entry>
1761 </row>
1762 <row>
1763 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_1</constant>&nbsp;</entry>
1764 <entry>Level 3.1</entry>
1765 </row>
1766 <row>
1767 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_2</constant>&nbsp;</entry>
1768 <entry>Level 3.2</entry>
1769 </row>
1770 <row>
1771 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_0</constant>&nbsp;</entry>
1772 <entry>Level 4.0</entry>
1773 </row>
1774 <row>
1775 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_1</constant>&nbsp;</entry>
1776 <entry>Level 4.1</entry>
1777 </row>
1778 <row>
1779 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_2</constant>&nbsp;</entry>
1780 <entry>Level 4.2</entry>
1781 </row>
1782 <row>
1783 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_0</constant>&nbsp;</entry>
1784 <entry>Level 5.0</entry>
1785 </row>
1786 <row>
1787 <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_1</constant>&nbsp;</entry>
1788 <entry>Level 5.1</entry>
1789 </row>
1790 </tbody>
1791 </entrytbl>
1792 </row>
1793
1794 <row><entry></entry></row>
1795 <row id="v4l2-mpeg-video-mpeg4-level">
1796 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL</constant>&nbsp;</entry>
1797 <entry>enum&nbsp;v4l2_mpeg_video_mpeg4_level</entry>
1798 </row>
1799 <row><entry spanname="descr">The level information for the MPEG4 elementary stream.
1800Applicable to the MPEG4 encoder.
1801Possible values are:</entry>
1802 </row>
1803 <row>
1804 <entrytbl spanname="descr" cols="2">
1805 <tbody valign="top">
1806 <row>
1807 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0</constant>&nbsp;</entry>
1808 <entry>Level 0</entry>
1809 </row>
1810 <row>
1811 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0B</constant>&nbsp;</entry>
1812 <entry>Level 0b</entry>
1813 </row>
1814 <row>
1815 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_1</constant>&nbsp;</entry>
1816 <entry>Level 1</entry>
1817 </row>
1818 <row>
1819 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_2</constant>&nbsp;</entry>
1820 <entry>Level 2</entry>
1821 </row>
1822 <row>
1823 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3</constant>&nbsp;</entry>
1824 <entry>Level 3</entry>
1825 </row>
1826 <row>
1827 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3B</constant>&nbsp;</entry>
1828 <entry>Level 3b</entry>
1829 </row>
1830 <row>
1831 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_4</constant>&nbsp;</entry>
1832 <entry>Level 4</entry>
1833 </row>
1834 <row>
1835 <entry><constant>V4L2_MPEG_VIDEO_LEVEL_5</constant>&nbsp;</entry>
1836 <entry>Level 5</entry>
1837 </row>
1838 </tbody>
1839 </entrytbl>
1840 </row>
1841
1842 <row><entry></entry></row>
1843 <row id="v4l2-mpeg-video-h264-profile">
1844 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_PROFILE</constant>&nbsp;</entry>
1845 <entry>enum&nbsp;v4l2_mpeg_video_h264_profile</entry>
1846 </row>
1847 <row><entry spanname="descr">The profile information for H264.
1848Applicable to the H264 encoder.
1849Possible values are:</entry>
1850 </row>
1851 <row>
1852 <entrytbl spanname="descr" cols="2">
1853 <tbody valign="top">
1854 <row>
1855 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE</constant>&nbsp;</entry>
1856 <entry>Baseline profile</entry>
1857 </row>
1858 <row>
1859 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE</constant>&nbsp;</entry>
1860 <entry>Constrained Baseline profile</entry>
1861 </row>
1862 <row>
1863 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MAIN</constant>&nbsp;</entry>
1864 <entry>Main profile</entry>
1865 </row>
1866 <row>
1867 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED</constant>&nbsp;</entry>
1868 <entry>Extended profile</entry>
1869 </row>
1870 <row>
1871 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH</constant>&nbsp;</entry>
1872 <entry>High profile</entry>
1873 </row>
1874 <row>
1875 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10</constant>&nbsp;</entry>
1876 <entry>High 10 profile</entry>
1877 </row>
1878 <row>
1879 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422</constant>&nbsp;</entry>
1880 <entry>High 422 profile</entry>
1881 </row>
1882 <row>
1883 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE</constant>&nbsp;</entry>
1884 <entry>High 444 Predictive profile</entry>
1885 </row>
1886 <row>
1887 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA</constant>&nbsp;</entry>
1888 <entry>High 10 Intra profile</entry>
1889 </row>
1890 <row>
1891 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA</constant>&nbsp;</entry>
1892 <entry>High 422 Intra profile</entry>
1893 </row>
1894 <row>
1895 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA</constant>&nbsp;</entry>
1896 <entry>High 444 Intra profile</entry>
1897 </row>
1898 <row>
1899 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA</constant>&nbsp;</entry>
1900 <entry>CAVLC 444 Intra profile</entry>
1901 </row>
1902 <row>
1903 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE</constant>&nbsp;</entry>
1904 <entry>Scalable Baseline profile</entry>
1905 </row>
1906 <row>
1907 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH</constant>&nbsp;</entry>
1908 <entry>Scalable High profile</entry>
1909 </row>
1910 <row>
1911 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA</constant>&nbsp;</entry>
1912 <entry>Scalable High Intra profile</entry>
1913 </row>
1914 <row>
1915 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH</constant>&nbsp;</entry>
1916 <entry>Stereo High profile</entry>
1917 </row>
1918 <row>
1919 <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH</constant>&nbsp;</entry>
1920 <entry>Multiview High profile</entry>
1921 </row>
1922
1923 </tbody>
1924 </entrytbl>
1925 </row>
1926
1927 <row><entry></entry></row>
1928 <row id="v4l2-mpeg-video-mpeg4-profile">
1929 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE</constant>&nbsp;</entry>
1930 <entry>enum&nbsp;v4l2_mpeg_video_mpeg4_profile</entry>
1931 </row>
1932 <row><entry spanname="descr">The profile information for MPEG4.
1933Applicable to the MPEG4 encoder.
1934Possible values are:</entry>
1935 </row>
1936 <row>
1937 <entrytbl spanname="descr" cols="2">
1938 <tbody valign="top">
1939 <row>
1940 <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE</constant>&nbsp;</entry>
1941 <entry>Simple profile</entry>
1942 </row>
1943 <row>
1944 <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_SIMPLE</constant>&nbsp;</entry>
1945 <entry>Advanced Simple profile</entry>
1946 </row>
1947 <row>
1948 <entry><constant>V4L2_MPEG_VIDEO_PROFILE_CORE</constant>&nbsp;</entry>
1949 <entry>Core profile</entry>
1950 </row>
1951 <row>
1952 <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE_SCALABLE</constant>&nbsp;</entry>
1953 <entry>Simple Scalable profile</entry>
1954 </row>
1955 <row>
1956 <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_CODING_EFFICIENCY</constant>&nbsp;</entry>
1957 <entry></entry>
1958 </row>
1959 </tbody>
1960 </entrytbl>
1961 </row>
1962
1963 <row><entry></entry></row>
1964 <row>
1965 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MAX_REF_PIC</constant>&nbsp;</entry>
1966 <entry>integer</entry>
1967 </row>
1968 <row><entry spanname="descr">The maximum number of reference pictures used for encoding.
1969Applicable to the encoder.
1970</entry>
1971 </row>
1972
1973 <row><entry></entry></row>
1974 <row id="v4l2-mpeg-video-multi-slice-mode">
1975 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant>&nbsp;</entry>
1976 <entry>enum&nbsp;v4l2_mpeg_video_multi_slice_mode</entry>
1977 </row>
1978 <row><entry spanname="descr">Determines how the encoder should handle division of frame into slices.
1979Applicable to the encoder.
1980Possible values are:</entry>
1981 </row>
1982 <row>
1983 <entrytbl spanname="descr" cols="2">
1984 <tbody valign="top">
1985 <row>
1986 <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE</constant>&nbsp;</entry>
1987 <entry>Single slice per frame.</entry>
1988 </row>
1989 <row>
1990 <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant>&nbsp;</entry>
1991 <entry>Multiple slices with set maximum number of macroblocks per slice.</entry>
1992 </row>
1993 <row>
1994 <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant>&nbsp;</entry>
1995 <entry>Multiple slice with set maximum size in bytes per slice.</entry>
1996 </row>
1997 </tbody>
1998 </entrytbl>
1999 </row>
2000
2001 <row><entry></entry></row>
2002 <row>
2003 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB</constant>&nbsp;</entry>
2004 <entry>integer</entry>
2005 </row>
2006 <row><entry spanname="descr">The maximum number of macroblocks in a slice. Used when
2007<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant>.
2008Applicable to the encoder.</entry>
2009 </row>
2010
2011 <row><entry></entry></row>
2012 <row>
2013 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES</constant>&nbsp;</entry>
2014 <entry>integer</entry>
2015 </row>
2016 <row><entry spanname="descr">The maximum size of a slice in bytes. Used when
2017<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant>.
2018Applicable to the encoder.</entry>
2019 </row>
2020
2021 <row><entry></entry></row>
2022 <row id="v4l2-mpeg-video-h264-loop-filter-mode">
2023 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE</constant>&nbsp;</entry>
2024 <entry>enum&nbsp;v4l2_mpeg_video_h264_loop_filter_mode</entry>
2025 </row>
2026 <row><entry spanname="descr">Loop filter mode for H264 encoder.
2027Possible values are:</entry>
2028 </row>
2029 <row>
2030 <entrytbl spanname="descr" cols="2">
2031 <tbody valign="top">
2032 <row>
2033 <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED</constant>&nbsp;</entry>
2034 <entry>Loop filter is enabled.</entry>
2035 </row>
2036 <row>
2037 <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED</constant>&nbsp;</entry>
2038 <entry>Loop filter is disabled.</entry>
2039 </row>
2040 <row>
2041 <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY</constant>&nbsp;</entry>
2042 <entry>Loop filter is disabled at the slice boundary.</entry>
2043 </row>
2044 </tbody>
2045 </entrytbl>
2046 </row>
2047
2048 <row><entry></entry></row>
2049 <row>
2050 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA</constant>&nbsp;</entry>
2051 <entry>integer</entry>
2052 </row>
2053 <row><entry spanname="descr">Loop filter alpha coefficient, defined in the H264 standard.
2054Applicable to the H264 encoder.</entry>
2055 </row>
2056
2057 <row><entry></entry></row>
2058 <row>
2059 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA</constant>&nbsp;</entry>
2060 <entry>integer</entry>
2061 </row>
2062 <row><entry spanname="descr">Loop filter beta coefficient, defined in the H264 standard.
2063Applicable to the H264 encoder.</entry>
2064 </row>
2065
2066 <row><entry></entry></row>
2067 <row id="v4l2-mpeg-video-h264-entropy-mode">
2068 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE</constant>&nbsp;</entry>
2069 <entry>enum&nbsp;v4l2_mpeg_video_h264_entropy_mode</entry>
2070 </row>
2071 <row><entry spanname="descr">Entropy coding mode for H264 - CABAC/CAVALC.
2072Applicable to the H264 encoder.
2073Possible values are:</entry>
2074 </row>
2075 <row>
2076 <entrytbl spanname="descr" cols="2">
2077 <tbody valign="top">
2078 <row>
2079 <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC</constant>&nbsp;</entry>
2080 <entry>Use CAVLC entropy coding.</entry>
2081 </row>
2082 <row>
2083 <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC</constant>&nbsp;</entry>
2084 <entry>Use CABAC entropy coding.</entry>
2085 </row>
2086 </tbody>
2087 </entrytbl>
2088 </row>
2089
2090 <row><entry></entry></row>
2091 <row>
2092 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM</constant>&nbsp;</entry>
2093 <entry>boolean</entry>
2094 </row>
2095 <row><entry spanname="descr">Enable 8X8 transform for H264. Applicable to the H264 encoder.</entry>
2096 </row>
2097
2098 <row><entry></entry></row>
2099 <row>
2100 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB</constant>&nbsp;</entry>
2101 <entry>integer</entry>
2102 </row>
2103 <row><entry spanname="descr">Cyclic intra macroblock refresh. This is the number of continuous macroblocks
2104refreshed every frame. Each frame a successive set of macroblocks is refreshed until the cycle completes and starts from the
2105top of the frame. Applicable to H264, H263 and MPEG4 encoder.</entry>
2106 </row>
2107
2108 <row><entry></entry></row>
2109 <row>
2110 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE</constant>&nbsp;</entry>
2111 <entry>boolean</entry>
2112 </row>
2113 <row><entry spanname="descr">Frame level rate control enable.
2114If this control is disabled then the quantization parameter for each frame type is constant and set with appropriate controls
2115(e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant>).
2116If frame rate control is enabled then quantization parameter is adjusted to meet the chosen bitrate. Minimum and maximum value
2117for the quantization parameter can be set with appropriate controls (e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant>).
2118Applicable to encoders.</entry>
2119 </row>
2120
2121 <row><entry></entry></row>
2122 <row>
2123 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>&nbsp;</entry>
2124 <entry>boolean</entry>
2125 </row>
2126 <row><entry spanname="descr">Macroblock level rate control enable.
2127Applicable to the MPEG4 and H264 encoders.</entry>
2128 </row>
2129
2130 <row><entry></entry></row>
2131 <row>
2132 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_QPEL</constant>&nbsp;</entry>
2133 <entry>boolean</entry>
2134 </row>
2135 <row><entry spanname="descr">Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4 encoder.</entry>
2136 </row>
2137
2138 <row><entry></entry></row>
2139 <row>
2140 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant>&nbsp;</entry>
2141 <entry>integer</entry>
2142 </row>
2143 <row><entry spanname="descr">Quantization parameter for an I frame for H263. Valid range: from 1 to 31.</entry>
2144 </row>
2145
2146 <row><entry></entry></row>
2147 <row>
2148 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant>&nbsp;</entry>
2149 <entry>integer</entry>
2150 </row>
2151 <row><entry spanname="descr">Minimum quantization parameter for H263. Valid range: from 1 to 31.</entry>
2152 </row>
2153
2154 <row><entry></entry></row>
2155 <row>
2156 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MAX_QP</constant>&nbsp;</entry>
2157 <entry>integer</entry>
2158 </row>
2159 <row><entry spanname="descr">Maximum quantization parameter for H263. Valid range: from 1 to 31.</entry>
2160 </row>
2161
2162 <row><entry></entry></row>
2163 <row>
2164 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP</constant>&nbsp;</entry>
2165 <entry>integer</entry>
2166 </row>
2167 <row><entry spanname="descr">Quantization parameter for an P frame for H263. Valid range: from 1 to 31.</entry>
2168 </row>
2169
2170 <row><entry></entry></row>
2171 <row>
2172 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP</constant>&nbsp;</entry>
2173 <entry>integer</entry>
2174 </row>
2175 <row><entry spanname="descr">Quantization parameter for an B frame for H263. Valid range: from 1 to 31.</entry>
2176 </row>
2177
2178 <row><entry></entry></row>
2179 <row>
2180 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP</constant>&nbsp;</entry>
2181 <entry>integer</entry>
2182 </row>
2183 <row><entry spanname="descr">Quantization parameter for an I frame for H264. Valid range: from 0 to 51.</entry>
2184 </row>
2185
2186 <row><entry></entry></row>
2187 <row>
2188 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MIN_QP</constant>&nbsp;</entry>
2189 <entry>integer</entry>
2190 </row>
2191 <row><entry spanname="descr">Minimum quantization parameter for H264. Valid range: from 0 to 51.</entry>
2192 </row>
2193
2194 <row><entry></entry></row>
2195 <row>
2196 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MAX_QP</constant>&nbsp;</entry>
2197 <entry>integer</entry>
2198 </row>
2199 <row><entry spanname="descr">Maximum quantization parameter for H264. Valid range: from 0 to 51.</entry>
2200 </row>
2201
2202 <row><entry></entry></row>
2203 <row>
2204 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP</constant>&nbsp;</entry>
2205 <entry>integer</entry>
2206 </row>
2207 <row><entry spanname="descr">Quantization parameter for an P frame for H264. Valid range: from 0 to 51.</entry>
2208 </row>
2209
2210 <row><entry></entry></row>
2211 <row>
2212 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP</constant>&nbsp;</entry>
2213 <entry>integer</entry>
2214 </row>
2215 <row><entry spanname="descr">Quantization parameter for an B frame for H264. Valid range: from 0 to 51.</entry>
2216 </row>
2217
2218 <row><entry></entry></row>
2219 <row>
2220 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP</constant>&nbsp;</entry>
2221 <entry>integer</entry>
2222 </row>
2223 <row><entry spanname="descr">Quantization parameter for an I frame for MPEG4. Valid range: from 1 to 31.</entry>
2224 </row>
2225
2226 <row><entry></entry></row>
2227 <row>
2228 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP</constant>&nbsp;</entry>
2229 <entry>integer</entry>
2230 </row>
2231 <row><entry spanname="descr">Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry>
2232 </row>
2233
2234 <row><entry></entry></row>
2235 <row>
2236 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP</constant>&nbsp;</entry>
2237 <entry>integer</entry>
2238 </row>
2239 <row><entry spanname="descr">Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry>
2240 </row>
2241
2242 <row><entry></entry></row>
2243 <row>
2244 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP</constant>&nbsp;</entry>
2245 <entry>integer</entry>
2246 </row>
2247 <row><entry spanname="descr">Quantization parameter for an P frame for MPEG4. Valid range: from 1 to 31.</entry>
2248 </row>
2249
2250 <row><entry></entry></row>
2251 <row>
2252 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP</constant>&nbsp;</entry>
2253 <entry>integer</entry>
2254 </row>
2255 <row><entry spanname="descr">Quantization parameter for an B frame for MPEG4. Valid range: from 1 to 31.</entry>
2256 </row>
2257
2258 <row><entry></entry></row>
2259 <row>
2260 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_SIZE</constant>&nbsp;</entry>
2261 <entry>integer</entry>
2262 </row>
2263 <row><entry spanname="descr">The Video Buffer Verifier size in kilobytes, it is used as a limitation of frame skip.
2264The VBV is defined in the standard as a mean to verify that the produced stream will be successfully decoded.
2265The standard describes it as "Part of a hypothetical decoder that is conceptually connected to the
2266output of the encoder. Its purpose is to provide a constraint on the variability of the data rate that an
2267encoder or editing process may produce.".
2268Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry>
2269 </row>
2270
2271 <row><entry></entry></row>
2272 <row id="v4l2-mpeg-video-vbv-delay">
2273 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_DELAY</constant>&nbsp;</entry>
2274 <entry>integer</entry>
2275 </row><row><entry spanname="descr">Sets the initial delay in milliseconds for
2276VBV buffer control.</entry>
2277 </row>
2278
2279 <row><entry></entry></row>
2280 <row>
2281 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant>&nbsp;</entry>
2282 <entry>integer</entry>
2283 </row>
2284 <row><entry spanname="descr">The Coded Picture Buffer size in kilobytes, it is used as a limitation of frame skip.
2285The CPB is defined in the H264 standard as a mean to verify that the produced stream will be successfully decoded.
2286Applicable to the H264 encoder.</entry>
2287 </row>
2288
2289 <row><entry></entry></row>
2290 <row>
2291 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_PERIOD</constant>&nbsp;</entry>
2292 <entry>integer</entry>
2293 </row>
2294 <row><entry spanname="descr">Period between I-frames in the open GOP for H264. In case of an open GOP
2295this is the period between two I-frames. The period between IDR (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE control.
2296An IDR frame, which stands for Instantaneous Decoding Refresh is an I-frame after which no prior frames are
2297referenced. This means that a stream can be restarted from an IDR frame without the need to store or decode any
2298previous frames. Applicable to the H264 encoder.</entry>
2299 </row>
2300
2301 <row><entry></entry></row>
2302 <row id="v4l2-mpeg-video-header-mode">
2303 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_HEADER_MODE</constant>&nbsp;</entry>
2304 <entry>enum&nbsp;v4l2_mpeg_video_header_mode</entry>
2305 </row>
2306 <row><entry spanname="descr">Determines whether the header is returned as the first buffer or is
2307it returned together with the first frame. Applicable to encoders.
2308Possible values are:</entry>
2309 </row>
2310 <row>
2311 <entrytbl spanname="descr" cols="2">
2312 <tbody valign="top">
2313 <row>
2314 <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE</constant>&nbsp;</entry>
2315 <entry>The stream header is returned separately in the first buffer.</entry>
2316 </row>
2317 <row>
2318 <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME</constant>&nbsp;</entry>
2319 <entry>The stream header is returned together with the first encoded frame.</entry>
2320 </row>
2321 </tbody>
2322 </entrytbl>
2323 </row>
2324 <row><entry></entry></row>
2325 <row>
2326 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER</constant>&nbsp;</entry>
2327 <entry>boolean</entry>
2328 </row><row><entry spanname="descr">Enabled the deblocking post processing filter for MPEG4 decoder.
2329Applicable to the MPEG4 decoder.</entry>
2330 </row>
2331 <row><entry></entry></row>
2332 <row>
2333 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES</constant>&nbsp;</entry>
2334 <entry>integer</entry>
2335 </row><row><entry spanname="descr">vop_time_increment_resolution value for MPEG4. Applicable to the MPEG4 encoder.</entry>
2336 </row>
2337 <row><entry></entry></row>
2338 <row>
2339 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC</constant>&nbsp;</entry>
2340 <entry>integer</entry>
2341 </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry>
2342 </row>
2343
2344 <row><entry></entry></row>
2345 <row>
2346 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING</constant>&nbsp;</entry>
2347 <entry>boolean</entry>
2348 </row>
2349 <row><entry spanname="descr">Enable generation of frame packing supplemental enhancement information in the encoded bitstream.
2350The frame packing SEI message contains the arrangement of L and R planes for 3D viewing. Applicable to the H264 encoder.</entry>
2351 </row>
2352
2353 <row><entry></entry></row>
2354 <row>
2355 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0</constant>&nbsp;</entry>
2356 <entry>boolean</entry>
2357 </row>
2358 <row><entry spanname="descr">Sets current frame as frame0 in frame packing SEI.
2359Applicable to the H264 encoder.</entry>
2360 </row>
2361
2362 <row><entry></entry></row>
2363 <row id="v4l2-mpeg-video-h264-sei-fp-arrangement-type">
2364 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE</constant>&nbsp;</entry>
2365 <entry>enum&nbsp;v4l2_mpeg_video_h264_sei_fp_arrangement_type</entry>
2366 </row>
2367 <row><entry spanname="descr">Frame packing arrangement type for H264 SEI.
2368Applicable to the H264 encoder.
2369Possible values are:</entry>
2370 </row>
2371 <row>
2372 <entrytbl spanname="descr" cols="2">
2373 <tbody valign="top">
2374 <row>
2375 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD</constant>&nbsp;</entry>
2376 <entry>Pixels are alternatively from L and R.</entry>
2377 </row>
2378 <row>
2379 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN</constant>&nbsp;</entry>
2380 <entry>L and R are interlaced by column.</entry>
2381 </row>
2382 <row>
2383 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW</constant>&nbsp;</entry>
2384 <entry>L and R are interlaced by row.</entry>
2385 </row>
2386 <row>
2387 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE</constant>&nbsp;</entry>
2388 <entry>L is on the left, R on the right.</entry>
2389 </row>
2390 <row>
2391 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM</constant>&nbsp;</entry>
2392 <entry>L is on top, R on bottom.</entry>
2393 </row>
2394 <row>
2395 <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL</constant>&nbsp;</entry>
2396 <entry>One view per frame.</entry>
2397 </row>
2398 </tbody>
2399 </entrytbl>
2400 </row>
2401
2402 <row><entry></entry></row>
2403 <row>
2404 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO</constant>&nbsp;</entry>
2405 <entry>boolean</entry>
2406 </row>
2407 <row><entry spanname="descr">Enables flexible macroblock ordering in the encoded bitstream. It is a technique
2408used for restructuring the ordering of macroblocks in pictures. Applicable to the H264 encoder.</entry>
2409 </row>
2410
2411 <row><entry></entry></row>
2412 <row id="v4l2-mpeg-video-h264-fmo-map-type">
2413 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE</constant>&nbsp;</entry>
2414 <entry>enum&nbsp;v4l2_mpeg_video_h264_fmo_map_type</entry>
2415 </row>
2416 <row><entry spanname="descr">When using FMO, the map type divides the image in different scan patterns of macroblocks.
2417Applicable to the H264 encoder.
2418Possible values are:</entry>
2419 </row>
2420 <row>
2421 <entrytbl spanname="descr" cols="2">
2422 <tbody valign="top">
2423 <row>
2424 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES</constant>&nbsp;</entry>
2425 <entry>Slices are interleaved one after other with macroblocks in run length order.</entry>
2426 </row>
2427 <row>
2428 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES</constant>&nbsp;</entry>
2429 <entry>Scatters the macroblocks based on a mathematical function known to both encoder and decoder.</entry>
2430 </row>
2431 <row>
2432 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER</constant>&nbsp;</entry>
2433 <entry>Macroblocks arranged in rectangular areas or regions of interest.</entry>
2434 </row>
2435 <row>
2436 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT</constant>&nbsp;</entry>
2437 <entry>Slice groups grow in a cyclic way from centre to outwards.</entry>
2438 </row>
2439 <row>
2440 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN</constant>&nbsp;</entry>
2441 <entry>Slice groups grow in raster scan pattern from left to right.</entry>
2442 </row>
2443 <row>
2444 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN</constant>&nbsp;</entry>
2445 <entry>Slice groups grow in wipe scan pattern from top to bottom.</entry>
2446 </row>
2447 <row>
2448 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT</constant>&nbsp;</entry>
2449 <entry>User defined map type.</entry>
2450 </row>
2451 </tbody>
2452 </entrytbl>
2453 </row>
2454
2455 <row><entry></entry></row>
2456 <row>
2457 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP</constant>&nbsp;</entry>
2458 <entry>integer</entry>
2459 </row>
2460 <row><entry spanname="descr">Number of slice groups in FMO.
2461Applicable to the H264 encoder.</entry>
2462 </row>
2463
2464 <row><entry></entry></row>
2465 <row id="v4l2-mpeg-video-h264-fmo-change-direction">
2466 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION</constant>&nbsp;</entry>
2467 <entry>enum&nbsp;v4l2_mpeg_video_h264_fmo_change_dir</entry>
2468 </row>
2469 <row><entry spanname="descr">Specifies a direction of the slice group change for raster and wipe maps.
2470Applicable to the H264 encoder.
2471Possible values are:</entry>
2472 </row>
2473 <row>
2474 <entrytbl spanname="descr" cols="2">
2475 <tbody valign="top">
2476 <row>
2477 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT</constant>&nbsp;</entry>
2478 <entry>Raster scan or wipe right.</entry>
2479 </row>
2480 <row>
2481 <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT</constant>&nbsp;</entry>
2482 <entry>Reverse raster scan or wipe left.</entry>
2483 </row>
2484 </tbody>
2485 </entrytbl>
2486 </row>
2487
2488 <row><entry></entry></row>
2489 <row>
2490 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE</constant>&nbsp;</entry>
2491 <entry>integer</entry>
2492 </row>
2493 <row><entry spanname="descr">Specifies the size of the first slice group for raster and wipe map.
2494Applicable to the H264 encoder.</entry>
2495 </row>
2496
2497 <row><entry></entry></row>
2498 <row>
2499 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH</constant>&nbsp;</entry>
2500 <entry>integer</entry>
2501 </row>
2502 <row><entry spanname="descr">Specifies the number of consecutive macroblocks for the interleaved map.
2503Applicable to the H264 encoder.</entry>
2504 </row>
2505
2506 <row><entry></entry></row>
2507 <row>
2508 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO</constant>&nbsp;</entry>
2509 <entry>boolean</entry>
2510 </row>
2511 <row><entry spanname="descr">Enables arbitrary slice ordering in encoded bitstream.
2512Applicable to the H264 encoder.</entry>
2513 </row>
2514
2515 <row><entry></entry></row>
2516 <row>
2517 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER</constant>&nbsp;</entry>
2518 <entry>integer</entry>
2519 </row><row><entry spanname="descr">Specifies the slice order in ASO. Applicable to the H264 encoder.
2520The supplied 32-bit integer is interpreted as follows (bit
25210 = least significant bit):</entry>
2522 </row>
2523 <row>
2524 <entrytbl spanname="descr" cols="2">
2525 <tbody valign="top">
2526 <row>
2527 <entry>Bit 0:15</entry>
2528 <entry>Slice ID</entry>
2529 </row>
2530 <row>
2531 <entry>Bit 16:32</entry>
2532 <entry>Slice position or order</entry>
2533 </row>
2534 </tbody>
2535 </entrytbl>
2536 </row>
2537
2538 <row><entry></entry></row>
2539 <row>
2540 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING</constant>&nbsp;</entry>
2541 <entry>boolean</entry>
2542 </row>
2543 <row><entry spanname="descr">Enables H264 hierarchical coding.
2544Applicable to the H264 encoder.</entry>
2545 </row>
2546
2547 <row><entry></entry></row>
2548 <row id="v4l2-mpeg-video-h264-hierarchical-coding-type">
2549 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE</constant>&nbsp;</entry>
2550 <entry>enum&nbsp;v4l2_mpeg_video_h264_hierarchical_coding_type</entry>
2551 </row>
2552 <row><entry spanname="descr">Specifies the hierarchical coding type.
2553Applicable to the H264 encoder.
2554Possible values are:</entry>
2555 </row>
2556 <row>
2557 <entrytbl spanname="descr" cols="2">
2558 <tbody valign="top">
2559 <row>
2560 <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B</constant>&nbsp;</entry>
2561 <entry>Hierarchical B coding.</entry>
2562 </row>
2563 <row>
2564 <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P</constant>&nbsp;</entry>
2565 <entry>Hierarchical P coding.</entry>
2566 </row>
2567 </tbody>
2568 </entrytbl>
2569 </row>
2570
2571 <row><entry></entry></row>
2572 <row>
2573 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER</constant>&nbsp;</entry>
2574 <entry>integer</entry>
2575 </row>
2576 <row><entry spanname="descr">Specifies the number of hierarchical coding layers.
2577Applicable to the H264 encoder.</entry>
2578 </row>
2579
2580 <row><entry></entry></row>
2581 <row>
2582 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP</constant>&nbsp;</entry>
2583 <entry>integer</entry>
2584 </row><row><entry spanname="descr">Specifies a user defined QP for each layer. Applicable to the H264 encoder.
2585The supplied 32-bit integer is interpreted as follows (bit
25860 = least significant bit):</entry>
2587 </row>
2588 <row>
2589 <entrytbl spanname="descr" cols="2">
2590 <tbody valign="top">
2591 <row>
2592 <entry>Bit 0:15</entry>
2593 <entry>QP value</entry>
2594 </row>
2595 <row>
2596 <entry>Bit 16:32</entry>
2597 <entry>Layer number</entry>
2598 </row>
2599 </tbody>
2600 </entrytbl>
2601 </row>
2602
2603 </tbody>
2604 </tgroup>
2605 </table>
2606 </section>
2607
2608 <section>
2609 <title>MFC 5.1 MPEG Controls</title>
2610
2611 <para>The following MPEG class controls deal with MPEG
2612decoding and encoding settings that are specific to the Multi Format Codec 5.1 device present
2613in the S5P family of SoCs by Samsung.
2614</para>
2615
2616 <table pgwide="1" frame="none" id="mfc51-control-id">
2617 <title>MFC 5.1 Control IDs</title>
2618 <tgroup cols="4">
2619 <colspec colname="c1" colwidth="1*" />
2620 <colspec colname="c2" colwidth="6*" />
2621 <colspec colname="c3" colwidth="2*" />
2622 <colspec colname="c4" colwidth="6*" />
2623 <spanspec namest="c1" nameend="c2" spanname="id" />
2624 <spanspec namest="c2" nameend="c4" spanname="descr" />
2625 <thead>
2626 <row>
2627 <entry spanname="id" align="left">ID</entry>
2628 <entry align="left">Type</entry>
2629 </row><row><entry spanname="descr" align="left">Description</entry>
2630 </row>
2631 </thead>
2632 <tbody valign="top">
2633 <row><entry></entry></row>
2634 <row>
2635 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE</constant>&nbsp;</entry>
2636 <entry>integer</entry>
2637 </row><row><entry spanname="descr">If the display delay is enabled then the decoder has to return a
2638CAPTURE buffer after processing a certain number of OUTPUT buffers. If this number is low, then it may result in
2639buffers not being dequeued in display order. In addition hardware may still use those buffers as reference, thus
2640application should not write to those buffers. This feature can be used for example for generating thumbnails of videos.
2641Applicable to the H264 decoder.
2642 </entry>
2643 </row>
2644 <row><entry></entry></row>
2645 <row>
2646 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY</constant>&nbsp;</entry>
2647 <entry>integer</entry>
2648 </row><row><entry spanname="descr">Display delay value for H264 decoder.
2649The decoder is forced to return a decoded frame after the set 'display delay' number of frames. If this number is
2650low it may result in frames returned out of dispaly order, in addition the hardware may still be using the returned buffer
2651as a reference picture for subsequent frames.
2652</entry>
2653 </row>
2654 <row><entry></entry></row>
2655 <row>
2656 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P</constant>&nbsp;</entry>
2657 <entry>integer</entry>
2658 </row><row><entry spanname="descr">The number of reference pictures used for encoding a P picture.
2659Applicable to the H264 encoder.</entry>
2660 </row>
2661 <row><entry></entry></row>
2662 <row>
2663 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING</constant>&nbsp;</entry>
2664 <entry>boolean</entry>
2665 </row><row><entry spanname="descr">Padding enable in the encoder - use a color instead of repeating border pixels.
2666Applicable to encoders.</entry>
2667 </row>
2668 <row><entry></entry></row>
2669 <row>
2670 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV</constant>&nbsp;</entry>
2671 <entry>integer</entry>
2672 </row><row><entry spanname="descr">Padding color in the encoder. Applicable to encoders. The supplied 32-bit integer is interpreted as follows (bit
26730 = least significant bit):</entry>
2674 </row>
2675 <row>
2676 <entrytbl spanname="descr" cols="2">
2677 <tbody valign="top">
2678 <row>
2679 <entry>Bit 0:7</entry>
2680 <entry>V chrominance information</entry>
2681 </row>
2682 <row>
2683 <entry>Bit 8:15</entry>
2684 <entry>U chrominance information</entry>
2685 </row>
2686 <row>
2687 <entry>Bit 16:23</entry>
2688 <entry>Y luminance information</entry>
2689 </row>
2690 <row>
2691 <entry>Bit 24:31</entry>
2692 <entry>Must be zero.</entry>
2693 </row>
2694 </tbody>
2695 </entrytbl>
2696 </row>
2697 <row><entry></entry></row>
2698 <row>
2699 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF</constant>&nbsp;</entry>
2700 <entry>integer</entry>
2701 </row><row><entry spanname="descr">Reaction coefficient for MFC rate control. Applicable to encoders.
2702<para>Note 1: Valid only when the frame level RC is enabled.</para>
2703<para>Note 2: For tight CBR, this field must be small (ex. 2 ~ 10).
2704For VBR, this field must be large (ex. 100 ~ 1000).</para>
2705<para>Note 3: It is not recommended to use the greater number than FRAME_RATE * (10^9 / BIT_RATE).</para>
2706</entry>
2707 </row>
2708 <row><entry></entry></row>
2709 <row>
2710 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK</constant>&nbsp;</entry>
2711 <entry>boolean</entry>
2712 </row><row><entry spanname="descr">Adaptive rate control for dark region.
2713Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>).
2714Applicable to the H264 encoder.</entry>
2715 </row>
2716 <row><entry></entry></row>
2717 <row>
2718 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH</constant>&nbsp;</entry>
2719 <entry>boolean</entry>
2720 </row><row><entry spanname="descr">Adaptive rate control for smooth region.
2721Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>).
2722Applicable to the H264 encoder.</entry>
2723 </row>
2724 <row><entry></entry></row>
2725 <row>
2726 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC</constant>&nbsp;</entry>
2727 <entry>boolean</entry>
2728 </row><row><entry spanname="descr">Adaptive rate control for static region.
2729Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>).
2730Applicable to the H264 encoder.</entry>
2731 </row>
2732 <row><entry></entry></row>
2733 <row>
2734 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY</constant>&nbsp;</entry>
2735 <entry>boolean</entry>
2736 </row><row><entry spanname="descr">Adaptive rate control for activity region.
2737Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>).
2738Applicable to the H264 encoder.</entry>
2739 </row>
2740 <row><entry></entry></row>
2741 <row id="v4l2-mpeg-mfc51-video-frame-skip-mode">
2742 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE</constant>&nbsp;</entry>
2743 <entry>enum&nbsp;v4l2_mpeg_mfc51_video_frame_skip_mode</entry>
2744 </row>
2745 <row><entry spanname="descr">
2746Indicates in what conditions the encoder should skip frames. If encoding a frame would cause the encoded stream to be larger then
2747a chosen data limit then the frame will be skipped.
2748Possible values are:</entry>
2749 </row>
2750 <row>
2751 <entrytbl spanname="descr" cols="2">
2752 <tbody valign="top">
2753 <row>
2754 <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED</constant>&nbsp;</entry>
2755 <entry>Frame skip mode is disabled.</entry>
2756 </row>
2757 <row>
2758 <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT</constant>&nbsp;</entry>
2759 <entry>Frame skip mode enabled and buffer limit is set by the chosen level and is defined by the standard.</entry>
2760 </row>
2761 <row>
2762 <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_BUF_LIMIT</constant>&nbsp;</entry>
2763 <entry>Frame skip mode enabled and buffer limit is set by the VBV (MPEG1/2/4) or CPB (H264) buffer size control.</entry>
2764 </row>
2765 </tbody>
2766 </entrytbl>
2767 </row>
2768 <row><entry></entry></row>
2769 <row>
2770 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT</constant>&nbsp;</entry>
2771 <entry>integer</entry>
2772 </row><row><entry spanname="descr">Enable rate-control with fixed target bit.
2773If this setting is enabled, then the rate control logic of the encoder will calculate the average bitrate
2774for a GOP and keep it below or equal the set bitrate target. Otherwise the rate control logic calculates the
2775overall average bitrate for the stream and keeps it below or equal to the set bitrate. In the first case
2776the average bitrate for the whole stream will be smaller then the set bitrate. This is caused because the
2777average is calculated for smaller number of frames, on the other hand enabling this setting will ensure that
2778the stream will meet tight bandwidth contraints. Applicable to encoders.
2779</entry>
2780 </row>
2781 <row><entry></entry></row>
2782 <row id="v4l2-mpeg-mfc51-video-force-frame-type">
2783 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE</constant>&nbsp;</entry>
2784 <entry>enum&nbsp;v4l2_mpeg_mfc51_video_force_frame_type</entry>
2785 </row>
2786 <row><entry spanname="descr">Force a frame type for the next queued buffer. Applicable to encoders.
2787Possible values are:</entry>
2788 </row>
2789 <row>
2790 <entrytbl spanname="descr" cols="2">
2791 <tbody valign="top">
2792 <row>
2793 <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED</constant>&nbsp;</entry>
2794 <entry>Forcing a specific frame type disabled.</entry>
2795 </row>
2796 <row>
2797 <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME</constant>&nbsp;</entry>
2798 <entry>Force an I-frame.</entry>
2799 </row>
2800 <row>
2801 <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED</constant>&nbsp;</entry>
2802 <entry>Force a non-coded frame.</entry>
2803 </row>
2804 </tbody>
2805 </entrytbl>
2806 </row>
2807 </tbody>
2808 </tgroup>
2809 </table>
2810 </section>
2811
2812 <section>
2813 <title>CX2341x MPEG Controls</title>
2814
2815 <para>The following MPEG class controls deal with MPEG
2816encoding settings that are specific to the Conexant CX23415 and
2817CX23416 MPEG encoding chips.</para>
2818
2819 <table pgwide="1" frame="none" id="cx2341x-control-id">
2820 <title>CX2341x Control IDs</title>
2821 <tgroup cols="4">
2822 <colspec colname="c1" colwidth="1*" />
2823 <colspec colname="c2" colwidth="6*" />
2824 <colspec colname="c3" colwidth="2*" />
2825 <colspec colname="c4" colwidth="6*" />
2826 <spanspec namest="c1" nameend="c2" spanname="id" />
2827 <spanspec namest="c2" nameend="c4" spanname="descr" />
2828 <thead>
2829 <row>
2830 <entry spanname="id" align="left">ID</entry>
2831 <entry align="left">Type</entry>
2832 </row><row><entry spanname="descr" align="left">Description</entry>
2833 </row>
2834 </thead>
2835 <tbody valign="top">
2836 <row><entry></entry></row>
2837 <row id="v4l2-mpeg-cx2341x-video-spatial-filter-mode">
2838 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE</constant>&nbsp;</entry>
2839 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_spatial_filter_mode</entry>
2840 </row><row><entry spanname="descr">Sets the Spatial
2841Filter mode (default <constant>MANUAL</constant>). Possible values
2842are:</entry>
2843 </row>
2844 <row>
2845 <entrytbl spanname="descr" cols="2">
2846 <tbody valign="top">
2847 <row>
2848 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL</constant>&nbsp;</entry>
2849 <entry>Choose the filter manually</entry>
2850 </row>
2851 <row>
2852 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO</constant>&nbsp;</entry>
2853 <entry>Choose the filter automatically</entry>
2854 </row>
2855 </tbody>
2856 </entrytbl>
2857 </row>
2858 <row><entry></entry></row>
2859 <row>
2860 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER</constant>&nbsp;</entry>
2861 <entry>integer&nbsp;(0-15)</entry>
2862 </row><row><entry spanname="descr">The setting for the
2863Spatial Filter. 0 = off, 15 = maximum. (Default is 0.)</entry>
2864 </row>
2865 <row><entry></entry></row>
2866 <row id="luma-spatial-filter-type">
2867 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE</constant>&nbsp;</entry>
2868 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_luma_spatial_filter_type</entry>
2869 </row><row><entry spanname="descr">Select the algorithm
2870to use for the Luma Spatial Filter (default
2871<constant>1D_HOR</constant>). Possible values:</entry>
2872 </row>
2873 <row>
2874 <entrytbl spanname="descr" cols="2">
2875 <tbody valign="top">
2876 <row>
2877 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF</constant>&nbsp;</entry>
2878 <entry>No filter</entry>
2879 </row>
2880 <row>
2881 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR</constant>&nbsp;</entry>
2882 <entry>One-dimensional horizontal</entry>
2883 </row>
2884 <row>
2885 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT</constant>&nbsp;</entry>
2886 <entry>One-dimensional vertical</entry>
2887 </row>
2888 <row>
2889 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE</constant>&nbsp;</entry>
2890 <entry>Two-dimensional separable</entry>
2891 </row>
2892 <row>
2893 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE</constant>&nbsp;</entry>
2894 <entry>Two-dimensional symmetrical
2895non-separable</entry>
2896 </row>
2897 </tbody>
2898 </entrytbl>
2899 </row>
2900 <row><entry></entry></row>
2901 <row id="chroma-spatial-filter-type">
2902 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE</constant>&nbsp;</entry>
2903 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type</entry>
2904 </row><row><entry spanname="descr">Select the algorithm
2905for the Chroma Spatial Filter (default <constant>1D_HOR</constant>).
2906Possible values are:</entry>
2907 </row>
2908 <row>
2909 <entrytbl spanname="descr" cols="2">
2910 <tbody valign="top">
2911 <row>
2912 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF</constant>&nbsp;</entry>
2913 <entry>No filter</entry>
2914 </row>
2915 <row>
2916 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR</constant>&nbsp;</entry>
2917 <entry>One-dimensional horizontal</entry>
2918 </row>
2919 </tbody>
2920 </entrytbl>
2921 </row>
2922 <row><entry></entry></row>
2923 <row id="v4l2-mpeg-cx2341x-video-temporal-filter-mode">
2924 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE</constant>&nbsp;</entry>
2925 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_temporal_filter_mode</entry>
2926 </row><row><entry spanname="descr">Sets the Temporal
2927Filter mode (default <constant>MANUAL</constant>). Possible values
2928are:</entry>
2929 </row>
2930 <row>
2931 <entrytbl spanname="descr" cols="2">
2932 <tbody valign="top">
2933 <row>
2934 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL</constant>&nbsp;</entry>
2935 <entry>Choose the filter manually</entry>
2936 </row>
2937 <row>
2938 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO</constant>&nbsp;</entry>
2939 <entry>Choose the filter automatically</entry>
2940 </row>
2941 </tbody>
2942 </entrytbl>
2943 </row>
2944 <row><entry></entry></row>
2945 <row>
2946 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER</constant>&nbsp;</entry>
2947 <entry>integer&nbsp;(0-31)</entry>
2948 </row><row><entry spanname="descr">The setting for the
2949Temporal Filter. 0 = off, 31 = maximum. (Default is 8 for full-scale
2950capturing and 0 for scaled capturing.)</entry>
2951 </row>
2952 <row><entry></entry></row>
2953 <row id="v4l2-mpeg-cx2341x-video-median-filter-type">
2954 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE</constant>&nbsp;</entry>
2955 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_median_filter_type</entry>
2956 </row><row><entry spanname="descr">Median Filter Type
2957(default <constant>OFF</constant>). Possible values are:</entry>
2958 </row>
2959 <row>
2960 <entrytbl spanname="descr" cols="2">
2961 <tbody valign="top">
2962 <row>
2963 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF</constant>&nbsp;</entry>
2964 <entry>No filter</entry>
2965 </row>
2966 <row>
2967 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR</constant>&nbsp;</entry>
2968 <entry>Horizontal filter</entry>
2969 </row>
2970 <row>
2971 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT</constant>&nbsp;</entry>
2972 <entry>Vertical filter</entry>
2973 </row>
2974 <row>
2975 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT</constant>&nbsp;</entry>
2976 <entry>Horizontal and vertical filter</entry>
2977 </row>
2978 <row>
2979 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG</constant>&nbsp;</entry>
2980 <entry>Diagonal filter</entry>
2981 </row>
2982 </tbody>
2983 </entrytbl>
2984 </row>
2985 <row><entry></entry></row>
2986 <row>
2987 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM</constant>&nbsp;</entry>
2988 <entry>integer&nbsp;(0-255)</entry>
2989 </row><row><entry spanname="descr">Threshold above which
2990the luminance median filter is enabled (default 0)</entry>
2991 </row>
2992 <row><entry></entry></row>
2993 <row>
2994 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP</constant>&nbsp;</entry>
2995 <entry>integer&nbsp;(0-255)</entry>
2996 </row><row><entry spanname="descr">Threshold below which
2997the luminance median filter is enabled (default 255)</entry>
2998 </row>
2999 <row><entry></entry></row>
3000 <row>
3001 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM</constant>&nbsp;</entry>
3002 <entry>integer&nbsp;(0-255)</entry>
3003 </row><row><entry spanname="descr">Threshold above which
3004the chroma median filter is enabled (default 0)</entry>
3005 </row>
3006 <row><entry></entry></row>
3007 <row>
3008 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP</constant>&nbsp;</entry>
3009 <entry>integer&nbsp;(0-255)</entry>
3010 </row><row><entry spanname="descr">Threshold below which
3011the chroma median filter is enabled (default 255)</entry>
3012 </row>
3013 <row><entry></entry></row>
3014 <row>
3015 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS</constant>&nbsp;</entry>
3016 <entry>boolean</entry>
3017 </row>
3018 <row><entry spanname="descr">The CX2341X MPEG encoder
3019can insert one empty MPEG-2 PES packet into the stream between every
3020four video frames. The packet size is 2048 bytes, including the
3021packet_start_code_prefix and stream_id fields. The stream_id is 0xBF
3022(private stream 2). The payload consists of 0x00 bytes, to be filled
3023in by the application. 0 = do not insert, 1 = insert packets.</entry>
3024 </row>
3025 </tbody>
3026 </tgroup>
3027 </table>
3028 </section>
3029 </section>
3030
3031 <section id="camera-controls">
3032 <title>Camera Control Reference</title>
3033
3034 <para>The Camera class includes controls for mechanical (or
3035equivalent digital) features of a device such as controllable lenses
3036or sensors.</para>
3037
3038 <table pgwide="1" frame="none" id="camera-control-id">
3039 <title>Camera Control IDs</title>
3040 <tgroup cols="4">
3041 <colspec colname="c1" colwidth="1*" />
3042 <colspec colname="c2" colwidth="6*" />
3043 <colspec colname="c3" colwidth="2*" />
3044 <colspec colname="c4" colwidth="6*" />
3045 <spanspec namest="c1" nameend="c2" spanname="id" />
3046 <spanspec namest="c2" nameend="c4" spanname="descr" />
3047 <thead>
3048 <row>
3049 <entry spanname="id" align="left">ID</entry>
3050 <entry align="left">Type</entry>
3051 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
3052 </row>
3053 </thead>
3054 <tbody valign="top">
3055 <row><entry></entry></row>
3056 <row>
3057 <entry spanname="id"><constant>V4L2_CID_CAMERA_CLASS</constant>&nbsp;</entry>
3058 <entry>class</entry>
3059 </row><row><entry spanname="descr">The Camera class
3060descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
3061description of this control class.</entry>
3062 </row>
3063 <row><entry></entry></row>
3064
3065 <row id="v4l2-exposure-auto-type">
3066 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_AUTO</constant>&nbsp;</entry>
3067 <entry>enum&nbsp;v4l2_exposure_auto_type</entry>
3068 </row><row><entry spanname="descr">Enables automatic
3069adjustments of the exposure time and/or iris aperture. The effect of
3070manual changes of the exposure time or iris aperture while these
3071features are enabled is undefined, drivers should ignore such
3072requests. Possible values are:</entry>
3073 </row>
3074 <row>
3075 <entrytbl spanname="descr" cols="2">
3076 <tbody valign="top">
3077 <row>
3078 <entry><constant>V4L2_EXPOSURE_AUTO</constant>&nbsp;</entry>
3079 <entry>Automatic exposure time, automatic iris
3080aperture.</entry>
3081 </row>
3082 <row>
3083 <entry><constant>V4L2_EXPOSURE_MANUAL</constant>&nbsp;</entry>
3084 <entry>Manual exposure time, manual iris.</entry>
3085 </row>
3086 <row>
3087 <entry><constant>V4L2_EXPOSURE_SHUTTER_PRIORITY</constant>&nbsp;</entry>
3088 <entry>Manual exposure time, auto iris.</entry>
3089 </row>
3090 <row>
3091 <entry><constant>V4L2_EXPOSURE_APERTURE_PRIORITY</constant>&nbsp;</entry>
3092 <entry>Auto exposure time, manual iris.</entry>
3093 </row>
3094 </tbody>
3095 </entrytbl>
3096 </row>
3097 <row><entry></entry></row>
3098
3099 <row>
3100 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_ABSOLUTE</constant>&nbsp;</entry>
3101 <entry>integer</entry>
3102 </row><row><entry spanname="descr">Determines the exposure
3103time of the camera sensor. The exposure time is limited by the frame
3104interval. Drivers should interpret the values as 100 &micro;s units,
3105where the value 1 stands for 1/10000th of a second, 10000 for 1 second
3106and 100000 for 10 seconds.</entry>
3107 </row>
3108 <row><entry></entry></row>
3109
3110 <row>
3111 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_AUTO_PRIORITY</constant>&nbsp;</entry>
3112 <entry>boolean</entry>
3113 </row><row><entry spanname="descr">When
3114<constant>V4L2_CID_EXPOSURE_AUTO</constant> is set to
3115<constant>AUTO</constant> or <constant>APERTURE_PRIORITY</constant>,
3116this control determines if the device may dynamically vary the frame
3117rate. By default this feature is disabled (0) and the frame rate must
3118remain constant.</entry>
3119 </row>
3120 <row><entry></entry></row>
3121
3122 <row>
3123 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_BIAS</constant>&nbsp;</entry>
3124 <entry>integer menu</entry>
3125 </row><row><entry spanname="descr"> Determines the automatic
3126exposure compensation, it is effective only when <constant>V4L2_CID_EXPOSURE_AUTO</constant>
3127control is set to <constant>AUTO</constant>, <constant>SHUTTER_PRIORITY </constant>
3128or <constant>APERTURE_PRIORITY</constant>.
3129It is expressed in terms of EV, drivers should interpret the values as 0.001 EV
3130units, where the value 1000 stands for +1 EV.
3131<para>Increasing the exposure compensation value is equivalent to decreasing
3132the exposure value (EV) and will increase the amount of light at the image
3133sensor. The camera performs the exposure compensation by adjusting absolute
3134exposure time and/or aperture.</para></entry>
3135 </row>
3136 <row><entry></entry></row>
3137
3138 <row id="v4l2-exposure-metering">
3139 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_METERING</constant>&nbsp;</entry>
3140 <entry>enum&nbsp;v4l2_exposure_metering</entry>
3141 </row><row><entry spanname="descr">Determines how the camera measures
3142the amount of light available for the frame exposure. Possible values are:</entry>
3143 </row>
3144 <row>
3145 <entrytbl spanname="descr" cols="2">
3146 <tbody valign="top">
3147 <row>
3148 <entry><constant>V4L2_EXPOSURE_METERING_AVERAGE</constant>&nbsp;</entry>
3149 <entry>Use the light information coming from the entire frame
3150and average giving no weighting to any particular portion of the metered area.
3151 </entry>
3152 </row>
3153 <row>
3154 <entry><constant>V4L2_EXPOSURE_METERING_CENTER_WEIGHTED</constant>&nbsp;</entry>
3155 <entry>Average the light information coming from the entire frame
3156giving priority to the center of the metered area.</entry>
3157 </row>
3158 <row>
3159 <entry><constant>V4L2_EXPOSURE_METERING_SPOT</constant>&nbsp;</entry>
3160 <entry>Measure only very small area at the center of the frame.</entry>
3161 </row>
3162 </tbody>
3163 </entrytbl>
3164 </row>
3165 <row><entry></entry></row>
3166
3167 <row>
3168 <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant>&nbsp;</entry>
3169 <entry>integer</entry>
3170 </row><row><entry spanname="descr">This control turns the
3171camera horizontally by the specified amount. The unit is undefined. A
3172positive value moves the camera to the right (clockwise when viewed
3173from above), a negative value to the left. A value of zero does not
3174cause motion. This is a write-only control.</entry>
3175 </row>
3176 <row><entry></entry></row>
3177
3178 <row>
3179 <entry spanname="id"><constant>V4L2_CID_TILT_RELATIVE</constant>&nbsp;</entry>
3180 <entry>integer</entry>
3181 </row><row><entry spanname="descr">This control turns the
3182camera vertically by the specified amount. The unit is undefined. A
3183positive value moves the camera up, a negative value down. A value of
3184zero does not cause motion. This is a write-only control.</entry>
3185 </row>
3186 <row><entry></entry></row>
3187
3188 <row>
3189 <entry spanname="id"><constant>V4L2_CID_PAN_RESET</constant>&nbsp;</entry>
3190 <entry>button</entry>
3191 </row><row><entry spanname="descr">When this control is set,
3192the camera moves horizontally to the default position.</entry>
3193 </row>
3194 <row><entry></entry></row>
3195
3196 <row>
3197 <entry spanname="id"><constant>V4L2_CID_TILT_RESET</constant>&nbsp;</entry>
3198 <entry>button</entry>
3199 </row><row><entry spanname="descr">When this control is set,
3200the camera moves vertically to the default position.</entry>
3201 </row>
3202 <row><entry></entry></row>
3203
3204 <row>
3205 <entry spanname="id"><constant>V4L2_CID_PAN_ABSOLUTE</constant>&nbsp;</entry>
3206 <entry>integer</entry>
3207 </row><row><entry spanname="descr">This control
3208turns the camera horizontally to the specified position. Positive
3209values move the camera to the right (clockwise when viewed from above),
3210negative values to the left. Drivers should interpret the values as arc
3211seconds, with valid values between -180 * 3600 and +180 * 3600
3212inclusive.</entry>
3213 </row>
3214 <row><entry></entry></row>
3215
3216 <row>
3217 <entry spanname="id"><constant>V4L2_CID_TILT_ABSOLUTE</constant>&nbsp;</entry>
3218 <entry>integer</entry>
3219 </row><row><entry spanname="descr">This control
3220turns the camera vertically to the specified position. Positive values
3221move the camera up, negative values down. Drivers should interpret the
3222values as arc seconds, with valid values between -180 * 3600 and +180
3223* 3600 inclusive.</entry>
3224 </row>
3225 <row><entry></entry></row>
3226
3227 <row>
3228 <entry spanname="id"><constant>V4L2_CID_FOCUS_ABSOLUTE</constant>&nbsp;</entry>
3229 <entry>integer</entry>
3230 </row><row><entry spanname="descr">This control sets the
3231focal point of the camera to the specified position. The unit is
3232undefined. Positive values set the focus closer to the camera,
3233negative values towards infinity.</entry>
3234 </row>
3235 <row><entry></entry></row>
3236
3237 <row>
3238 <entry spanname="id"><constant>V4L2_CID_FOCUS_RELATIVE</constant>&nbsp;</entry>
3239 <entry>integer</entry>
3240 </row><row><entry spanname="descr">This control moves the
3241focal point of the camera by the specified amount. The unit is
3242undefined. Positive values move the focus closer to the camera,
3243negative values towards infinity. This is a write-only control.</entry>
3244 </row>
3245 <row><entry></entry></row>
3246
3247 <row>
3248 <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO</constant>&nbsp;</entry>
3249 <entry>boolean</entry>
3250 </row><row><entry spanname="descr">Enables continuous automatic
3251focus adjustments. The effect of manual focus adjustments while this feature
3252is enabled is undefined, drivers should ignore such requests.</entry>
3253 </row>
3254 <row><entry></entry></row>
3255
3256 <row>
3257 <entry spanname="id"><constant>V4L2_CID_AUTO_FOCUS_START</constant>&nbsp;</entry>
3258 <entry>button</entry>
3259 </row><row><entry spanname="descr">Starts single auto focus process.
3260The effect of setting this control when <constant>V4L2_CID_FOCUS_AUTO</constant>
3261is set to <constant>TRUE</constant> (1) is undefined, drivers should ignore
3262such requests.</entry>
3263 </row>
3264 <row><entry></entry></row>
3265
3266 <row>
3267 <entry spanname="id"><constant>V4L2_CID_AUTO_FOCUS_STOP</constant>&nbsp;</entry>
3268 <entry>button</entry>
3269 </row><row><entry spanname="descr">Aborts automatic focusing
3270started with <constant>V4L2_CID_AUTO_FOCUS_START</constant> control. It is
3271effective only when the continuous autofocus is disabled, that is when
3272<constant>V4L2_CID_FOCUS_AUTO</constant> control is set to <constant>FALSE
3273</constant> (0).</entry>
3274 </row>
3275 <row><entry></entry></row>
3276
3277 <row id="v4l2-auto-focus-status">
3278 <entry spanname="id">
3279 <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant>&nbsp;</entry>
3280 <entry>bitmask</entry>
3281 </row>
3282 <row><entry spanname="descr">The automatic focus status. This is a read-only
3283 control.</entry>
3284 </row>
3285 <row>
3286 <entrytbl spanname="descr" cols="2">
3287 <tbody valign="top">
3288 <row>
3289 <entry><constant>V4L2_AUTO_FOCUS_STATUS_IDLE</constant>&nbsp;</entry>
3290 <entry>Automatic focus is not active.</entry>
3291 </row>
3292 <row>
3293 <entry><constant>V4L2_AUTO_FOCUS_STATUS_BUSY</constant>&nbsp;</entry>
3294 <entry>Automatic focusing is in progress.</entry>
3295 </row>
3296 <row>
3297 <entry><constant>V4L2_AUTO_FOCUS_STATUS_REACHED</constant>&nbsp;</entry>
3298 <entry>Focus has been reached.</entry>
3299 </row>
3300 <row>
3301 <entry><constant>V4L2_AUTO_FOCUS_STATUS_FAILED</constant>&nbsp;</entry>
3302 <entry>Automatic focus has failed, the driver will not
3303 transition from this state until another action is
3304 performed by an application.</entry>
3305 </row>
3306 </tbody>
3307 </entrytbl>
3308 </row>
3309 <row><entry spanname="descr">
3310Setting <constant>V4L2_LOCK_FOCUS</constant> lock bit of the <constant>V4L2_CID_3A_LOCK
3311</constant> control may stop updates of the <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant>
3312control value.</entry>
3313 </row>
3314 <row><entry></entry></row>
3315
3316 <row id="v4l2-auto-focus-range">
3317 <entry spanname="id">
3318 <constant>V4L2_CID_AUTO_FOCUS_RANGE</constant>&nbsp;</entry>
3319 <entry>enum&nbsp;v4l2_auto_focus_range</entry>
3320 </row>
3321 <row><entry spanname="descr">Determines auto focus distance range
3322for which lens may be adjusted. </entry>
3323 </row>
3324 <row>
3325 <entrytbl spanname="descr" cols="2">
3326 <tbody valign="top">
3327 <row>
3328 <entry><constant>V4L2_AUTO_FOCUS_RANGE_AUTO</constant>&nbsp;</entry>
3329 <entry>The camera automatically selects the focus range.</entry>
3330 </row>
3331 <row>
3332 <entry><constant>V4L2_AUTO_FOCUS_RANGE_NORMAL</constant>&nbsp;</entry>
3333 <entry>Normal distance range, limited for best automatic focus
3334performance.</entry>
3335 </row>
3336 <row>
3337 <entry><constant>V4L2_AUTO_FOCUS_RANGE_MACRO</constant>&nbsp;</entry>
3338 <entry>Macro (close-up) auto focus. The camera will
3339use its minimum possible distance for auto focus.</entry>
3340 </row>
3341 <row>
3342 <entry><constant>V4L2_AUTO_FOCUS_RANGE_INFINITY</constant>&nbsp;</entry>
3343 <entry>The lens is set to focus on an object at infinite distance.</entry>
3344 </row>
3345 </tbody>
3346 </entrytbl>
3347 </row>
3348 <row><entry></entry></row>
3349
3350 <row>
3351 <entry spanname="id"><constant>V4L2_CID_ZOOM_ABSOLUTE</constant>&nbsp;</entry>
3352 <entry>integer</entry>
3353 </row><row><entry spanname="descr">Specify the objective lens
3354focal length as an absolute value. The zoom unit is driver-specific and its
3355value should be a positive integer.</entry>
3356 </row>
3357 <row><entry></entry></row>
3358
3359 <row>
3360 <entry spanname="id"><constant>V4L2_CID_ZOOM_RELATIVE</constant>&nbsp;</entry>
3361 <entry>integer</entry>
3362 </row><row><entry spanname="descr">Specify the objective lens
3363focal length relatively to the current value. Positive values move the zoom
3364lens group towards the telephoto direction, negative values towards the
3365wide-angle direction. The zoom unit is driver-specific. This is a write-only control.</entry>
3366 </row>
3367 <row><entry></entry></row>
3368
3369 <row>
3370 <entry spanname="id"><constant>V4L2_CID_ZOOM_CONTINUOUS</constant>&nbsp;</entry>
3371 <entry>integer</entry>
3372 </row><row><entry spanname="descr">Move the objective lens group
3373at the specified speed until it reaches physical device limits or until an
3374explicit request to stop the movement. A positive value moves the zoom lens
3375group towards the telephoto direction. A value of zero stops the zoom lens
3376group movement. A negative value moves the zoom lens group towards the
3377wide-angle direction. The zoom speed unit is driver-specific.</entry>
3378 </row>
3379 <row><entry></entry></row>
3380
3381 <row>
3382 <entry spanname="id"><constant>V4L2_CID_IRIS_ABSOLUTE</constant>&nbsp;</entry>
3383 <entry>integer</entry>
3384 </row><row><entry spanname="descr">This control sets the
3385camera's aperture to the specified value. The unit is undefined.
3386Larger values open the iris wider, smaller values close it.</entry>
3387 </row>
3388 <row><entry></entry></row>
3389
3390 <row>
3391 <entry spanname="id"><constant>V4L2_CID_IRIS_RELATIVE</constant>&nbsp;</entry>
3392 <entry>integer</entry>
3393 </row><row><entry spanname="descr">This control modifies the
3394camera's aperture by the specified amount. The unit is undefined.
3395Positive values open the iris one step further, negative values close
3396it one step further. This is a write-only control.</entry>
3397 </row>
3398 <row><entry></entry></row>
3399
3400 <row>
3401 <entry spanname="id"><constant>V4L2_CID_PRIVACY</constant>&nbsp;</entry>
3402 <entry>boolean</entry>
3403 </row><row><entry spanname="descr">Prevent video from being acquired
3404by the camera. When this control is set to <constant>TRUE</constant> (1), no
3405image can be captured by the camera. Common means to enforce privacy are
3406mechanical obturation of the sensor and firmware image processing, but the
3407device is not restricted to these methods. Devices that implement the privacy
3408control must support read access and may support write access.</entry>
3409 </row>
3410
3411 <row>
3412 <entry spanname="id"><constant>V4L2_CID_BAND_STOP_FILTER</constant>&nbsp;</entry>
3413 <entry>integer</entry>
3414 </row><row><entry spanname="descr">Switch the band-stop filter of a
3415camera sensor on or off, or specify its strength. Such band-stop filters can
3416be used, for example, to filter out the fluorescent light component.</entry>
3417 </row>
3418 <row><entry></entry></row>
3419
3420 <row id="v4l2-auto-n-preset-white-balance">
3421 <entry spanname="id"><constant>V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE</constant>&nbsp;</entry>
3422 <entry>enum&nbsp;v4l2_auto_n_preset_white_balance</entry>
3423 </row><row><entry spanname="descr">Sets white balance to automatic,
3424manual or a preset. The presets determine color temperature of the light as
3425a hint to the camera for white balance adjustments resulting in most accurate
3426color representation. The following white balance presets are listed in order
3427of increasing color temperature.</entry>
3428 </row>
3429 <row>
3430 <entrytbl spanname="descr" cols="2">
3431 <tbody valign="top">
3432 <row>
3433 <entry><constant>V4L2_WHITE_BALANCE_MANUAL</constant>&nbsp;</entry>
3434 <entry>Manual white balance.</entry>
3435 </row>
3436 <row>
3437 <entry><constant>V4L2_WHITE_BALANCE_AUTO</constant>&nbsp;</entry>
3438 <entry>Automatic white balance adjustments.</entry>
3439 </row>
3440 <row>
3441 <entry><constant>V4L2_WHITE_BALANCE_INCANDESCENT</constant>&nbsp;</entry>
3442 <entry>White balance setting for incandescent (tungsten) lighting.
3443It generally cools down the colors and corresponds approximately to 2500...3500 K
3444color temperature range.</entry>
3445 </row>
3446 <row>
3447 <entry><constant>V4L2_WHITE_BALANCE_FLUORESCENT</constant>&nbsp;</entry>
3448 <entry>White balance preset for fluorescent lighting.
3449It corresponds approximately to 4000...5000 K color temperature.</entry>
3450 </row>
3451 <row>
3452 <entry><constant>V4L2_WHITE_BALANCE_FLUORESCENT_H</constant>&nbsp;</entry>
3453 <entry>With this setting the camera will compensate for
3454fluorescent H lighting.</entry>
3455 </row>
3456 <row>
3457 <entry><constant>V4L2_WHITE_BALANCE_HORIZON</constant>&nbsp;</entry>
3458 <entry>White balance setting for horizon daylight.
3459It corresponds approximately to 5000 K color temperature.</entry>
3460 </row>
3461 <row>
3462 <entry><constant>V4L2_WHITE_BALANCE_DAYLIGHT</constant>&nbsp;</entry>
3463 <entry>White balance preset for daylight (with clear sky).
3464It corresponds approximately to 5000...6500 K color temperature.</entry>
3465 </row>
3466 <row>
3467 <entry><constant>V4L2_WHITE_BALANCE_FLASH</constant>&nbsp;</entry>
3468 <entry>With this setting the camera will compensate for the flash
3469light. It slightly warms up the colors and corresponds roughly to 5000...5500 K
3470color temperature.</entry>
3471 </row>
3472 <row>
3473 <entry><constant>V4L2_WHITE_BALANCE_CLOUDY</constant>&nbsp;</entry>
3474 <entry>White balance preset for moderately overcast sky.
3475This option corresponds approximately to 6500...8000 K color temperature
3476range.</entry>
3477 </row>
3478 <row>
3479 <entry><constant>V4L2_WHITE_BALANCE_SHADE</constant>&nbsp;</entry>
3480 <entry>White balance preset for shade or heavily overcast
3481sky. It corresponds approximately to 9000...10000 K color temperature.
3482</entry>
3483 </row>
3484 </tbody>
3485 </entrytbl>
3486 </row>
3487 <row><entry></entry></row>
3488
3489 <row id="v4l2-wide-dynamic-range">
3490 <entry spanname="id"><constant>V4L2_CID_WIDE_DYNAMIC_RANGE</constant></entry>
3491 <entry>boolean</entry>
3492 </row>
3493 <row>
3494 <entry spanname="descr">Enables or disables the camera's wide dynamic
3495range feature. This feature allows to obtain clear images in situations where
3496intensity of the illumination varies significantly throughout the scene, i.e.
3497there are simultaneously very dark and very bright areas. It is most commonly
3498realized in cameras by combining two subsequent frames with different exposure
3499times. <footnote id="ctypeconv"><para> This control may be changed to a menu
3500control in the future, if more options are required.</para></footnote></entry>
3501 </row>
3502 <row><entry></entry></row>
3503
3504 <row id="v4l2-image-stabilization">
3505 <entry spanname="id"><constant>V4L2_CID_IMAGE_STABILIZATION</constant></entry>
3506 <entry>boolean</entry>
3507 </row>
3508 <row>
3509 <entry spanname="descr">Enables or disables image stabilization.
3510 <footnoteref linkend="ctypeconv"/></entry>
3511 </row>
3512 <row><entry></entry></row>
3513
3514 <row>
3515 <entry spanname="id"><constant>V4L2_CID_ISO_SENSITIVITY</constant>&nbsp;</entry>
3516 <entry>integer menu</entry>
3517 </row><row><entry spanname="descr">Determines ISO equivalent of an
3518image sensor indicating the sensor's sensitivity to light. The numbers are
3519expressed in arithmetic scale, as per <xref linkend="iso12232" /> standard,
3520where doubling the sensor sensitivity is represented by doubling the numerical
3521ISO value. Applications should interpret the values as standard ISO values
3522multiplied by 1000, e.g. control value 800 stands for ISO 0.8. Drivers will
3523usually support only a subset of standard ISO values. The effect of setting
3524this control while the <constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>
3525control is set to a value other than <constant>V4L2_CID_ISO_SENSITIVITY_MANUAL
3526</constant> is undefined, drivers should ignore such requests.</entry>
3527 </row>
3528 <row><entry></entry></row>
3529
3530 <row id="v4l2-iso-sensitivity-auto-type">
3531 <entry spanname="id"><constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>&nbsp;</entry>
3532 <entry>enum&nbsp;v4l2_iso_sensitivity_type</entry>
3533 </row><row><entry spanname="descr">Enables or disables automatic ISO
3534sensitivity adjustments.</entry>
3535 </row>
3536 <row>
3537 <entrytbl spanname="descr" cols="2">
3538 <tbody valign="top">
3539 <row>
3540 <entry><constant>V4L2_CID_ISO_SENSITIVITY_MANUAL</constant>&nbsp;</entry>
3541 <entry>Manual ISO sensitivity.</entry>
3542 </row>
3543 <row>
3544 <entry><constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>&nbsp;</entry>
3545 <entry>Automatic ISO sensitivity adjustments.</entry>
3546 </row>
3547 </tbody>
3548 </entrytbl>
3549 </row>
3550 <row><entry></entry></row>
3551
3552 <row id="v4l2-scene-mode">
3553 <entry spanname="id"><constant>V4L2_CID_SCENE_MODE</constant>&nbsp;</entry>
3554 <entry>enum&nbsp;v4l2_scene_mode</entry>
3555 </row><row><entry spanname="descr">This control allows to select
3556scene programs as the camera automatic modes optimized for common shooting
3557scenes. Within these modes the camera determines best exposure, aperture,
3558focusing, light metering, white balance and equivalent sensitivity. The
3559controls of those parameters are influenced by the scene mode control.
3560An exact behavior in each mode is subject to the camera specification.
3561
3562<para>When the scene mode feature is not used, this control should be set to
3563<constant>V4L2_SCENE_MODE_NONE</constant> to make sure the other possibly
3564related controls are accessible. The following scene programs are defined:
3565</para>
3566</entry>
3567 </row>
3568 <row>
3569 <entrytbl spanname="descr" cols="2">
3570 <tbody valign="top">
3571 <row>
3572 <entry><constant>V4L2_SCENE_MODE_NONE</constant>&nbsp;</entry>
3573 <entry>The scene mode feature is disabled.</entry>
3574 </row>
3575 <row>
3576 <entry><constant>V4L2_SCENE_MODE_BACKLIGHT</constant>&nbsp;</entry>
3577 <entry>Backlight. Compensates for dark shadows when light is
3578 coming from behind a subject, also by automatically turning
3579 on the flash.</entry>
3580 </row>
3581 <row>
3582 <entry><constant>V4L2_SCENE_MODE_BEACH_SNOW</constant>&nbsp;</entry>
3583 <entry>Beach and snow. This mode compensates for all-white or
3584bright scenes, which tend to look gray and low contrast, when camera's automatic
3585exposure is based on an average scene brightness. To compensate, this mode
3586automatically slightly overexposes the frames. The white balance may also be
3587adjusted to compensate for the fact that reflected snow looks bluish rather
3588than white.</entry>
3589 </row>
3590 <row>
3591 <entry><constant>V4L2_SCENE_MODE_CANDLELIGHT</constant>&nbsp;</entry>
3592 <entry>Candle light. The camera generally raises the ISO
3593sensitivity and lowers the shutter speed. This mode compensates for relatively
3594close subject in the scene. The flash is disabled in order to preserve the
3595ambiance of the light.</entry>
3596 </row>
3597 <row>
3598 <entry><constant>V4L2_SCENE_MODE_DAWN_DUSK</constant>&nbsp;</entry>
3599 <entry>Dawn and dusk. Preserves the colors seen in low
3600natural light before dusk and after down. The camera may turn off the flash,
3601and automatically focus at infinity. It will usually boost saturation and
3602lower the shutter speed.</entry>
3603 </row>
3604 <row>
3605 <entry><constant>V4L2_SCENE_MODE_FALL_COLORS</constant>&nbsp;</entry>
3606 <entry>Fall colors. Increases saturation and adjusts white
3607balance for color enhancement. Pictures of autumn leaves get saturated reds
3608and yellows.</entry>
3609 </row>
3610 <row>
3611 <entry><constant>V4L2_SCENE_MODE_FIREWORKS</constant>&nbsp;</entry>
3612 <entry>Fireworks. Long exposure times are used to capture
3613the expanding burst of light from a firework. The camera may invoke image
3614stabilization.</entry>
3615 </row>
3616 <row>
3617 <entry><constant>V4L2_SCENE_MODE_LANDSCAPE</constant>&nbsp;</entry>
3618 <entry>Landscape. The camera may choose a small aperture to
3619provide deep depth of field and long exposure duration to help capture detail
3620in dim light conditions. The focus is fixed at infinity. Suitable for distant
3621and wide scenery.</entry>
3622 </row>
3623 <row>
3624 <entry><constant>V4L2_SCENE_MODE_NIGHT</constant>&nbsp;</entry>
3625 <entry>Night, also known as Night Landscape. Designed for low
3626light conditions, it preserves detail in the dark areas without blowing out bright
3627objects. The camera generally sets itself to a medium-to-high ISO sensitivity,
3628with a relatively long exposure time, and turns flash off. As such, there will be
3629increased image noise and the possibility of blurred image.</entry>
3630 </row>
3631 <row>
3632 <entry><constant>V4L2_SCENE_MODE_PARTY_INDOOR</constant>&nbsp;</entry>
3633 <entry>Party and indoor. Designed to capture indoor scenes
3634that are lit by indoor background lighting as well as the flash. The camera
3635usually increases ISO sensitivity, and adjusts exposure for the low light
3636conditions.</entry>
3637 </row>
3638 <row>
3639 <entry><constant>V4L2_SCENE_MODE_PORTRAIT</constant>&nbsp;</entry>
3640 <entry>Portrait. The camera adjusts the aperture so that the
3641depth of field is reduced, which helps to isolate the subject against a smooth
3642background. Most cameras recognize the presence of faces in the scene and focus
3643on them. The color hue is adjusted to enhance skin tones. The intensity of the
3644flash is often reduced.</entry>
3645 </row>
3646 <row>
3647 <entry><constant>V4L2_SCENE_MODE_SPORTS</constant>&nbsp;</entry>
3648 <entry>Sports. Significantly increases ISO and uses a fast
3649shutter speed to freeze motion of rapidly-moving subjects. Increased image
3650noise may be seen in this mode.</entry>
3651 </row>
3652 <row>
3653 <entry><constant>V4L2_SCENE_MODE_SUNSET</constant>&nbsp;</entry>
3654 <entry>Sunset. Preserves deep hues seen in sunsets and
3655sunrises. It bumps up the saturation.</entry>
3656 </row>
3657 <row>
3658 <entry><constant>V4L2_SCENE_MODE_TEXT</constant>&nbsp;</entry>
3659 <entry>Text. It applies extra contrast and sharpness, it is
3660typically a black-and-white mode optimized for readability. Automatic focus
3661may be switched to close-up mode and this setting may also involve some
3662lens-distortion correction.</entry>
3663 </row>
3664 </tbody>
3665 </entrytbl>
3666 </row>
3667 <row><entry></entry></row>
3668
3669 <row>
3670 <entry spanname="id"><constant>V4L2_CID_3A_LOCK</constant></entry>
3671 <entry>bitmask</entry>
3672 </row>
3673 <row>
3674 <entry spanname="descr">This control locks or unlocks the automatic
3675focus, exposure and white balance. The automatic adjustments can be paused
3676independently by setting the corresponding lock bit to 1. The camera then retains
3677the settings until the lock bit is cleared. The following lock bits are defined:
3678</entry>
3679 </row>
3680 <row>
3681 <entrytbl spanname="descr" cols="2">
3682 <tbody valign="top">
3683 <row>
3684 <entry><constant>V4L2_LOCK_EXPOSURE</constant></entry>
3685 <entry>Automatic exposure adjustments lock.</entry>
3686 </row>
3687 <row>
3688 <entry><constant>V4L2_LOCK_WHITE_BALANCE</constant></entry>
3689 <entry>Automatic white balance adjustments lock.</entry>
3690 </row>
3691 <row>
3692 <entry><constant>V4L2_LOCK_FOCUS</constant></entry>
3693 <entry>Automatic focus lock.</entry>
3694 </row>
3695 </tbody>
3696 </entrytbl>
3697 </row>
3698 <row><entry spanname="descr">
3699When a given algorithm is not enabled, drivers should ignore requests
3700to lock it and should return no error. An example might be an application
3701setting bit <constant>V4L2_LOCK_WHITE_BALANCE</constant> when the
3702<constant>V4L2_CID_AUTO_WHITE_BALANCE</constant> control is set to
3703<constant>FALSE</constant>. The value of this control may be changed
3704by exposure, white balance or focus controls.</entry>
3705 </row>
3706 <row><entry></entry></row>
3707
3708 </tbody>
3709 </tgroup>
3710 </table>
3711 </section>
3712
3713 <section id="fm-tx-controls">
3714 <title>FM Transmitter Control Reference</title>
3715
3716 <para>The FM Transmitter (FM_TX) class includes controls for common features of
3717FM transmissions capable devices. Currently this class includes parameters for audio
3718compression, pilot tone generation, audio deviation limiter, RDS transmission and
3719tuning power features.</para>
3720
3721 <table pgwide="1" frame="none" id="fm-tx-control-id">
3722 <title>FM_TX Control IDs</title>
3723
3724 <tgroup cols="4">
3725 <colspec colname="c1" colwidth="1*" />
3726 <colspec colname="c2" colwidth="6*" />
3727 <colspec colname="c3" colwidth="2*" />
3728 <colspec colname="c4" colwidth="6*" />
3729 <spanspec namest="c1" nameend="c2" spanname="id" />
3730 <spanspec namest="c2" nameend="c4" spanname="descr" />
3731 <thead>
3732 <row>
3733 <entry spanname="id" align="left">ID</entry>
3734 <entry align="left">Type</entry>
3735 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
3736 </row>
3737 </thead>
3738 <tbody valign="top">
3739 <row><entry></entry></row>
3740 <row>
3741 <entry spanname="id"><constant>V4L2_CID_FM_TX_CLASS</constant>&nbsp;</entry>
3742 <entry>class</entry>
3743 </row><row><entry spanname="descr">The FM_TX class
3744descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
3745description of this control class.</entry>
3746 </row>
3747 <row>
3748 <entry spanname="id"><constant>V4L2_CID_RDS_TX_DEVIATION</constant>&nbsp;</entry>
3749 <entry>integer</entry>
3750 </row>
3751 <row><entry spanname="descr">Configures RDS signal frequency deviation level in Hz.
3752The range and step are driver-specific.</entry>
3753 </row>
3754 <row>
3755 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PI</constant>&nbsp;</entry>
3756 <entry>integer</entry>
3757 </row>
3758 <row><entry spanname="descr">Sets the RDS Programme Identification field
3759for transmission.</entry>
3760 </row>
3761 <row>
3762 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PTY</constant>&nbsp;</entry>
3763 <entry>integer</entry>
3764 </row>
3765 <row><entry spanname="descr">Sets the RDS Programme Type field for transmission.
3766This encodes up to 31 pre-defined programme types.</entry>
3767 </row>
3768 <row>
3769 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PS_NAME</constant>&nbsp;</entry>
3770 <entry>string</entry>
3771 </row>
3772 <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission.
3773It is intended for static display on a receiver. It is the primary aid to listeners in programme service
3774identification and selection. In Annex E of <xref linkend="iec62106" />, the RDS specification,
3775there is a full description of the correct character encoding for Programme Service name strings.
3776Also from RDS specification, PS is usually a single eight character text. However, it is also possible
3777to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured
3778with steps of 8 characters. The result is it must always contain a string with size multiple of 8.</entry>
3779 </row>
3780 <row>
3781 <entry spanname="id"><constant>V4L2_CID_RDS_TX_RADIO_TEXT</constant>&nbsp;</entry>
3782 <entry>string</entry>
3783 </row>
3784 <row><entry spanname="descr">Sets the Radio Text info for transmission. It is a textual description of
3785what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names,
3786programme-related information or any other text. In these cases, RadioText should be used in addition to
3787<constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described
3788in Annex E of <xref linkend="iec62106" />. The length of Radio Text strings depends on which RDS Block is being
3789used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible
3790to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured
3791with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry>
3792 </row>
3793 <row>
3794 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_ENABLED</constant>&nbsp;</entry>
3795 <entry>boolean</entry>
3796 </row>
3797 <row><entry spanname="descr">Enables or disables the audio deviation limiter feature.
3798The limiter is useful when trying to maximize the audio volume, minimize receiver-generated
3799distortion and prevent overmodulation.
3800</entry>
3801 </row>
3802 <row>
3803 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_RELEASE_TIME</constant>&nbsp;</entry>
3804 <entry>integer</entry>
3805 </row>
3806 <row><entry spanname="descr">Sets the audio deviation limiter feature release time.
3807Unit is in useconds. Step and range are driver-specific.</entry>
3808 </row>
3809 <row>
3810 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_DEVIATION</constant>&nbsp;</entry>
3811 <entry>integer</entry>
3812 </row>
3813 <row><entry spanname="descr">Configures audio frequency deviation level in Hz.
3814The range and step are driver-specific.</entry>
3815 </row>
3816 <row>
3817 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_ENABLED</constant>&nbsp;</entry>
3818 <entry>boolean</entry>
3819 </row>
3820 <row><entry spanname="descr">Enables or disables the audio compression feature.
3821This feature amplifies signals below the threshold by a fixed gain and compresses audio
3822signals above the threshold by the ratio of Threshold/(Gain + Threshold).</entry>
3823 </row>
3824 <row>
3825 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_GAIN</constant>&nbsp;</entry>
3826 <entry>integer</entry>
3827 </row>
3828 <row><entry spanname="descr">Sets the gain for audio compression feature. It is
3829a dB value. The range and step are driver-specific.</entry>
3830 </row>
3831 <row>
3832 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_THRESHOLD</constant>&nbsp;</entry>
3833 <entry>integer</entry>
3834 </row>
3835 <row><entry spanname="descr">Sets the threshold level for audio compression freature.
3836It is a dB value. The range and step are driver-specific.</entry>
3837 </row>
3838 <row>
3839 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME</constant>&nbsp;</entry>
3840 <entry>integer</entry>
3841 </row>
3842 <row><entry spanname="descr">Sets the attack time for audio compression feature.
3843It is a useconds value. The range and step are driver-specific.</entry>
3844 </row>
3845 <row>
3846 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME</constant>&nbsp;</entry>
3847 <entry>integer</entry>
3848 </row>
3849 <row><entry spanname="descr">Sets the release time for audio compression feature.
3850It is a useconds value. The range and step are driver-specific.</entry>
3851 </row>
3852 <row>
3853 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_ENABLED</constant>&nbsp;</entry>
3854 <entry>boolean</entry>
3855 </row>
3856 <row><entry spanname="descr">Enables or disables the pilot tone generation feature.</entry>
3857 </row>
3858 <row>
3859 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_DEVIATION</constant>&nbsp;</entry>
3860 <entry>integer</entry>
3861 </row>
3862 <row><entry spanname="descr">Configures pilot tone frequency deviation level. Unit is
3863in Hz. The range and step are driver-specific.</entry>
3864 </row>
3865 <row>
3866 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_FREQUENCY</constant>&nbsp;</entry>
3867 <entry>integer</entry>
3868 </row>
3869 <row><entry spanname="descr">Configures pilot tone frequency value. Unit is
3870in Hz. The range and step are driver-specific.</entry>
3871 </row>
3872 <row>
3873 <entry spanname="id"><constant>V4L2_CID_TUNE_PREEMPHASIS</constant>&nbsp;</entry>
3874 <entry>integer</entry>
3875 </row>
3876 <row id="v4l2-preemphasis"><entry spanname="descr">Configures the pre-emphasis value for broadcasting.
3877A pre-emphasis filter is applied to the broadcast to accentuate the high audio frequencies.
3878Depending on the region, a time constant of either 50 or 75 useconds is used. The enum&nbsp;v4l2_preemphasis
3879defines possible values for pre-emphasis. Here they are:</entry>
3880 </row><row>
3881 <entrytbl spanname="descr" cols="2">
3882 <tbody valign="top">
3883 <row>
3884 <entry><constant>V4L2_PREEMPHASIS_DISABLED</constant>&nbsp;</entry>
3885 <entry>No pre-emphasis is applied.</entry>
3886 </row>
3887 <row>
3888 <entry><constant>V4L2_PREEMPHASIS_50_uS</constant>&nbsp;</entry>
3889 <entry>A pre-emphasis of 50 uS is used.</entry>
3890 </row>
3891 <row>
3892 <entry><constant>V4L2_PREEMPHASIS_75_uS</constant>&nbsp;</entry>
3893 <entry>A pre-emphasis of 75 uS is used.</entry>
3894 </row>
3895 </tbody>
3896 </entrytbl>
3897
3898 </row>
3899 <row>
3900 <entry spanname="id"><constant>V4L2_CID_TUNE_POWER_LEVEL</constant>&nbsp;</entry>
3901 <entry>integer</entry>
3902 </row>
3903 <row><entry spanname="descr">Sets the output power level for signal transmission.
3904Unit is in dBuV. Range and step are driver-specific.</entry>
3905 </row>
3906 <row>
3907 <entry spanname="id"><constant>V4L2_CID_TUNE_ANTENNA_CAPACITOR</constant>&nbsp;</entry>
3908 <entry>integer</entry>
3909 </row>
3910 <row><entry spanname="descr">This selects the value of antenna tuning capacitor
3911manually or automatically if set to zero. Unit, range and step are driver-specific.</entry>
3912 </row>
3913 <row><entry></entry></row>
3914 </tbody>
3915 </tgroup>
3916 </table>
3917
3918<para>For more details about RDS specification, refer to
3919<xref linkend="iec62106" /> document, from CENELEC.</para>
3920 </section>
3921
3922 <section id="flash-controls">
3923 <title>Flash Control Reference</title>
3924
3925 <note>
3926 <title>Experimental</title>
3927
3928 <para>This is an <link linkend="experimental">experimental</link>
3929interface and may change in the future.</para>
3930 </note>
3931
3932 <para>
3933 The V4L2 flash controls are intended to provide generic access
3934 to flash controller devices. Flash controller devices are
3935 typically used in digital cameras.
3936 </para>
3937
3938 <para>
3939 The interface can support both LED and xenon flash devices. As
3940 of writing this, there is no xenon flash driver using this
3941 interface.
3942 </para>
3943
3944 <section id="flash-controls-use-cases">
3945 <title>Supported use cases</title>
3946
3947 <section>
3948 <title>Unsynchronised LED flash (software strobe)</title>
3949
3950 <para>
3951 Unsynchronised LED flash is controlled directly by the
3952 host as the sensor. The flash must be enabled by the host
3953 before the exposure of the image starts and disabled once
3954 it ends. The host is fully responsible for the timing of
3955 the flash.
3956 </para>
3957
3958 <para>Example of such device: Nokia N900.</para>
3959 </section>
3960
3961 <section>
3962 <title>Synchronised LED flash (hardware strobe)</title>
3963
3964 <para>
3965 The synchronised LED flash is pre-programmed by the host
3966 (power and timeout) but controlled by the sensor through a
3967 strobe signal from the sensor to the flash.
3968 </para>
3969
3970 <para>
3971 The sensor controls the flash duration and timing. This
3972 information typically must be made available to the
3973 sensor.
3974 </para>
3975
3976 </section>
3977
3978 <section>
3979 <title>LED flash as torch</title>
3980
3981 <para>
3982 LED flash may be used as torch in conjunction with another
3983 use case involving camera or individually.
3984 </para>
3985
3986
3987 <table pgwide="1" frame="none" id="flash-control-id">
3988 <title>Flash Control IDs</title>
3989
3990 <tgroup cols="4">
3991 <colspec colname="c1" colwidth="1*" />
3992 <colspec colname="c2" colwidth="6*" />
3993 <colspec colname="c3" colwidth="2*" />
3994 <colspec colname="c4" colwidth="6*" />
3995 <spanspec namest="c1" nameend="c2" spanname="id" />
3996 <spanspec namest="c2" nameend="c4" spanname="descr" />
3997 <thead>
3998 <row>
3999 <entry spanname="id" align="left">ID</entry>
4000 <entry align="left">Type</entry>
4001 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4002 </row>
4003 </thead>
4004 <tbody valign="top">
4005 <row><entry></entry></row>
4006 <row>
4007 <entry spanname="id"><constant>V4L2_CID_FLASH_CLASS</constant></entry>
4008 <entry>class</entry>
4009 </row>
4010 <row>
4011 <entry spanname="descr">The FLASH class descriptor.</entry>
4012 </row>
4013 <row>
4014 <entry spanname="id"><constant>V4L2_CID_FLASH_LED_MODE</constant></entry>
4015 <entry>menu</entry>
4016 </row>
4017 <row id="v4l2-flash-led-mode">
4018 <entry spanname="descr">Defines the mode of the flash LED,
4019 the high-power white LED attached to the flash controller.
4020 Setting this control may not be possible in presence of
4021 some faults. See V4L2_CID_FLASH_FAULT.</entry>
4022 </row>
4023 <row>
4024 <entrytbl spanname="descr" cols="2">
4025 <tbody valign="top">
4026 <row>
4027 <entry><constant>V4L2_FLASH_LED_MODE_NONE</constant></entry>
4028 <entry>Off.</entry>
4029 </row>
4030 <row>
4031 <entry><constant>V4L2_FLASH_LED_MODE_FLASH</constant></entry>
4032 <entry>Flash mode.</entry>
4033 </row>
4034 <row>
4035 <entry><constant>V4L2_FLASH_LED_MODE_TORCH</constant></entry>
4036 <entry>Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.</entry>
4037 </row>
4038 </tbody>
4039 </entrytbl>
4040 </row>
4041 <row>
4042 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_SOURCE</constant></entry>
4043 <entry>menu</entry>
4044 </row>
4045 <row id="v4l2-flash-strobe-source"><entry
4046 spanname="descr">Defines the source of the flash LED
4047 strobe.</entry>
4048 </row>
4049 <row>
4050 <entrytbl spanname="descr" cols="2">
4051 <tbody valign="top">
4052 <row>
4053 <entry><constant>V4L2_FLASH_STROBE_SOURCE_SOFTWARE</constant></entry>
4054 <entry>The flash strobe is triggered by using
4055 the V4L2_CID_FLASH_STROBE control.</entry>
4056 </row>
4057 <row>
4058 <entry><constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL</constant></entry>
4059 <entry>The flash strobe is triggered by an
4060 external source. Typically this is a sensor,
4061 which makes it possible to synchronises the
4062 flash strobe start to exposure start.</entry>
4063 </row>
4064 </tbody>
4065 </entrytbl>
4066 </row>
4067 <row>
4068 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE</constant></entry>
4069 <entry>button</entry>
4070 </row>
4071 <row>
4072 <entry spanname="descr">Strobe flash. Valid when
4073 V4L2_CID_FLASH_LED_MODE is set to
4074 V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
4075 is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
4076 control may not be possible in presence of some faults.
4077 See V4L2_CID_FLASH_FAULT.</entry>
4078 </row>
4079 <row>
4080 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STOP</constant></entry>
4081 <entry>button</entry>
4082 </row>
4083 <row><entry spanname="descr">Stop flash strobe immediately.</entry>
4084 </row>
4085 <row>
4086 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STATUS</constant></entry>
4087 <entry>boolean</entry>
4088 </row>
4089 <row>
4090 <entry spanname="descr">Strobe status: whether the flash
4091 is strobing at the moment or not. This is a read-only
4092 control.</entry>
4093 </row>
4094 <row>
4095 <entry spanname="id"><constant>V4L2_CID_FLASH_TIMEOUT</constant></entry>
4096 <entry>integer</entry>
4097 </row>
4098 <row>
4099 <entry spanname="descr">Hardware timeout for flash. The
4100 flash strobe is stopped after this period of time has
4101 passed from the start of the strobe.</entry>
4102 </row>
4103 <row>
4104 <entry spanname="id"><constant>V4L2_CID_FLASH_INTENSITY</constant></entry>
4105 <entry>integer</entry>
4106 </row>
4107 <row>
4108 <entry spanname="descr">Intensity of the flash strobe when
4109 the flash LED is in flash mode
4110 (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps
4111 (mA) if possible.</entry>
4112 </row>
4113 <row>
4114 <entry spanname="id"><constant>V4L2_CID_FLASH_TORCH_INTENSITY</constant></entry>
4115 <entry>integer</entry>
4116 </row>
4117 <row>
4118 <entry spanname="descr">Intensity of the flash LED in
4119 torch mode (V4L2_FLASH_LED_MODE_TORCH). The unit should be
4120 milliamps (mA) if possible. Setting this control may not
4121 be possible in presence of some faults. See
4122 V4L2_CID_FLASH_FAULT.</entry>
4123 </row>
4124 <row>
4125 <entry spanname="id"><constant>V4L2_CID_FLASH_INDICATOR_INTENSITY</constant></entry>
4126 <entry>integer</entry>
4127 </row>
4128 <row>
4129 <entry spanname="descr">Intensity of the indicator LED.
4130 The indicator LED may be fully independent of the flash
4131 LED. The unit should be microamps (uA) if possible.</entry>
4132 </row>
4133 <row>
4134 <entry spanname="id"><constant>V4L2_CID_FLASH_FAULT</constant></entry>
4135 <entry>bitmask</entry>
4136 </row>
4137 <row>
4138 <entry spanname="descr">Faults related to the flash. The
4139 faults tell about specific problems in the flash chip
4140 itself or the LEDs attached to it. Faults may prevent
4141 further use of some of the flash controls. In particular,
4142 V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
4143 if the fault affects the flash LED. Exactly which faults
4144 have such an effect is chip dependent. Reading the faults
4145 resets the control and returns the chip to a usable state
4146 if possible.</entry>
4147 </row>
4148 <row>
4149 <entrytbl spanname="descr" cols="2">
4150 <tbody valign="top">
4151 <row>
4152 <entry><constant>V4L2_FLASH_FAULT_OVER_VOLTAGE</constant></entry>
4153 <entry>Flash controller voltage to the flash LED
4154 has exceeded the limit specific to the flash
4155 controller.</entry>
4156 </row>
4157 <row>
4158 <entry><constant>V4L2_FLASH_FAULT_TIMEOUT</constant></entry>
4159 <entry>The flash strobe was still on when
4160 the timeout set by the user ---
4161 V4L2_CID_FLASH_TIMEOUT control --- has expired.
4162 Not all flash controllers may set this in all
4163 such conditions.</entry>
4164 </row>
4165 <row>
4166 <entry><constant>V4L2_FLASH_FAULT_OVER_TEMPERATURE</constant></entry>
4167 <entry>The flash controller has overheated.</entry>
4168 </row>
4169 <row>
4170 <entry><constant>V4L2_FLASH_FAULT_SHORT_CIRCUIT</constant></entry>
4171 <entry>The short circuit protection of the flash
4172 controller has been triggered.</entry>
4173 </row>
4174 <row>
4175 <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry>
4176 <entry>Current in the LED power supply has exceeded the limit
4177 specific to the flash controller.</entry>
4178 </row>
4179 <row>
4180 <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry>
4181 <entry>The flash controller has detected a short or open
4182 circuit condition on the indicator LED.</entry>
4183 </row>
4184 </tbody>
4185 </entrytbl>
4186 </row>
4187 <row>
4188 <entry spanname="id"><constant>V4L2_CID_FLASH_CHARGE</constant></entry>
4189 <entry>boolean</entry>
4190 </row>
4191 <row><entry spanname="descr">Enable or disable charging of the xenon
4192 flash capacitor.</entry>
4193 </row>
4194 <row>
4195 <entry spanname="id"><constant>V4L2_CID_FLASH_READY</constant></entry>
4196 <entry>boolean</entry>
4197 </row>
4198 <row>
4199 <entry spanname="descr">Is the flash ready to strobe?
4200 Xenon flashes require their capacitors charged before
4201 strobing. LED flashes often require a cooldown period
4202 after strobe during which another strobe will not be
4203 possible. This is a read-only control.</entry>
4204 </row>
4205 <row><entry></entry></row>
4206 </tbody>
4207 </tgroup>
4208 </table>
4209 </section>
4210 </section>
4211 </section>
4212
4213 <section id="jpeg-controls">
4214 <title>JPEG Control Reference</title>
4215 <para>The JPEG class includes controls for common features of JPEG
4216 encoders and decoders. Currently it includes features for codecs
4217 implementing progressive baseline DCT compression process with
4218 Huffman entrophy coding.</para>
4219 <table pgwide="1" frame="none" id="jpeg-control-id">
4220 <title>JPEG Control IDs</title>
4221
4222 <tgroup cols="4">
4223 <colspec colname="c1" colwidth="1*" />
4224 <colspec colname="c2" colwidth="6*" />
4225 <colspec colname="c3" colwidth="2*" />
4226 <colspec colname="c4" colwidth="6*" />
4227 <spanspec namest="c1" nameend="c2" spanname="id" />
4228 <spanspec namest="c2" nameend="c4" spanname="descr" />
4229 <thead>
4230 <row>
4231 <entry spanname="id" align="left">ID</entry>
4232 <entry align="left">Type</entry>
4233 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4234 </row>
4235 </thead>
4236 <tbody valign="top">
4237 <row><entry></entry></row>
4238 <row>
4239 <entry spanname="id"><constant>V4L2_CID_JPEG_CLASS</constant>&nbsp;</entry>
4240 <entry>class</entry>
4241 </row><row><entry spanname="descr">The JPEG class descriptor. Calling
4242 &VIDIOC-QUERYCTRL; for this control will return a description of this
4243 control class.
4244
4245 </entry>
4246 </row>
4247 <row>
4248 <entry spanname="id"><constant>V4L2_CID_JPEG_CHROMA_SUBSAMPLING</constant></entry>
4249 <entry>menu</entry>
4250 </row>
4251 <row id="v4l2-jpeg-chroma-subsampling">
4252 <entry spanname="descr">The chroma subsampling factors describe how
4253 each component of an input image is sampled, in respect to maximum
4254 sample rate in each spatial dimension. See <xref linkend="itu-t81"/>,
4255 clause A.1.1. for more details. The <constant>
4256 V4L2_CID_JPEG_CHROMA_SUBSAMPLING</constant> control determines how
4257 Cb and Cr components are downsampled after coverting an input image
4258 from RGB to Y'CbCr color space.
4259 </entry>
4260 </row>
4261 <row>
4262 <entrytbl spanname="descr" cols="2">
4263 <tbody valign="top">
4264 <row>
4265 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_444</constant>
4266 </entry><entry>No chroma subsampling, each pixel has
4267 Y, Cr and Cb values.</entry>
4268 </row>
4269 <row>
4270 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_422</constant>
4271 </entry><entry>Horizontally subsample Cr, Cb components
4272 by a factor of 2.</entry>
4273 </row>
4274 <row>
4275 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_420</constant>
4276 </entry><entry>Subsample Cr, Cb components horizontally
4277 and vertically by 2.</entry>
4278 </row>
4279 <row>
4280 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_411</constant>
4281 </entry><entry>Horizontally subsample Cr, Cb components
4282 by a factor of 4.</entry>
4283 </row>
4284 <row>
4285 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_410</constant>
4286 </entry><entry>Subsample Cr, Cb components horizontally
4287 by 4 and vertically by 2.</entry>
4288 </row>
4289 <row>
4290 <entry><constant>V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY</constant>
4291 </entry><entry>Use only luminance component.</entry>
4292 </row>
4293 </tbody>
4294 </entrytbl>
4295 </row>
4296 <row>
4297 <entry spanname="id"><constant>V4L2_CID_JPEG_RESTART_INTERVAL</constant>
4298 </entry><entry>integer</entry>
4299 </row>
4300 <row><entry spanname="descr">
4301 The restart interval determines an interval of inserting RSTm
4302 markers (m = 0..7). The purpose of these markers is to additionally
4303 reinitialize the encoder process, in order to process blocks of
4304 an image independently.
4305 For the lossy compression processes the restart interval unit is
4306 MCU (Minimum Coded Unit) and its value is contained in DRI
4307 (Define Restart Interval) marker. If <constant>
4308 V4L2_CID_JPEG_RESTART_INTERVAL</constant> control is set to 0,
4309 DRI and RSTm markers will not be inserted.
4310 </entry>
4311 </row>
4312 <row id="jpeg-quality-control">
4313 <entry spanname="id"><constant>V4L2_CID_JPEG_COMPRESSION_QUALITY</constant></entry>
4314 <entry>integer</entry>
4315 </row>
4316 <row>
4317 <entry spanname="descr">
4318 <constant>V4L2_CID_JPEG_COMPRESSION_QUALITY</constant> control
4319 determines trade-off between image quality and size.
4320 It provides simpler method for applications to control image quality,
4321 without a need for direct reconfiguration of luminance and chrominance
4322 quantization tables.
4323
4324 In cases where a driver uses quantization tables configured directly
4325 by an application, using interfaces defined elsewhere, <constant>
4326 V4L2_CID_JPEG_COMPRESSION_QUALITY</constant> control should be set
4327 by driver to 0.
4328
4329 <para>The value range of this control is driver-specific. Only
4330 positive, non-zero values are meaningful. The recommended range
4331 is 1 - 100, where larger values correspond to better image quality.
4332 </para>
4333 </entry>
4334 </row>
4335 <row id="jpeg-active-marker-control">
4336 <entry spanname="id"><constant>V4L2_CID_JPEG_ACTIVE_MARKER</constant></entry>
4337 <entry>bitmask</entry>
4338 </row>
4339 <row>
4340 <entry spanname="descr">Specify which JPEG markers are included
4341 in compressed stream. This control is valid only for encoders.
4342 </entry>
4343 </row>
4344 <row>
4345 <entrytbl spanname="descr" cols="2">
4346 <tbody valign="top">
4347 <row>
4348 <entry><constant>V4L2_JPEG_ACTIVE_MARKER_APP0</constant></entry>
4349 <entry>Application data segment APP<subscript>0</subscript>.</entry>
4350 </row><row>
4351 <entry><constant>V4L2_JPEG_ACTIVE_MARKER_APP1</constant></entry>
4352 <entry>Application data segment APP<subscript>1</subscript>.</entry>
4353 </row><row>
4354 <entry><constant>V4L2_JPEG_ACTIVE_MARKER_COM</constant></entry>
4355 <entry>Comment segment.</entry>
4356 </row><row>
4357 <entry><constant>V4L2_JPEG_ACTIVE_MARKER_DQT</constant></entry>
4358 <entry>Quantization tables segment.</entry>
4359 </row><row>
4360 <entry><constant>V4L2_JPEG_ACTIVE_MARKER_DHT</constant></entry>
4361 <entry>Huffman tables segment.</entry>
4362 </row>
4363 </tbody>
4364 </entrytbl>
4365 </row>
4366 <row><entry></entry></row>
4367 </tbody>
4368 </tgroup>
4369 </table>
4370 <para>For more details about JPEG specification, refer
4371 to <xref linkend="itu-t81"/>, <xref linkend="jfif"/>,
4372 <xref linkend="w3c-jpeg-jfif"/>.</para>
4373 </section>
4374
4375 <section id="image-source-controls">
4376 <title>Image Source Control Reference</title>
4377
4378 <note>
4379 <title>Experimental</title>
4380
4381 <para>This is an <link
4382 linkend="experimental">experimental</link> interface and may
4383 change in the future.</para>
4384 </note>
4385
4386 <para>
4387 The Image Source control class is intended for low-level
4388 control of image source devices such as image sensors. The
4389 devices feature an analogue to digital converter and a bus
4390 transmitter to transmit the image data out of the device.
4391 </para>
4392
4393 <table pgwide="1" frame="none" id="image-source-control-id">
4394 <title>Image Source Control IDs</title>
4395
4396 <tgroup cols="4">
4397 <colspec colname="c1" colwidth="1*" />
4398 <colspec colname="c2" colwidth="6*" />
4399 <colspec colname="c3" colwidth="2*" />
4400 <colspec colname="c4" colwidth="6*" />
4401 <spanspec namest="c1" nameend="c2" spanname="id" />
4402 <spanspec namest="c2" nameend="c4" spanname="descr" />
4403 <thead>
4404 <row>
4405 <entry spanname="id" align="left">ID</entry>
4406 <entry align="left">Type</entry>
4407 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4408 </row>
4409 </thead>
4410 <tbody valign="top">
4411 <row><entry></entry></row>
4412 <row>
4413 <entry spanname="id"><constant>V4L2_CID_IMAGE_SOURCE_CLASS</constant></entry>
4414 <entry>class</entry>
4415 </row>
4416 <row>
4417 <entry spanname="descr">The IMAGE_SOURCE class descriptor.</entry>
4418 </row>
4419 <row>
4420 <entry spanname="id"><constant>V4L2_CID_VBLANK</constant></entry>
4421 <entry>integer</entry>
4422 </row>
4423 <row>
4424 <entry spanname="descr">Vertical blanking. The idle period
4425 after every frame during which no image data is produced.
4426 The unit of vertical blanking is a line. Every line has
4427 length of the image width plus horizontal blanking at the
4428 pixel rate defined by
4429 <constant>V4L2_CID_PIXEL_RATE</constant> control in the
4430 same sub-device.</entry>
4431 </row>
4432 <row>
4433 <entry spanname="id"><constant>V4L2_CID_HBLANK</constant></entry>
4434 <entry>integer</entry>
4435 </row>
4436 <row>
4437 <entry spanname="descr">Horizontal blanking. The idle
4438 period after every line of image data during which no
4439 image data is produced. The unit of horizontal blanking is
4440 pixels.</entry>
4441 </row>
4442 <row>
4443 <entry spanname="id"><constant>V4L2_CID_ANALOGUE_GAIN</constant></entry>
4444 <entry>integer</entry>
4445 </row>
4446 <row>
4447 <entry spanname="descr">Analogue gain is gain affecting
4448 all colour components in the pixel matrix. The gain
4449 operation is performed in the analogue domain before A/D
4450 conversion.
4451 </entry>
4452 </row>
4453 <row><entry></entry></row>
4454 </tbody>
4455 </tgroup>
4456 </table>
4457
4458 </section>
4459
4460 <section id="image-process-controls">
4461 <title>Image Process Control Reference</title>
4462
4463 <note>
4464 <title>Experimental</title>
4465
4466 <para>This is an <link
4467 linkend="experimental">experimental</link> interface and may
4468 change in the future.</para>
4469 </note>
4470
4471 <para>
4472 The Image Source control class is intended for low-level control of
4473 image processing functions. Unlike
4474 <constant>V4L2_CID_IMAGE_SOURCE_CLASS</constant>, the controls in
4475 this class affect processing the image, and do not control capturing
4476 of it.
4477 </para>
4478
4479 <table pgwide="1" frame="none" id="image-process-control-id">
4480 <title>Image Source Control IDs</title>
4481
4482 <tgroup cols="4">
4483 <colspec colname="c1" colwidth="1*" />
4484 <colspec colname="c2" colwidth="6*" />
4485 <colspec colname="c3" colwidth="2*" />
4486 <colspec colname="c4" colwidth="6*" />
4487 <spanspec namest="c1" nameend="c2" spanname="id" />
4488 <spanspec namest="c2" nameend="c4" spanname="descr" />
4489 <thead>
4490 <row>
4491 <entry spanname="id" align="left">ID</entry>
4492 <entry align="left">Type</entry>
4493 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4494 </row>
4495 </thead>
4496 <tbody valign="top">
4497 <row><entry></entry></row>
4498 <row>
4499 <entry spanname="id"><constant>V4L2_CID_IMAGE_PROC_CLASS</constant></entry>
4500 <entry>class</entry>
4501 </row>
4502 <row>
4503 <entry spanname="descr">The IMAGE_PROC class descriptor.</entry>
4504 </row>
4505 <row>
4506 <entry spanname="id"><constant>V4L2_CID_LINK_FREQ</constant></entry>
4507 <entry>integer menu</entry>
4508 </row>
4509 <row>
4510 <entry spanname="descr">Data bus frequency. Together with the
4511 media bus pixel code, bus type (clock cycles per sample), the
4512 data bus frequency defines the pixel rate
4513 (<constant>V4L2_CID_PIXEL_RATE</constant>) in the
4514 pixel array (or possibly elsewhere, if the device is not an
4515 image sensor). The frame rate can be calculated from the pixel
4516 clock, image width and height and horizontal and vertical
4517 blanking. While the pixel rate control may be defined elsewhere
4518 than in the subdev containing the pixel array, the frame rate
4519 cannot be obtained from that information. This is because only
4520 on the pixel array it can be assumed that the vertical and
4521 horizontal blanking information is exact: no other blanking is
4522 allowed in the pixel array. The selection of frame rate is
4523 performed by selecting the desired horizontal and vertical
4524 blanking. The unit of this control is Hz. </entry>
4525 </row>
4526 <row>
4527 <entry spanname="id"><constant>V4L2_CID_PIXEL_RATE</constant></entry>
4528 <entry>64-bit integer</entry>
4529 </row>
4530 <row>
4531 <entry spanname="descr">Pixel rate in the source pads of
4532 the subdev. This control is read-only and its unit is
4533 pixels / second.
4534 </entry>
4535 </row>
4536 <row>
4537 <entry spanname="id"><constant>V4L2_CID_TEST_PATTERN</constant></entry>
4538 <entry>menu</entry>
4539 </row>
4540 <row id="v4l2-test-pattern">
4541 <entry spanname="descr"> Some capture/display/sensor devices have
4542 the capability to generate test pattern images. These hardware
4543 specific test patterns can be used to test if a device is working
4544 properly.</entry>
4545 </row>
4546 <row><entry></entry></row>
4547 </tbody>
4548 </tgroup>
4549 </table>
4550
4551 </section>
4552
4553 <section id="dv-controls">
4554 <title>Digital Video Control Reference</title>
4555
4556 <note>
4557 <title>Experimental</title>
4558
4559 <para>This is an <link
4560 linkend="experimental">experimental</link> interface and may
4561 change in the future.</para>
4562 </note>
4563
4564 <para>
4565 The Digital Video control class is intended to control receivers
4566 and transmitters for <ulink url="http://en.wikipedia.org/wiki/Vga">VGA</ulink>,
4567 <ulink url="http://en.wikipedia.org/wiki/Digital_Visual_Interface">DVI</ulink>
4568 (Digital Visual Interface), HDMI (<xref linkend="hdmi" />) and DisplayPort (<xref linkend="dp" />).
4569 These controls are generally expected to be private to the receiver or transmitter
4570 subdevice that implements them, so they are only exposed on the
4571 <filename>/dev/v4l-subdev*</filename> device node.
4572 </para>
4573
4574 <para>Note that these devices can have multiple input or output pads which are
4575 hooked up to e.g. HDMI connectors. Even though the subdevice will receive or
4576 transmit video from/to only one of those pads, the other pads can still be
4577 active when it comes to EDID (Extended Display Identification Data,
4578 <xref linkend="vesaedid" />) and HDCP (High-bandwidth Digital Content
4579 Protection System, <xref linkend="hdcp" />) processing, allowing the device
4580 to do the fairly slow EDID/HDCP handling in advance. This allows for quick
4581 switching between connectors.</para>
4582
4583 <para>These pads appear in several of the controls in this section as
4584 bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad 1,
4585 etc. The maximum value of the control is the set of valid pads.</para>
4586
4587 <table pgwide="1" frame="none" id="dv-control-id">
4588 <title>Digital Video Control IDs</title>
4589
4590 <tgroup cols="4">
4591 <colspec colname="c1" colwidth="1*" />
4592 <colspec colname="c2" colwidth="6*" />
4593 <colspec colname="c3" colwidth="2*" />
4594 <colspec colname="c4" colwidth="6*" />
4595 <spanspec namest="c1" nameend="c2" spanname="id" />
4596 <spanspec namest="c2" nameend="c4" spanname="descr" />
4597 <thead>
4598 <row>
4599 <entry spanname="id" align="left">ID</entry>
4600 <entry align="left">Type</entry>
4601 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4602 </row>
4603 </thead>
4604 <tbody valign="top">
4605 <row><entry></entry></row>
4606 <row>
4607 <entry spanname="id"><constant>V4L2_CID_DV_CLASS</constant></entry>
4608 <entry>class</entry>
4609 </row>
4610 <row>
4611 <entry spanname="descr">The Digital Video class descriptor.</entry>
4612 </row>
4613 <row>
4614 <entry spanname="id"><constant>V4L2_CID_DV_TX_HOTPLUG</constant></entry>
4615 <entry>bitmask</entry>
4616 </row>
4617 <row>
4618 <entry spanname="descr">Many connectors have a hotplug pin which is high
4619 if EDID information is available from the source. This control shows the
4620 state of the hotplug pin as seen by the transmitter.
4621 Each bit corresponds to an output pad on the transmitter. If an output pad
4622 does not have an associated hotplug pin, then the bit for that pad will be 0.
4623 This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors.
4624 </entry>
4625 </row>
4626 <row>
4627 <entry spanname="id"><constant>V4L2_CID_DV_TX_RXSENSE</constant></entry>
4628 <entry>bitmask</entry>
4629 </row>
4630 <row>
4631 <entry spanname="descr">Rx Sense is the detection of pull-ups on the TMDS
4632 clock lines. This normally means that the sink has left/entered standby (i.e.
4633 the transmitter can sense that the receiver is ready to receive video).
4634 Each bit corresponds to an output pad on the transmitter. If an output pad
4635 does not have an associated Rx Sense, then the bit for that pad will be 0.
4636 This read-only control is applicable to DVI-D and HDMI devices.
4637 </entry>
4638 </row>
4639 <row>
4640 <entry spanname="id"><constant>V4L2_CID_DV_TX_EDID_PRESENT</constant></entry>
4641 <entry>bitmask</entry>
4642 </row>
4643 <row>
4644 <entry spanname="descr">When the transmitter sees the hotplug signal from the
4645 receiver it will attempt to read the EDID. If set, then the transmitter has read
4646 at least the first block (= 128 bytes).
4647 Each bit corresponds to an output pad on the transmitter. If an output pad
4648 does not support EDIDs, then the bit for that pad will be 0.
4649 This read-only control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4650 </entry>
4651 </row>
4652 <row>
4653 <entry spanname="id"><constant>V4L2_CID_DV_TX_MODE</constant></entry>
4654 <entry id="v4l2-dv-tx-mode">enum v4l2_dv_tx_mode</entry>
4655 </row>
4656 <row>
4657 <entry spanname="descr">HDMI transmitters can transmit in DVI-D mode (just video)
4658 or in HDMI mode (video + audio + auxiliary data). This control selects which mode
4659 to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
4660 This control is applicable to HDMI connectors.
4661 </entry>
4662 </row>
4663 <row>
4664 <entry spanname="id"><constant>V4L2_CID_DV_TX_RGB_RANGE</constant></entry>
4665 <entry id="v4l2-dv-rgb-range">enum v4l2_dv_rgb_range</entry>
4666 </row>
4667 <row>
4668 <entry spanname="descr">Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
4669 follows the RGB quantization range specified in the standard for the video interface
4670 (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard
4671 to be compatible with sinks that have not implemented the standard correctly
4672 (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be
4673 used whereas limited range sets the range to (16 &lt;&lt; (N-8)) - (235 &lt;&lt; (N-8))
4674 where N is the number of bits per component.
4675 This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4676 </entry>
4677 </row>
4678 <row>
4679 <entry spanname="id"><constant>V4L2_CID_DV_RX_POWER_PRESENT</constant></entry>
4680 <entry>bitmask</entry>
4681 </row>
4682 <row>
4683 <entry spanname="descr">Detects whether the receiver receives power from the source
4684 (e.g. HDMI carries 5V on one of the pins). This is often used to power an eeprom
4685 which contains EDID information, such that the source can read the EDID even if
4686 the sink is in standby/power off.
4687 Each bit corresponds to an input pad on the transmitter. If an input pad
4688 cannot detect whether power is present, then the bit for that pad will be 0.
4689 This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors.
4690 </entry>
4691 </row>
4692 <row>
4693 <entry spanname="id"><constant>V4L2_CID_DV_RX_RGB_RANGE</constant></entry>
4694 <entry>enum v4l2_dv_rgb_range</entry>
4695 </row>
4696 <row>
4697 <entry spanname="descr">Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
4698 follows the RGB quantization range specified in the standard for the video interface
4699 (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard
4700 to be compatible with sources that have not implemented the standard correctly
4701 (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be
4702 used whereas limited range sets the range to (16 &lt;&lt; (N-8)) - (235 &lt;&lt; (N-8))
4703 where N is the number of bits per component.
4704 This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4705 </entry>
4706 </row>
4707 <row><entry></entry></row>
4708 </tbody>
4709 </tgroup>
4710 </table>
4711
4712 </section>
4713</section>
diff --git a/Documentation/DocBook/media/v4l/crop.pdf b/Documentation/DocBook/media/v4l/crop.pdf
new file mode 100644
index 00000000000..c9fb81cd32f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/crop.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/dev-capture.xml b/Documentation/DocBook/media/v4l/dev-capture.xml
new file mode 100644
index 00000000000..e1c5f9406d6
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-capture.xml
@@ -0,0 +1,110 @@
1 <title>Video Capture Interface</title>
2
3 <para>Video capture devices sample an analog video signal and store
4the digitized images in memory. Today nearly all devices can capture
5at full 25 or 30 frames/second. With this interface applications can
6control the capture process and move images from the driver into user
7space.</para>
8
9 <para>Conventionally V4L2 video capture devices are accessed through
10character device special files named <filename>/dev/video</filename>
11and <filename>/dev/video0</filename> to
12<filename>/dev/video63</filename> with major number 81 and minor
13numbers 0 to 63. <filename>/dev/video</filename> is typically a
14symbolic link to the preferred video device. Note the same device
15files are used for video output devices.</para>
16
17 <section>
18 <title>Querying Capabilities</title>
19
20 <para>Devices supporting the video capture interface set the
21<constant>V4L2_CAP_VIDEO_CAPTURE</constant> or
22<constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant> flag in the
23<structfield>capabilities</structfield> field of &v4l2-capability;
24returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions
25they may also support the <link linkend="overlay">video overlay</link>
26(<constant>V4L2_CAP_VIDEO_OVERLAY</constant>) and the <link
27linkend="raw-vbi">raw VBI capture</link>
28(<constant>V4L2_CAP_VBI_CAPTURE</constant>) interface. At least one of
29the read/write or streaming I/O methods must be supported. Tuners and
30audio inputs are optional.</para>
31 </section>
32
33 <section>
34 <title>Supplemental Functions</title>
35
36 <para>Video capture devices shall support <link
37linkend="audio">audio input</link>, <link
38linkend="tuner">tuner</link>, <link linkend="control">controls</link>,
39<link linkend="crop">cropping and scaling</link> and <link
40linkend="streaming-par">streaming parameter</link> ioctls as needed.
41The <link linkend="video">video input</link> and <link
42linkend="standard">video standard</link> ioctls must be supported by
43all video capture devices.</para>
44 </section>
45
46 <section>
47 <title>Image Format Negotiation</title>
48
49 <para>The result of a capture operation is determined by
50cropping and image format parameters. The former select an area of the
51video picture to capture, the latter how images are stored in memory,
52&ie; in RGB or YUV format, the number of bits per pixel or width and
53height. Together they also define how images are scaled in the
54process.</para>
55
56 <para>As usual these parameters are <emphasis>not</emphasis> reset
57at &func-open; time to permit Unix tool chains, programming a device
58and then reading from it as if it was a plain file. Well written V4L2
59applications ensure they really get what they want, including cropping
60and scaling.</para>
61
62 <para>Cropping initialization at minimum requires to reset the
63parameters to defaults. An example is given in <xref
64linkend="crop" />.</para>
65
66 <para>To query the current image format applications set the
67<structfield>type</structfield> field of a &v4l2-format; to
68<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> or
69<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant> and call the
70&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill
71the &v4l2-pix-format; <structfield>pix</structfield> or the
72&v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member of the
73<structfield>fmt</structfield> union.</para>
74
75 <para>To request different parameters applications set the
76<structfield>type</structfield> field of a &v4l2-format; as above and
77initialize all fields of the &v4l2-pix-format;
78<structfield>vbi</structfield> member of the
79<structfield>fmt</structfield> union, or better just modify the
80results of <constant>VIDIOC_G_FMT</constant>, and call the
81&VIDIOC-S-FMT; ioctl with a pointer to this structure. Drivers may
82adjust the parameters and finally return the actual parameters as
83<constant>VIDIOC_G_FMT</constant> does.</para>
84
85 <para>Like <constant>VIDIOC_S_FMT</constant> the
86&VIDIOC-TRY-FMT; ioctl can be used to learn about hardware limitations
87without disabling I/O or possibly time consuming hardware
88preparations.</para>
89
90 <para>The contents of &v4l2-pix-format; and &v4l2-pix-format-mplane;
91are discussed in <xref linkend="pixfmt" />. See also the specification of the
92<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant>
93and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video
94capture devices must implement both the
95<constant>VIDIOC_G_FMT</constant> and
96<constant>VIDIOC_S_FMT</constant> ioctl, even if
97<constant>VIDIOC_S_FMT</constant> ignores all requests and always
98returns default parameters as <constant>VIDIOC_G_FMT</constant> does.
99<constant>VIDIOC_TRY_FMT</constant> is optional.</para>
100 </section>
101
102 <section>
103 <title>Reading Images</title>
104
105 <para>A video capture device may support the <link
106linkend="rw">read() function</link> and/or streaming (<link
107linkend="mmap">memory mapping</link> or <link
108linkend="userp">user pointer</link>) I/O. See <xref
109linkend="io" /> for details.</para>
110 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-codec.xml b/Documentation/DocBook/media/v4l/dev-codec.xml
new file mode 100644
index 00000000000..dca0ecd54dc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-codec.xml
@@ -0,0 +1,18 @@
1 <title>Codec Interface</title>
2
3 <note>
4 <title>Suspended</title>
5
6 <para>This interface has been be suspended from the V4L2 API
7implemented in Linux 2.6 until we have more experience with codec
8device interfaces.</para>
9 </note>
10
11 <para>A V4L2 codec can compress, decompress, transform, or otherwise
12convert video data from one format into another format, in memory.
13Applications send data to be converted to the driver through a
14&func-write; call, and receive the converted data through a
15&func-read; call. For efficiency a driver may also support streaming
16I/O.</para>
17
18 <para>[to do]</para>
diff --git a/Documentation/DocBook/media/v4l/dev-effect.xml b/Documentation/DocBook/media/v4l/dev-effect.xml
new file mode 100644
index 00000000000..2350a67c071
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-effect.xml
@@ -0,0 +1,17 @@
1 <title>Effect Devices Interface</title>
2
3 <note>
4 <title>Suspended</title>
5
6 <para>This interface has been be suspended from the V4L2 API
7implemented in Linux 2.6 until we have more experience with effect
8device interfaces.</para>
9 </note>
10
11 <para>A V4L2 video effect device can do image effects, filtering, or
12combine two or more images or image streams. For example video
13transitions or wipes. Applications send data to be processed and
14receive the result data either with &func-read; and &func-write;
15functions, or through the streaming I/O mechanism.</para>
16
17 <para>[to do]</para>
diff --git a/Documentation/DocBook/media/v4l/dev-event.xml b/Documentation/DocBook/media/v4l/dev-event.xml
new file mode 100644
index 00000000000..19f4becfae3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-event.xml
@@ -0,0 +1,43 @@
1 <title>Event Interface</title>
2
3 <para>The V4L2 event interface provides a means for a user to get
4 immediately notified on certain conditions taking place on a device.
5 This might include start of frame or loss of signal events, for
6 example. Changes in the value or state of a V4L2 control can also be
7 reported through events.
8 </para>
9
10 <para>To receive events, the events the user is interested in first must
11 be subscribed using the &VIDIOC-SUBSCRIBE-EVENT; ioctl. Once an event is
12 subscribed, the events of subscribed types are dequeueable using the
13 &VIDIOC-DQEVENT; ioctl. Events may be unsubscribed using
14 VIDIOC_UNSUBSCRIBE_EVENT ioctl. The special event type V4L2_EVENT_ALL may
15 be used to unsubscribe all the events the driver supports.</para>
16
17 <para>The event subscriptions and event queues are specific to file
18 handles. Subscribing an event on one file handle does not affect
19 other file handles.</para>
20
21 <para>The information on dequeueable events is obtained by using select or
22 poll system calls on video devices. The V4L2 events use POLLPRI events on
23 poll system call and exceptions on select system call.</para>
24
25 <para>Starting with kernel 3.1 certain guarantees can be given with
26 regards to events:<orderedlist>
27 <listitem>
28 <para>Each subscribed event has its own internal dedicated event queue.
29This means that flooding of one event type will not interfere with other
30event types.</para>
31 </listitem>
32 <listitem>
33 <para>If the internal event queue for a particular subscribed event
34becomes full, then the oldest event in that queue will be dropped.</para>
35 </listitem>
36 <listitem>
37 <para>Where applicable, certain event types can ensure that the payload
38of the oldest event that is about to be dropped will be merged with the payload
39of the next oldest event. Thus ensuring that no information is lost, but only an
40intermediate step leading up to that information. See the documentation for the
41event you want to subscribe to whether this is applicable for that event or not.</para>
42 </listitem>
43 </orderedlist></para>
diff --git a/Documentation/DocBook/media/v4l/dev-osd.xml b/Documentation/DocBook/media/v4l/dev-osd.xml
new file mode 100644
index 00000000000..dd91d6134e8
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-osd.xml
@@ -0,0 +1,149 @@
1 <title>Video Output Overlay Interface</title>
2 <subtitle>Also known as On-Screen Display (OSD)</subtitle>
3
4 <para>Some video output devices can overlay a framebuffer image onto
5the outgoing video signal. Applications can set up such an overlay
6using this interface, which borrows structures and ioctls of the <link
7linkend="overlay">Video Overlay</link> interface.</para>
8
9 <para>The OSD function is accessible through the same character
10special file as the <link linkend="capture">Video Output</link> function.
11Note the default function of such a <filename>/dev/video</filename> device
12is video capturing or output. The OSD function is only available after
13calling the &VIDIOC-S-FMT; ioctl.</para>
14
15 <section>
16 <title>Querying Capabilities</title>
17
18 <para>Devices supporting the <wordasword>Video Output
19Overlay</wordasword> interface set the
20<constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant> flag in the
21<structfield>capabilities</structfield> field of &v4l2-capability;
22returned by the &VIDIOC-QUERYCAP; ioctl.</para>
23 </section>
24
25 <section>
26 <title>Framebuffer</title>
27
28 <para>Contrary to the <wordasword>Video Overlay</wordasword>
29interface the framebuffer is normally implemented on the TV card and
30not the graphics card. On Linux it is accessible as a framebuffer
31device (<filename>/dev/fbN</filename>). Given a V4L2 device,
32applications can find the corresponding framebuffer device by calling
33the &VIDIOC-G-FBUF; ioctl. It returns, amongst other information, the
34physical address of the framebuffer in the
35<structfield>base</structfield> field of &v4l2-framebuffer;. The
36framebuffer device ioctl <constant>FBIOGET_FSCREENINFO</constant>
37returns the same address in the <structfield>smem_start</structfield>
38field of struct <structname>fb_fix_screeninfo</structname>. The
39<constant>FBIOGET_FSCREENINFO</constant> ioctl and struct
40<structname>fb_fix_screeninfo</structname> are defined in the
41<filename>linux/fb.h</filename> header file.</para>
42
43 <para>The width and height of the framebuffer depends on the
44current video standard. A V4L2 driver may reject attempts to change
45the video standard (or any other ioctl which would imply a framebuffer
46size change) with an &EBUSY; until all applications closed the
47framebuffer device.</para>
48
49 <example>
50 <title>Finding a framebuffer device for OSD</title>
51
52 <programlisting>
53#include &lt;linux/fb.h&gt;
54
55&v4l2-framebuffer; fbuf;
56unsigned int i;
57int fb_fd;
58
59if (-1 == ioctl (fd, VIDIOC_G_FBUF, &amp;fbuf)) {
60 perror ("VIDIOC_G_FBUF");
61 exit (EXIT_FAILURE);
62}
63
64for (i = 0; i &gt; 30; ++i) {
65 char dev_name[16];
66 struct fb_fix_screeninfo si;
67
68 snprintf (dev_name, sizeof (dev_name), "/dev/fb%u", i);
69
70 fb_fd = open (dev_name, O_RDWR);
71 if (-1 == fb_fd) {
72 switch (errno) {
73 case ENOENT: /* no such file */
74 case ENXIO: /* no driver */
75 continue;
76
77 default:
78 perror ("open");
79 exit (EXIT_FAILURE);
80 }
81 }
82
83 if (0 == ioctl (fb_fd, FBIOGET_FSCREENINFO, &amp;si)) {
84 if (si.smem_start == (unsigned long) fbuf.base)
85 break;
86 } else {
87 /* Apparently not a framebuffer device. */
88 }
89
90 close (fb_fd);
91 fb_fd = -1;
92}
93
94/* fb_fd is the file descriptor of the framebuffer device
95 for the video output overlay, or -1 if no device was found. */
96</programlisting>
97 </example>
98 </section>
99
100 <section>
101 <title>Overlay Window and Scaling</title>
102
103 <para>The overlay is controlled by source and target rectangles.
104The source rectangle selects a subsection of the framebuffer image to
105be overlaid, the target rectangle an area in the outgoing video signal
106where the image will appear. Drivers may or may not support scaling,
107and arbitrary sizes and positions of these rectangles. Further drivers
108may support any (or none) of the clipping/blending methods defined for
109the <link linkend="overlay">Video Overlay</link> interface.</para>
110
111 <para>A &v4l2-window; defines the size of the source rectangle,
112its position in the framebuffer and the clipping/blending method to be
113used for the overlay. To get the current parameters applications set
114the <structfield>type</structfield> field of a &v4l2-format; to
115<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant> and call the
116&VIDIOC-G-FMT; ioctl. The driver fills the
117<structname>v4l2_window</structname> substructure named
118<structfield>win</structfield>. It is not possible to retrieve a
119previously programmed clipping list or bitmap.</para>
120
121 <para>To program the source rectangle applications set the
122<structfield>type</structfield> field of a &v4l2-format; to
123<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant>, initialize
124the <structfield>win</structfield> substructure and call the
125&VIDIOC-S-FMT; ioctl. The driver adjusts the parameters against
126hardware limits and returns the actual parameters as
127<constant>VIDIOC_G_FMT</constant> does. Like
128<constant>VIDIOC_S_FMT</constant>, the &VIDIOC-TRY-FMT; ioctl can be
129used to learn about driver capabilities without actually changing
130driver state. Unlike <constant>VIDIOC_S_FMT</constant> this also works
131after the overlay has been enabled.</para>
132
133 <para>A &v4l2-crop; defines the size and position of the target
134rectangle. The scaling factor of the overlay is implied by the width
135and height given in &v4l2-window; and &v4l2-crop;. The cropping API
136applies to <wordasword>Video Output</wordasword> and <wordasword>Video
137Output Overlay</wordasword> devices in the same way as to
138<wordasword>Video Capture</wordasword> and <wordasword>Video
139Overlay</wordasword> devices, merely reversing the direction of the
140data flow. For more information see <xref linkend="crop" />.</para>
141 </section>
142
143 <section>
144 <title>Enabling Overlay</title>
145
146 <para>There is no V4L2 ioctl to enable or disable the overlay,
147however the framebuffer interface of the driver may support the
148<constant>FBIOBLANK</constant> ioctl.</para>
149 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-output.xml b/Documentation/DocBook/media/v4l/dev-output.xml
new file mode 100644
index 00000000000..9130a3dc788
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-output.xml
@@ -0,0 +1,106 @@
1 <title>Video Output Interface</title>
2
3 <para>Video output devices encode stills or image sequences as
4analog video signal. With this interface applications can
5control the encoding process and move images from user space to
6the driver.</para>
7
8 <para>Conventionally V4L2 video output devices are accessed through
9character device special files named <filename>/dev/video</filename>
10and <filename>/dev/video0</filename> to
11<filename>/dev/video63</filename> with major number 81 and minor
12numbers 0 to 63. <filename>/dev/video</filename> is typically a
13symbolic link to the preferred video device. Note the same device
14files are used for video capture devices.</para>
15
16 <section>
17 <title>Querying Capabilities</title>
18
19 <para>Devices supporting the video output interface set the
20<constant>V4L2_CAP_VIDEO_OUTPUT</constant> or
21<constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant> flag in the
22<structfield>capabilities</structfield> field of &v4l2-capability;
23returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions
24they may also support the <link linkend="raw-vbi">raw VBI
25output</link> (<constant>V4L2_CAP_VBI_OUTPUT</constant>) interface. At
26least one of the read/write or streaming I/O methods must be
27supported. Modulators and audio outputs are optional.</para>
28 </section>
29
30 <section>
31 <title>Supplemental Functions</title>
32
33 <para>Video output devices shall support <link
34linkend="audio">audio output</link>, <link
35linkend="tuner">modulator</link>, <link linkend="control">controls</link>,
36<link linkend="crop">cropping and scaling</link> and <link
37linkend="streaming-par">streaming parameter</link> ioctls as needed.
38The <link linkend="video">video output</link> and <link
39linkend="standard">video standard</link> ioctls must be supported by
40all video output devices.</para>
41 </section>
42
43 <section>
44 <title>Image Format Negotiation</title>
45
46 <para>The output is determined by cropping and image format
47parameters. The former select an area of the video picture where the
48image will appear, the latter how images are stored in memory, &ie; in
49RGB or YUV format, the number of bits per pixel or width and height.
50Together they also define how images are scaled in the process.</para>
51
52 <para>As usual these parameters are <emphasis>not</emphasis> reset
53at &func-open; time to permit Unix tool chains, programming a device
54and then writing to it as if it was a plain file. Well written V4L2
55applications ensure they really get what they want, including cropping
56and scaling.</para>
57
58 <para>Cropping initialization at minimum requires to reset the
59parameters to defaults. An example is given in <xref
60linkend="crop" />.</para>
61
62 <para>To query the current image format applications set the
63<structfield>type</structfield> field of a &v4l2-format; to
64<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> or
65<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and call the
66&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill
67the &v4l2-pix-format; <structfield>pix</structfield> or the
68&v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member of the
69<structfield>fmt</structfield> union.</para>
70
71 <para>To request different parameters applications set the
72<structfield>type</structfield> field of a &v4l2-format; as above and
73initialize all fields of the &v4l2-pix-format;
74<structfield>vbi</structfield> member of the
75<structfield>fmt</structfield> union, or better just modify the
76results of <constant>VIDIOC_G_FMT</constant>, and call the
77&VIDIOC-S-FMT; ioctl with a pointer to this structure. Drivers may
78adjust the parameters and finally return the actual parameters as
79<constant>VIDIOC_G_FMT</constant> does.</para>
80
81 <para>Like <constant>VIDIOC_S_FMT</constant> the
82&VIDIOC-TRY-FMT; ioctl can be used to learn about hardware limitations
83without disabling I/O or possibly time consuming hardware
84preparations.</para>
85
86 <para>The contents of &v4l2-pix-format; and &v4l2-pix-format-mplane;
87are discussed in <xref linkend="pixfmt" />. See also the specification of the
88<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant>
89and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video
90output devices must implement both the
91<constant>VIDIOC_G_FMT</constant> and
92<constant>VIDIOC_S_FMT</constant> ioctl, even if
93<constant>VIDIOC_S_FMT</constant> ignores all requests and always
94returns default parameters as <constant>VIDIOC_G_FMT</constant> does.
95<constant>VIDIOC_TRY_FMT</constant> is optional.</para>
96 </section>
97
98 <section>
99 <title>Writing Images</title>
100
101 <para>A video output device may support the <link
102linkend="rw">write() function</link> and/or streaming (<link
103linkend="mmap">memory mapping</link> or <link
104linkend="userp">user pointer</link>) I/O. See <xref
105linkend="io" /> for details.</para>
106 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-overlay.xml b/Documentation/DocBook/media/v4l/dev-overlay.xml
new file mode 100644
index 00000000000..40d1d768143
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-overlay.xml
@@ -0,0 +1,371 @@
1 <title>Video Overlay Interface</title>
2 <subtitle>Also known as Framebuffer Overlay or Previewing</subtitle>
3
4 <para>Video overlay devices have the ability to genlock (TV-)video
5into the (VGA-)video signal of a graphics card, or to store captured
6images directly in video memory of a graphics card, typically with
7clipping. This can be considerable more efficient than capturing
8images and displaying them by other means. In the old days when only
9nuclear power plants needed cooling towers this used to be the only
10way to put live video into a window.</para>
11
12 <para>Video overlay devices are accessed through the same character
13special files as <link linkend="capture">video capture</link> devices.
14Note the default function of a <filename>/dev/video</filename> device
15is video capturing. The overlay function is only available after
16calling the &VIDIOC-S-FMT; ioctl.</para>
17
18 <para>The driver may support simultaneous overlay and capturing
19using the read/write and streaming I/O methods. If so, operation at
20the nominal frame rate of the video standard is not guaranteed. Frames
21may be directed away from overlay to capture, or one field may be used
22for overlay and the other for capture if the capture parameters permit
23this.</para>
24
25 <para>Applications should use different file descriptors for
26capturing and overlay. This must be supported by all drivers capable
27of simultaneous capturing and overlay. Optionally these drivers may
28also permit capturing and overlay with a single file descriptor for
29compatibility with V4L and earlier versions of V4L2.<footnote>
30 <para>A common application of two file descriptors is the
31XFree86 <link linkend="xvideo">Xv/V4L</link> interface driver and
32a V4L2 application. While the X server controls video overlay, the
33application can take advantage of memory mapping and DMA.</para>
34 <para>In the opinion of the designers of this API, no driver
35writer taking the efforts to support simultaneous capturing and
36overlay will restrict this ability by requiring a single file
37descriptor, as in V4L and earlier versions of V4L2. Making this
38optional means applications depending on two file descriptors need
39backup routines to be compatible with all drivers, which is
40considerable more work than using two fds in applications which do
41not. Also two fd's fit the general concept of one file descriptor for
42each logical stream. Hence as a complexity trade-off drivers
43<emphasis>must</emphasis> support two file descriptors and
44<emphasis>may</emphasis> support single fd operation.</para>
45 </footnote></para>
46
47 <section>
48 <title>Querying Capabilities</title>
49
50 <para>Devices supporting the video overlay interface set the
51<constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag in the
52<structfield>capabilities</structfield> field of &v4l2-capability;
53returned by the &VIDIOC-QUERYCAP; ioctl. The overlay I/O method specified
54below must be supported. Tuners and audio inputs are optional.</para>
55 </section>
56
57 <section>
58 <title>Supplemental Functions</title>
59
60 <para>Video overlay devices shall support <link
61linkend="audio">audio input</link>, <link
62linkend="tuner">tuner</link>, <link linkend="control">controls</link>,
63<link linkend="crop">cropping and scaling</link> and <link
64linkend="streaming-par">streaming parameter</link> ioctls as needed.
65The <link linkend="video">video input</link> and <link
66linkend="standard">video standard</link> ioctls must be supported by
67all video overlay devices.</para>
68 </section>
69
70 <section>
71 <title>Setup</title>
72
73 <para>Before overlay can commence applications must program the
74driver with frame buffer parameters, namely the address and size of
75the frame buffer and the image format, for example RGB 5:6:5. The
76&VIDIOC-G-FBUF; and &VIDIOC-S-FBUF; ioctls are available to get
77and set these parameters, respectively. The
78<constant>VIDIOC_S_FBUF</constant> ioctl is privileged because it
79allows to set up DMA into physical memory, bypassing the memory
80protection mechanisms of the kernel. Only the superuser can change the
81frame buffer address and size. Users are not supposed to run TV
82applications as root or with SUID bit set. A small helper application
83with suitable privileges should query the graphics system and program
84the V4L2 driver at the appropriate time.</para>
85
86 <para>Some devices add the video overlay to the output signal
87of the graphics card. In this case the frame buffer is not modified by
88the video device, and the frame buffer address and pixel format are
89not needed by the driver. The <constant>VIDIOC_S_FBUF</constant> ioctl
90is not privileged. An application can check for this type of device by
91calling the <constant>VIDIOC_G_FBUF</constant> ioctl.</para>
92
93 <para>A driver may support any (or none) of five clipping/blending
94methods:<orderedlist>
95 <listitem>
96 <para>Chroma-keying displays the overlaid image only where
97pixels in the primary graphics surface assume a certain color.</para>
98 </listitem>
99 <listitem>
100 <para>A bitmap can be specified where each bit corresponds
101to a pixel in the overlaid image. When the bit is set, the
102corresponding video pixel is displayed, otherwise a pixel of the
103graphics surface.</para>
104 </listitem>
105 <listitem>
106 <para>A list of clipping rectangles can be specified. In
107these regions <emphasis>no</emphasis> video is displayed, so the
108graphics surface can be seen here.</para>
109 </listitem>
110 <listitem>
111 <para>The framebuffer has an alpha channel that can be used
112to clip or blend the framebuffer with the video.</para>
113 </listitem>
114 <listitem>
115 <para>A global alpha value can be specified to blend the
116framebuffer contents with video images.</para>
117 </listitem>
118 </orderedlist></para>
119
120 <para>When simultaneous capturing and overlay is supported and
121the hardware prohibits different image and frame buffer formats, the
122format requested first takes precedence. The attempt to capture
123(&VIDIOC-S-FMT;) or overlay (&VIDIOC-S-FBUF;) may fail with an
124&EBUSY; or return accordingly modified parameters..</para>
125 </section>
126
127 <section>
128 <title>Overlay Window</title>
129
130 <para>The overlaid image is determined by cropping and overlay
131window parameters. The former select an area of the video picture to
132capture, the latter how images are overlaid and clipped. Cropping
133initialization at minimum requires to reset the parameters to
134defaults. An example is given in <xref linkend="crop" />.</para>
135
136 <para>The overlay window is described by a &v4l2-window;. It
137defines the size of the image, its position over the graphics surface
138and the clipping to be applied. To get the current parameters
139applications set the <structfield>type</structfield> field of a
140&v4l2-format; to <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant> and
141call the &VIDIOC-G-FMT; ioctl. The driver fills the
142<structname>v4l2_window</structname> substructure named
143<structfield>win</structfield>. It is not possible to retrieve a
144previously programmed clipping list or bitmap.</para>
145
146 <para>To program the overlay window applications set the
147<structfield>type</structfield> field of a &v4l2-format; to
148<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, initialize the
149<structfield>win</structfield> substructure and call the
150&VIDIOC-S-FMT; ioctl. The driver adjusts the parameters against
151hardware limits and returns the actual parameters as
152<constant>VIDIOC_G_FMT</constant> does. Like
153<constant>VIDIOC_S_FMT</constant>, the &VIDIOC-TRY-FMT; ioctl can be
154used to learn about driver capabilities without actually changing
155driver state. Unlike <constant>VIDIOC_S_FMT</constant> this also works
156after the overlay has been enabled.</para>
157
158 <para>The scaling factor of the overlaid image is implied by the
159width and height given in &v4l2-window; and the size of the cropping
160rectangle. For more information see <xref linkend="crop" />.</para>
161
162 <para>When simultaneous capturing and overlay is supported and
163the hardware prohibits different image and window sizes, the size
164requested first takes precedence. The attempt to capture or overlay as
165well (&VIDIOC-S-FMT;) may fail with an &EBUSY; or return accordingly
166modified parameters.</para>
167
168 <table pgwide="1" frame="none" id="v4l2-window">
169 <title>struct <structname>v4l2_window</structname></title>
170 <tgroup cols="3">
171 &cs-str;
172 <tbody valign="top">
173 <row>
174 <entry>&v4l2-rect;</entry>
175 <entry><structfield>w</structfield></entry>
176 <entry>Size and position of the window relative to the
177top, left corner of the frame buffer defined with &VIDIOC-S-FBUF;. The
178window can extend the frame buffer width and height, the
179<structfield>x</structfield> and <structfield>y</structfield>
180coordinates can be negative, and it can lie completely outside the
181frame buffer. The driver clips the window accordingly, or if that is
182not possible, modifies its size and/or position.</entry>
183 </row>
184 <row>
185 <entry>&v4l2-field;</entry>
186 <entry><structfield>field</structfield></entry>
187 <entry>Applications set this field to determine which
188video field shall be overlaid, typically one of
189<constant>V4L2_FIELD_ANY</constant> (0),
190<constant>V4L2_FIELD_TOP</constant>,
191<constant>V4L2_FIELD_BOTTOM</constant> or
192<constant>V4L2_FIELD_INTERLACED</constant>. Drivers may have to choose
193a different field order and return the actual setting here.</entry>
194 </row>
195 <row>
196 <entry>__u32</entry>
197 <entry><structfield>chromakey</structfield></entry>
198 <entry>When chroma-keying has been negotiated with
199&VIDIOC-S-FBUF; applications set this field to the desired pixel value
200for the chroma key. The format is the same as the pixel format of the
201framebuffer (&v4l2-framebuffer;
202<structfield>fmt.pixelformat</structfield> field), with bytes in host
203order. E.&nbsp;g. for <link
204linkend="V4L2-PIX-FMT-BGR32"><constant>V4L2_PIX_FMT_BGR24</constant></link>
205the value should be 0xRRGGBB on a little endian, 0xBBGGRR on a big
206endian host.</entry>
207 </row>
208 <row>
209 <entry>&v4l2-clip; *</entry>
210 <entry><structfield>clips</structfield></entry>
211 <entry>When chroma-keying has <emphasis>not</emphasis>
212been negotiated and &VIDIOC-G-FBUF; indicated this capability,
213applications can set this field to point to an array of
214clipping rectangles.</entry>
215 </row>
216 <row>
217 <entry></entry>
218 <entry></entry>
219 <entry>Like the window coordinates
220<structfield>w</structfield>, clipping rectangles are defined relative
221to the top, left corner of the frame buffer. However clipping
222rectangles must not extend the frame buffer width and height, and they
223must not overlap. If possible applications should merge adjacent
224rectangles. Whether this must create x-y or y-x bands, or the order of
225rectangles, is not defined. When clip lists are not supported the
226driver ignores this field. Its contents after calling &VIDIOC-S-FMT;
227are undefined.</entry>
228 </row>
229 <row>
230 <entry>__u32</entry>
231 <entry><structfield>clipcount</structfield></entry>
232 <entry>When the application set the
233<structfield>clips</structfield> field, this field must contain the
234number of clipping rectangles in the list. When clip lists are not
235supported the driver ignores this field, its contents after calling
236<constant>VIDIOC_S_FMT</constant> are undefined. When clip lists are
237supported but no clipping is desired this field must be set to
238zero.</entry>
239 </row>
240 <row>
241 <entry>void *</entry>
242 <entry><structfield>bitmap</structfield></entry>
243 <entry>When chroma-keying has
244<emphasis>not</emphasis> been negotiated and &VIDIOC-G-FBUF; indicated
245this capability, applications can set this field to point to a
246clipping bit mask.</entry>
247 </row>
248 <row>
249 <entry spanname="hspan"><para>It must be of the same size
250as the window, <structfield>w.width</structfield> and
251<structfield>w.height</structfield>. Each bit corresponds to a pixel
252in the overlaid image, which is displayed only when the bit is
253<emphasis>set</emphasis>. Pixel coordinates translate to bits like:
254<programlisting>
255((__u8 *) <structfield>bitmap</structfield>)[<structfield>w.width</structfield> * y + x / 8] &amp; (1 &lt;&lt; (x &amp; 7))</programlisting></para><para>where <structfield>0</structfield> &le; x &lt;
256<structfield>w.width</structfield> and <structfield>0</structfield> &le;
257y &lt;<structfield>w.height</structfield>.<footnote>
258 <para>Should we require
259 <structfield>w.width</structfield> to be a multiple of
260 eight?</para>
261 </footnote></para><para>When a clipping
262bit mask is not supported the driver ignores this field, its contents
263after calling &VIDIOC-S-FMT; are undefined. When a bit mask is supported
264but no clipping is desired this field must be set to
265<constant>NULL</constant>.</para><para>Applications need not create a
266clip list or bit mask. When they pass both, or despite negotiating
267chroma-keying, the results are undefined. Regardless of the chosen
268method, the clipping abilities of the hardware may be limited in
269quantity or quality. The results when these limits are exceeded are
270undefined.<footnote>
271 <para>When the image is written into frame buffer
272memory it will be undesirable if the driver clips out less pixels
273than expected, because the application and graphics system are not
274aware these regions need to be refreshed. The driver should clip out
275more pixels or not write the image at all.</para>
276 </footnote></para></entry>
277 </row>
278 <row>
279 <entry>__u8</entry>
280 <entry><structfield>global_alpha</structfield></entry>
281 <entry>The global alpha value used to blend the
282framebuffer with video images, if global alpha blending has been
283negotiated (<constant>V4L2_FBUF_FLAG_GLOBAL_ALPHA</constant>, see
284&VIDIOC-S-FBUF;, <xref linkend="framebuffer-flags" />).</entry>
285 </row>
286 <row>
287 <entry></entry>
288 <entry></entry>
289 <entry>Note this field was added in Linux 2.6.23, extending the structure. However
290the <link linkend="vidioc-g-fmt">VIDIOC_G/S/TRY_FMT</link> ioctls,
291which take a pointer to a <link
292linkend="v4l2-format">v4l2_format</link> parent structure with padding
293bytes at the end, are not affected.</entry>
294 </row>
295 </tbody>
296 </tgroup>
297 </table>
298
299 <table pgwide="1" frame="none" id="v4l2-clip">
300 <title>struct <structname>v4l2_clip</structname><footnote>
301 <para>The X Window system defines "regions" which are
302vectors of struct BoxRec { short x1, y1, x2, y2; } with width = x2 -
303x1 and height = y2 - y1, so one cannot pass X11 clip lists
304directly.</para>
305 </footnote></title>
306 <tgroup cols="3">
307 &cs-str;
308 <tbody valign="top">
309 <row>
310 <entry>&v4l2-rect;</entry>
311 <entry><structfield>c</structfield></entry>
312 <entry>Coordinates of the clipping rectangle, relative to
313the top, left corner of the frame buffer. Only window pixels
314<emphasis>outside</emphasis> all clipping rectangles are
315displayed.</entry>
316 </row>
317 <row>
318 <entry>&v4l2-clip; *</entry>
319 <entry><structfield>next</structfield></entry>
320 <entry>Pointer to the next clipping rectangle, NULL when
321this is the last rectangle. Drivers ignore this field, it cannot be
322used to pass a linked list of clipping rectangles.</entry>
323 </row>
324 </tbody>
325 </tgroup>
326 </table>
327
328 <!-- NB for easier reading this table is duplicated
329 in the vidioc-cropcap chapter.-->
330
331 <table pgwide="1" frame="none" id="v4l2-rect">
332 <title>struct <structname>v4l2_rect</structname></title>
333 <tgroup cols="3">
334 &cs-str;
335 <tbody valign="top">
336 <row>
337 <entry>__s32</entry>
338 <entry><structfield>left</structfield></entry>
339 <entry>Horizontal offset of the top, left corner of the
340rectangle, in pixels.</entry>
341 </row>
342 <row>
343 <entry>__s32</entry>
344 <entry><structfield>top</structfield></entry>
345 <entry>Vertical offset of the top, left corner of the
346rectangle, in pixels. Offsets increase to the right and down.</entry>
347 </row>
348 <row>
349 <entry>__s32</entry>
350 <entry><structfield>width</structfield></entry>
351 <entry>Width of the rectangle, in pixels.</entry>
352 </row>
353 <row>
354 <entry>__s32</entry>
355 <entry><structfield>height</structfield></entry>
356 <entry>Height of the rectangle, in pixels. Width and
357height cannot be negative, the fields are signed for hysterical
358reasons. <!-- video4linux-list@redhat.com on 22 Oct 2002 subject
359"Re:[V4L][patches!] Re:v4l2/kernel-2.5" --></entry>
360 </row>
361 </tbody>
362 </tgroup>
363 </table>
364 </section>
365
366 <section>
367 <title>Enabling Overlay</title>
368
369 <para>To start or stop the frame buffer overlay applications call
370the &VIDIOC-OVERLAY; ioctl.</para>
371 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-radio.xml b/Documentation/DocBook/media/v4l/dev-radio.xml
new file mode 100644
index 00000000000..3e6ac73b36a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-radio.xml
@@ -0,0 +1,49 @@
1 <title>Radio Interface</title>
2
3 <para>This interface is intended for AM and FM (analog) radio
4receivers and transmitters.</para>
5
6 <para>Conventionally V4L2 radio devices are accessed through
7character device special files named <filename>/dev/radio</filename>
8and <filename>/dev/radio0</filename> to
9<filename>/dev/radio63</filename> with major number 81 and minor
10numbers 64 to 127.</para>
11
12 <section>
13 <title>Querying Capabilities</title>
14
15 <para>Devices supporting the radio interface set the
16<constant>V4L2_CAP_RADIO</constant> and
17<constant>V4L2_CAP_TUNER</constant> or
18<constant>V4L2_CAP_MODULATOR</constant> flag in the
19<structfield>capabilities</structfield> field of &v4l2-capability;
20returned by the &VIDIOC-QUERYCAP; ioctl. Other combinations of
21capability flags are reserved for future extensions.</para>
22 </section>
23
24 <section>
25 <title>Supplemental Functions</title>
26
27 <para>Radio devices can support <link
28linkend="control">controls</link>, and must support the <link
29linkend="tuner">tuner or modulator</link> ioctls.</para>
30
31 <para>They do not support the video input or output, audio input
32or output, video standard, cropping and scaling, compression and
33streaming parameter, or overlay ioctls. All other ioctls and I/O
34methods are reserved for future extensions.</para>
35 </section>
36
37 <section>
38 <title>Programming</title>
39
40 <para>Radio devices may have a couple audio controls (as discussed
41in <xref linkend="control" />) such as a volume control, possibly custom
42controls. Further all radio devices have one tuner or modulator (these are
43discussed in <xref linkend="tuner" />) with index number zero to select
44the radio frequency and to determine if a monaural or FM stereo
45program is received/emitted. Drivers switch automatically between AM and FM
46depending on the selected frequency. The &VIDIOC-G-TUNER; or
47&VIDIOC-G-MODULATOR; ioctl
48reports the supported frequency range.</para>
49 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-raw-vbi.xml b/Documentation/DocBook/media/v4l/dev-raw-vbi.xml
new file mode 100644
index 00000000000..b788c72c885
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-raw-vbi.xml
@@ -0,0 +1,339 @@
1 <title>Raw VBI Data Interface</title>
2
3 <para>VBI is an abbreviation of Vertical Blanking Interval, a gap
4in the sequence of lines of an analog video signal. During VBI
5no picture information is transmitted, allowing some time while the
6electron beam of a cathode ray tube TV returns to the top of the
7screen. Using an oscilloscope you will find here the vertical
8synchronization pulses and short data packages ASK
9modulated<footnote><para>ASK: Amplitude-Shift Keying. A high signal
10level represents a '1' bit, a low level a '0' bit.</para></footnote>
11onto the video signal. These are transmissions of services such as
12Teletext or Closed Caption.</para>
13
14 <para>Subject of this interface type is raw VBI data, as sampled off
15a video signal, or to be added to a signal for output.
16The data format is similar to uncompressed video images, a number of
17lines times a number of samples per line, we call this a VBI image.</para>
18
19 <para>Conventionally V4L2 VBI devices are accessed through character
20device special files named <filename>/dev/vbi</filename> and
21<filename>/dev/vbi0</filename> to <filename>/dev/vbi31</filename> with
22major number 81 and minor numbers 224 to 255.
23<filename>/dev/vbi</filename> is typically a symbolic link to the
24preferred VBI device. This convention applies to both input and output
25devices.</para>
26
27 <para>To address the problems of finding related video and VBI
28devices VBI capturing and output is also available as device function
29under <filename>/dev/video</filename>. To capture or output raw VBI
30data with these devices applications must call the &VIDIOC-S-FMT;
31ioctl. Accessed as <filename>/dev/vbi</filename>, raw VBI capturing
32or output is the default device function.</para>
33
34 <section>
35 <title>Querying Capabilities</title>
36
37 <para>Devices supporting the raw VBI capturing or output API set
38the <constant>V4L2_CAP_VBI_CAPTURE</constant> or
39<constant>V4L2_CAP_VBI_OUTPUT</constant> flags, respectively, in the
40<structfield>capabilities</structfield> field of &v4l2-capability;
41returned by the &VIDIOC-QUERYCAP; ioctl. At least one of the
42read/write, streaming or asynchronous I/O methods must be
43supported. VBI devices may or may not have a tuner or modulator.</para>
44 </section>
45
46 <section>
47 <title>Supplemental Functions</title>
48
49 <para>VBI devices shall support <link linkend="video">video
50input or output</link>, <link linkend="tuner">tuner or
51modulator</link>, and <link linkend="control">controls</link> ioctls
52as needed. The <link linkend="standard">video standard</link> ioctls provide
53information vital to program a VBI device, therefore must be
54supported.</para>
55 </section>
56
57 <section>
58 <title>Raw VBI Format Negotiation</title>
59
60 <para>Raw VBI sampling abilities can vary, in particular the
61sampling frequency. To properly interpret the data V4L2 specifies an
62ioctl to query the sampling parameters. Moreover, to allow for some
63flexibility applications can also suggest different parameters.</para>
64
65 <para>As usual these parameters are <emphasis>not</emphasis>
66reset at &func-open; time to permit Unix tool chains, programming a
67device and then reading from it as if it was a plain file. Well
68written V4L2 applications should always ensure they really get what
69they want, requesting reasonable parameters and then checking if the
70actual parameters are suitable.</para>
71
72 <para>To query the current raw VBI capture parameters
73applications set the <structfield>type</structfield> field of a
74&v4l2-format; to <constant>V4L2_BUF_TYPE_VBI_CAPTURE</constant> or
75<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>, and call the
76&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill
77the &v4l2-vbi-format; <structfield>vbi</structfield> member of the
78<structfield>fmt</structfield> union.</para>
79
80 <para>To request different parameters applications set the
81<structfield>type</structfield> field of a &v4l2-format; as above and
82initialize all fields of the &v4l2-vbi-format;
83<structfield>vbi</structfield> member of the
84<structfield>fmt</structfield> union, or better just modify the
85results of <constant>VIDIOC_G_FMT</constant>, and call the
86&VIDIOC-S-FMT; ioctl with a pointer to this structure. Drivers return
87an &EINVAL; only when the given parameters are ambiguous, otherwise
88they modify the parameters according to the hardware capabilites and
89return the actual parameters. When the driver allocates resources at
90this point, it may return an &EBUSY; to indicate the returned
91parameters are valid but the required resources are currently not
92available. That may happen for instance when the video and VBI areas
93to capture would overlap, or when the driver supports multiple opens
94and another process already requested VBI capturing or output. Anyway,
95applications must expect other resource allocation points which may
96return <errorcode>EBUSY</errorcode>, at the &VIDIOC-STREAMON; ioctl
97and the first read(), write() and select() call.</para>
98
99 <para>VBI devices must implement both the
100<constant>VIDIOC_G_FMT</constant> and
101<constant>VIDIOC_S_FMT</constant> ioctl, even if
102<constant>VIDIOC_S_FMT</constant> ignores all requests and always
103returns default parameters as <constant>VIDIOC_G_FMT</constant> does.
104<constant>VIDIOC_TRY_FMT</constant> is optional.</para>
105
106 <table pgwide="1" frame="none" id="v4l2-vbi-format">
107 <title>struct <structname>v4l2_vbi_format</structname></title>
108 <tgroup cols="3">
109 &cs-str;
110 <tbody valign="top">
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>sampling_rate</structfield></entry>
114 <entry>Samples per second, i.&nbsp;e. unit 1 Hz.</entry>
115 </row>
116 <row>
117 <entry>__u32</entry>
118 <entry><structfield>offset</structfield></entry>
119 <entry><para>Horizontal offset of the VBI image,
120relative to the leading edge of the line synchronization pulse and
121counted in samples: The first sample in the VBI image will be located
122<structfield>offset</structfield> /
123<structfield>sampling_rate</structfield> seconds following the leading
124edge. See also <xref linkend="vbi-hsync" />.</para></entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>samples_per_line</structfield></entry>
129 <entry></entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>sample_format</structfield></entry>
134 <entry><para>Defines the sample format as in <xref
135linkend="pixfmt" />, a four-character-code.<footnote>
136 <para>A few devices may be unable to
137sample VBI data at all but can extend the video capture window to the
138VBI region.</para>
139 </footnote> Usually this is
140<constant>V4L2_PIX_FMT_GREY</constant>, i.&nbsp;e. each sample
141consists of 8 bits with lower values oriented towards the black level.
142Do not assume any other correlation of values with the signal level.
143For example, the MSB does not necessarily indicate if the signal is
144'high' or 'low' because 128 may not be the mean value of the
145signal. Drivers shall not convert the sample format by software.</para></entry>
146 </row>
147 <row>
148 <entry>__u32</entry>
149 <entry><structfield>start</structfield>[2]</entry>
150 <entry>This is the scanning system line number
151associated with the first line of the VBI image, of the first and the
152second field respectively. See <xref linkend="vbi-525" /> and
153<xref linkend="vbi-625" /> for valid values. VBI input drivers can
154return start values 0 if the hardware cannot reliable identify
155scanning lines, VBI acquisition may not require this
156information.</entry>
157 </row>
158 <row>
159 <entry>__u32</entry>
160 <entry><structfield>count</structfield>[2]</entry>
161 <entry>The number of lines in the first and second
162field image, respectively.</entry>
163 </row>
164 <row>
165 <entry spanname="hspan"><para>Drivers should be as
166flexibility as possible. For example, it may be possible to extend or
167move the VBI capture window down to the picture area, implementing a
168'full field mode' to capture data service transmissions embedded in
169the picture.</para><para>An application can set the first or second
170<structfield>count</structfield> value to zero if no data is required
171from the respective field; <structfield>count</structfield>[1] if the
172scanning system is progressive, &ie; not interlaced. The
173corresponding start value shall be ignored by the application and
174driver. Anyway, drivers may not support single field capturing and
175return both count values non-zero.</para><para>Both
176<structfield>count</structfield> values set to zero, or line numbers
177outside the bounds depicted in <xref linkend="vbi-525" /> and <xref
178 linkend="vbi-625" />, or a field image covering
179lines of two fields, are invalid and shall not be returned by the
180driver.</para><para>To initialize the <structfield>start</structfield>
181and <structfield>count</structfield> fields, applications must first
182determine the current video standard selection. The &v4l2-std-id; or
183the <structfield>framelines</structfield> field of &v4l2-standard; can
184be evaluated for this purpose.</para></entry>
185 </row>
186 <row>
187 <entry>__u32</entry>
188 <entry><structfield>flags</structfield></entry>
189 <entry>See <xref linkend="vbifmt-flags" /> below. Currently
190only drivers set flags, applications must set this field to
191zero.</entry>
192 </row>
193 <row>
194 <entry>__u32</entry>
195 <entry><structfield>reserved</structfield>[2]</entry>
196 <entry>This array is reserved for future extensions.
197Drivers and applications must set it to zero.</entry>
198 </row>
199 </tbody>
200 </tgroup>
201 </table>
202
203 <table pgwide="1" frame="none" id="vbifmt-flags">
204 <title>Raw VBI Format Flags</title>
205 <tgroup cols="3">
206 &cs-def;
207 <tbody valign="top">
208 <row>
209 <entry><constant>V4L2_VBI_UNSYNC</constant></entry>
210 <entry>0x0001</entry>
211 <entry><para>This flag indicates hardware which does not
212properly distinguish between fields. Normally the VBI image stores the
213first field (lower scanning line numbers) first in memory. This may be
214a top or bottom field depending on the video standard. When this flag
215is set the first or second field may be stored first, however the
216fields are still in correct temporal order with the older field first
217in memory.<footnote>
218 <para>Most VBI services transmit on both fields, but
219some have different semantics depending on the field number. These
220cannot be reliable decoded or encoded when
221<constant>V4L2_VBI_UNSYNC</constant> is set.</para>
222 </footnote></para></entry>
223 </row>
224 <row>
225 <entry><constant>V4L2_VBI_INTERLACED</constant></entry>
226 <entry>0x0002</entry>
227 <entry>By default the two field images will be passed
228sequentially; all lines of the first field followed by all lines of
229the second field (compare <xref linkend="field-order" />
230<constant>V4L2_FIELD_SEQ_TB</constant> and
231<constant>V4L2_FIELD_SEQ_BT</constant>, whether the top or bottom
232field is first in memory depends on the video standard). When this
233flag is set, the two fields are interlaced (cf.
234<constant>V4L2_FIELD_INTERLACED</constant>). The first line of the
235first field followed by the first line of the second field, then the
236two second lines, and so on. Such a layout may be necessary when the
237hardware has been programmed to capture or output interlaced video
238images and is unable to separate the fields for VBI capturing at
239the same time. For simplicity setting this flag implies that both
240<structfield>count</structfield> values are equal and non-zero.</entry>
241 </row>
242 </tbody>
243 </tgroup>
244 </table>
245
246 <figure id="vbi-hsync">
247 <title>Line synchronization</title>
248 <mediaobject>
249 <imageobject>
250 <imagedata fileref="vbi_hsync.pdf" format="PS" />
251 </imageobject>
252 <imageobject>
253 <imagedata fileref="vbi_hsync.gif" format="GIF" />
254 </imageobject>
255 <textobject>
256 <phrase>Line synchronization diagram</phrase>
257 </textobject>
258 </mediaobject>
259 </figure>
260
261 <figure id="vbi-525">
262 <title>ITU-R 525 line numbering (M/NTSC and M/PAL)</title>
263 <mediaobject>
264 <imageobject>
265 <imagedata fileref="vbi_525.pdf" format="PS" />
266 </imageobject>
267 <imageobject>
268 <imagedata fileref="vbi_525.gif" format="GIF" />
269 </imageobject>
270 <textobject>
271 <phrase>NTSC field synchronization diagram</phrase>
272 </textobject>
273 <caption>
274 <para>(1) For the purpose of this specification field 2
275starts in line 264 and not 263.5 because half line capturing is not
276supported.</para>
277 </caption>
278 </mediaobject>
279 </figure>
280
281 <figure id="vbi-625">
282 <title>ITU-R 625 line numbering</title>
283 <mediaobject>
284 <imageobject>
285 <imagedata fileref="vbi_625.pdf" format="PS" />
286 </imageobject>
287 <imageobject>
288 <imagedata fileref="vbi_625.gif" format="GIF" />
289 </imageobject>
290 <textobject>
291 <phrase>PAL/SECAM field synchronization diagram</phrase>
292 </textobject>
293 <caption>
294 <para>(1) For the purpose of this specification field 2
295starts in line 314 and not 313.5 because half line capturing is not
296supported.</para>
297 </caption>
298 </mediaobject>
299 </figure>
300
301 <para>Remember the VBI image format depends on the selected
302video standard, therefore the application must choose a new standard or
303query the current standard first. Attempts to read or write data ahead
304of format negotiation, or after switching the video standard which may
305invalidate the negotiated VBI parameters, should be refused by the
306driver. A format change during active I/O is not permitted.</para>
307 </section>
308
309 <section>
310 <title>Reading and writing VBI images</title>
311
312 <para>To assure synchronization with the field number and easier
313implementation, the smallest unit of data passed at a time is one
314frame, consisting of two fields of VBI images immediately following in
315memory.</para>
316
317 <para>The total size of a frame computes as follows:</para>
318
319 <programlisting>
320(<structfield>count</structfield>[0] + <structfield>count</structfield>[1]) *
321<structfield>samples_per_line</structfield> * sample size in bytes</programlisting>
322
323 <para>The sample size is most likely always one byte,
324applications must check the <structfield>sample_format</structfield>
325field though, to function properly with other drivers.</para>
326
327 <para>A VBI device may support <link
328 linkend="rw">read/write</link> and/or streaming (<link
329 linkend="mmap">memory mapping</link> or <link
330 linkend="userp">user pointer</link>) I/O. The latter bears the
331possibility of synchronizing video and
332VBI data by using buffer timestamps.</para>
333
334 <para>Remember the &VIDIOC-STREAMON; ioctl and the first read(),
335write() and select() call can be resource allocation points returning
336an &EBUSY; if the required hardware resources are temporarily
337unavailable, for example the device is already in use by another
338process.</para>
339 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-rds.xml b/Documentation/DocBook/media/v4l/dev-rds.xml
new file mode 100644
index 00000000000..be2f3373732
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-rds.xml
@@ -0,0 +1,196 @@
1 <title>RDS Interface</title>
2
3 <para>The Radio Data System transmits supplementary
4information in binary format, for example the station name or travel
5information, on an inaudible audio subcarrier of a radio program. This
6interface is aimed at devices capable of receiving and/or transmitting RDS
7information.</para>
8
9 <para>For more information see the core RDS standard <xref linkend="iec62106" />
10and the RBDS standard <xref linkend="nrsc4" />.</para>
11
12 <para>Note that the RBDS standard as is used in the USA is almost identical
13to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
14fields have slightly different meanings. See the RBDS standard for more
15information.</para>
16
17 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
18This is a proprietary format which seems to be discontinued. The RDS interface does not
19support this format. Should support for MMBS (or the so-called 'E blocks' in general)
20be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
21
22 <section>
23 <title>Querying Capabilities</title>
24
25 <para>Devices supporting the RDS capturing API set
26the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
27the <structfield>capabilities</structfield> field of &v4l2-capability;
28returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
29will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
30the <structfield>capability</structfield> field of &v4l2-tuner;. If
31the driver only passes RDS blocks without interpreting the data
32the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be
33set, see <link linkend="reading-rds-data">Reading RDS data</link>.
34For future use the
35flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> has also been
36defined. However, a driver for a radio tuner with this capability does
37not yet exist, so if you are planning to write such a driver you
38should discuss this on the linux-media mailing list: &v4l-ml;.</para>
39
40 <para> Whether an RDS signal is present can be detected by looking
41at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
42the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
43was detected.</para>
44
45 <para>Devices supporting the RDS output API
46set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
47the <structfield>capabilities</structfield> field of &v4l2-capability;
48returned by the &VIDIOC-QUERYCAP; ioctl.
49Any modulator that supports RDS will set the
50<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
51field of &v4l2-modulator;.
52In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
53bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
54If the driver only passes RDS blocks without interpreting the data
55the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be set. If the
56tuner is capable of handling RDS entities like program identification codes and radio
57text, the flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> should be set,
58see <link linkend="writing-rds-data">Writing RDS data</link> and
59<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
60 </section>
61
62 <section id="reading-rds-data">
63 <title>Reading RDS data</title>
64
65 <para>RDS data can be read from the radio device
66with the &func-read; function. The data is packed in groups of three bytes.</para>
67 </section>
68
69 <section id="writing-rds-data">
70 <title>Writing RDS data</title>
71
72 <para>RDS data can be written to the radio device
73with the &func-write; function. The data is packed in groups of three bytes,
74as follows:</para>
75 </section>
76
77 <section>
78 <title>RDS datastructures</title>
79 <table frame="none" pgwide="1" id="v4l2-rds-data">
80 <title>struct
81<structname>v4l2_rds_data</structname></title>
82 <tgroup cols="3">
83 <colspec colname="c1" colwidth="1*" />
84 <colspec colname="c2" colwidth="1*" />
85 <colspec colname="c3" colwidth="5*" />
86 <tbody valign="top">
87 <row>
88 <entry>__u8</entry>
89 <entry><structfield>lsb</structfield></entry>
90 <entry>Least Significant Byte of RDS Block</entry>
91 </row>
92 <row>
93 <entry>__u8</entry>
94 <entry><structfield>msb</structfield></entry>
95 <entry>Most Significant Byte of RDS Block</entry>
96 </row>
97 <row>
98 <entry>__u8</entry>
99 <entry><structfield>block</structfield></entry>
100 <entry>Block description</entry>
101 </row>
102 </tbody>
103 </tgroup>
104 </table>
105 <table frame="none" pgwide="1" id="v4l2-rds-block">
106 <title>Block description</title>
107 <tgroup cols="2">
108 <colspec colname="c1" colwidth="1*" />
109 <colspec colname="c2" colwidth="5*" />
110 <tbody valign="top">
111 <row>
112 <entry>Bits 0-2</entry>
113 <entry>Block (aka offset) of the received data.</entry>
114 </row>
115 <row>
116 <entry>Bits 3-5</entry>
117 <entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry>
118 </row>
119 <row>
120 <entry>Bit 6</entry>
121 <entry>Corrected bit. Indicates that an error was corrected for this data block.</entry>
122 </row>
123 <row>
124 <entry>Bit 7</entry>
125 <entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry>
126 </row>
127 </tbody>
128 </tgroup>
129 </table>
130
131 <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
132 <title>Block defines</title>
133 <tgroup cols="4">
134 <colspec colname="c1" colwidth="1*" />
135 <colspec colname="c2" colwidth="1*" />
136 <colspec colname="c3" colwidth="1*" />
137 <colspec colname="c4" colwidth="5*" />
138 <tbody valign="top">
139 <row>
140 <entry>V4L2_RDS_BLOCK_MSK</entry>
141 <entry> </entry>
142 <entry>7</entry>
143 <entry>Mask for bits 0-2 to get the block ID.</entry>
144 </row>
145 <row>
146 <entry>V4L2_RDS_BLOCK_A</entry>
147 <entry> </entry>
148 <entry>0</entry>
149 <entry>Block A.</entry>
150 </row>
151 <row>
152 <entry>V4L2_RDS_BLOCK_B</entry>
153 <entry> </entry>
154 <entry>1</entry>
155 <entry>Block B.</entry>
156 </row>
157 <row>
158 <entry>V4L2_RDS_BLOCK_C</entry>
159 <entry> </entry>
160 <entry>2</entry>
161 <entry>Block C.</entry>
162 </row>
163 <row>
164 <entry>V4L2_RDS_BLOCK_D</entry>
165 <entry> </entry>
166 <entry>3</entry>
167 <entry>Block D.</entry>
168 </row>
169 <row>
170 <entry>V4L2_RDS_BLOCK_C_ALT</entry>
171 <entry> </entry>
172 <entry>4</entry>
173 <entry>Block C'.</entry>
174 </row>
175 <row>
176 <entry>V4L2_RDS_BLOCK_INVALID</entry>
177 <entry>read-only</entry>
178 <entry>7</entry>
179 <entry>An invalid block.</entry>
180 </row>
181 <row>
182 <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
183 <entry>read-only</entry>
184 <entry>0x40</entry>
185 <entry>A bit error was detected but corrected.</entry>
186 </row>
187 <row>
188 <entry>V4L2_RDS_BLOCK_ERROR</entry>
189 <entry>read-only</entry>
190 <entry>0x80</entry>
191 <entry>An uncorrectable error occurred.</entry>
192 </row>
193 </tbody>
194 </tgroup>
195 </table>
196 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml b/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml
new file mode 100644
index 00000000000..548f8ea28de
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml
@@ -0,0 +1,699 @@
1 <title>Sliced VBI Data Interface</title>
2
3 <para>VBI stands for Vertical Blanking Interval, a gap in the
4sequence of lines of an analog video signal. During VBI no picture
5information is transmitted, allowing some time while the electron beam
6of a cathode ray tube TV returns to the top of the screen.</para>
7
8 <para>Sliced VBI devices use hardware to demodulate data transmitted
9in the VBI. V4L2 drivers shall <emphasis>not</emphasis> do this by
10software, see also the <link linkend="raw-vbi">raw VBI
11interface</link>. The data is passed as short packets of fixed size,
12covering one scan line each. The number of packets per video frame is
13variable.</para>
14
15 <para>Sliced VBI capture and output devices are accessed through the
16same character special files as raw VBI devices. When a driver
17supports both interfaces, the default function of a
18<filename>/dev/vbi</filename> device is <emphasis>raw</emphasis> VBI
19capturing or output, and the sliced VBI function is only available
20after calling the &VIDIOC-S-FMT; ioctl as defined below. Likewise a
21<filename>/dev/video</filename> device may support the sliced VBI API,
22however the default function here is video capturing or output.
23Different file descriptors must be used to pass raw and sliced VBI
24data simultaneously, if this is supported by the driver.</para>
25
26 <section>
27 <title>Querying Capabilities</title>
28
29 <para>Devices supporting the sliced VBI capturing or output API
30set the <constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant> or
31<constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant> flag respectively, in
32the <structfield>capabilities</structfield> field of &v4l2-capability;
33returned by the &VIDIOC-QUERYCAP; ioctl. At least one of the
34read/write, streaming or asynchronous <link linkend="io">I/O
35methods</link> must be supported. Sliced VBI devices may have a tuner
36or modulator.</para>
37 </section>
38
39 <section>
40 <title>Supplemental Functions</title>
41
42 <para>Sliced VBI devices shall support <link linkend="video">video
43input or output</link> and <link linkend="tuner">tuner or
44modulator</link> ioctls if they have these capabilities, and they may
45support <link linkend="control">control</link> ioctls. The <link
46linkend="standard">video standard</link> ioctls provide information
47vital to program a sliced VBI device, therefore must be
48supported.</para>
49 </section>
50
51 <section id="sliced-vbi-format-negotitation">
52 <title>Sliced VBI Format Negotiation</title>
53
54 <para>To find out which data services are supported by the
55hardware applications can call the &VIDIOC-G-SLICED-VBI-CAP; ioctl.
56All drivers implementing the sliced VBI interface must support this
57ioctl. The results may differ from those of the &VIDIOC-S-FMT; ioctl
58when the number of VBI lines the hardware can capture or output per
59frame, or the number of services it can identify on a given line are
60limited. For example on PAL line 16 the hardware may be able to look
61for a VPS or Teletext signal, but not both at the same time.</para>
62
63 <para>To determine the currently selected services applications
64set the <structfield>type </structfield> field of &v4l2-format; to
65<constant> V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant> or <constant>
66V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant>, and the &VIDIOC-G-FMT;
67ioctl fills the <structfield>fmt.sliced</structfield> member, a
68&v4l2-sliced-vbi-format;.</para>
69
70 <para>Applications can request different parameters by
71initializing or modifying the <structfield>fmt.sliced</structfield>
72member and calling the &VIDIOC-S-FMT; ioctl with a pointer to the
73<structname>v4l2_format</structname> structure.</para>
74
75 <para>The sliced VBI API is more complicated than the raw VBI API
76because the hardware must be told which VBI service to expect on each
77scan line. Not all services may be supported by the hardware on all
78lines (this is especially true for VBI output where Teletext is often
79unsupported and other services can only be inserted in one specific
80line). In many cases, however, it is sufficient to just set the
81<structfield>service_set</structfield> field to the required services
82and let the driver fill the <structfield>service_lines</structfield>
83array according to hardware capabilities. Only if more precise control
84is needed should the programmer set the
85<structfield>service_lines</structfield> array explicitly.</para>
86
87 <para>The &VIDIOC-S-FMT; ioctl modifies the parameters
88according to hardware capabilities. When the driver allocates
89resources at this point, it may return an &EBUSY; if the required
90resources are temporarily unavailable. Other resource allocation
91points which may return <errorcode>EBUSY</errorcode> can be the
92&VIDIOC-STREAMON; ioctl and the first &func-read;, &func-write; and
93&func-select; call.</para>
94
95 <table frame="none" pgwide="1" id="v4l2-sliced-vbi-format">
96 <title>struct
97<structname>v4l2_sliced_vbi_format</structname></title>
98 <tgroup cols="5">
99 <colspec colname="c1" colwidth="3*" />
100 <colspec colname="c2" colwidth="3*" />
101 <colspec colname="c3" colwidth="2*" />
102 <colspec colname="c4" colwidth="2*" />
103 <colspec colname="c5" colwidth="2*" />
104 <spanspec namest="c3" nameend="c5" spanname="hspan" />
105 <tbody valign="top">
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>service_set</structfield></entry>
109 <entry spanname="hspan"><para>If
110<structfield>service_set</structfield> is non-zero when passed with
111&VIDIOC-S-FMT; or &VIDIOC-TRY-FMT;, the
112<structfield>service_lines</structfield> array will be filled by the
113driver according to the services specified in this field. For example,
114if <structfield>service_set</structfield> is initialized with
115<constant>V4L2_SLICED_TELETEXT_B | V4L2_SLICED_WSS_625</constant>, a
116driver for the cx25840 video decoder sets lines 7-22 of both
117fields<footnote><para>According to <link
118linkend="ets300706">ETS&nbsp;300&nbsp;706</link> lines 6-22 of the
119first field and lines 5-22 of the second field may carry Teletext
120data.</para></footnote> to <constant>V4L2_SLICED_TELETEXT_B</constant>
121and line 23 of the first field to
122<constant>V4L2_SLICED_WSS_625</constant>. If
123<structfield>service_set</structfield> is set to zero, then the values
124of <structfield>service_lines</structfield> will be used instead.
125</para><para>On return the driver sets this field to the union of all
126elements of the returned <structfield>service_lines</structfield>
127array. It may contain less services than requested, perhaps just one,
128if the hardware cannot handle more services simultaneously. It may be
129empty (zero) if none of the requested services are supported by the
130hardware.</para></entry>
131 </row>
132 <row>
133 <entry>__u16</entry>
134 <entry><structfield>service_lines</structfield>[2][24]</entry>
135 <entry spanname="hspan"><para>Applications initialize this
136array with sets of data services the driver shall look for or insert
137on the respective scan line. Subject to hardware capabilities drivers
138return the requested set, a subset, which may be just a single
139service, or an empty set. When the hardware cannot handle multiple
140services on the same line the driver shall choose one. No assumptions
141can be made on which service the driver chooses.</para><para>Data
142services are defined in <xref linkend="vbi-services2" />. Array indices
143map to ITU-R line numbers (see also <xref linkend="vbi-525" /> and <xref
144 linkend="vbi-625" />) as follows: <!-- No nested
145tables, sigh. --></para></entry>
146 </row>
147 <row>
148 <entry></entry>
149 <entry></entry>
150 <entry>Element</entry>
151 <entry>525 line systems</entry>
152 <entry>625 line systems</entry>
153 </row>
154 <row>
155 <entry></entry>
156 <entry></entry>
157 <entry><structfield>service_lines</structfield>[0][1]</entry>
158 <entry align="center">1</entry>
159 <entry align="center">1</entry>
160 </row>
161 <row>
162 <entry></entry>
163 <entry></entry>
164 <entry><structfield>service_lines</structfield>[0][23]</entry>
165 <entry align="center">23</entry>
166 <entry align="center">23</entry>
167 </row>
168 <row>
169 <entry></entry>
170 <entry></entry>
171 <entry><structfield>service_lines</structfield>[1][1]</entry>
172 <entry align="center">264</entry>
173 <entry align="center">314</entry>
174 </row>
175 <row>
176 <entry></entry>
177 <entry></entry>
178 <entry><structfield>service_lines</structfield>[1][23]</entry>
179 <entry align="center">286</entry>
180 <entry align="center">336</entry>
181 </row>
182 <!-- End of line numbers table. -->
183 <row>
184 <entry></entry>
185 <entry></entry>
186 <entry spanname="hspan">Drivers must set
187<structfield>service_lines</structfield>[0][0] and
188<structfield>service_lines</structfield>[1][0] to zero.</entry>
189 </row>
190 <row>
191 <entry>__u32</entry>
192 <entry><structfield>io_size</structfield></entry>
193 <entry spanname="hspan">Maximum number of bytes passed by
194one &func-read; or &func-write; call, and the buffer size in bytes for
195the &VIDIOC-QBUF; and &VIDIOC-DQBUF; ioctl. Drivers set this field to
196the size of &v4l2-sliced-vbi-data; times the number of non-zero
197elements in the returned <structfield>service_lines</structfield>
198array (that is the number of lines potentially carrying data).</entry>
199 </row>
200 <row>
201 <entry>__u32</entry>
202 <entry><structfield>reserved</structfield>[2]</entry>
203 <entry spanname="hspan">This array is reserved for future
204extensions. Applications and drivers must set it to zero.</entry>
205 </row>
206 </tbody>
207 </tgroup>
208 </table>
209
210 <!-- See also vidioc-g-sliced-vbi-cap.sgml -->
211 <table frame="none" pgwide="1" id="vbi-services2">
212 <title>Sliced VBI services</title>
213 <tgroup cols="5">
214 <colspec colname="c1" colwidth="2*" />
215 <colspec colname="c2" colwidth="1*" />
216 <colspec colname="c3" colwidth="1*" />
217 <colspec colname="c4" colwidth="2*" />
218 <colspec colname="c5" colwidth="2*" />
219 <spanspec namest="c3" nameend="c5" spanname="rlp" />
220 <thead>
221 <row>
222 <entry>Symbol</entry>
223 <entry>Value</entry>
224 <entry>Reference</entry>
225 <entry>Lines, usually</entry>
226 <entry>Payload</entry>
227 </row>
228 </thead>
229 <tbody valign="top">
230 <row>
231 <entry><constant>V4L2_SLICED_TELETEXT_B</constant>
232(Teletext System B)</entry>
233 <entry>0x0001</entry>
234 <entry><xref linkend="ets300706" />, <xref linkend="itu653" /></entry>
235 <entry>PAL/SECAM line 7-22, 320-335 (second field 7-22)</entry>
236 <entry>Last 42 of the 45 byte Teletext packet, that is
237without clock run-in and framing code, lsb first transmitted.</entry>
238 </row>
239 <row>
240 <entry><constant>V4L2_SLICED_VPS</constant></entry>
241 <entry>0x0400</entry>
242 <entry><xref linkend="ets300231" /></entry>
243 <entry>PAL line 16</entry>
244 <entry>Byte number 3 to 15 according to Figure 9 of
245ETS&nbsp;300&nbsp;231, lsb first transmitted.</entry>
246 </row>
247 <row>
248 <entry><constant>V4L2_SLICED_CAPTION_525</constant></entry>
249 <entry>0x1000</entry>
250 <entry><xref linkend="eia608" /></entry>
251 <entry>NTSC line 21, 284 (second field 21)</entry>
252 <entry>Two bytes in transmission order, including parity
253bit, lsb first transmitted.</entry>
254 </row>
255 <row>
256 <entry><constant>V4L2_SLICED_WSS_625</constant></entry>
257 <entry>0x4000</entry>
258 <entry><xref linkend="itu1119" />, <xref linkend="en300294" /></entry>
259 <entry>PAL/SECAM line 23</entry>
260 <entry><screen>
261Byte 0 1
262 msb lsb msb lsb
263 Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
264</screen></entry>
265 </row>
266 <row>
267 <entry><constant>V4L2_SLICED_VBI_525</constant></entry>
268 <entry>0x1000</entry>
269 <entry spanname="rlp">Set of services applicable to 525
270line systems.</entry>
271 </row>
272 <row>
273 <entry><constant>V4L2_SLICED_VBI_625</constant></entry>
274 <entry>0x4401</entry>
275 <entry spanname="rlp">Set of services applicable to 625
276line systems.</entry>
277 </row>
278 </tbody>
279 </tgroup>
280 </table>
281
282 <para>Drivers may return an &EINVAL; when applications attempt to
283read or write data without prior format negotiation, after switching
284the video standard (which may invalidate the negotiated VBI
285parameters) and after switching the video input (which may change the
286video standard as a side effect). The &VIDIOC-S-FMT; ioctl may return
287an &EBUSY; when applications attempt to change the format while i/o is
288in progress (between a &VIDIOC-STREAMON; and &VIDIOC-STREAMOFF; call,
289and after the first &func-read; or &func-write; call).</para>
290 </section>
291
292 <section>
293 <title>Reading and writing sliced VBI data</title>
294
295 <para>A single &func-read; or &func-write; call must pass all data
296belonging to one video frame. That is an array of
297<structname>v4l2_sliced_vbi_data</structname> structures with one or
298more elements and a total size not exceeding
299<structfield>io_size</structfield> bytes. Likewise in streaming I/O
300mode one buffer of <structfield>io_size</structfield> bytes must
301contain data of one video frame. The <structfield>id</structfield> of
302unused <structname>v4l2_sliced_vbi_data</structname> elements must be
303zero.</para>
304
305 <table frame="none" pgwide="1" id="v4l2-sliced-vbi-data">
306 <title>struct
307<structname>v4l2_sliced_vbi_data</structname></title>
308 <tgroup cols="3">
309 &cs-def;
310 <tbody valign="top">
311 <row>
312 <entry>__u32</entry>
313 <entry><structfield>id</structfield></entry>
314 <entry>A flag from <xref linkend="vbi-services" />
315identifying the type of data in this packet. Only a single bit must be
316set. When the <structfield>id</structfield> of a captured packet is
317zero, the packet is empty and the contents of other fields are
318undefined. Applications shall ignore empty packets. When the
319<structfield>id</structfield> of a packet for output is zero the
320contents of the <structfield>data</structfield> field are undefined
321and the driver must no longer insert data on the requested
322<structfield>field</structfield> and
323<structfield>line</structfield>.</entry>
324 </row>
325 <row>
326 <entry>__u32</entry>
327 <entry><structfield>field</structfield></entry>
328 <entry>The video field number this data has been captured
329from, or shall be inserted at. <constant>0</constant> for the first
330field, <constant>1</constant> for the second field.</entry>
331 </row>
332 <row>
333 <entry>__u32</entry>
334 <entry><structfield>line</structfield></entry>
335 <entry>The field (as opposed to frame) line number this
336data has been captured from, or shall be inserted at. See <xref
337 linkend="vbi-525" /> and <xref linkend="vbi-625" /> for valid
338values. Sliced VBI capture devices can set the line number of all
339packets to <constant>0</constant> if the hardware cannot reliably
340identify scan lines. The field number must always be valid.</entry>
341 </row>
342 <row>
343 <entry>__u32</entry>
344 <entry><structfield>reserved</structfield></entry>
345 <entry>This field is reserved for future extensions.
346Applications and drivers must set it to zero.</entry>
347 </row>
348 <row>
349 <entry>__u8</entry>
350 <entry><structfield>data</structfield>[48]</entry>
351 <entry>The packet payload. See <xref
352 linkend="vbi-services" /> for the contents and number of
353bytes passed for each data type. The contents of padding bytes at the
354end of this array are undefined, drivers and applications shall ignore
355them.</entry>
356 </row>
357 </tbody>
358 </tgroup>
359 </table>
360
361 <para>Packets are always passed in ascending line number order,
362without duplicate line numbers. The &func-write; function and the
363&VIDIOC-QBUF; ioctl must return an &EINVAL; when applications violate
364this rule. They must also return an &EINVAL; when applications pass an
365incorrect field or line number, or a combination of
366<structfield>field</structfield>, <structfield>line</structfield> and
367<structfield>id</structfield> which has not been negotiated with the
368&VIDIOC-G-FMT; or &VIDIOC-S-FMT; ioctl. When the line numbers are
369unknown the driver must pass the packets in transmitted order. The
370driver can insert empty packets with <structfield>id</structfield> set
371to zero anywhere in the packet array.</para>
372
373 <para>To assure synchronization and to distinguish from frame
374dropping, when a captured frame does not carry any of the requested
375data services drivers must pass one or more empty packets. When an
376application fails to pass VBI data in time for output, the driver
377must output the last VPS and WSS packet again, and disable the output
378of Closed Caption and Teletext data, or output data which is ignored
379by Closed Caption and Teletext decoders.</para>
380
381 <para>A sliced VBI device may support <link
382linkend="rw">read/write</link> and/or streaming (<link
383linkend="mmap">memory mapping</link> and/or <link linkend="userp">user
384pointer</link>) I/O. The latter bears the possibility of synchronizing
385video and VBI data by using buffer timestamps.</para>
386
387 </section>
388
389 <section>
390 <title>Sliced VBI Data in MPEG Streams</title>
391
392 <para>If a device can produce an MPEG output stream, it may be
393capable of providing <link
394linkend="sliced-vbi-format-negotitation">negotiated sliced VBI
395services</link> as data embedded in the MPEG stream. Users or
396applications control this sliced VBI data insertion with the <link
397linkend="v4l2-mpeg-stream-vbi-fmt">V4L2_CID_MPEG_STREAM_VBI_FMT</link>
398control.</para>
399
400 <para>If the driver does not provide the <link
401linkend="v4l2-mpeg-stream-vbi-fmt">V4L2_CID_MPEG_STREAM_VBI_FMT</link>
402control, or only allows that control to be set to <link
403linkend="v4l2-mpeg-stream-vbi-fmt"><constant>
404V4L2_MPEG_STREAM_VBI_FMT_NONE</constant></link>, then the device
405cannot embed sliced VBI data in the MPEG stream.</para>
406
407 <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt">
408V4L2_CID_MPEG_STREAM_VBI_FMT</link> control does not implicitly set
409the device driver to capture nor cease capturing sliced VBI data. The
410control only indicates to embed sliced VBI data in the MPEG stream, if
411an application has negotiated sliced VBI service be captured.</para>
412
413 <para>It may also be the case that a device can embed sliced VBI
414data in only certain types of MPEG streams: for example in an MPEG-2
415PS but not an MPEG-2 TS. In this situation, if sliced VBI data
416insertion is requested, the sliced VBI data will be embedded in MPEG
417stream types when supported, and silently omitted from MPEG stream
418types where sliced VBI data insertion is not supported by the device.
419</para>
420
421 <para>The following subsections specify the format of the
422embedded sliced VBI data.</para>
423
424 <section>
425 <title>MPEG Stream Embedded, Sliced VBI Data Format: NONE</title>
426 <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt"><constant>
427V4L2_MPEG_STREAM_VBI_FMT_NONE</constant></link> embedded sliced VBI
428format shall be interpreted by drivers as a control to cease
429embedding sliced VBI data in MPEG streams. Neither the device nor
430driver shall insert "empty" embedded sliced VBI data packets in the
431MPEG stream when this format is set. No MPEG stream data structures
432are specified for this format.</para>
433 </section>
434
435 <section>
436 <title>MPEG Stream Embedded, Sliced VBI Data Format: IVTV</title>
437 <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt"><constant>
438V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant></link> embedded sliced VBI
439format, when supported, indicates to the driver to embed up to 36
440lines of sliced VBI data per frame in an MPEG-2 <emphasis>Private
441Stream 1 PES</emphasis> packet encapsulated in an MPEG-2 <emphasis>
442Program Pack</emphasis> in the MPEG stream.</para>
443
444 <para><emphasis>Historical context</emphasis>: This format
445specification originates from a custom, embedded, sliced VBI data
446format used by the <filename>ivtv</filename> driver. This format
447has already been informally specified in the kernel sources in the
448file <filename>Documentation/video4linux/cx2341x/README.vbi</filename>
449. The maximum size of the payload and other aspects of this format
450are driven by the CX23415 MPEG decoder's capabilities and limitations
451with respect to extracting, decoding, and displaying sliced VBI data
452embedded within an MPEG stream.</para>
453
454 <para>This format's use is <emphasis>not</emphasis> exclusive to
455the <filename>ivtv</filename> driver <emphasis>nor</emphasis>
456exclusive to CX2341x devices, as the sliced VBI data packet insertion
457into the MPEG stream is implemented in driver software. At least the
458<filename>cx18</filename> driver provides sliced VBI data insertion
459into an MPEG-2 PS in this format as well.</para>
460
461 <para>The following definitions specify the payload of the
462MPEG-2 <emphasis>Private Stream 1 PES</emphasis> packets that contain
463sliced VBI data when <link linkend="v4l2-mpeg-stream-vbi-fmt">
464<constant>V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant></link> is set.
465(The MPEG-2 <emphasis>Private Stream 1 PES</emphasis> packet header
466and encapsulating MPEG-2 <emphasis>Program Pack</emphasis> header are
467not detailed here. Please refer to the MPEG-2 specifications for
468details on those packet headers.)</para>
469
470 <para>The payload of the MPEG-2 <emphasis>Private Stream 1 PES
471</emphasis> packets that contain sliced VBI data is specified by
472&v4l2-mpeg-vbi-fmt-ivtv;. The payload is variable
473length, depending on the actual number of lines of sliced VBI data
474present in a video frame. The payload may be padded at the end with
475unspecified fill bytes to align the end of the payload to a 4-byte
476boundary. The payload shall never exceed 1552 bytes (2 fields with
47718 lines/field with 43 bytes of data/line and a 4 byte magic number).
478</para>
479
480 <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-fmt-ivtv">
481 <title>struct <structname>v4l2_mpeg_vbi_fmt_ivtv</structname>
482 </title>
483 <tgroup cols="4">
484 &cs-ustr;
485 <tbody valign="top">
486 <row>
487 <entry>__u8</entry>
488 <entry><structfield>magic</structfield>[4]</entry>
489 <entry></entry>
490 <entry>A "magic" constant from <xref
491 linkend="v4l2-mpeg-vbi-fmt-ivtv-magic" /> that indicates
492this is a valid sliced VBI data payload and also indicates which
493member of the anonymous union, <structfield>itv0</structfield> or
494<structfield>ITV0</structfield>, to use for the payload data.</entry>
495 </row>
496 <row>
497 <entry>union</entry>
498 <entry>(anonymous)</entry>
499 </row>
500 <row>
501 <entry></entry>
502 <entry>struct <link linkend="v4l2-mpeg-vbi-itv0">
503 <structname>v4l2_mpeg_vbi_itv0</structname></link>
504 </entry>
505 <entry><structfield>itv0</structfield></entry>
506 <entry>The primary form of the sliced VBI data payload
507that contains anywhere from 1 to 35 lines of sliced VBI data.
508Line masks are provided in this form of the payload indicating
509which VBI lines are provided.</entry>
510 </row>
511 <row>
512 <entry></entry>
513 <entry>struct <link linkend="v4l2-mpeg-vbi-itv0-1">
514 <structname>v4l2_mpeg_vbi_ITV0</structname></link>
515 </entry>
516 <entry><structfield>ITV0</structfield></entry>
517 <entry>An alternate form of the sliced VBI data payload
518used when 36 lines of sliced VBI data are present. No line masks are
519provided in this form of the payload; all valid line mask bits are
520implcitly set.</entry>
521 </row>
522 </tbody>
523 </tgroup>
524 </table>
525
526 <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-fmt-ivtv-magic">
527 <title>Magic Constants for &v4l2-mpeg-vbi-fmt-ivtv;
528 <structfield>magic</structfield> field</title>
529 <tgroup cols="3">
530 &cs-def;
531 <thead>
532 <row>
533 <entry align="left">Defined Symbol</entry>
534 <entry align="left">Value</entry>
535 <entry align="left">Description</entry>
536 </row>
537 </thead>
538 <tbody valign="top">
539 <row>
540 <entry><constant>V4L2_MPEG_VBI_IVTV_MAGIC0</constant>
541 </entry>
542 <entry>"itv0"</entry>
543 <entry>Indicates the <structfield>itv0</structfield>
544member of the union in &v4l2-mpeg-vbi-fmt-ivtv; is valid.</entry>
545 </row>
546 <row>
547 <entry><constant>V4L2_MPEG_VBI_IVTV_MAGIC1</constant>
548 </entry>
549 <entry>"ITV0"</entry>
550 <entry>Indicates the <structfield>ITV0</structfield>
551member of the union in &v4l2-mpeg-vbi-fmt-ivtv; is valid and
552that 36 lines of sliced VBI data are present.</entry>
553 </row>
554 </tbody>
555 </tgroup>
556 </table>
557
558 <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-itv0">
559 <title>struct <structname>v4l2_mpeg_vbi_itv0</structname>
560 </title>
561 <tgroup cols="3">
562 &cs-str;
563 <tbody valign="top">
564 <row>
565 <entry>__le32</entry>
566 <entry><structfield>linemask</structfield>[2]</entry>
567 <entry><para>Bitmasks indicating the VBI service lines
568present. These <structfield>linemask</structfield> values are stored
569in little endian byte order in the MPEG stream. Some reference
570<structfield>linemask</structfield> bit positions with their
571corresponding VBI line number and video field are given below.
572b<subscript>0</subscript> indicates the least significant bit of a
573<structfield>linemask</structfield> value:<screen>
574<structfield>linemask</structfield>[0] b<subscript>0</subscript>: line 6 first field
575<structfield>linemask</structfield>[0] b<subscript>17</subscript>: line 23 first field
576<structfield>linemask</structfield>[0] b<subscript>18</subscript>: line 6 second field
577<structfield>linemask</structfield>[0] b<subscript>31</subscript>: line 19 second field
578<structfield>linemask</structfield>[1] b<subscript>0</subscript>: line 20 second field
579<structfield>linemask</structfield>[1] b<subscript>3</subscript>: line 23 second field
580<structfield>linemask</structfield>[1] b<subscript>4</subscript>-b<subscript>31</subscript>: unused and set to 0</screen></para></entry>
581 </row>
582 <row>
583 <entry>struct <link linkend="v4l2-mpeg-vbi-itv0-line">
584 <structname>v4l2_mpeg_vbi_itv0_line</structname></link>
585 </entry>
586 <entry><structfield>line</structfield>[35]</entry>
587 <entry>This is a variable length array that holds from 1
588to 35 lines of sliced VBI data. The sliced VBI data lines present
589correspond to the bits set in the <structfield>linemask</structfield>
590array, starting from b<subscript>0</subscript> of <structfield>
591linemask</structfield>[0] up through b<subscript>31</subscript> of
592<structfield>linemask</structfield>[0], and from b<subscript>0
593</subscript> of <structfield>linemask</structfield>[1] up through b
594<subscript>3</subscript> of <structfield>linemask</structfield>[1].
595<structfield>line</structfield>[0] corresponds to the first bit
596found set in the <structfield>linemask</structfield> array,
597<structfield>line</structfield>[1] corresponds to the second bit
598found set in the <structfield>linemask</structfield> array, etc.
599If no <structfield>linemask</structfield> array bits are set, then
600<structfield>line</structfield>[0] may contain one line of
601unspecified data that should be ignored by applications.</entry>
602 </row>
603 </tbody>
604 </tgroup>
605 </table>
606
607 <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-itv0-1">
608 <title>struct <structname>v4l2_mpeg_vbi_ITV0</structname>
609 </title>
610 <tgroup cols="3">
611 &cs-str;
612 <tbody valign="top">
613 <row>
614 <entry>struct <link linkend="v4l2-mpeg-vbi-itv0-line">
615 <structname>v4l2_mpeg_vbi_itv0_line</structname></link>
616 </entry>
617 <entry><structfield>line</structfield>[36]</entry>
618 <entry>A fixed length array of 36 lines of sliced VBI
619data. <structfield>line</structfield>[0] through <structfield>line
620</structfield>[17] correspond to lines 6 through 23 of the
621first field. <structfield>line</structfield>[18] through
622<structfield>line</structfield>[35] corresponds to lines 6
623through 23 of the second field.</entry>
624 </row>
625 </tbody>
626 </tgroup>
627 </table>
628
629 <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-itv0-line">
630 <title>struct <structname>v4l2_mpeg_vbi_itv0_line</structname>
631 </title>
632 <tgroup cols="3">
633 &cs-str;
634 <tbody valign="top">
635 <row>
636 <entry>__u8</entry>
637 <entry><structfield>id</structfield></entry>
638 <entry>A line identifier value from
639<xref linkend="ITV0-Line-Identifier-Constants" /> that indicates
640the type of sliced VBI data stored on this line.</entry>
641 </row>
642 <row>
643 <entry>__u8</entry>
644 <entry><structfield>data</structfield>[42]</entry>
645 <entry>The sliced VBI data for the line.</entry>
646 </row>
647 </tbody>
648 </tgroup>
649 </table>
650
651 <table frame="none" pgwide="1" id="ITV0-Line-Identifier-Constants">
652 <title>Line Identifiers for struct <link
653 linkend="v4l2-mpeg-vbi-itv0-line"><structname>
654v4l2_mpeg_vbi_itv0_line</structname></link> <structfield>id
655</structfield> field</title>
656 <tgroup cols="3">
657 &cs-def;
658 <thead>
659 <row>
660 <entry align="left">Defined Symbol</entry>
661 <entry align="left">Value</entry>
662 <entry align="left">Description</entry>
663 </row>
664 </thead>
665 <tbody valign="top">
666 <row>
667 <entry><constant>V4L2_MPEG_VBI_IVTV_TELETEXT_B</constant>
668 </entry>
669 <entry>1</entry>
670 <entry>Refer to <link linkend="vbi-services2">
671Sliced VBI services</link> for a description of the line payload.</entry>
672 </row>
673 <row>
674 <entry><constant>V4L2_MPEG_VBI_IVTV_CAPTION_525</constant>
675 </entry>
676 <entry>4</entry>
677 <entry>Refer to <link linkend="vbi-services2">
678Sliced VBI services</link> for a description of the line payload.</entry>
679 </row>
680 <row>
681 <entry><constant>V4L2_MPEG_VBI_IVTV_WSS_625</constant>
682 </entry>
683 <entry>5</entry>
684 <entry>Refer to <link linkend="vbi-services2">
685Sliced VBI services</link> for a description of the line payload.</entry>
686 </row>
687 <row>
688 <entry><constant>V4L2_MPEG_VBI_IVTV_VPS</constant>
689 </entry>
690 <entry>7</entry>
691 <entry>Refer to <link linkend="vbi-services2">
692Sliced VBI services</link> for a description of the line payload.</entry>
693 </row>
694 </tbody>
695 </tgroup>
696 </table>
697
698 </section>
699 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
new file mode 100644
index 00000000000..d15aaf83f56
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -0,0 +1,467 @@
1 <title>Sub-device Interface</title>
2
3 <note>
4 <title>Experimental</title>
5 <para>This is an <link linkend="experimental">experimental</link>
6 interface and may change in the future.</para>
7 </note>
8
9 <para>The complex nature of V4L2 devices, where hardware is often made of
10 several integrated circuits that need to interact with each other in a
11 controlled way, leads to complex V4L2 drivers. The drivers usually reflect
12 the hardware model in software, and model the different hardware components
13 as software blocks called sub-devices.</para>
14
15 <para>V4L2 sub-devices are usually kernel-only objects. If the V4L2 driver
16 implements the media device API, they will automatically inherit from media
17 entities. Applications will be able to enumerate the sub-devices and discover
18 the hardware topology using the media entities, pads and links enumeration
19 API.</para>
20
21 <para>In addition to make sub-devices discoverable, drivers can also choose
22 to make them directly configurable by applications. When both the sub-device
23 driver and the V4L2 device driver support this, sub-devices will feature a
24 character device node on which ioctls can be called to
25 <itemizedlist>
26 <listitem><para>query, read and write sub-devices controls</para></listitem>
27 <listitem><para>subscribe and unsubscribe to events and retrieve them</para></listitem>
28 <listitem><para>negotiate image formats on individual pads</para></listitem>
29 </itemizedlist>
30 </para>
31
32 <para>Sub-device character device nodes, conventionally named
33 <filename>/dev/v4l-subdev*</filename>, use major number 81.</para>
34
35 <section>
36 <title>Controls</title>
37 <para>Most V4L2 controls are implemented by sub-device hardware. Drivers
38 usually merge all controls and expose them through video device nodes.
39 Applications can control all sub-devices through a single interface.</para>
40
41 <para>Complex devices sometimes implement the same control in different
42 pieces of hardware. This situation is common in embedded platforms, where
43 both sensors and image processing hardware implement identical functions,
44 such as contrast adjustment, white balance or faulty pixels correction. As
45 the V4L2 controls API doesn't support several identical controls in a single
46 device, all but one of the identical controls are hidden.</para>
47
48 <para>Applications can access those hidden controls through the sub-device
49 node with the V4L2 control API described in <xref linkend="control" />. The
50 ioctls behave identically as when issued on V4L2 device nodes, with the
51 exception that they deal only with controls implemented in the sub-device.
52 </para>
53
54 <para>Depending on the driver, those controls might also be exposed through
55 one (or several) V4L2 device nodes.</para>
56 </section>
57
58 <section>
59 <title>Events</title>
60 <para>V4L2 sub-devices can notify applications of events as described in
61 <xref linkend="event" />. The API behaves identically as when used on V4L2
62 device nodes, with the exception that it only deals with events generated by
63 the sub-device. Depending on the driver, those events might also be reported
64 on one (or several) V4L2 device nodes.</para>
65 </section>
66
67 <section id="pad-level-formats">
68 <title>Pad-level Formats</title>
69
70 <warning><para>Pad-level formats are only applicable to very complex device that
71 need to expose low-level format configuration to user space. Generic V4L2
72 applications do <emphasis>not</emphasis> need to use the API described in
73 this section.</para></warning>
74
75 <note><para>For the purpose of this section, the term
76 <wordasword>format</wordasword> means the combination of media bus data
77 format, frame width and frame height.</para></note>
78
79 <para>Image formats are typically negotiated on video capture and
80 output devices using the format and <link
81 linkend="vidioc-subdev-g-selection">selection</link> ioctls. The
82 driver is responsible for configuring every block in the video
83 pipeline according to the requested format at the pipeline input
84 and/or output.</para>
85
86 <para>For complex devices, such as often found in embedded systems,
87 identical image sizes at the output of a pipeline can be achieved using
88 different hardware configurations. One such example is shown on
89 <xref linkend="pipeline-scaling" />, where
90 image scaling can be performed on both the video sensor and the host image
91 processing hardware.</para>
92
93 <figure id="pipeline-scaling">
94 <title>Image Format Negotiation on Pipelines</title>
95 <mediaobject>
96 <imageobject>
97 <imagedata fileref="pipeline.pdf" format="PS" />
98 </imageobject>
99 <imageobject>
100 <imagedata fileref="pipeline.png" format="PNG" />
101 </imageobject>
102 <textobject>
103 <phrase>High quality and high speed pipeline configuration</phrase>
104 </textobject>
105 </mediaobject>
106 </figure>
107
108 <para>The sensor scaler is usually of less quality than the host scaler, but
109 scaling on the sensor is required to achieve higher frame rates. Depending
110 on the use case (quality vs. speed), the pipeline must be configured
111 differently. Applications need to configure the formats at every point in
112 the pipeline explicitly.</para>
113
114 <para>Drivers that implement the <link linkend="media-controller-intro">media
115 API</link> can expose pad-level image format configuration to applications.
116 When they do, applications can use the &VIDIOC-SUBDEV-G-FMT; and
117 &VIDIOC-SUBDEV-S-FMT; ioctls. to negotiate formats on a per-pad basis.</para>
118
119 <para>Applications are responsible for configuring coherent parameters on
120 the whole pipeline and making sure that connected pads have compatible
121 formats. The pipeline is checked for formats mismatch at &VIDIOC-STREAMON;
122 time, and an &EPIPE; is then returned if the configuration is
123 invalid.</para>
124
125 <para>Pad-level image format configuration support can be tested by calling
126 the &VIDIOC-SUBDEV-G-FMT; ioctl on pad 0. If the driver returns an &EINVAL;
127 pad-level format configuration is not supported by the sub-device.</para>
128
129 <section>
130 <title>Format Negotiation</title>
131
132 <para>Acceptable formats on pads can (and usually do) depend on a number
133 of external parameters, such as formats on other pads, active links, or
134 even controls. Finding a combination of formats on all pads in a video
135 pipeline, acceptable to both application and driver, can't rely on formats
136 enumeration only. A format negotiation mechanism is required.</para>
137
138 <para>Central to the format negotiation mechanism are the get/set format
139 operations. When called with the <structfield>which</structfield> argument
140 set to <constant>V4L2_SUBDEV_FORMAT_TRY</constant>, the
141 &VIDIOC-SUBDEV-G-FMT; and &VIDIOC-SUBDEV-S-FMT; ioctls operate on a set of
142 formats parameters that are not connected to the hardware configuration.
143 Modifying those 'try' formats leaves the device state untouched (this
144 applies to both the software state stored in the driver and the hardware
145 state stored in the device itself).</para>
146
147 <para>While not kept as part of the device state, try formats are stored
148 in the sub-device file handles. A &VIDIOC-SUBDEV-G-FMT; call will return
149 the last try format set <emphasis>on the same sub-device file
150 handle</emphasis>. Several applications querying the same sub-device at
151 the same time will thus not interact with each other.</para>
152
153 <para>To find out whether a particular format is supported by the device,
154 applications use the &VIDIOC-SUBDEV-S-FMT; ioctl. Drivers verify and, if
155 needed, change the requested <structfield>format</structfield> based on
156 device requirements and return the possibly modified value. Applications
157 can then choose to try a different format or accept the returned value and
158 continue.</para>
159
160 <para>Formats returned by the driver during a negotiation iteration are
161 guaranteed to be supported by the device. In particular, drivers guarantee
162 that a returned format will not be further changed if passed to an
163 &VIDIOC-SUBDEV-S-FMT; call as-is (as long as external parameters, such as
164 formats on other pads or links' configuration are not changed).</para>
165
166 <para>Drivers automatically propagate formats inside sub-devices. When a
167 try or active format is set on a pad, corresponding formats on other pads
168 of the same sub-device can be modified by the driver. Drivers are free to
169 modify formats as required by the device. However, they should comply with
170 the following rules when possible:
171 <itemizedlist>
172 <listitem><para>Formats should be propagated from sink pads to source pads.
173 Modifying a format on a source pad should not modify the format on any
174 sink pad.</para></listitem>
175 <listitem><para>Sub-devices that scale frames using variable scaling factors
176 should reset the scale factors to default values when sink pads formats
177 are modified. If the 1:1 scaling ratio is supported, this means that
178 source pads formats should be reset to the sink pads formats.</para></listitem>
179 </itemizedlist>
180 </para>
181
182 <para>Formats are not propagated across links, as that would involve
183 propagating them from one sub-device file handle to another. Applications
184 must then take care to configure both ends of every link explicitly with
185 compatible formats. Identical formats on the two ends of a link are
186 guaranteed to be compatible. Drivers are free to accept different formats
187 matching device requirements as being compatible.</para>
188
189 <para><xref linkend="sample-pipeline-config" />
190 shows a sample configuration sequence for the pipeline described in
191 <xref linkend="pipeline-scaling" /> (table
192 columns list entity names and pad numbers).</para>
193
194 <table pgwide="0" frame="none" id="sample-pipeline-config">
195 <title>Sample Pipeline Configuration</title>
196 <tgroup cols="3">
197 <colspec colname="what"/>
198 <colspec colname="sensor-0" />
199 <colspec colname="frontend-0" />
200 <colspec colname="frontend-1" />
201 <colspec colname="scaler-0" />
202 <colspec colname="scaler-1" />
203 <thead>
204 <row>
205 <entry></entry>
206 <entry>Sensor/0</entry>
207 <entry>Frontend/0</entry>
208 <entry>Frontend/1</entry>
209 <entry>Scaler/0</entry>
210 <entry>Scaler/1</entry>
211 </row>
212 </thead>
213 <tbody valign="top">
214 <row>
215 <entry>Initial state</entry>
216 <entry>2048x1536</entry>
217 <entry>-</entry>
218 <entry>-</entry>
219 <entry>-</entry>
220 <entry>-</entry>
221 </row>
222 <row>
223 <entry>Configure frontend input</entry>
224 <entry>2048x1536</entry>
225 <entry><emphasis>2048x1536</emphasis></entry>
226 <entry><emphasis>2046x1534</emphasis></entry>
227 <entry>-</entry>
228 <entry>-</entry>
229 </row>
230 <row>
231 <entry>Configure scaler input</entry>
232 <entry>2048x1536</entry>
233 <entry>2048x1536</entry>
234 <entry>2046x1534</entry>
235 <entry><emphasis>2046x1534</emphasis></entry>
236 <entry><emphasis>2046x1534</emphasis></entry>
237 </row>
238 <row>
239 <entry>Configure scaler output</entry>
240 <entry>2048x1536</entry>
241 <entry>2048x1536</entry>
242 <entry>2046x1534</entry>
243 <entry>2046x1534</entry>
244 <entry><emphasis>1280x960</emphasis></entry>
245 </row>
246 </tbody>
247 </tgroup>
248 </table>
249
250 <para>
251 <orderedlist>
252 <listitem><para>Initial state. The sensor output is set to its native 3MP
253 resolution. Resolutions on the host frontend and scaler input and output
254 pads are undefined.</para></listitem>
255 <listitem><para>The application configures the frontend input pad resolution to
256 2048x1536. The driver propagates the format to the frontend output pad.
257 Note that the propagated output format can be different, as in this case,
258 than the input format, as the hardware might need to crop pixels (for
259 instance when converting a Bayer filter pattern to RGB or YUV).</para></listitem>
260 <listitem><para>The application configures the scaler input pad resolution to
261 2046x1534 to match the frontend output resolution. The driver propagates
262 the format to the scaler output pad.</para></listitem>
263 <listitem><para>The application configures the scaler output pad resolution to
264 1280x960.</para></listitem>
265 </orderedlist>
266 </para>
267
268 <para>When satisfied with the try results, applications can set the active
269 formats by setting the <structfield>which</structfield> argument to
270 <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. Active formats are changed
271 exactly as try formats by drivers. To avoid modifying the hardware state
272 during format negotiation, applications should negotiate try formats first
273 and then modify the active settings using the try formats returned during
274 the last negotiation iteration. This guarantees that the active format
275 will be applied as-is by the driver without being modified.
276 </para>
277 </section>
278
279 <section id="v4l2-subdev-selections">
280 <title>Selections: cropping, scaling and composition</title>
281
282 <para>Many sub-devices support cropping frames on their input or output
283 pads (or possible even on both). Cropping is used to select the area of
284 interest in an image, typically on an image sensor or a video decoder. It can
285 also be used as part of digital zoom implementations to select the area of
286 the image that will be scaled up.</para>
287
288 <para>Crop settings are defined by a crop rectangle and represented in a
289 &v4l2-rect; by the coordinates of the top left corner and the rectangle
290 size. Both the coordinates and sizes are expressed in pixels.</para>
291
292 <para>As for pad formats, drivers store try and active
293 rectangles for the selection targets <xref
294 linkend="v4l2-selections-common" />.</para>
295
296 <para>On sink pads, cropping is applied relative to the
297 current pad format. The pad format represents the image size as
298 received by the sub-device from the previous block in the
299 pipeline, and the crop rectangle represents the sub-image that
300 will be transmitted further inside the sub-device for
301 processing.</para>
302
303 <para>The scaling operation changes the size of the image by
304 scaling it to new dimensions. The scaling ratio isn't specified
305 explicitly, but is implied from the original and scaled image
306 sizes. Both sizes are represented by &v4l2-rect;.</para>
307
308 <para>Scaling support is optional. When supported by a subdev,
309 the crop rectangle on the subdev's sink pad is scaled to the
310 size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL
311 using <constant>V4L2_SEL_TGT_COMPOSE</constant>
312 selection target on the same pad. If the subdev supports scaling
313 but not composing, the top and left values are not used and must
314 always be set to zero.</para>
315
316 <para>On source pads, cropping is similar to sink pads, with the
317 exception that the source size from which the cropping is
318 performed, is the COMPOSE rectangle on the sink pad. In both
319 sink and source pads, the crop rectangle must be entirely
320 contained inside the source image size for the crop
321 operation.</para>
322
323 <para>The drivers should always use the closest possible
324 rectangle the user requests on all selection targets, unless
325 specifically told otherwise.
326 <constant>V4L2_SEL_FLAG_GE</constant> and
327 <constant>V4L2_SEL_FLAG_LE</constant> flags may be
328 used to round the image size either up or down. <xref
329 linkend="v4l2-selection-flags" /></para>
330 </section>
331
332 <section>
333 <title>Types of selection targets</title>
334
335 <section>
336 <title>Actual targets</title>
337
338 <para>Actual targets (without a postfix) reflect the actual
339 hardware configuration at any point of time. There is a BOUNDS
340 target corresponding to every actual target.</para>
341 </section>
342
343 <section>
344 <title>BOUNDS targets</title>
345
346 <para>BOUNDS targets is the smallest rectangle that contains all
347 valid actual rectangles. It may not be possible to set the actual
348 rectangle as large as the BOUNDS rectangle, however. This may be
349 because e.g. a sensor's pixel array is not rectangular but
350 cross-shaped or round. The maximum size may also be smaller than the
351 BOUNDS rectangle.</para>
352 </section>
353
354 </section>
355
356 <section>
357 <title>Order of configuration and format propagation</title>
358
359 <para>Inside subdevs, the order of image processing steps will
360 always be from the sink pad towards the source pad. This is also
361 reflected in the order in which the configuration must be
362 performed by the user: the changes made will be propagated to
363 any subsequent stages. If this behaviour is not desired, the
364 user must set
365 <constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant> flag. This
366 flag causes no propagation of the changes are allowed in any
367 circumstances. This may also cause the accessed rectangle to be
368 adjusted by the driver, depending on the properties of the
369 underlying hardware.</para>
370
371 <para>The coordinates to a step always refer to the actual size
372 of the previous step. The exception to this rule is the source
373 compose rectangle, which refers to the sink compose bounds
374 rectangle --- if it is supported by the hardware.</para>
375
376 <orderedlist>
377 <listitem><para>Sink pad format. The user configures the sink pad
378 format. This format defines the parameters of the image the
379 entity receives through the pad for further processing.</para></listitem>
380
381 <listitem><para>Sink pad actual crop selection. The sink pad crop
382 defines the crop performed to the sink pad format.</para></listitem>
383
384 <listitem><para>Sink pad actual compose selection. The size of the
385 sink pad compose rectangle defines the scaling ratio compared
386 to the size of the sink pad crop rectangle. The location of
387 the compose rectangle specifies the location of the actual
388 sink compose rectangle in the sink compose bounds
389 rectangle.</para></listitem>
390
391 <listitem><para>Source pad actual crop selection. Crop on the source
392 pad defines crop performed to the image in the sink compose
393 bounds rectangle.</para></listitem>
394
395 <listitem><para>Source pad format. The source pad format defines the
396 output pixel format of the subdev, as well as the other
397 parameters with the exception of the image width and height.
398 Width and height are defined by the size of the source pad
399 actual crop selection.</para></listitem>
400 </orderedlist>
401
402 <para>Accessing any of the above rectangles not supported by the
403 subdev will return <constant>EINVAL</constant>. Any rectangle
404 referring to a previous unsupported rectangle coordinates will
405 instead refer to the previous supported rectangle. For example,
406 if sink crop is not supported, the compose selection will refer
407 to the sink pad format dimensions instead.</para>
408
409 <figure id="subdev-image-processing-crop">
410 <title>Image processing in subdevs: simple crop example</title>
411 <mediaobject>
412 <imageobject>
413 <imagedata fileref="subdev-image-processing-crop.svg"
414 format="SVG" scale="200" />
415 </imageobject>
416 </mediaobject>
417 </figure>
418
419 <para>In the above example, the subdev supports cropping on its
420 sink pad. To configure it, the user sets the media bus format on
421 the subdev's sink pad. Now the actual crop rectangle can be set
422 on the sink pad --- the location and size of this rectangle
423 reflect the location and size of a rectangle to be cropped from
424 the sink format. The size of the sink crop rectangle will also
425 be the size of the format of the subdev's source pad.</para>
426
427 <figure id="subdev-image-processing-scaling-multi-source">
428 <title>Image processing in subdevs: scaling with multiple sources</title>
429 <mediaobject>
430 <imageobject>
431 <imagedata fileref="subdev-image-processing-scaling-multi-source.svg"
432 format="SVG" scale="200" />
433 </imageobject>
434 </mediaobject>
435 </figure>
436
437 <para>In this example, the subdev is capable of first cropping,
438 then scaling and finally cropping for two source pads
439 individually from the resulting scaled image. The location of
440 the scaled image in the cropped image is ignored in sink compose
441 target. Both of the locations of the source crop rectangles
442 refer to the sink scaling rectangle, independently cropping an
443 area at location specified by the source crop rectangle from
444 it.</para>
445
446 <figure id="subdev-image-processing-full">
447 <title>Image processing in subdevs: scaling and composition
448 with multiple sinks and sources</title>
449 <mediaobject>
450 <imageobject>
451 <imagedata fileref="subdev-image-processing-full.svg"
452 format="SVG" scale="200" />
453 </imageobject>
454 </mediaobject>
455 </figure>
456
457 <para>The subdev driver supports two sink pads and two source
458 pads. The images from both of the sink pads are individually
459 cropped, then scaled and further composed on the composition
460 bounds rectangle. From that, two independent streams are cropped
461 and sent out of the subdev from the source pads.</para>
462
463 </section>
464
465 </section>
466
467 &sub-subdev-formats;
diff --git a/Documentation/DocBook/media/v4l/dev-teletext.xml b/Documentation/DocBook/media/v4l/dev-teletext.xml
new file mode 100644
index 00000000000..bd21c64d70f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-teletext.xml
@@ -0,0 +1,29 @@
1 <title>Teletext Interface</title>
2
3 <para>This interface was aimed at devices receiving and demodulating
4Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the
5Teletext packages and storing formatted pages in cache memory. Such
6devices are usually implemented as microcontrollers with serial
7interface (I<superscript>2</superscript>C) and could be found on old
8TV cards, dedicated Teletext decoding cards and home-brew devices
9connected to the PC parallel port.</para>
10
11 <para>The Teletext API was designed by Martin Buck. It was defined in
12the kernel header file <filename>linux/videotext.h</filename>, the
13specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/">
14ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of
15the German public television Teletext service.)</para>
16
17 <para>Eventually the Teletext API was integrated into the V4L API
18with character device file names <filename>/dev/vtx0</filename> to
19<filename>/dev/vtx31</filename>, device major number 81, minor numbers
20192 to 223.</para>
21
22 <para>However, teletext decoders were quickly replaced by more
23generic VBI demodulators and those dedicated teletext decoders no longer exist.
24For many years the vtx devices were still around, even though nobody used
25them. So the decision was made to finally remove support for the Teletext API in
26kernel 2.6.37.</para>
27
28 <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or
29<link linkend="sliced">sliced</link> VBI API.</para>
diff --git a/Documentation/DocBook/media/v4l/driver.xml b/Documentation/DocBook/media/v4l/driver.xml
new file mode 100644
index 00000000000..7c6638baced
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/driver.xml
@@ -0,0 +1,200 @@
1 <title>V4L2 Driver Programming</title>
2
3 <!-- This part defines the interface between the "videodev"
4 module and individual drivers. -->
5
6 <para>to do</para>
7<!--
8 <para>V4L2 is a two-layer driver system. The top layer is the "videodev"
9kernel module. When videodev initializes it registers as character device
10with major number 81, and it registers a set of file operations. All V4L2
11drivers are really clients of videodev, which calls V4L2 drivers through
12driver method functions. V4L2 drivers are also written as kernel modules.
13After probing the hardware they register one or more devices with
14videodev.</para>
15
16 <section id="driver-modules">
17 <title>Driver Modules</title>
18
19 <para>V4L2 driver modules must have an initialization function which is
20called after the module was loaded into kernel, an exit function whis is
21called before the module is removed. When the driver is compiled into the
22kernel these functions called at system boot and shutdown time.</para>
23
24 <informalexample>
25 <programlisting>
26#include &lt;linux/module.h&gt;
27
28/* Export information about this module. For details and other useful
29 macros see <filename>linux/module.h</filename>. */
30MODULE_DESCRIPTION("my - driver for my hardware");
31MODULE_AUTHOR("Your name here");
32MODULE_LICENSE("GPL");
33
34static void
35my_module_exit (void)
36{
37 /* Free all resources allocated by my_module_init(). */
38}
39
40static int
41my_module_init (void)
42{
43 /* Bind the driver to the supported hardware, see
44 <link linkend="driver-pci"> and
45 <link linkend="driver-usb"> for examples. */
46
47 return 0; /* a negative value on error, 0 on success. */
48}
49
50/* Export module functions. */
51module_init (my_module_init);
52module_exit (my_module_exit);
53</programlisting>
54 </informalexample>
55
56 <para>Users can add parameters when kernel modules are inserted:</para>
57
58 <informalexample>
59 <programlisting>
60include &lt;linux/moduleparam.h&gt;
61
62static int my_option = 123;
63static int my_option_array[47];
64
65/* Export the symbol, an int, with access permissions 0664.
66 See <filename>linux/moduleparam.h</filename> for other types. */
67module_param (my_option, int, 0644);
68module_param_array (my_option_array, int, NULL, 0644);
69
70MODULE_PARM_DESC (my_option, "Does magic things, default 123");
71</programlisting>
72 </informalexample>
73
74 <para>One parameter should be supported by all V4L2 drivers, the minor
75number of the device it will register. Purpose is to predictably link V4L2
76drivers to device nodes if more than one video device is installed. Use the
77name of the device node followed by a "_nr" suffix, for example "video_nr"
78for <filename>/dev/video</filename>.</para>
79
80 <informalexample>
81 <programlisting>
82/* Minor number of the device, -1 to allocate the first unused. */
83static int video_nr = -1;
84
85module_param (video_nr, int, 0444);
86</programlisting>
87 </informalexample>
88 </section>
89
90 <section id="driver-pci">
91 <title>PCI Devices</title>
92
93 <para>PCI devices are initialized like this:</para>
94
95 <informalexample>
96 <programlisting>
97typedef struct {
98 /* State of one physical device. */
99} my_device;
100
101static int
102my_resume (struct pci_dev * pci_dev)
103{
104 /* Restore the suspended device to working state. */
105}
106
107static int
108my_suspend (struct pci_dev * pci_dev,
109 pm_message_t state)
110{
111 /* This function is called before the system goes to sleep.
112 Stop all DMAs and disable interrupts, then put the device
113 into a low power state. For details see the kernel
114 sources under <filename>Documentation/power</filename>. */
115
116 return 0; /* a negative value on error, 0 on success. */
117}
118
119static void
120my_remove (struct pci_dev * pci_dev)
121{
122 my_device *my = pci_get_drvdata (pci_dev);
123
124 /* Describe me. */
125}
126
127static int
128my_probe (struct pci_dev * pci_dev,
129 const struct pci_device_id * pci_id)
130{
131 my_device *my;
132
133 /* Describe me. */
134
135 /* You can allocate per-device data here and store a pointer
136 to it in the pci_dev structure. */
137 my = ...;
138 pci_set_drvdata (pci_dev, my);
139
140 return 0; /* a negative value on error, 0 on success. */
141}
142
143/* A list of supported PCI devices. */
144static struct pci_device_id
145my_pci_device_ids [] = {
146 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
147 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
148 { 0 } /* end of list */
149};
150
151/* Load our module if supported PCI devices are installed. */
152MODULE_DEVICE_TABLE (pci, my_pci_device_ids);
153
154static struct pci_driver
155my_pci_driver = {
156 .name = "my",
157 .id_table = my_pci_device_ids,
158
159 .probe = my_probe,
160 .remove = my_remove,
161
162 /* Power management functions. */
163 .suspend = my_suspend,
164 .resume = my_resume,
165};
166
167static void
168my_module_exit (void)
169{
170 pci_unregister_driver (&my_pci_driver);
171}
172
173static int
174my_module_init (void)
175{
176 return pci_register_driver (&my_pci_driver);
177}
178</programlisting>
179 </informalexample>
180 </section>
181
182 <section id="driver-usb">
183 <title>USB Devices</title>
184 <para>to do</para>
185 </section>
186 <section id="driver-registering">
187 <title>Registering V4L2 Drivers</title>
188
189 <para>After a V4L2 driver probed the hardware it registers one or more
190devices with the videodev module.</para>
191 </section>
192 <section id="driver-file-ops">
193 <title>File Operations</title>
194 <para>to do</para>
195 </section>
196 <section id="driver-internal-api">
197 <title>Internal API</title>
198 <para>to do</para>
199 </section>
200-->
diff --git a/Documentation/DocBook/media/v4l/fdl-appendix.xml b/Documentation/DocBook/media/v4l/fdl-appendix.xml
new file mode 100644
index 00000000000..ae22394ba99
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/fdl-appendix.xml
@@ -0,0 +1,671 @@
1<!--
2 The GNU Free Documentation License 1.1 in DocBook
3 Markup by Eric Baudais <baudais@okstate.edu>
4 Maintained by the GNOME Documentation Project
5 http://live.gnome.org/DocumentationProject
6 Version: 1.0.1
7 Last Modified: Nov 16, 2000
8-->
9
10<appendix id="fdl">
11 <appendixinfo>
12 <releaseinfo>
13 Version 1.1, March 2000
14 </releaseinfo>
15 <copyright>
16 <year>2000</year><holder>Free Software Foundation, Inc.</holder>
17 </copyright>
18 <legalnotice id="fdl-legalnotice">
19 <para>
20 <address>Free Software Foundation, Inc. <street>59 Temple Place,
21 Suite 330</street>, <city>Boston</city>, <state>MA</state>
22 <postcode>02111-1307</postcode> <country>USA</country></address>
23 Everyone is permitted to copy and distribute verbatim copies of this
24 license document, but changing it is not allowed.
25 </para>
26 </legalnotice>
27 </appendixinfo>
28 <title>GNU Free Documentation License</title>
29
30 <sect1 id="fdl-preamble">
31 <title>0. PREAMBLE</title>
32 <para>
33 The purpose of this License is to make a manual, textbook, or
34 other written document <quote>free</quote> in the sense of
35 freedom: to assure everyone the effective freedom to copy and
36 redistribute it, with or without modifying it, either
37 commercially or noncommercially. Secondarily, this License
38 preserves for the author and publisher a way to get credit for
39 their work, while not being considered responsible for
40 modifications made by others.
41 </para>
42
43 <para>
44 This License is a kind of <quote>copyleft</quote>, which means
45 that derivative works of the document must themselves be free in
46 the same sense. It complements the GNU General Public License,
47 which is a copyleft license designed for free software.
48 </para>
49
50 <para>
51 We have designed this License in order to use it for manuals for
52 free software, because free software needs free documentation: a
53 free program should come with manuals providing the same
54 freedoms that the software does. But this License is not limited
55 to software manuals; it can be used for any textual work,
56 regardless of subject matter or whether it is published as a
57 printed book. We recommend this License principally for works
58 whose purpose is instruction or reference.
59 </para>
60 </sect1>
61 <sect1 id="fdl-section1">
62 <title>1. APPLICABILITY AND DEFINITIONS</title>
63 <para id="fdl-document">
64 This License applies to any manual or other work that contains a
65 notice placed by the copyright holder saying it can be
66 distributed under the terms of this License. The
67 <quote>Document</quote>, below, refers to any such manual or
68 work. Any member of the public is a licensee, and is addressed
69 as <quote>you</quote>.
70 </para>
71
72 <para id="fdl-modified">
73 A <quote>Modified Version</quote> of the Document means any work
74 containing the Document or a portion of it, either copied
75 verbatim, or with modifications and/or translated into another
76 language.
77 </para>
78
79 <para id="fdl-secondary">
80 A <quote>Secondary Section</quote> is a named appendix or a
81 front-matter section of the <link
82 linkend="fdl-document">Document</link> that deals exclusively
83 with the relationship of the publishers or authors of the
84 Document to the Document's overall subject (or to related
85 matters) and contains nothing that could fall directly within
86 that overall subject. (For example, if the Document is in part a
87 textbook of mathematics, a Secondary Section may not explain any
88 mathematics.) The relationship could be a matter of historical
89 connection with the subject or with related matters, or of
90 legal, commercial, philosophical, ethical or political position
91 regarding them.
92 </para>
93
94 <para id="fdl-invariant">
95 The <quote>Invariant Sections</quote> are certain <link
96 linkend="fdl-secondary"> Secondary Sections</link> whose titles
97 are designated, as being those of Invariant Sections, in the
98 notice that says that the <link
99 linkend="fdl-document">Document</link> is released under this
100 License.
101 </para>
102
103 <para id="fdl-cover-texts">
104 The <quote>Cover Texts</quote> are certain short passages of
105 text that are listed, as Front-Cover Texts or Back-Cover Texts,
106 in the notice that says that the <link
107 linkend="fdl-document">Document</link> is released under this
108 License.
109 </para>
110
111 <para id="fdl-transparent">
112 A <quote>Transparent</quote> copy of the <link
113 linkend="fdl-document"> Document</link> means a machine-readable
114 copy, represented in a format whose specification is available
115 to the general public, whose contents can be viewed and edited
116 directly and straightforwardly with generic text editors or (for
117 images composed of pixels) generic paint programs or (for
118 drawings) some widely available drawing editor, and that is
119 suitable for input to text formatters or for automatic
120 translation to a variety of formats suitable for input to text
121 formatters. A copy made in an otherwise Transparent file format
122 whose markup has been designed to thwart or discourage
123 subsequent modification by readers is not Transparent. A copy
124 that is not <quote>Transparent</quote> is called
125 <quote>Opaque</quote>.
126 </para>
127
128 <para>
129 Examples of suitable formats for Transparent copies include
130 plain ASCII without markup, Texinfo input format, LaTeX input
131 format, SGML or XML using a publicly available DTD, and
132 standard-conforming simple HTML designed for human
133 modification. Opaque formats include PostScript, PDF,
134 proprietary formats that can be read and edited only by
135 proprietary word processors, SGML or XML for which the DTD
136 and/or processing tools are not generally available, and the
137 machine-generated HTML produced by some word processors for
138 output purposes only.
139 </para>
140
141 <para id="fdl-title-page">
142 The <quote>Title Page</quote> means, for a printed book, the
143 title page itself, plus such following pages as are needed to
144 hold, legibly, the material this License requires to appear in
145 the title page. For works in formats which do not have any title
146 page as such, <quote>Title Page</quote> means the text near the
147 most prominent appearance of the work's title, preceding the
148 beginning of the body of the text.
149 </para>
150 </sect1>
151
152 <sect1 id="fdl-section2">
153 <title>2. VERBATIM COPYING</title>
154 <para>
155 You may copy and distribute the <link
156 linkend="fdl-document">Document</link> in any medium, either
157 commercially or noncommercially, provided that this License, the
158 copyright notices, and the license notice saying this License
159 applies to the Document are reproduced in all copies, and that
160 you add no other conditions whatsoever to those of this
161 License. You may not use technical measures to obstruct or
162 control the reading or further copying of the copies you make or
163 distribute. However, you may accept compensation in exchange for
164 copies. If you distribute a large enough number of copies you
165 must also follow the conditions in <link
166 linkend="fdl-section3">section 3</link>.
167 </para>
168
169 <para>
170 You may also lend copies, under the same conditions stated
171 above, and you may publicly display copies.
172 </para>
173 </sect1>
174
175 <sect1 id="fdl-section3">
176 <title>3. COPYING IN QUANTITY</title>
177 <para>
178 If you publish printed copies of the <link
179 linkend="fdl-document">Document</link> numbering more than 100,
180 and the Document's license notice requires <link
181 linkend="fdl-cover-texts">Cover Texts</link>, you must enclose
182 the copies in covers that carry, clearly and legibly, all these
183 Cover Texts: Front-Cover Texts on the front cover, and
184 Back-Cover Texts on the back cover. Both covers must also
185 clearly and legibly identify you as the publisher of these
186 copies. The front cover must present the full title with all
187 words of the title equally prominent and visible. You may add
188 other material on the covers in addition. Copying with changes
189 limited to the covers, as long as they preserve the title of the
190 <link linkend="fdl-document">Document</link> and satisfy these
191 conditions, can be treated as verbatim copying in other
192 respects.
193 </para>
194
195 <para>
196 If the required texts for either cover are too voluminous to fit
197 legibly, you should put the first ones listed (as many as fit
198 reasonably) on the actual cover, and continue the rest onto
199 adjacent pages.
200 </para>
201
202 <para>
203 If you publish or distribute <link
204 linkend="fdl-transparent">Opaque</link> copies of the <link
205 linkend="fdl-document">Document</link> numbering more than 100,
206 you must either include a machine-readable <link
207 linkend="fdl-transparent">Transparent</link> copy along with
208 each Opaque copy, or state in or with each Opaque copy a
209 publicly-accessible computer-network location containing a
210 complete Transparent copy of the Document, free of added
211 material, which the general network-using public has access to
212 download anonymously at no charge using public-standard network
213 protocols. If you use the latter option, you must take
214 reasonably prudent steps, when you begin distribution of Opaque
215 copies in quantity, to ensure that this Transparent copy will
216 remain thus accessible at the stated location until at least one
217 year after the last time you distribute an Opaque copy (directly
218 or through your agents or retailers) of that edition to the
219 public.
220 </para>
221
222 <para>
223 It is requested, but not required, that you contact the authors
224 of the <link linkend="fdl-document">Document</link> well before
225 redistributing any large number of copies, to give them a chance
226 to provide you with an updated version of the Document.
227 </para>
228 </sect1>
229
230 <sect1 id="fdl-section4">
231 <title>4. MODIFICATIONS</title>
232 <para>
233 You may copy and distribute a <link
234 linkend="fdl-modified">Modified Version</link> of the <link
235 linkend="fdl-document">Document</link> under the conditions of
236 sections <link linkend="fdl-section2">2</link> and <link
237 linkend="fdl-section3">3</link> above, provided that you release
238 the Modified Version under precisely this License, with the
239 Modified Version filling the role of the Document, thus
240 licensing distribution and modification of the Modified Version
241 to whoever possesses a copy of it. In addition, you must do
242 these things in the Modified Version:
243 </para>
244
245 <itemizedlist mark="opencircle">
246 <listitem>
247 <formalpara>
248 <title>A</title>
249 <para>
250 Use in the <link linkend="fdl-title-page">Title
251 Page</link> (and on the covers, if any) a title distinct
252 from that of the <link
253 linkend="fdl-document">Document</link>, and from those of
254 previous versions (which should, if there were any, be
255 listed in the History section of the Document). You may
256 use the same title as a previous version if the original
257 publisher of that version gives permission.
258 </para>
259 </formalpara>
260 </listitem>
261
262 <listitem>
263 <formalpara>
264 <title>B</title>
265 <para>
266 List on the <link linkend="fdl-title-page">Title
267 Page</link>, as authors, one or more persons or entities
268 responsible for authorship of the modifications in the
269 <link linkend="fdl-modified">Modified Version</link>,
270 together with at least five of the principal authors of
271 the <link linkend="fdl-document">Document</link> (all of
272 its principal authors, if it has less than five).
273 </para>
274 </formalpara>
275 </listitem>
276
277 <listitem>
278 <formalpara>
279 <title>C</title>
280 <para>
281 State on the <link linkend="fdl-title-page">Title
282 Page</link> the name of the publisher of the <link
283 linkend="fdl-modified">Modified Version</link>, as the
284 publisher.
285 </para>
286 </formalpara>
287 </listitem>
288
289 <listitem>
290 <formalpara>
291 <title>D</title>
292 <para>
293 Preserve all the copyright notices of the <link
294 linkend="fdl-document">Document</link>.
295 </para>
296 </formalpara>
297 </listitem>
298
299 <listitem>
300 <formalpara>
301 <title>E</title>
302 <para>
303 Add an appropriate copyright notice for your modifications
304 adjacent to the other copyright notices.
305 </para>
306 </formalpara>
307 </listitem>
308
309 <listitem>
310 <formalpara>
311 <title>F</title>
312 <para>
313 Include, immediately after the copyright notices, a
314 license notice giving the public permission to use the
315 <link linkend="fdl-modified">Modified Version</link> under
316 the terms of this License, in the form shown in the
317 Addendum below.
318 </para>
319 </formalpara>
320 </listitem>
321
322 <listitem>
323 <formalpara>
324 <title>G</title>
325 <para>
326 Preserve in that license notice the full lists of <link
327 linkend="fdl-invariant"> Invariant Sections</link> and
328 required <link linkend="fdl-cover-texts">Cover
329 Texts</link> given in the <link
330 linkend="fdl-document">Document's</link> license notice.
331 </para>
332 </formalpara>
333 </listitem>
334
335 <listitem>
336 <formalpara>
337 <title>H</title>
338 <para>
339 Include an unaltered copy of this License.
340 </para>
341 </formalpara>
342 </listitem>
343
344 <listitem>
345 <formalpara>
346 <title>I</title>
347 <para>
348 Preserve the section entitled <quote>History</quote>, and
349 its title, and add to it an item stating at least the
350 title, year, new authors, and publisher of the <link
351 linkend="fdl-modified">Modified Version </link>as given on
352 the <link linkend="fdl-title-page">Title Page</link>. If
353 there is no section entitled <quote>History</quote> in the
354 <link linkend="fdl-document">Document</link>, create one
355 stating the title, year, authors, and publisher of the
356 Document as given on its Title Page, then add an item
357 describing the Modified Version as stated in the previous
358 sentence.
359 </para>
360 </formalpara>
361 </listitem>
362
363 <listitem>
364 <formalpara>
365 <title>J</title>
366 <para>
367 Preserve the network location, if any, given in the <link
368 linkend="fdl-document">Document</link> for public access
369 to a <link linkend="fdl-transparent">Transparent</link>
370 copy of the Document, and likewise the network locations
371 given in the Document for previous versions it was based
372 on. These may be placed in the <quote>History</quote>
373 section. You may omit a network location for a work that
374 was published at least four years before the Document
375 itself, or if the original publisher of the version it
376 refers to gives permission.
377 </para>
378 </formalpara>
379 </listitem>
380
381 <listitem>
382 <formalpara>
383 <title>K</title>
384 <para>
385 In any section entitled <quote>Acknowledgements</quote> or
386 <quote>Dedications</quote>, preserve the section's title,
387 and preserve in the section all the substance and tone of
388 each of the contributor acknowledgements and/or
389 dedications given therein.
390 </para>
391 </formalpara>
392 </listitem>
393
394 <listitem>
395 <formalpara>
396 <title>L</title>
397 <para>
398 Preserve all the <link linkend="fdl-invariant">Invariant
399 Sections</link> of the <link
400 linkend="fdl-document">Document</link>, unaltered in their
401 text and in their titles. Section numbers or the
402 equivalent are not considered part of the section titles.
403 </para>
404 </formalpara>
405 </listitem>
406
407 <listitem>
408 <formalpara>
409 <title>M</title>
410 <para>
411 Delete any section entitled
412 <quote>Endorsements</quote>. Such a section may not be
413 included in the <link linkend="fdl-modified">Modified
414 Version</link>.
415 </para>
416 </formalpara>
417 </listitem>
418
419 <listitem>
420 <formalpara>
421 <title>N</title>
422 <para>
423 Do not retitle any existing section as
424 <quote>Endorsements</quote> or to conflict in title with
425 any <link linkend="fdl-invariant">Invariant
426 Section</link>.
427 </para>
428 </formalpara>
429 </listitem>
430 </itemizedlist>
431
432 <para>
433 If the <link linkend="fdl-modified">Modified Version</link>
434 includes new front-matter sections or appendices that qualify as
435 <link linkend="fdl-secondary">Secondary Sections</link> and
436 contain no material copied from the Document, you may at your
437 option designate some or all of these sections as invariant. To
438 do this, add their titles to the list of <link
439 linkend="fdl-invariant">Invariant Sections</link> in the
440 Modified Version's license notice. These titles must be
441 distinct from any other section titles.
442 </para>
443
444 <para>
445 You may add a section entitled <quote>Endorsements</quote>,
446 provided it contains nothing but endorsements of your <link
447 linkend="fdl-modified">Modified Version</link> by various
448 parties--for example, statements of peer review or that the text
449 has been approved by an organization as the authoritative
450 definition of a standard.
451 </para>
452
453 <para>
454 You may add a passage of up to five words as a <link
455 linkend="fdl-cover-texts">Front-Cover Text</link>, and a passage
456 of up to 25 words as a <link
457 linkend="fdl-cover-texts">Back-Cover Text</link>, to the end of
458 the list of <link linkend="fdl-cover-texts">Cover Texts</link>
459 in the <link linkend="fdl-modified">Modified Version</link>.
460 Only one passage of Front-Cover Text and one of Back-Cover Text
461 may be added by (or through arrangements made by) any one
462 entity. If the <link linkend="fdl-document">Document</link>
463 already includes a cover text for the same cover, previously
464 added by you or by arrangement made by the same entity you are
465 acting on behalf of, you may not add another; but you may
466 replace the old one, on explicit permission from the previous
467 publisher that added the old one.
468 </para>
469
470 <para>
471 The author(s) and publisher(s) of the <link
472 linkend="fdl-document">Document</link> do not by this License
473 give permission to use their names for publicity for or to
474 assert or imply endorsement of any <link
475 linkend="fdl-modified">Modified Version </link>.
476 </para>
477 </sect1>
478
479 <sect1 id="fdl-section5">
480 <title>5. COMBINING DOCUMENTS</title>
481 <para>
482 You may combine the <link linkend="fdl-document">Document</link>
483 with other documents released under this License, under the
484 terms defined in <link linkend="fdl-section4">section 4</link>
485 above for modified versions, provided that you include in the
486 combination all of the <link linkend="fdl-invariant">Invariant
487 Sections</link> of all of the original documents, unmodified,
488 and list them all as Invariant Sections of your combined work in
489 its license notice.
490 </para>
491
492 <para>
493 The combined work need only contain one copy of this License,
494 and multiple identical <link linkend="fdl-invariant">Invariant
495 Sections</link> may be replaced with a single copy. If there are
496 multiple Invariant Sections with the same name but different
497 contents, make the title of each such section unique by adding
498 at the end of it, in parentheses, the name of the original
499 author or publisher of that section if known, or else a unique
500 number. Make the same adjustment to the section titles in the
501 list of Invariant Sections in the license notice of the combined
502 work.
503 </para>
504
505 <para>
506 In the combination, you must combine any sections entitled
507 <quote>History</quote> in the various original documents,
508 forming one section entitled <quote>History</quote>; likewise
509 combine any sections entitled <quote>Acknowledgements</quote>,
510 and any sections entitled <quote>Dedications</quote>. You must
511 delete all sections entitled <quote>Endorsements.</quote>
512 </para>
513 </sect1>
514
515 <sect1 id="fdl-section6">
516 <title>6. COLLECTIONS OF DOCUMENTS</title>
517 <para>
518 You may make a collection consisting of the <link
519 linkend="fdl-document">Document</link> and other documents
520 released under this License, and replace the individual copies
521 of this License in the various documents with a single copy that
522 is included in the collection, provided that you follow the
523 rules of this License for verbatim copying of each of the
524 documents in all other respects.
525 </para>
526
527 <para>
528 You may extract a single document from such a collection, and
529 dispbibute it individually under this License, provided you
530 insert a copy of this License into the extracted document, and
531 follow this License in all other respects regarding verbatim
532 copying of that document.
533 </para>
534 </sect1>
535
536 <sect1 id="fdl-section7">
537 <title>7. AGGREGATION WITH INDEPENDENT WORKS</title>
538 <para>
539 A compilation of the <link
540 linkend="fdl-document">Document</link> or its derivatives with
541 other separate and independent documents or works, in or on a
542 volume of a storage or distribution medium, does not as a whole
543 count as a <link linkend="fdl-modified">Modified Version</link>
544 of the Document, provided no compilation copyright is claimed
545 for the compilation. Such a compilation is called an
546 <quote>aggregate</quote>, and this License does not apply to the
547 other self-contained works thus compiled with the Document , on
548 account of their being thus compiled, if they are not themselves
549 derivative works of the Document. If the <link
550 linkend="fdl-cover-texts">Cover Text</link> requirement of <link
551 linkend="fdl-section3">section 3</link> is applicable to these
552 copies of the Document, then if the Document is less than one
553 quarter of the entire aggregate, the Document's Cover Texts may
554 be placed on covers that surround only the Document within the
555 aggregate. Otherwise they must appear on covers around the whole
556 aggregate.
557 </para>
558 </sect1>
559
560 <sect1 id="fdl-section8">
561 <title>8. TRANSLATION</title>
562 <para>
563 Translation is considered a kind of modification, so you may
564 distribute translations of the <link
565 linkend="fdl-document">Document</link> under the terms of <link
566 linkend="fdl-section4">section 4</link>. Replacing <link
567 linkend="fdl-invariant"> Invariant Sections</link> with
568 translations requires special permission from their copyright
569 holders, but you may include translations of some or all
570 Invariant Sections in addition to the original versions of these
571 Invariant Sections. You may include a translation of this
572 License provided that you also include the original English
573 version of this License. In case of a disagreement between the
574 translation and the original English version of this License,
575 the original English version will prevail.
576 </para>
577 </sect1>
578
579 <sect1 id="fdl-section9">
580 <title>9. TERMINATION</title>
581 <para>
582 You may not copy, modify, sublicense, or distribute the <link
583 linkend="fdl-document">Document</link> except as expressly
584 provided for under this License. Any other attempt to copy,
585 modify, sublicense or distribute the Document is void, and will
586 automatically terminate your rights under this License. However,
587 parties who have received copies, or rights, from you under this
588 License will not have their licenses terminated so long as such
589 parties remain in full compliance.
590 </para>
591 </sect1>
592
593 <sect1 id="fdl-section10">
594 <title>10. FUTURE REVISIONS OF THIS LICENSE</title>
595 <para>
596 The <ulink type="http"
597 url="http://www.gnu.org/fsf/fsf.html">Free Software
598 Foundation</ulink> may publish new, revised versions of the GNU
599 Free Documentation License from time to time. Such new versions
600 will be similar in spirit to the present version, but may differ
601 in detail to address new problems or concerns. See <ulink
602 type="http"
603 url="http://www.gnu.org/copyleft">http://www.gnu.org/copyleft/</ulink>.
604 </para>
605
606 <para>
607 Each version of the License is given a distinguishing version
608 number. If the <link linkend="fdl-document">Document</link>
609 specifies that a particular numbered version of this License
610 <quote>or any later version</quote> applies to it, you have the
611 option of following the terms and conditions either of that
612 specified version or of any later version that has been
613 published (not as a draft) by the Free Software Foundation. If
614 the Document does not specify a version number of this License,
615 you may choose any version ever published (not as a draft) by
616 the Free Software Foundation.
617 </para>
618 </sect1>
619
620 <sect1 id="fdl-using">
621 <title>Addendum</title>
622 <para>
623 To use this License in a document you have written, include a copy of
624 the License in the document and put the following copyright and
625 license notices just after the title page:
626 </para>
627
628 <blockquote>
629 <para>
630 Copyright &copy; YEAR YOUR NAME.
631 </para>
632 <para>
633 Permission is granted to copy, distribute and/or modify this
634 document under the terms of the GNU Free Documentation
635 License, Version 1.1 or any later version published by the
636 Free Software Foundation; with the <link
637 linkend="fdl-invariant">Invariant Sections</link> being LIST
638 THEIR TITLES, with the <link
639 linkend="fdl-cover-texts">Front-Cover Texts</link> being LIST,
640 and with the <link linkend="fdl-cover-texts">Back-Cover
641 Texts</link> being LIST. A copy of the license is included in
642 the section entitled <quote>GNU Free Documentation
643 License</quote>.
644 </para>
645 </blockquote>
646
647 <para>
648 If you have no <link linkend="fdl-invariant">Invariant
649 Sections</link>, write <quote>with no Invariant Sections</quote>
650 instead of saying which ones are invariant. If you have no
651 <link linkend="fdl-cover-texts">Front-Cover Texts</link>, write
652 <quote>no Front-Cover Texts</quote> instead of
653 <quote>Front-Cover Texts being LIST</quote>; likewise for <link
654 linkend="fdl-cover-texts">Back-Cover Texts</link>.
655 </para>
656
657 <para>
658 If your document contains nontrivial examples of program code,
659 we recommend releasing these examples in parallel under your
660 choice of free software license, such as the <ulink type="http"
661 url="http://www.gnu.org/copyleft/gpl.html"> GNU General Public
662 License</ulink>, to permit their use in free software.
663 </para>
664 </sect1>
665</appendix>
666
667
668
669
670
671
diff --git a/Documentation/DocBook/media/v4l/fieldseq_bt.pdf b/Documentation/DocBook/media/v4l/fieldseq_bt.pdf
new file mode 100644
index 00000000000..26598b23f80
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/fieldseq_bt.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/fieldseq_tb.pdf b/Documentation/DocBook/media/v4l/fieldseq_tb.pdf
new file mode 100644
index 00000000000..4965b22ddb3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/fieldseq_tb.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/func-close.xml b/Documentation/DocBook/media/v4l/func-close.xml
new file mode 100644
index 00000000000..232920d2f3c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-close.xml
@@ -0,0 +1,62 @@
1<refentry id="func-close">
2 <refmeta>
3 <refentrytitle>V4L2 close()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-close</refname>
9 <refpurpose>Close a V4L2 device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;unistd.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>close</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 </funcprototype>
19 </funcsynopsis>
20 </refsynopsisdiv>
21
22 <refsect1>
23 <title>Arguments</title>
24
25 <variablelist>
26 <varlistentry>
27 <term><parameter>fd</parameter></term>
28 <listitem>
29 <para>&fd;</para>
30 </listitem>
31 </varlistentry>
32 </variablelist>
33 </refsect1>
34
35 <refsect1>
36 <title>Description</title>
37
38 <para>Closes the device. Any I/O in progress is terminated and
39resources associated with the file descriptor are freed. However data
40format parameters, current input or output, control values or other
41properties remain unchanged.</para>
42 </refsect1>
43
44 <refsect1>
45 <title>Return Value</title>
46
47 <para>The function returns <returnvalue>0</returnvalue> on
48success, <returnvalue>-1</returnvalue> on failure and the
49<varname>errno</varname> is set appropriately. Possible error
50codes:</para>
51
52 <variablelist>
53 <varlistentry>
54 <term><errorcode>EBADF</errorcode></term>
55 <listitem>
56 <para><parameter>fd</parameter> is not a valid open file
57descriptor.</para>
58 </listitem>
59 </varlistentry>
60 </variablelist>
61 </refsect1>
62</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-ioctl.xml b/Documentation/DocBook/media/v4l/func-ioctl.xml
new file mode 100644
index 00000000000..4394184a1a6
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-ioctl.xml
@@ -0,0 +1,71 @@
1<refentry id="func-ioctl">
2 <refmeta>
3 <refentrytitle>V4L2 ioctl()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-ioctl</refname>
9 <refpurpose>Program a V4L2 device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;sys/ioctl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>void *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>V4L2 ioctl request code as defined in the <filename>videodev2.h</filename> header file, for example
38VIDIOC_QUERYCAP.</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para>Pointer to a function parameter, usually a structure.</para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <para>The <function>ioctl()</function> function is used to program
54V4L2 devices. The argument <parameter>fd</parameter> must be an open
55file descriptor. An ioctl <parameter>request</parameter> has encoded
56in it whether the argument is an input, output or read/write
57parameter, and the size of the argument <parameter>argp</parameter> in
58bytes. Macros and defines specifying V4L2 ioctl requests are located
59in the <filename>videodev2.h</filename> header file.
60Applications should use their own copy, not include the version in the
61kernel sources on the system they compile on. All V4L2 ioctl requests,
62their respective function and parameters are specified in <xref
63 linkend="user-func" />.</para>
64 </refsect1>
65
66 <refsect1>
67 &return-value;
68 <para>When an ioctl that takes an output or read/write parameter fails,
69 the parameter remains unmodified.</para>
70 </refsect1>
71</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-mmap.xml b/Documentation/DocBook/media/v4l/func-mmap.xml
new file mode 100644
index 00000000000..f31ad71bf30
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-mmap.xml
@@ -0,0 +1,183 @@
1<refentry id="func-mmap">
2 <refmeta>
3 <refentrytitle>V4L2 mmap()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-mmap</refname>
9 <refpurpose>Map device memory into application address space</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>
15#include &lt;unistd.h&gt;
16#include &lt;sys/mman.h&gt;</funcsynopsisinfo>
17 <funcprototype>
18 <funcdef>void *<function>mmap</function></funcdef>
19 <paramdef>void *<parameter>start</parameter></paramdef>
20 <paramdef>size_t <parameter>length</parameter></paramdef>
21 <paramdef>int <parameter>prot</parameter></paramdef>
22 <paramdef>int <parameter>flags</parameter></paramdef>
23 <paramdef>int <parameter>fd</parameter></paramdef>
24 <paramdef>off_t <parameter>offset</parameter></paramdef>
25 </funcprototype>
26 </funcsynopsis>
27 </refsynopsisdiv>
28
29 <refsect1>
30 <title>Arguments</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>start</parameter></term>
34 <listitem>
35 <para>Map the buffer to this address in the
36application's address space. When the <constant>MAP_FIXED</constant>
37flag is specified, <parameter>start</parameter> must be a multiple of the
38pagesize and mmap will fail when the specified address
39cannot be used. Use of this option is discouraged; applications should
40just specify a <constant>NULL</constant> pointer here.</para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>length</parameter></term>
45 <listitem>
46 <para>Length of the memory area to map. This must be the
47same value as returned by the driver in the &v4l2-buffer;
48<structfield>length</structfield> field for the
49single-planar API, and the same value as returned by the driver
50in the &v4l2-plane; <structfield>length</structfield> field for the
51multi-planar API.</para>
52 </listitem>
53 </varlistentry>
54 <varlistentry>
55 <term><parameter>prot</parameter></term>
56 <listitem>
57 <para>The <parameter>prot</parameter> argument describes the
58desired memory protection. Regardless of the device type and the
59direction of data exchange it should be set to
60<constant>PROT_READ</constant> | <constant>PROT_WRITE</constant>,
61permitting read and write access to image buffers. Drivers should
62support at least this combination of flags. Note the Linux
63<filename>video-buf</filename> kernel module, which is used by the
64bttv, saa7134, saa7146, cx88 and vivi driver supports only
65<constant>PROT_READ</constant> | <constant>PROT_WRITE</constant>. When
66the driver does not support the desired protection the
67<function>mmap()</function> function fails.</para>
68 <para>Note device memory accesses (&eg; the memory on a
69graphics card with video capturing hardware) may incur a performance
70penalty compared to main memory accesses, or reads may be
71significantly slower than writes or vice versa. Other I/O methods may
72be more efficient in this case.</para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><parameter>flags</parameter></term>
77 <listitem>
78 <para>The <parameter>flags</parameter> parameter
79specifies the type of the mapped object, mapping options and whether
80modifications made to the mapped copy of the page are private to the
81process or are to be shared with other references.</para>
82 <para><constant>MAP_FIXED</constant> requests that the
83driver selects no other address than the one specified. If the
84specified address cannot be used, <function>mmap()</function> will fail. If
85<constant>MAP_FIXED</constant> is specified,
86<parameter>start</parameter> must be a multiple of the pagesize. Use
87of this option is discouraged.</para>
88 <para>One of the <constant>MAP_SHARED</constant> or
89<constant>MAP_PRIVATE</constant> flags must be set.
90<constant>MAP_SHARED</constant> allows applications to share the
91mapped memory with other (&eg; child-) processes. Note the Linux
92<filename>video-buf</filename> module which is used by the bttv,
93saa7134, saa7146, cx88 and vivi driver supports only
94<constant>MAP_SHARED</constant>. <constant>MAP_PRIVATE</constant>
95requests copy-on-write semantics. V4L2 applications should not set the
96<constant>MAP_PRIVATE</constant>, <constant>MAP_DENYWRITE</constant>,
97<constant>MAP_EXECUTABLE</constant> or <constant>MAP_ANON</constant>
98flag.</para>
99 </listitem>
100 </varlistentry>
101 <varlistentry>
102 <term><parameter>fd</parameter></term>
103 <listitem>
104 <para>&fd;</para>
105 </listitem>
106 </varlistentry>
107 <varlistentry>
108 <term><parameter>offset</parameter></term>
109 <listitem>
110 <para>Offset of the buffer in device memory. This must be the
111same value as returned by the driver in the &v4l2-buffer;
112<structfield>m</structfield> union <structfield>offset</structfield> field for
113the single-planar API, and the same value as returned by the driver
114in the &v4l2-plane; <structfield>m</structfield> union
115<structfield>mem_offset</structfield> field for the multi-planar API.</para>
116 </listitem>
117 </varlistentry>
118 </variablelist>
119 </refsect1>
120
121 <refsect1>
122 <title>Description</title>
123
124 <para>The <function>mmap()</function> function asks to map
125<parameter>length</parameter> bytes starting at
126<parameter>offset</parameter> in the memory of the device specified by
127<parameter>fd</parameter> into the application address space,
128preferably at address <parameter>start</parameter>. This latter
129address is a hint only, and is usually specified as 0.</para>
130
131 <para>Suitable length and offset parameters are queried with the
132&VIDIOC-QUERYBUF; ioctl. Buffers must be allocated with the
133&VIDIOC-REQBUFS; ioctl before they can be queried.</para>
134
135 <para>To unmap buffers the &func-munmap; function is used.</para>
136 </refsect1>
137
138 <refsect1>
139 <title>Return Value</title>
140
141 <para>On success <function>mmap()</function> returns a pointer to
142the mapped buffer. On error <constant>MAP_FAILED</constant> (-1) is
143returned, and the <varname>errno</varname> variable is set
144appropriately. Possible error codes are:</para>
145
146 <variablelist>
147 <varlistentry>
148 <term><errorcode>EBADF</errorcode></term>
149 <listitem>
150 <para><parameter>fd</parameter> is not a valid file
151descriptor.</para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><errorcode>EACCES</errorcode></term>
156 <listitem>
157 <para><parameter>fd</parameter> is
158not open for reading and writing.</para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
162 <term><errorcode>EINVAL</errorcode></term>
163 <listitem>
164 <para>The <parameter>start</parameter> or
165<parameter>length</parameter> or <parameter>offset</parameter> are not
166suitable. (E.&nbsp;g. they are too large, or not aligned on a
167<constant>PAGESIZE</constant> boundary.)</para>
168 <para>The <parameter>flags</parameter> or
169<parameter>prot</parameter> value is not supported.</para>
170 <para>No buffers have been allocated with the
171&VIDIOC-REQBUFS; ioctl.</para>
172 </listitem>
173 </varlistentry>
174 <varlistentry>
175 <term><errorcode>ENOMEM</errorcode></term>
176 <listitem>
177 <para>Not enough physical or virtual memory was available to
178complete the request.</para>
179 </listitem>
180 </varlistentry>
181 </variablelist>
182 </refsect1>
183</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-munmap.xml b/Documentation/DocBook/media/v4l/func-munmap.xml
new file mode 100644
index 00000000000..860d49ca54a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-munmap.xml
@@ -0,0 +1,76 @@
1<refentry id="func-munmap">
2 <refmeta>
3 <refentrytitle>V4L2 munmap()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-munmap</refname>
9 <refpurpose>Unmap device memory</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>
15#include &lt;unistd.h&gt;
16#include &lt;sys/mman.h&gt;</funcsynopsisinfo>
17 <funcprototype>
18 <funcdef>int <function>munmap</function></funcdef>
19 <paramdef>void *<parameter>start</parameter></paramdef>
20 <paramdef>size_t <parameter>length</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24 <refsect1>
25 <title>Arguments</title>
26 <variablelist>
27 <varlistentry>
28 <term><parameter>start</parameter></term>
29 <listitem>
30 <para>Address of the mapped buffer as returned by the
31&func-mmap; function.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>length</parameter></term>
36 <listitem>
37 <para>Length of the mapped buffer. This must be the same
38value as given to <function>mmap()</function> and returned by the
39driver in the &v4l2-buffer; <structfield>length</structfield>
40field for the single-planar API and in the &v4l2-plane;
41<structfield>length</structfield> field for the multi-planar API.</para>
42 </listitem>
43 </varlistentry>
44 </variablelist>
45 </refsect1>
46
47 <refsect1>
48 <title>Description</title>
49
50 <para>Unmaps a previously with the &func-mmap; function mapped
51buffer and frees it, if possible. <!-- ? This function (not freeing)
52has no impact on I/O in progress, specifically it does not imply
53&VIDIOC-STREAMOFF; to terminate I/O. Unmapped buffers can still be
54enqueued, dequeued or queried, they are just not accessible by the
55application.--></para>
56 </refsect1>
57
58 <refsect1>
59 <title>Return Value</title>
60
61 <para>On success <function>munmap()</function> returns 0, on
62failure -1 and the <varname>errno</varname> variable is set
63appropriately:</para>
64
65 <variablelist>
66 <varlistentry>
67 <term><errorcode>EINVAL</errorcode></term>
68 <listitem>
69 <para>The <parameter>start</parameter> or
70<parameter>length</parameter> is incorrect, or no buffers have been
71mapped yet.</para>
72 </listitem>
73 </varlistentry>
74 </variablelist>
75 </refsect1>
76</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-open.xml b/Documentation/DocBook/media/v4l/func-open.xml
new file mode 100644
index 00000000000..cf64e207c3e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-open.xml
@@ -0,0 +1,113 @@
1<refentry id="func-open">
2 <refmeta>
3 <refentrytitle>V4L2 open()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-open</refname>
9 <refpurpose>Open a V4L2 device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;fcntl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>open</function></funcdef>
17 <paramdef>const char *<parameter>device_name</parameter></paramdef>
18 <paramdef>int <parameter>flags</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>device_name</parameter></term>
29 <listitem>
30 <para>Device to be opened.</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>flags</parameter></term>
35 <listitem>
36 <para>Open flags. Access mode must be
37<constant>O_RDWR</constant>. This is just a technicality, input devices
38still support only reading and output devices only writing.</para>
39 <para>When the <constant>O_NONBLOCK</constant> flag is
40given, the read() function and the &VIDIOC-DQBUF; ioctl will return
41the &EAGAIN; when no data is available or no buffer is in the driver
42outgoing queue, otherwise these functions block until data becomes
43available. All V4L2 drivers exchanging data with applications must
44support the <constant>O_NONBLOCK</constant> flag.</para>
45 <para>Other flags have no effect.</para>
46 </listitem>
47 </varlistentry>
48 </variablelist>
49 </refsect1>
50 <refsect1>
51 <title>Description</title>
52
53 <para>To open a V4L2 device applications call
54<function>open()</function> with the desired device name. This
55function has no side effects; all data format parameters, current
56input or output, control values or other properties remain unchanged.
57At the first <function>open()</function> call after loading the driver
58they will be reset to default values, drivers are never in an
59undefined state.</para>
60 </refsect1>
61 <refsect1>
62 <title>Return Value</title>
63
64 <para>On success <function>open</function> returns the new file
65descriptor. On error -1 is returned, and the <varname>errno</varname>
66variable is set appropriately. Possible error codes are:</para>
67
68 <variablelist>
69 <varlistentry>
70 <term><errorcode>EACCES</errorcode></term>
71 <listitem>
72 <para>The caller has no permission to access the
73device.</para>
74 </listitem>
75 </varlistentry>
76 <varlistentry>
77 <term><errorcode>EBUSY</errorcode></term>
78 <listitem>
79 <para>The driver does not support multiple opens and the
80device is already in use.</para>
81 </listitem>
82 </varlistentry>
83 <varlistentry>
84 <term><errorcode>ENXIO</errorcode></term>
85 <listitem>
86 <para>No device corresponding to this device special file
87exists.</para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term><errorcode>ENOMEM</errorcode></term>
92 <listitem>
93 <para>Not enough kernel memory was available to complete the
94request.</para>
95 </listitem>
96 </varlistentry>
97 <varlistentry>
98 <term><errorcode>EMFILE</errorcode></term>
99 <listitem>
100 <para>The process already has the maximum number of
101files open.</para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term><errorcode>ENFILE</errorcode></term>
106 <listitem>
107 <para>The limit on the total number of files open on the
108system has been reached.</para>
109 </listitem>
110 </varlistentry>
111 </variablelist>
112 </refsect1>
113</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-poll.xml b/Documentation/DocBook/media/v4l/func-poll.xml
new file mode 100644
index 00000000000..85cad8bff5b
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-poll.xml
@@ -0,0 +1,119 @@
1<refentry id="func-poll">
2 <refmeta>
3 <refentrytitle>V4L2 poll()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-poll</refname>
9 <refpurpose>Wait for some event on a file descriptor</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;sys/poll.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>poll</function></funcdef>
17 <paramdef>struct pollfd *<parameter>ufds</parameter></paramdef>
18 <paramdef>unsigned int <parameter>nfds</parameter></paramdef>
19 <paramdef>int <parameter>timeout</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Description</title>
26
27 <para>With the <function>poll()</function> function applications
28can suspend execution until the driver has captured data or is ready
29to accept data for output.</para>
30
31 <para>When streaming I/O has been negotiated this function waits
32until a buffer has been filled or displayed and can be dequeued with
33the &VIDIOC-DQBUF; ioctl. When buffers are already in the outgoing
34queue of the driver the function returns immediately.</para>
35
36 <para>On success <function>poll()</function> returns the number of
37file descriptors that have been selected (that is, file descriptors
38for which the <structfield>revents</structfield> field of the
39respective <structname>pollfd</structname> structure is non-zero).
40Capture devices set the <constant>POLLIN</constant> and
41<constant>POLLRDNORM</constant> flags in the
42<structfield>revents</structfield> field, output devices the
43<constant>POLLOUT</constant> and <constant>POLLWRNORM</constant>
44flags. When the function timed out it returns a value of zero, on
45failure it returns <returnvalue>-1</returnvalue> and the
46<varname>errno</varname> variable is set appropriately. When the
47application did not call &VIDIOC-QBUF; or &VIDIOC-STREAMON; yet the
48<function>poll()</function> function succeeds, but sets the
49<constant>POLLERR</constant> flag in the
50<structfield>revents</structfield> field.</para>
51
52 <para>When use of the <function>read()</function> function has
53been negotiated and the driver does not capture yet, the
54<function>poll</function> function starts capturing. When that fails
55it returns a <constant>POLLERR</constant> as above. Otherwise it waits
56until data has been captured and can be read. When the driver captures
57continuously (as opposed to, for example, still images) the function
58may return immediately.</para>
59
60 <para>When use of the <function>write()</function> function has
61been negotiated the <function>poll</function> function just waits
62until the driver is ready for a non-blocking
63<function>write()</function> call.</para>
64
65 <para>All drivers implementing the <function>read()</function> or
66<function>write()</function> function or streaming I/O must also
67support the <function>poll()</function> function.</para>
68
69 <para>For more details see the
70<function>poll()</function> manual page.</para>
71 </refsect1>
72
73 <refsect1>
74 <title>Return Value</title>
75
76 <para>On success, <function>poll()</function> returns the number
77structures which have non-zero <structfield>revents</structfield>
78fields, or zero if the call timed out. On error
79<returnvalue>-1</returnvalue> is returned, and the
80<varname>errno</varname> variable is set appropriately:</para>
81
82 <variablelist>
83 <varlistentry>
84 <term><errorcode>EBADF</errorcode></term>
85 <listitem>
86 <para>One or more of the <parameter>ufds</parameter> members
87specify an invalid file descriptor.</para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term><errorcode>EBUSY</errorcode></term>
92 <listitem>
93 <para>The driver does not support multiple read or write
94streams and the device is already in use.</para>
95 </listitem>
96 </varlistentry>
97 <varlistentry>
98 <term><errorcode>EFAULT</errorcode></term>
99 <listitem>
100 <para><parameter>ufds</parameter> references an inaccessible
101memory area.</para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term><errorcode>EINTR</errorcode></term>
106 <listitem>
107 <para>The call was interrupted by a signal.</para>
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term><errorcode>EINVAL</errorcode></term>
112 <listitem>
113 <para>The <parameter>nfds</parameter> argument is greater
114than <constant>OPEN_MAX</constant>.</para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118 </refsect1>
119</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-read.xml b/Documentation/DocBook/media/v4l/func-read.xml
new file mode 100644
index 00000000000..e218bbfbd36
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-read.xml
@@ -0,0 +1,181 @@
1<refentry id="func-read">
2 <refmeta>
3 <refentrytitle>V4L2 read()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-read</refname>
9 <refpurpose>Read from a V4L2 device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;unistd.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>ssize_t <function>read</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>void *<parameter>buf</parameter></paramdef>
19 <paramdef>size_t <parameter>count</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>buf</parameter></term>
36 <listitem>
37 <para></para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>count</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para><function>read()</function> attempts to read up to
53<parameter>count</parameter> bytes from file descriptor
54<parameter>fd</parameter> into the buffer starting at
55<parameter>buf</parameter>. The layout of the data in the buffer is
56discussed in the respective device interface section, see ##. If <parameter>count</parameter> is zero,
57<function>read()</function> returns zero and has no other results. If
58<parameter>count</parameter> is greater than
59<constant>SSIZE_MAX</constant>, the result is unspecified. Regardless
60of the <parameter>count</parameter> value each
61<function>read()</function> call will provide at most one frame (two
62fields) worth of data.</para>
63
64 <para>By default <function>read()</function> blocks until data
65becomes available. When the <constant>O_NONBLOCK</constant> flag was
66given to the &func-open; function it
67returns immediately with an &EAGAIN; when no data is available. The
68&func-select; or &func-poll; functions
69can always be used to suspend execution until data becomes available. All
70drivers supporting the <function>read()</function> function must also
71support <function>select()</function> and
72<function>poll()</function>.</para>
73
74 <para>Drivers can implement read functionality in different
75ways, using a single or multiple buffers and discarding the oldest or
76newest frames once the internal buffers are filled.</para>
77
78 <para><function>read()</function> never returns a "snapshot" of a
79buffer being filled. Using a single buffer the driver will stop
80capturing when the application starts reading the buffer until the
81read is finished. Thus only the period of the vertical blanking
82interval is available for reading, or the capture rate must fall below
83the nominal frame rate of the video standard.</para>
84
85<para>The behavior of
86<function>read()</function> when called during the active picture
87period or the vertical blanking separating the top and bottom field
88depends on the discarding policy. A driver discarding the oldest
89frames keeps capturing into an internal buffer, continuously
90overwriting the previously, not read frame, and returns the frame
91being received at the time of the <function>read()</function> call as
92soon as it is complete.</para>
93
94 <para>A driver discarding the newest frames stops capturing until
95the next <function>read()</function> call. The frame being received at
96<function>read()</function> time is discarded, returning the following
97frame instead. Again this implies a reduction of the capture rate to
98one half or less of the nominal frame rate. An example of this model
99is the video read mode of the bttv driver, initiating a DMA to user
100memory when <function>read()</function> is called and returning when
101the DMA finished.</para>
102
103 <para>In the multiple buffer model drivers maintain a ring of
104internal buffers, automatically advancing to the next free buffer.
105This allows continuous capturing when the application can empty the
106buffers fast enough. Again, the behavior when the driver runs out of
107free buffers depends on the discarding policy.</para>
108
109 <para>Applications can get and set the number of buffers used
110internally by the driver with the &VIDIOC-G-PARM; and &VIDIOC-S-PARM;
111ioctls. They are optional, however. The discarding policy is not
112reported and cannot be changed. For minimum requirements see <xref
113 linkend="devices" />.</para>
114 </refsect1>
115
116 <refsect1>
117 <title>Return Value</title>
118
119 <para>On success, the number of bytes read is returned. It is not
120an error if this number is smaller than the number of bytes requested,
121or the amount of data required for one frame. This may happen for
122example because <function>read()</function> was interrupted by a
123signal. On error, -1 is returned, and the <varname>errno</varname>
124variable is set appropriately. In this case the next read will start
125at the beginning of a new frame. Possible error codes are:</para>
126
127 <variablelist>
128 <varlistentry>
129 <term><errorcode>EAGAIN</errorcode></term>
130 <listitem>
131 <para>Non-blocking I/O has been selected using
132O_NONBLOCK and no data was immediately available for reading.</para>
133 </listitem>
134 </varlistentry>
135 <varlistentry>
136 <term><errorcode>EBADF</errorcode></term>
137 <listitem>
138 <para><parameter>fd</parameter> is not a valid file
139descriptor or is not open for reading, or the process already has the
140maximum number of files open.</para>
141 </listitem>
142 </varlistentry>
143 <varlistentry>
144 <term><errorcode>EBUSY</errorcode></term>
145 <listitem>
146 <para>The driver does not support multiple read streams and the
147device is already in use.</para>
148 </listitem>
149 </varlistentry>
150 <varlistentry>
151 <term><errorcode>EFAULT</errorcode></term>
152 <listitem>
153 <para><parameter>buf</parameter> references an inaccessible
154memory area.</para>
155 </listitem>
156 </varlistentry>
157 <varlistentry>
158 <term><errorcode>EINTR</errorcode></term>
159 <listitem>
160 <para>The call was interrupted by a signal before any
161data was read.</para>
162 </listitem>
163 </varlistentry>
164 <varlistentry>
165 <term><errorcode>EIO</errorcode></term>
166 <listitem>
167 <para>I/O error. This indicates some hardware problem or a
168failure to communicate with a remote device (USB camera etc.).</para>
169 </listitem>
170 </varlistentry>
171 <varlistentry>
172 <term><errorcode>EINVAL</errorcode></term>
173 <listitem>
174 <para>The <function>read()</function> function is not
175supported by this driver, not on this device, or generally not on this
176type of device.</para>
177 </listitem>
178 </varlistentry>
179 </variablelist>
180 </refsect1>
181</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-select.xml b/Documentation/DocBook/media/v4l/func-select.xml
new file mode 100644
index 00000000000..e12a60d9bd8
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-select.xml
@@ -0,0 +1,130 @@
1<refentry id="func-select">
2 <refmeta>
3 <refentrytitle>V4L2 select()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-select</refname>
9 <refpurpose>Synchronous I/O multiplexing</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>
15#include &lt;sys/time.h&gt;
16#include &lt;sys/types.h&gt;
17#include &lt;unistd.h&gt;</funcsynopsisinfo>
18 <funcprototype>
19 <funcdef>int <function>select</function></funcdef>
20 <paramdef>int <parameter>nfds</parameter></paramdef>
21 <paramdef>fd_set *<parameter>readfds</parameter></paramdef>
22 <paramdef>fd_set *<parameter>writefds</parameter></paramdef>
23 <paramdef>fd_set *<parameter>exceptfds</parameter></paramdef>
24 <paramdef>struct timeval *<parameter>timeout</parameter></paramdef>
25 </funcprototype>
26 </funcsynopsis>
27 </refsynopsisdiv>
28
29 <refsect1>
30 <title>Description</title>
31
32 <para>With the <function>select()</function> function applications
33can suspend execution until the driver has captured data or is ready
34to accept data for output.</para>
35
36 <para>When streaming I/O has been negotiated this function waits
37until a buffer has been filled or displayed and can be dequeued with
38the &VIDIOC-DQBUF; ioctl. When buffers are already in the outgoing
39queue of the driver the function returns immediately.</para>
40
41 <para>On success <function>select()</function> returns the total
42number of bits set in the <structname>fd_set</structname>s. When the
43function timed out it returns a value of zero. On failure it returns
44<returnvalue>-1</returnvalue> and the <varname>errno</varname>
45variable is set appropriately. When the application did not call
46&VIDIOC-QBUF; or &VIDIOC-STREAMON; yet the
47<function>select()</function> function succeeds, setting the bit of
48the file descriptor in <parameter>readfds</parameter> or
49<parameter>writefds</parameter>, but subsequent &VIDIOC-DQBUF; calls
50will fail.<footnote><para>The Linux kernel implements
51<function>select()</function> like the &func-poll; function, but
52<function>select()</function> cannot return a
53<constant>POLLERR</constant>.</para>
54 </footnote></para>
55
56 <para>When use of the <function>read()</function> function has
57been negotiated and the driver does not capture yet, the
58<function>select()</function> function starts capturing. When that
59fails, <function>select()</function> returns successful and a
60subsequent <function>read()</function> call, which also attempts to
61start capturing, will return an appropriate error code. When the
62driver captures continuously (as opposed to, for example, still
63images) and data is already available the
64<function>select()</function> function returns immediately.</para>
65
66 <para>When use of the <function>write()</function> function has
67been negotiated the <function>select()</function> function just waits
68until the driver is ready for a non-blocking
69<function>write()</function> call.</para>
70
71 <para>All drivers implementing the <function>read()</function> or
72<function>write()</function> function or streaming I/O must also
73support the <function>select()</function> function.</para>
74
75 <para>For more details see the <function>select()</function>
76manual page.</para>
77
78 </refsect1>
79
80 <refsect1>
81 <title>Return Value</title>
82
83 <para>On success, <function>select()</function> returns the number
84of descriptors contained in the three returned descriptor sets, which
85will be zero if the timeout expired. On error
86<returnvalue>-1</returnvalue> is returned, and the
87<varname>errno</varname> variable is set appropriately; the sets and
88<parameter>timeout</parameter> are undefined. Possible error codes
89are:</para>
90
91 <variablelist>
92 <varlistentry>
93 <term><errorcode>EBADF</errorcode></term>
94 <listitem>
95 <para>One or more of the file descriptor sets specified a
96file descriptor that is not open.</para>
97 </listitem>
98 </varlistentry>
99 <varlistentry>
100 <term><errorcode>EBUSY</errorcode></term>
101 <listitem>
102 <para>The driver does not support multiple read or write
103streams and the device is already in use.</para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term><errorcode>EFAULT</errorcode></term>
108 <listitem>
109 <para>The <parameter>readfds</parameter>,
110<parameter>writefds</parameter>, <parameter>exceptfds</parameter> or
111<parameter>timeout</parameter> pointer references an inaccessible memory
112area.</para>
113 </listitem>
114 </varlistentry>
115 <varlistentry>
116 <term><errorcode>EINTR</errorcode></term>
117 <listitem>
118 <para>The call was interrupted by a signal.</para>
119 </listitem>
120 </varlistentry>
121 <varlistentry>
122 <term><errorcode>EINVAL</errorcode></term>
123 <listitem>
124 <para>The <parameter>nfds</parameter> argument is less than
125zero or greater than <constant>FD_SETSIZE</constant>.</para>
126 </listitem>
127 </varlistentry>
128 </variablelist>
129 </refsect1>
130</refentry>
diff --git a/Documentation/DocBook/media/v4l/func-write.xml b/Documentation/DocBook/media/v4l/func-write.xml
new file mode 100644
index 00000000000..57520788572
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/func-write.xml
@@ -0,0 +1,128 @@
1<refentry id="func-write">
2 <refmeta>
3 <refentrytitle>V4L2 write()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>v4l2-write</refname>
9 <refpurpose>Write to a V4L2 device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;unistd.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>ssize_t <function>write</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>void *<parameter>buf</parameter></paramdef>
19 <paramdef>size_t <parameter>count</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>buf</parameter></term>
36 <listitem>
37 <para></para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>count</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para><function>write()</function> writes up to
53<parameter>count</parameter> bytes to the device referenced by the
54file descriptor <parameter>fd</parameter> from the buffer starting at
55<parameter>buf</parameter>. When the hardware outputs are not active
56yet, this function enables them. When <parameter>count</parameter> is
57zero, <function>write()</function> returns
58<returnvalue>0</returnvalue> without any other effect.</para>
59
60 <para>When the application does not provide more data in time, the
61previous video frame, raw VBI image, sliced VPS or WSS data is
62displayed again. Sliced Teletext or Closed Caption data is not
63repeated, the driver inserts a blank line instead.</para>
64 </refsect1>
65
66 <refsect1>
67 <title>Return Value</title>
68
69 <para>On success, the number of bytes written are returned. Zero
70indicates nothing was written. On error, <returnvalue>-1</returnvalue>
71is returned, and the <varname>errno</varname> variable is set
72appropriately. In this case the next write will start at the beginning
73of a new frame. Possible error codes are:</para>
74
75 <variablelist>
76 <varlistentry>
77 <term><errorcode>EAGAIN</errorcode></term>
78 <listitem>
79 <para>Non-blocking I/O has been selected using the <link
80linkend="func-open"><constant>O_NONBLOCK</constant></link> flag and no
81buffer space was available to write the data immediately.</para>
82 </listitem>
83 </varlistentry>
84 <varlistentry>
85 <term><errorcode>EBADF</errorcode></term>
86 <listitem>
87 <para><parameter>fd</parameter> is not a valid file
88descriptor or is not open for writing.</para>
89 </listitem>
90 </varlistentry>
91 <varlistentry>
92 <term><errorcode>EBUSY</errorcode></term>
93 <listitem>
94 <para>The driver does not support multiple write streams and the
95device is already in use.</para>
96 </listitem>
97 </varlistentry>
98 <varlistentry>
99 <term><errorcode>EFAULT</errorcode></term>
100 <listitem>
101 <para><parameter>buf</parameter> references an inaccessible
102memory area.</para>
103 </listitem>
104 </varlistentry>
105 <varlistentry>
106 <term><errorcode>EINTR</errorcode></term>
107 <listitem>
108 <para>The call was interrupted by a signal before any
109data was written.</para>
110 </listitem>
111 </varlistentry>
112 <varlistentry>
113 <term><errorcode>EIO</errorcode></term>
114 <listitem>
115 <para>I/O error. This indicates some hardware problem.</para>
116 </listitem>
117 </varlistentry>
118 <varlistentry>
119 <term><errorcode>EINVAL</errorcode></term>
120 <listitem>
121 <para>The <function>write()</function> function is not
122supported by this driver, not on this device, or generally not on this
123type of device.</para>
124 </listitem>
125 </varlistentry>
126 </variablelist>
127 </refsect1>
128</refentry>
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
new file mode 100644
index 00000000000..7e29a4e1f69
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -0,0 +1,77 @@
1<title>Generic Error Codes</title>
2
3<table frame="none" pgwide="1" id="gen-errors">
4 <title>Generic error codes</title>
5 <tgroup cols="2">
6 &cs-str;
7 <tbody valign="top">
8 <!-- Keep it ordered alphabetically -->
9 <row>
10 <entry>EAGAIN (aka EWOULDBLOCK)</entry>
11 <entry>The ioctl can't be handled because the device is in state where
12 it can't perform it. This could happen for example in case where
13 device is sleeping and ioctl is performed to query statistics.
14 It is also returned when the ioctl would need to wait
15 for an event, but the device was opened in non-blocking mode.
16 </entry>
17 </row>
18 <row>
19 <entry>EBADF</entry>
20 <entry>The file descriptor is not a valid.</entry>
21 </row>
22 <row>
23 <entry>EBUSY</entry>
24 <entry>The ioctl can't be handled because the device is busy. This is
25 typically return while device is streaming, and an ioctl tried to
26 change something that would affect the stream, or would require the
27 usage of a hardware resource that was already allocated. The ioctl
28 must not be retried without performing another action to fix the
29 problem first (typically: stop the stream before retrying).</entry>
30 </row>
31 <row>
32 <entry>EFAULT</entry>
33 <entry>There was a failure while copying data from/to userspace,
34 probably caused by an invalid pointer reference.</entry>
35 </row>
36 <row>
37 <entry>EINVAL</entry>
38 <entry>One or more of the ioctl parameters are invalid or out of the
39 allowed range. This is a widely used error code. See the individual
40 ioctl requests for specific causes.</entry>
41 </row>
42 <row>
43 <entry>ENODEV</entry>
44 <entry>Device not found or was removed.</entry>
45 </row>
46 <row>
47 <entry>ENOMEM</entry>
48 <entry>There's not enough memory to handle the desired operation.</entry>
49 </row>
50 <row>
51 <entry>ENOTTY</entry>
52 <entry>The ioctl is not supported by the driver, actually meaning that
53 the required functionality is not available, or the file
54 descriptor is not for a media device.</entry>
55 </row>
56 <row>
57 <entry>ENOSPC</entry>
58 <entry>On USB devices, the stream ioctl's can return this error, meaning
59 that this request would overcommit the usb bandwidth reserved
60 for periodic transfers (up to 80% of the USB bandwidth).</entry>
61 </row>
62 <row>
63 <entry>EPERM</entry>
64 <entry>Permission denied. Can be returned if the device needs write
65 permission, or some special capabilities is needed
66 (e. g. root)</entry>
67 </row>
68 </tbody>
69 </tgroup>
70</table>
71
72<para>Note 1: ioctls may return other error codes. Since errors may have side
73effects such as a driver reset, applications should abort on unexpected errors.
74</para>
75
76<para>Note 2: Request-specific error codes are listed in the individual
77requests descriptions.</para>
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
new file mode 100644
index 00000000000..388a3403265
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -0,0 +1,1450 @@
1 <title>Input/Output</title>
2
3 <para>The V4L2 API defines several different methods to read from or
4write to a device. All drivers exchanging data with applications must
5support at least one of them.</para>
6
7 <para>The classic I/O method using the <function>read()</function>
8and <function>write()</function> function is automatically selected
9after opening a V4L2 device. When the driver does not support this
10method attempts to read or write will fail at any time.</para>
11
12 <para>Other methods must be negotiated. To select the streaming I/O
13method with memory mapped or user buffers applications call the
14&VIDIOC-REQBUFS; ioctl. The asynchronous I/O method is not defined
15yet.</para>
16
17 <para>Video overlay can be considered another I/O method, although
18the application does not directly receive the image data. It is
19selected by initiating video overlay with the &VIDIOC-S-FMT; ioctl.
20For more information see <xref linkend="overlay" />.</para>
21
22 <para>Generally exactly one I/O method, including overlay, is
23associated with each file descriptor. The only exceptions are
24applications not exchanging data with a driver ("panel applications",
25see <xref linkend="open" />) and drivers permitting simultaneous video capturing
26and overlay using the same file descriptor, for compatibility with V4L
27and earlier versions of V4L2.</para>
28
29 <para><constant>VIDIOC_S_FMT</constant> and
30<constant>VIDIOC_REQBUFS</constant> would permit this to some degree,
31but for simplicity drivers need not support switching the I/O method
32(after first switching away from read/write) other than by closing
33and reopening the device.</para>
34
35 <para>The following sections describe the various I/O methods in
36more detail.</para>
37
38 <section id="rw">
39 <title>Read/Write</title>
40
41 <para>Input and output devices support the
42<function>read()</function> and <function>write()</function> function,
43respectively, when the <constant>V4L2_CAP_READWRITE</constant> flag in
44the <structfield>capabilities</structfield> field of &v4l2-capability;
45returned by the &VIDIOC-QUERYCAP; ioctl is set.</para>
46
47 <para>Drivers may need the CPU to copy the data, but they may also
48support DMA to or from user memory, so this I/O method is not
49necessarily less efficient than other methods merely exchanging buffer
50pointers. It is considered inferior though because no meta-information
51like frame counters or timestamps are passed. This information is
52necessary to recognize frame dropping and to synchronize with other
53data streams. However this is also the simplest I/O method, requiring
54little or no setup to exchange data. It permits command line stunts
55like this (the <application>vidctrl</application> tool is
56fictitious):</para>
57
58 <informalexample>
59 <screen>
60&gt; vidctrl /dev/video --input=0 --format=YUYV --size=352x288
61&gt; dd if=/dev/video of=myimage.422 bs=202752 count=1
62</screen>
63 </informalexample>
64
65 <para>To read from the device applications use the
66&func-read; function, to write the &func-write; function.
67Drivers must implement one I/O method if they
68exchange data with applications, but it need not be this.<footnote>
69 <para>It would be desirable if applications could depend on
70drivers supporting all I/O interfaces, but as much as the complex
71memory mapping I/O can be inadequate for some devices we have no
72reason to require this interface, which is most useful for simple
73applications capturing still images.</para>
74 </footnote> When reading or writing is supported, the driver
75must also support the &func-select; and &func-poll;
76function.<footnote>
77 <para>At the driver level <function>select()</function> and
78<function>poll()</function> are the same, and
79<function>select()</function> is too important to be optional.</para>
80 </footnote></para>
81 </section>
82
83 <section id="mmap">
84 <title>Streaming I/O (Memory Mapping)</title>
85
86 <para>Input and output devices support this I/O method when the
87<constant>V4L2_CAP_STREAMING</constant> flag in the
88<structfield>capabilities</structfield> field of &v4l2-capability;
89returned by the &VIDIOC-QUERYCAP; ioctl is set. There are two
90streaming methods, to determine if the memory mapping flavor is
91supported applications must call the &VIDIOC-REQBUFS; ioctl.</para>
92
93 <para>Streaming is an I/O method where only pointers to buffers
94are exchanged between application and driver, the data itself is not
95copied. Memory mapping is primarily intended to map buffers in device
96memory into the application's address space. Device memory can be for
97example the video memory on a graphics card with a video capture
98add-on. However, being the most efficient I/O method available for a
99long time, many other drivers support streaming as well, allocating
100buffers in DMA-able main memory.</para>
101
102 <para>A driver can support many sets of buffers. Each set is
103identified by a unique buffer type value. The sets are independent and
104each set can hold a different type of data. To access different sets
105at the same time different file descriptors must be used.<footnote>
106 <para>One could use one file descriptor and set the buffer
107type field accordingly when calling &VIDIOC-QBUF; etc., but it makes
108the <function>select()</function> function ambiguous. We also like the
109clean approach of one file descriptor per logical stream. Video
110overlay for example is also a logical stream, although the CPU is not
111needed for continuous operation.</para>
112 </footnote></para>
113
114 <para>To allocate device buffers applications call the
115&VIDIOC-REQBUFS; ioctl with the desired number of buffers and buffer
116type, for example <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>.
117This ioctl can also be used to change the number of buffers or to free
118the allocated memory, provided none of the buffers are still
119mapped.</para>
120
121 <para>Before applications can access the buffers they must map
122them into their address space with the &func-mmap; function. The
123location of the buffers in device memory can be determined with the
124&VIDIOC-QUERYBUF; ioctl. In the single-planar API case, the
125<structfield>m.offset</structfield> and <structfield>length</structfield>
126returned in a &v4l2-buffer; are passed as sixth and second parameter to the
127<function>mmap()</function> function. When using the multi-planar API,
128struct &v4l2-buffer; contains an array of &v4l2-plane; structures, each
129containing its own <structfield>m.offset</structfield> and
130<structfield>length</structfield>. When using the multi-planar API, every
131plane of every buffer has to be mapped separately, so the number of
132calls to &func-mmap; should be equal to number of buffers times number of
133planes in each buffer. The offset and length values must not be modified.
134Remember, the buffers are allocated in physical memory, as opposed to virtual
135memory, which can be swapped out to disk. Applications should free the buffers
136as soon as possible with the &func-munmap; function.</para>
137
138 <example>
139 <title>Mapping buffers in the single-planar API</title>
140 <programlisting>
141&v4l2-requestbuffers; reqbuf;
142struct {
143 void *start;
144 size_t length;
145} *buffers;
146unsigned int i;
147
148memset(&amp;reqbuf, 0, sizeof(reqbuf));
149reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
150reqbuf.memory = V4L2_MEMORY_MMAP;
151reqbuf.count = 20;
152
153if (-1 == ioctl (fd, &VIDIOC-REQBUFS;, &amp;reqbuf)) {
154 if (errno == EINVAL)
155 printf("Video capturing or mmap-streaming is not supported\n");
156 else
157 perror("VIDIOC_REQBUFS");
158
159 exit(EXIT_FAILURE);
160}
161
162/* We want at least five buffers. */
163
164if (reqbuf.count &lt; 5) {
165 /* You may need to free the buffers here. */
166 printf("Not enough buffer memory\n");
167 exit(EXIT_FAILURE);
168}
169
170buffers = calloc(reqbuf.count, sizeof(*buffers));
171assert(buffers != NULL);
172
173for (i = 0; i &lt; reqbuf.count; i++) {
174 &v4l2-buffer; buffer;
175
176 memset(&amp;buffer, 0, sizeof(buffer));
177 buffer.type = reqbuf.type;
178 buffer.memory = V4L2_MEMORY_MMAP;
179 buffer.index = i;
180
181 if (-1 == ioctl (fd, &VIDIOC-QUERYBUF;, &amp;buffer)) {
182 perror("VIDIOC_QUERYBUF");
183 exit(EXIT_FAILURE);
184 }
185
186 buffers[i].length = buffer.length; /* remember for munmap() */
187
188 buffers[i].start = mmap(NULL, buffer.length,
189 PROT_READ | PROT_WRITE, /* recommended */
190 MAP_SHARED, /* recommended */
191 fd, buffer.m.offset);
192
193 if (MAP_FAILED == buffers[i].start) {
194 /* If you do not exit here you should unmap() and free()
195 the buffers mapped so far. */
196 perror("mmap");
197 exit(EXIT_FAILURE);
198 }
199}
200
201/* Cleanup. */
202
203for (i = 0; i &lt; reqbuf.count; i++)
204 munmap(buffers[i].start, buffers[i].length);
205 </programlisting>
206 </example>
207
208 <example>
209 <title>Mapping buffers in the multi-planar API</title>
210 <programlisting>
211&v4l2-requestbuffers; reqbuf;
212/* Our current format uses 3 planes per buffer */
213#define FMT_NUM_PLANES = 3
214
215struct {
216 void *start[FMT_NUM_PLANES];
217 size_t length[FMT_NUM_PLANES];
218} *buffers;
219unsigned int i, j;
220
221memset(&amp;reqbuf, 0, sizeof(reqbuf));
222reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
223reqbuf.memory = V4L2_MEMORY_MMAP;
224reqbuf.count = 20;
225
226if (ioctl(fd, &VIDIOC-REQBUFS;, &amp;reqbuf) &lt; 0) {
227 if (errno == EINVAL)
228 printf("Video capturing or mmap-streaming is not supported\n");
229 else
230 perror("VIDIOC_REQBUFS");
231
232 exit(EXIT_FAILURE);
233}
234
235/* We want at least five buffers. */
236
237if (reqbuf.count &lt; 5) {
238 /* You may need to free the buffers here. */
239 printf("Not enough buffer memory\n");
240 exit(EXIT_FAILURE);
241}
242
243buffers = calloc(reqbuf.count, sizeof(*buffers));
244assert(buffers != NULL);
245
246for (i = 0; i &lt; reqbuf.count; i++) {
247 &v4l2-buffer; buffer;
248 &v4l2-plane; planes[FMT_NUM_PLANES];
249
250 memset(&amp;buffer, 0, sizeof(buffer));
251 buffer.type = reqbuf.type;
252 buffer.memory = V4L2_MEMORY_MMAP;
253 buffer.index = i;
254 /* length in struct v4l2_buffer in multi-planar API stores the size
255 * of planes array. */
256 buffer.length = FMT_NUM_PLANES;
257 buffer.m.planes = planes;
258
259 if (ioctl(fd, &VIDIOC-QUERYBUF;, &amp;buffer) &lt; 0) {
260 perror("VIDIOC_QUERYBUF");
261 exit(EXIT_FAILURE);
262 }
263
264 /* Every plane has to be mapped separately */
265 for (j = 0; j &lt; FMT_NUM_PLANES; j++) {
266 buffers[i].length[j] = buffer.m.planes[j].length; /* remember for munmap() */
267
268 buffers[i].start[j] = mmap(NULL, buffer.m.planes[j].length,
269 PROT_READ | PROT_WRITE, /* recommended */
270 MAP_SHARED, /* recommended */
271 fd, buffer.m.planes[j].m.offset);
272
273 if (MAP_FAILED == buffers[i].start[j]) {
274 /* If you do not exit here you should unmap() and free()
275 the buffers and planes mapped so far. */
276 perror("mmap");
277 exit(EXIT_FAILURE);
278 }
279 }
280}
281
282/* Cleanup. */
283
284for (i = 0; i &lt; reqbuf.count; i++)
285 for (j = 0; j &lt; FMT_NUM_PLANES; j++)
286 munmap(buffers[i].start[j], buffers[i].length[j]);
287 </programlisting>
288 </example>
289
290 <para>Conceptually streaming drivers maintain two buffer queues, an incoming
291and an outgoing queue. They separate the synchronous capture or output
292operation locked to a video clock from the application which is
293subject to random disk or network delays and preemption by
294other processes, thereby reducing the probability of data loss.
295The queues are organized as FIFOs, buffers will be
296output in the order enqueued in the incoming FIFO, and were
297captured in the order dequeued from the outgoing FIFO.</para>
298
299 <para>The driver may require a minimum number of buffers enqueued
300at all times to function, apart of this no limit exists on the number
301of buffers applications can enqueue in advance, or dequeue and
302process. They can also enqueue in a different order than buffers have
303been dequeued, and the driver can <emphasis>fill</emphasis> enqueued
304<emphasis>empty</emphasis> buffers in any order. <footnote>
305 <para>Random enqueue order permits applications processing
306images out of order (such as video codecs) to return buffers earlier,
307reducing the probability of data loss. Random fill order allows
308drivers to reuse buffers on a LIFO-basis, taking advantage of caches
309holding scatter-gather lists and the like.</para>
310 </footnote> The index number of a buffer (&v4l2-buffer;
311<structfield>index</structfield>) plays no role here, it only
312identifies the buffer.</para>
313
314 <para>Initially all mapped buffers are in dequeued state,
315inaccessible by the driver. For capturing applications it is customary
316to first enqueue all mapped buffers, then to start capturing and enter
317the read loop. Here the application waits until a filled buffer can be
318dequeued, and re-enqueues the buffer when the data is no longer
319needed. Output applications fill and enqueue buffers, when enough
320buffers are stacked up the output is started with
321<constant>VIDIOC_STREAMON</constant>. In the write loop, when
322the application runs out of free buffers, it must wait until an empty
323buffer can be dequeued and reused.</para>
324
325 <para>To enqueue and dequeue a buffer applications use the
326&VIDIOC-QBUF; and &VIDIOC-DQBUF; ioctl. The status of a buffer being
327mapped, enqueued, full or empty can be determined at any time using the
328&VIDIOC-QUERYBUF; ioctl. Two methods exist to suspend execution of the
329application until one or more buffers can be dequeued. By default
330<constant>VIDIOC_DQBUF</constant> blocks when no buffer is in the
331outgoing queue. When the <constant>O_NONBLOCK</constant> flag was
332given to the &func-open; function, <constant>VIDIOC_DQBUF</constant>
333returns immediately with an &EAGAIN; when no buffer is available. The
334&func-select; or &func-poll; functions are always available.</para>
335
336 <para>To start and stop capturing or output applications call the
337&VIDIOC-STREAMON; and &VIDIOC-STREAMOFF; ioctl. Note
338<constant>VIDIOC_STREAMOFF</constant> removes all buffers from both
339queues as a side effect. Since there is no notion of doing anything
340"now" on a multitasking system, if an application needs to synchronize
341with another event it should examine the &v4l2-buffer;
342<structfield>timestamp</structfield> of captured buffers, or set the
343field before enqueuing buffers for output.</para>
344
345 <para>Drivers implementing memory mapping I/O must
346support the <constant>VIDIOC_REQBUFS</constant>,
347<constant>VIDIOC_QUERYBUF</constant>,
348<constant>VIDIOC_QBUF</constant>, <constant>VIDIOC_DQBUF</constant>,
349<constant>VIDIOC_STREAMON</constant> and
350<constant>VIDIOC_STREAMOFF</constant> ioctl, the
351<function>mmap()</function>, <function>munmap()</function>,
352<function>select()</function> and <function>poll()</function>
353function.<footnote>
354 <para>At the driver level <function>select()</function> and
355<function>poll()</function> are the same, and
356<function>select()</function> is too important to be optional. The
357rest should be evident.</para>
358 </footnote></para>
359
360 <para>[capture example]</para>
361
362 </section>
363
364 <section id="userp">
365 <title>Streaming I/O (User Pointers)</title>
366
367 <para>Input and output devices support this I/O method when the
368<constant>V4L2_CAP_STREAMING</constant> flag in the
369<structfield>capabilities</structfield> field of &v4l2-capability;
370returned by the &VIDIOC-QUERYCAP; ioctl is set. If the particular user
371pointer method (not only memory mapping) is supported must be
372determined by calling the &VIDIOC-REQBUFS; ioctl.</para>
373
374 <para>This I/O method combines advantages of the read/write and
375memory mapping methods. Buffers (planes) are allocated by the application
376itself, and can reside for example in virtual or shared memory. Only
377pointers to data are exchanged, these pointers and meta-information
378are passed in &v4l2-buffer; (or in &v4l2-plane; in the multi-planar API case).
379The driver must be switched into user pointer I/O mode by calling the
380&VIDIOC-REQBUFS; with the desired buffer type. No buffers (planes) are allocated
381beforehand, consequently they are not indexed and cannot be queried like mapped
382buffers with the <constant>VIDIOC_QUERYBUF</constant> ioctl.</para>
383
384 <example>
385 <title>Initiating streaming I/O with user pointers</title>
386
387 <programlisting>
388&v4l2-requestbuffers; reqbuf;
389
390memset (&amp;reqbuf, 0, sizeof (reqbuf));
391reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
392reqbuf.memory = V4L2_MEMORY_USERPTR;
393
394if (ioctl (fd, &VIDIOC-REQBUFS;, &amp;reqbuf) == -1) {
395 if (errno == EINVAL)
396 printf ("Video capturing or user pointer streaming is not supported\n");
397 else
398 perror ("VIDIOC_REQBUFS");
399
400 exit (EXIT_FAILURE);
401}
402 </programlisting>
403 </example>
404
405 <para>Buffer (plane) addresses and sizes are passed on the fly with the
406&VIDIOC-QBUF; ioctl. Although buffers are commonly cycled,
407applications can pass different addresses and sizes at each
408<constant>VIDIOC_QBUF</constant> call. If required by the hardware the
409driver swaps memory pages within physical memory to create a
410continuous area of memory. This happens transparently to the
411application in the virtual memory subsystem of the kernel. When buffer
412pages have been swapped out to disk they are brought back and finally
413locked in physical memory for DMA.<footnote>
414 <para>We expect that frequently used buffers are typically not
415swapped out. Anyway, the process of swapping, locking or generating
416scatter-gather lists may be time consuming. The delay can be masked by
417the depth of the incoming buffer queue, and perhaps by maintaining
418caches assuming a buffer will be soon enqueued again. On the other
419hand, to optimize memory usage drivers can limit the number of buffers
420locked in advance and recycle the most recently used buffers first. Of
421course, the pages of empty buffers in the incoming queue need not be
422saved to disk. Output buffers must be saved on the incoming and
423outgoing queue because an application may share them with other
424processes.</para>
425 </footnote></para>
426
427 <para>Filled or displayed buffers are dequeued with the
428&VIDIOC-DQBUF; ioctl. The driver can unlock the memory pages at any
429time between the completion of the DMA and this ioctl. The memory is
430also unlocked when &VIDIOC-STREAMOFF; is called, &VIDIOC-REQBUFS;, or
431when the device is closed. Applications must take care not to free
432buffers without dequeuing. For once, the buffers remain locked until
433further, wasting physical memory. Second the driver will not be
434notified when the memory is returned to the application's free list
435and subsequently reused for other purposes, possibly completing the
436requested DMA and overwriting valuable data.</para>
437
438 <para>For capturing applications it is customary to enqueue a
439number of empty buffers, to start capturing and enter the read loop.
440Here the application waits until a filled buffer can be dequeued, and
441re-enqueues the buffer when the data is no longer needed. Output
442applications fill and enqueue buffers, when enough buffers are stacked
443up output is started. In the write loop, when the application
444runs out of free buffers it must wait until an empty buffer can be
445dequeued and reused. Two methods exist to suspend execution of the
446application until one or more buffers can be dequeued. By default
447<constant>VIDIOC_DQBUF</constant> blocks when no buffer is in the
448outgoing queue. When the <constant>O_NONBLOCK</constant> flag was
449given to the &func-open; function, <constant>VIDIOC_DQBUF</constant>
450returns immediately with an &EAGAIN; when no buffer is available. The
451&func-select; or &func-poll; function are always available.</para>
452
453 <para>To start and stop capturing or output applications call the
454&VIDIOC-STREAMON; and &VIDIOC-STREAMOFF; ioctl. Note
455<constant>VIDIOC_STREAMOFF</constant> removes all buffers from both
456queues and unlocks all buffers as a side effect. Since there is no
457notion of doing anything "now" on a multitasking system, if an
458application needs to synchronize with another event it should examine
459the &v4l2-buffer; <structfield>timestamp</structfield> of captured
460buffers, or set the field before enqueuing buffers for output.</para>
461
462 <para>Drivers implementing user pointer I/O must
463support the <constant>VIDIOC_REQBUFS</constant>,
464<constant>VIDIOC_QBUF</constant>, <constant>VIDIOC_DQBUF</constant>,
465<constant>VIDIOC_STREAMON</constant> and
466<constant>VIDIOC_STREAMOFF</constant> ioctl, the
467<function>select()</function> and <function>poll()</function> function.<footnote>
468 <para>At the driver level <function>select()</function> and
469<function>poll()</function> are the same, and
470<function>select()</function> is too important to be optional. The
471rest should be evident.</para>
472 </footnote></para>
473 </section>
474
475 <section id="dmabuf">
476 <title>Streaming I/O (DMA buffer importing)</title>
477
478 <note>
479 <title>Experimental</title>
480 <para>This is an <link linkend="experimental"> experimental </link>
481 interface and may change in the future.</para>
482 </note>
483
484<para>The DMABUF framework provides a generic method for sharing buffers
485between multiple devices. Device drivers that support DMABUF can export a DMA
486buffer to userspace as a file descriptor (known as the exporter role), import a
487DMA buffer from userspace using a file descriptor previously exported for a
488different or the same device (known as the importer role), or both. This
489section describes the DMABUF importer role API in V4L2.</para>
490
491 <para>Refer to <link linked="vidioc-expbuf"> DMABUF exporting </link> for
492details about exporting V4L2 buffers as DMABUF file descriptors.</para>
493
494<para>Input and output devices support the streaming I/O method when the
495<constant>V4L2_CAP_STREAMING</constant> flag in the
496<structfield>capabilities</structfield> field of &v4l2-capability; returned by
497the &VIDIOC-QUERYCAP; ioctl is set. Whether importing DMA buffers through
498DMABUF file descriptors is supported is determined by calling the
499&VIDIOC-REQBUFS; ioctl with the memory type set to
500<constant>V4L2_MEMORY_DMABUF</constant>.</para>
501
502 <para>This I/O method is dedicated to sharing DMA buffers between different
503devices, which may be V4L devices or other video-related devices (e.g. DRM).
504Buffers (planes) are allocated by a driver on behalf of an application. Next,
505these buffers are exported to the application as file descriptors using an API
506which is specific for an allocator driver. Only such file descriptor are
507exchanged. The descriptors and meta-information are passed in &v4l2-buffer; (or
508in &v4l2-plane; in the multi-planar API case). The driver must be switched
509into DMABUF I/O mode by calling the &VIDIOC-REQBUFS; with the desired buffer
510type.</para>
511
512 <example>
513 <title>Initiating streaming I/O with DMABUF file descriptors</title>
514
515 <programlisting>
516&v4l2-requestbuffers; reqbuf;
517
518memset(&amp;reqbuf, 0, sizeof (reqbuf));
519reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
520reqbuf.memory = V4L2_MEMORY_DMABUF;
521reqbuf.count = 1;
522
523if (ioctl(fd, &VIDIOC-REQBUFS;, &amp;reqbuf) == -1) {
524 if (errno == EINVAL)
525 printf("Video capturing or DMABUF streaming is not supported\n");
526 else
527 perror("VIDIOC_REQBUFS");
528
529 exit(EXIT_FAILURE);
530}
531 </programlisting>
532 </example>
533
534 <para>The buffer (plane) file descriptor is passed on the fly with the
535&VIDIOC-QBUF; ioctl. In case of multiplanar buffers, every plane can be
536associated with a different DMABUF descriptor. Although buffers are commonly
537cycled, applications can pass a different DMABUF descriptor at each
538<constant>VIDIOC_QBUF</constant> call.</para>
539
540 <example>
541 <title>Queueing DMABUF using single plane API</title>
542
543 <programlisting>
544int buffer_queue(int v4lfd, int index, int dmafd)
545{
546 &v4l2-buffer; buf;
547
548 memset(&amp;buf, 0, sizeof buf);
549 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
550 buf.memory = V4L2_MEMORY_DMABUF;
551 buf.index = index;
552 buf.m.fd = dmafd;
553
554 if (ioctl(v4lfd, &VIDIOC-QBUF;, &amp;buf) == -1) {
555 perror("VIDIOC_QBUF");
556 return -1;
557 }
558
559 return 0;
560}
561 </programlisting>
562 </example>
563
564 <example>
565 <title>Queueing DMABUF using multi plane API</title>
566
567 <programlisting>
568int buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes)
569{
570 &v4l2-buffer; buf;
571 &v4l2-plane; planes[VIDEO_MAX_PLANES];
572 int i;
573
574 memset(&amp;buf, 0, sizeof buf);
575 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
576 buf.memory = V4L2_MEMORY_DMABUF;
577 buf.index = index;
578 buf.m.planes = planes;
579 buf.length = n_planes;
580
581 memset(&amp;planes, 0, sizeof planes);
582
583 for (i = 0; i &lt; n_planes; ++i)
584 buf.m.planes[i].m.fd = dmafd[i];
585
586 if (ioctl(v4lfd, &VIDIOC-QBUF;, &amp;buf) == -1) {
587 perror("VIDIOC_QBUF");
588 return -1;
589 }
590
591 return 0;
592}
593 </programlisting>
594 </example>
595
596 <para>Captured or displayed buffers are dequeued with the
597&VIDIOC-DQBUF; ioctl. The driver can unlock the buffer at any
598time between the completion of the DMA and this ioctl. The memory is
599also unlocked when &VIDIOC-STREAMOFF; is called, &VIDIOC-REQBUFS;, or
600when the device is closed.</para>
601
602 <para>For capturing applications it is customary to enqueue a
603number of empty buffers, to start capturing and enter the read loop.
604Here the application waits until a filled buffer can be dequeued, and
605re-enqueues the buffer when the data is no longer needed. Output
606applications fill and enqueue buffers, when enough buffers are stacked
607up output is started. In the write loop, when the application
608runs out of free buffers it must wait until an empty buffer can be
609dequeued and reused. Two methods exist to suspend execution of the
610application until one or more buffers can be dequeued. By default
611<constant>VIDIOC_DQBUF</constant> blocks when no buffer is in the
612outgoing queue. When the <constant>O_NONBLOCK</constant> flag was
613given to the &func-open; function, <constant>VIDIOC_DQBUF</constant>
614returns immediately with an &EAGAIN; when no buffer is available. The
615&func-select; and &func-poll; functions are always available.</para>
616
617 <para>To start and stop capturing or displaying applications call the
618&VIDIOC-STREAMON; and &VIDIOC-STREAMOFF; ioctls. Note that
619<constant>VIDIOC_STREAMOFF</constant> removes all buffers from both queues and
620unlocks all buffers as a side effect. Since there is no notion of doing
621anything "now" on a multitasking system, if an application needs to synchronize
622with another event it should examine the &v4l2-buffer;
623<structfield>timestamp</structfield> of captured buffers, or set the field
624before enqueuing buffers for output.</para>
625
626 <para>Drivers implementing DMABUF importing I/O must support the
627<constant>VIDIOC_REQBUFS</constant>, <constant>VIDIOC_QBUF</constant>,
628<constant>VIDIOC_DQBUF</constant>, <constant>VIDIOC_STREAMON</constant> and
629<constant>VIDIOC_STREAMOFF</constant> ioctls, and the
630<function>select()</function> and <function>poll()</function> functions.</para>
631
632 </section>
633
634 <section id="async">
635 <title>Asynchronous I/O</title>
636
637 <para>This method is not defined yet.</para>
638 </section>
639
640 <section id="buffer">
641 <title>Buffers</title>
642
643 <para>A buffer contains data exchanged by application and
644driver using one of the Streaming I/O methods. In the multi-planar API, the
645data is held in planes, while the buffer structure acts as a container
646for the planes. Only pointers to buffers (planes) are exchanged, the data
647itself is not copied. These pointers, together with meta-information like
648timestamps or field parity, are stored in a struct
649<structname>v4l2_buffer</structname>, argument to
650the &VIDIOC-QUERYBUF;, &VIDIOC-QBUF; and &VIDIOC-DQBUF; ioctl.
651In the multi-planar API, some plane-specific members of struct
652<structname>v4l2_buffer</structname>, such as pointers and sizes for each
653plane, are stored in struct <structname>v4l2_plane</structname> instead.
654In that case, struct <structname>v4l2_buffer</structname> contains an array of
655plane structures.</para>
656
657 <para>Nominally timestamps refer to the first data byte transmitted.
658In practice however the wide range of hardware covered by the V4L2 API
659limits timestamp accuracy. Often an interrupt routine will
660sample the system clock shortly after the field or frame was stored
661completely in memory. So applications must expect a constant
662difference up to one field or frame period plus a small (few scan
663lines) random error. The delay and error can be much
664larger due to compression or transmission over an external bus when
665the frames are not properly stamped by the sender. This is frequently
666the case with USB cameras. Here timestamps refer to the instant the
667field or frame was received by the driver, not the capture time. These
668devices identify by not enumerating any video standards, see <xref
669linkend="standard" />.</para>
670
671 <para>Similar limitations apply to output timestamps. Typically
672the video hardware locks to a clock controlling the video timing, the
673horizontal and vertical synchronization pulses. At some point in the
674line sequence, possibly the vertical blanking, an interrupt routine
675samples the system clock, compares against the timestamp and programs
676the hardware to repeat the previous field or frame, or to display the
677buffer contents.</para>
678
679 <para>Apart of limitations of the video device and natural
680inaccuracies of all clocks, it should be noted system time itself is
681not perfectly stable. It can be affected by power saving cycles,
682warped to insert leap seconds, or even turned back or forth by the
683system administrator affecting long term measurements. <footnote>
684 <para>Since no other Linux multimedia
685API supports unadjusted time it would be foolish to introduce here. We
686must use a universally supported clock to synchronize different media,
687hence time of day.</para>
688 </footnote></para>
689
690 <table frame="none" pgwide="1" id="v4l2-buffer">
691 <title>struct <structname>v4l2_buffer</structname></title>
692 <tgroup cols="4">
693 &cs-ustr;
694 <tbody valign="top">
695 <row>
696 <entry>__u32</entry>
697 <entry><structfield>index</structfield></entry>
698 <entry></entry>
699 <entry>Number of the buffer, set by the application. This
700field is only used for <link linkend="mmap">memory mapping</link> I/O
701and can range from zero to the number of buffers allocated
702with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry>
703 </row>
704 <row>
705 <entry>__u32</entry>
706 <entry><structfield>type</structfield></entry>
707 <entry></entry>
708 <entry>Type of the buffer, same as &v4l2-format;
709<structfield>type</structfield> or &v4l2-requestbuffers;
710<structfield>type</structfield>, set by the application. See <xref
711linkend="v4l2-buf-type" /></entry>
712 </row>
713 <row>
714 <entry>__u32</entry>
715 <entry><structfield>bytesused</structfield></entry>
716 <entry></entry>
717 <entry>The number of bytes occupied by the data in the
718buffer. It depends on the negotiated data format and may change with
719each buffer for compressed variable size data like JPEG images.
720Drivers must set this field when <structfield>type</structfield>
721refers to an input stream, applications when an output stream.</entry>
722 </row>
723 <row>
724 <entry>__u32</entry>
725 <entry><structfield>flags</structfield></entry>
726 <entry></entry>
727 <entry>Flags set by the application or driver, see <xref
728linkend="buffer-flags" />.</entry>
729 </row>
730 <row>
731 <entry>__u32</entry>
732 <entry><structfield>field</structfield></entry>
733 <entry></entry>
734 <entry>Indicates the field order of the image in the
735buffer, see <xref linkend="v4l2-field" />. This field is not used when
736the buffer contains VBI data. Drivers must set it when
737<structfield>type</structfield> refers to an input stream,
738applications when an output stream.</entry>
739 </row>
740 <row>
741 <entry>struct timeval</entry>
742 <entry><structfield>timestamp</structfield></entry>
743 <entry></entry>
744 <entry><para>For input streams this is the
745system time (as returned by the <function>gettimeofday()</function>
746function) when the first data byte was captured. For output streams
747the data will not be displayed before this time, secondary to the
748nominal frame rate determined by the current video standard in
749enqueued order. Applications can for example zero this field to
750display frames as soon as possible. The driver stores the time at
751which the first data byte was actually sent out in the
752<structfield>timestamp</structfield> field. This permits
753applications to monitor the drift between the video and system
754clock.</para></entry>
755 </row>
756 <row>
757 <entry>&v4l2-timecode;</entry>
758 <entry><structfield>timecode</structfield></entry>
759 <entry></entry>
760 <entry>When <structfield>type</structfield> is
761<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> and the
762<constant>V4L2_BUF_FLAG_TIMECODE</constant> flag is set in
763<structfield>flags</structfield>, this structure contains a frame
764timecode. In <link linkend="v4l2-field">V4L2_FIELD_ALTERNATE</link>
765mode the top and bottom field contain the same timecode.
766Timecodes are intended to help video editing and are typically recorded on
767video tapes, but also embedded in compressed formats like MPEG. This
768field is independent of the <structfield>timestamp</structfield> and
769<structfield>sequence</structfield> fields.</entry>
770 </row>
771 <row>
772 <entry>__u32</entry>
773 <entry><structfield>sequence</structfield></entry>
774 <entry></entry>
775 <entry>Set by the driver, counting the frames (not fields!) in
776sequence. This field is set for both input and output devices.</entry>
777 </row>
778 <row>
779 <entry spanname="hspan"><para>In <link
780linkend="v4l2-field">V4L2_FIELD_ALTERNATE</link> mode the top and
781bottom field have the same sequence number. The count starts at zero
782and includes dropped or repeated frames. A dropped frame was received
783by an input device but could not be stored due to lack of free buffer
784space. A repeated frame was displayed again by an output device
785because the application did not pass new data in
786time.</para><para>Note this may count the frames received
787e.g. over USB, without taking into account the frames dropped by the
788remote hardware due to limited compression throughput or bus
789bandwidth. These devices identify by not enumerating any video
790standards, see <xref linkend="standard" />.</para></entry>
791 </row>
792 <row>
793 <entry>__u32</entry>
794 <entry><structfield>memory</structfield></entry>
795 <entry></entry>
796 <entry>This field must be set by applications and/or drivers
797in accordance with the selected I/O method. See <xref linkend="v4l2-memory"
798 /></entry>
799 </row>
800 <row>
801 <entry>union</entry>
802 <entry><structfield>m</structfield></entry>
803 </row>
804 <row>
805 <entry></entry>
806 <entry>__u32</entry>
807 <entry><structfield>offset</structfield></entry>
808 <entry>For the single-planar API and when
809<structfield>memory</structfield> is <constant>V4L2_MEMORY_MMAP</constant> this
810is the offset of the buffer from the start of the device memory. The value is
811returned by the driver and apart of serving as parameter to the &func-mmap;
812function not useful for applications. See <xref linkend="mmap" /> for details
813 </entry>
814 </row>
815 <row>
816 <entry></entry>
817 <entry>unsigned long</entry>
818 <entry><structfield>userptr</structfield></entry>
819 <entry>For the single-planar API and when
820<structfield>memory</structfield> is <constant>V4L2_MEMORY_USERPTR</constant>
821this is a pointer to the buffer (casted to unsigned long type) in virtual
822memory, set by the application. See <xref linkend="userp" /> for details.
823 </entry>
824 </row>
825 <row>
826 <entry></entry>
827 <entry>struct v4l2_plane</entry>
828 <entry><structfield>*planes</structfield></entry>
829 <entry>When using the multi-planar API, contains a userspace pointer
830 to an array of &v4l2-plane;. The size of the array should be put
831 in the <structfield>length</structfield> field of this
832 <structname>v4l2_buffer</structname> structure.</entry>
833 </row>
834 <row>
835 <entry></entry>
836 <entry>int</entry>
837 <entry><structfield>fd</structfield></entry>
838 <entry>For the single-plane API and when
839<structfield>memory</structfield> is <constant>V4L2_MEMORY_DMABUF</constant> this
840is the file descriptor associated with a DMABUF buffer.</entry>
841 </row>
842 <row>
843 <entry>__u32</entry>
844 <entry><structfield>length</structfield></entry>
845 <entry></entry>
846 <entry>Size of the buffer (not the payload) in bytes for the
847 single-planar API. For the multi-planar API the application sets
848 this to the number of elements in the <structfield>planes</structfield>
849 array. The driver will fill in the actual number of valid elements in
850 that array.
851 </entry>
852 </row>
853 <row>
854 <entry>__u32</entry>
855 <entry><structfield>reserved2</structfield></entry>
856 <entry></entry>
857 <entry>A place holder for future extensions. Applications
858should set this to 0.</entry>
859 </row>
860 <row>
861 <entry>__u32</entry>
862 <entry><structfield>reserved</structfield></entry>
863 <entry></entry>
864 <entry>A place holder for future extensions. Applications
865should set this to 0.</entry>
866 </row>
867 </tbody>
868 </tgroup>
869 </table>
870
871 <table frame="none" pgwide="1" id="v4l2-plane">
872 <title>struct <structname>v4l2_plane</structname></title>
873 <tgroup cols="4">
874 &cs-ustr;
875 <tbody valign="top">
876 <row>
877 <entry>__u32</entry>
878 <entry><structfield>bytesused</structfield></entry>
879 <entry></entry>
880 <entry>The number of bytes occupied by data in the plane
881 (its payload).</entry>
882 </row>
883 <row>
884 <entry>__u32</entry>
885 <entry><structfield>length</structfield></entry>
886 <entry></entry>
887 <entry>Size in bytes of the plane (not its payload).</entry>
888 </row>
889 <row>
890 <entry>union</entry>
891 <entry><structfield>m</structfield></entry>
892 <entry></entry>
893 <entry></entry>
894 </row>
895 <row>
896 <entry></entry>
897 <entry>__u32</entry>
898 <entry><structfield>mem_offset</structfield></entry>
899 <entry>When the memory type in the containing &v4l2-buffer; is
900 <constant>V4L2_MEMORY_MMAP</constant>, this is the value that
901 should be passed to &func-mmap;, similar to the
902 <structfield>offset</structfield> field in &v4l2-buffer;.</entry>
903 </row>
904 <row>
905 <entry></entry>
906 <entry>__unsigned long</entry>
907 <entry><structfield>userptr</structfield></entry>
908 <entry>When the memory type in the containing &v4l2-buffer; is
909 <constant>V4L2_MEMORY_USERPTR</constant>, this is a userspace
910 pointer to the memory allocated for this plane by an application.
911 </entry>
912 </row>
913 <row>
914 <entry></entry>
915 <entry>int</entry>
916 <entry><structfield>fd</structfield></entry>
917 <entry>When the memory type in the containing &v4l2-buffer; is
918 <constant>V4L2_MEMORY_DMABUF</constant>, this is a file
919 descriptor associated with a DMABUF buffer, similar to the
920 <structfield>fd</structfield> field in &v4l2-buffer;.</entry>
921 </row>
922 <row>
923 <entry>__u32</entry>
924 <entry><structfield>data_offset</structfield></entry>
925 <entry></entry>
926 <entry>Offset in bytes to video data in the plane, if applicable.
927 </entry>
928 </row>
929 <row>
930 <entry>__u32</entry>
931 <entry><structfield>reserved[11]</structfield></entry>
932 <entry></entry>
933 <entry>Reserved for future use. Should be zeroed by an
934 application.</entry>
935 </row>
936 </tbody>
937 </tgroup>
938 </table>
939
940 <table frame="none" pgwide="1" id="v4l2-buf-type">
941 <title>enum v4l2_buf_type</title>
942 <tgroup cols="3">
943 &cs-def;
944 <tbody valign="top">
945 <row>
946 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant></entry>
947 <entry>1</entry>
948 <entry>Buffer of a single-planar video capture stream, see <xref
949 linkend="capture" />.</entry>
950 </row>
951 <row>
952 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>
953 </entry>
954 <entry>9</entry>
955 <entry>Buffer of a multi-planar video capture stream, see <xref
956 linkend="capture" />.</entry>
957 </row>
958 <row>
959 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant></entry>
960 <entry>2</entry>
961 <entry>Buffer of a single-planar video output stream, see <xref
962 linkend="output" />.</entry>
963 </row>
964 <row>
965 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>
966 </entry>
967 <entry>10</entry>
968 <entry>Buffer of a multi-planar video output stream, see <xref
969 linkend="output" />.</entry>
970 </row>
971 <row>
972 <entry><constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant></entry>
973 <entry>3</entry>
974 <entry>Buffer for video overlay, see <xref linkend="overlay" />.</entry>
975 </row>
976 <row>
977 <entry><constant>V4L2_BUF_TYPE_VBI_CAPTURE</constant></entry>
978 <entry>4</entry>
979 <entry>Buffer of a raw VBI capture stream, see <xref
980 linkend="raw-vbi" />.</entry>
981 </row>
982 <row>
983 <entry><constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant></entry>
984 <entry>5</entry>
985 <entry>Buffer of a raw VBI output stream, see <xref
986 linkend="raw-vbi" />.</entry>
987 </row>
988 <row>
989 <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant></entry>
990 <entry>6</entry>
991 <entry>Buffer of a sliced VBI capture stream, see <xref
992 linkend="sliced" />.</entry>
993 </row>
994 <row>
995 <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant></entry>
996 <entry>7</entry>
997 <entry>Buffer of a sliced VBI output stream, see <xref
998 linkend="sliced" />.</entry>
999 </row>
1000 <row>
1001 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant></entry>
1002 <entry>8</entry>
1003 <entry>Buffer for video output overlay (OSD), see <xref
1004 linkend="osd" />.</entry>
1005 </row>
1006 </tbody>
1007 </tgroup>
1008 </table>
1009
1010 <table frame="none" pgwide="1" id="buffer-flags">
1011 <title>Buffer Flags</title>
1012 <tgroup cols="3">
1013 &cs-def;
1014 <tbody valign="top">
1015 <row>
1016 <entry><constant>V4L2_BUF_FLAG_MAPPED</constant></entry>
1017 <entry>0x0001</entry>
1018 <entry>The buffer resides in device memory and has been mapped
1019into the application's address space, see <xref linkend="mmap" /> for details.
1020Drivers set or clear this flag when the
1021<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link
1022 linkend="vidioc-qbuf">VIDIOC_QBUF</link> or <link
1023 linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl is called. Set by the driver.</entry>
1024 </row>
1025 <row>
1026 <entry><constant>V4L2_BUF_FLAG_QUEUED</constant></entry>
1027 <entry>0x0002</entry>
1028 <entry>Internally drivers maintain two buffer queues, an
1029incoming and outgoing queue. When this flag is set, the buffer is
1030currently on the incoming queue. It automatically moves to the
1031outgoing queue after the buffer has been filled (capture devices) or
1032displayed (output devices). Drivers set or clear this flag when the
1033<constant>VIDIOC_QUERYBUF</constant> ioctl is called. After
1034(successful) calling the <constant>VIDIOC_QBUF </constant>ioctl it is
1035always set and after <constant>VIDIOC_DQBUF</constant> always
1036cleared.</entry>
1037 </row>
1038 <row>
1039 <entry><constant>V4L2_BUF_FLAG_DONE</constant></entry>
1040 <entry>0x0004</entry>
1041 <entry>When this flag is set, the buffer is currently on
1042the outgoing queue, ready to be dequeued from the driver. Drivers set
1043or clear this flag when the <constant>VIDIOC_QUERYBUF</constant> ioctl
1044is called. After calling the <constant>VIDIOC_QBUF</constant> or
1045<constant>VIDIOC_DQBUF</constant> it is always cleared. Of course a
1046buffer cannot be on both queues at the same time, the
1047<constant>V4L2_BUF_FLAG_QUEUED</constant> and
1048<constant>V4L2_BUF_FLAG_DONE</constant> flag are mutually exclusive.
1049They can be both cleared however, then the buffer is in "dequeued"
1050state, in the application domain to say so.</entry>
1051 </row>
1052 <row>
1053 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry>
1054 <entry>0x0040</entry>
1055 <entry>When this flag is set, the buffer has been dequeued
1056 successfully, although the data might have been corrupted.
1057 This is recoverable, streaming may continue as normal and
1058 the buffer may be reused normally.
1059 Drivers set this flag when the <constant>VIDIOC_DQBUF</constant>
1060 ioctl is called.</entry>
1061 </row>
1062 <row>
1063 <entry><constant>V4L2_BUF_FLAG_KEYFRAME</constant></entry>
1064 <entry>0x0008</entry>
1065 <entry>Drivers set or clear this flag when calling the
1066<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video
1067capture devices when the buffer contains a compressed image which is a
1068key frame (or field), &ie; can be decompressed on its own.</entry>
1069 </row>
1070 <row>
1071 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry>
1072 <entry>0x0010</entry>
1073 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1074this flags predicted frames or fields which contain only differences to a
1075previous key frame.</entry>
1076 </row>
1077 <row>
1078 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry>
1079 <entry>0x0020</entry>
1080 <entry>Similar to <constant>V4L2_BUF_FLAG_PFRAME</constant>
1081 this is a bidirectional predicted frame or field. [ooc tbd]</entry>
1082 </row>
1083 <row>
1084 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry>
1085 <entry>0x0100</entry>
1086 <entry>The <structfield>timecode</structfield> field is valid.
1087Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
1088ioctl is called.</entry>
1089 </row>
1090 <row>
1091 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
1092 <entry>0x0400</entry>
1093 <entry>The buffer has been prepared for I/O and can be queued by the
1094application. Drivers set or clear this flag when the
1095<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link
1096 linkend="vidioc-qbuf">VIDIOC_PREPARE_BUF</link>, <link
1097 linkend="vidioc-qbuf">VIDIOC_QBUF</link> or <link
1098 linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl is called.</entry>
1099 </row>
1100 <row>
1101 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry>
1102 <entry>0x0800</entry>
1103 <entry>Caches do not have to be invalidated for this buffer.
1104Typically applications shall use this flag if the data captured in the buffer
1105is not going to be touched by the CPU, instead the buffer will, probably, be
1106passed on to a DMA-capable hardware unit for further processing or output.
1107</entry>
1108 </row>
1109 <row>
1110 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry>
1111 <entry>0x1000</entry>
1112 <entry>Caches do not have to be cleaned for this buffer.
1113Typically applications shall use this flag for output buffers if the data
1114in this buffer has not been created by the CPU but by some DMA-capable unit,
1115in which case caches have not been used.</entry>
1116 </row>
1117 </tbody>
1118 </tgroup>
1119 </table>
1120
1121 <table pgwide="1" frame="none" id="v4l2-memory">
1122 <title>enum v4l2_memory</title>
1123 <tgroup cols="3">
1124 &cs-def;
1125 <tbody valign="top">
1126 <row>
1127 <entry><constant>V4L2_MEMORY_MMAP</constant></entry>
1128 <entry>1</entry>
1129 <entry>The buffer is used for <link linkend="mmap">memory
1130mapping</link> I/O.</entry>
1131 </row>
1132 <row>
1133 <entry><constant>V4L2_MEMORY_USERPTR</constant></entry>
1134 <entry>2</entry>
1135 <entry>The buffer is used for <link linkend="userp">user
1136pointer</link> I/O.</entry>
1137 </row>
1138 <row>
1139 <entry><constant>V4L2_MEMORY_OVERLAY</constant></entry>
1140 <entry>3</entry>
1141 <entry>[to do]</entry>
1142 </row>
1143 <row>
1144 <entry><constant>V4L2_MEMORY_DMABUF</constant></entry>
1145 <entry>4</entry>
1146 <entry>The buffer is used for <link linkend="dmabuf">DMA shared
1147buffer</link> I/O.</entry>
1148 </row>
1149 </tbody>
1150 </tgroup>
1151 </table>
1152
1153 <section>
1154 <title>Timecodes</title>
1155
1156 <para>The <structname>v4l2_timecode</structname> structure is
1157designed to hold a <xref linkend="smpte12m" /> or similar timecode.
1158(struct <structname>timeval</structname> timestamps are stored in
1159&v4l2-buffer; field <structfield>timestamp</structfield>.)</para>
1160
1161 <table frame="none" pgwide="1" id="v4l2-timecode">
1162 <title>struct <structname>v4l2_timecode</structname></title>
1163 <tgroup cols="3">
1164 &cs-str;
1165 <tbody valign="top">
1166 <row>
1167 <entry>__u32</entry>
1168 <entry><structfield>type</structfield></entry>
1169 <entry>Frame rate the timecodes are based on, see <xref
1170 linkend="timecode-type" />.</entry>
1171 </row>
1172 <row>
1173 <entry>__u32</entry>
1174 <entry><structfield>flags</structfield></entry>
1175 <entry>Timecode flags, see <xref linkend="timecode-flags" />.</entry>
1176 </row>
1177 <row>
1178 <entry>__u8</entry>
1179 <entry><structfield>frames</structfield></entry>
1180 <entry>Frame count, 0 ... 23/24/29/49/59, depending on the
1181 type of timecode.</entry>
1182 </row>
1183 <row>
1184 <entry>__u8</entry>
1185 <entry><structfield>seconds</structfield></entry>
1186 <entry>Seconds count, 0 ... 59. This is a binary, not BCD number.</entry>
1187 </row>
1188 <row>
1189 <entry>__u8</entry>
1190 <entry><structfield>minutes</structfield></entry>
1191 <entry>Minutes count, 0 ... 59. This is a binary, not BCD number.</entry>
1192 </row>
1193 <row>
1194 <entry>__u8</entry>
1195 <entry><structfield>hours</structfield></entry>
1196 <entry>Hours count, 0 ... 29. This is a binary, not BCD number.</entry>
1197 </row>
1198 <row>
1199 <entry>__u8</entry>
1200 <entry><structfield>userbits</structfield>[4]</entry>
1201 <entry>The "user group" bits from the timecode.</entry>
1202 </row>
1203 </tbody>
1204 </tgroup>
1205 </table>
1206
1207 <table frame="none" pgwide="1" id="timecode-type">
1208 <title>Timecode Types</title>
1209 <tgroup cols="3">
1210 &cs-def;
1211 <tbody valign="top">
1212 <row>
1213 <entry><constant>V4L2_TC_TYPE_24FPS</constant></entry>
1214 <entry>1</entry>
1215 <entry>24 frames per second, i.&nbsp;e. film.</entry>
1216 </row>
1217 <row>
1218 <entry><constant>V4L2_TC_TYPE_25FPS</constant></entry>
1219 <entry>2</entry>
1220 <entry>25 frames per second, &ie; PAL or SECAM video.</entry>
1221 </row>
1222 <row>
1223 <entry><constant>V4L2_TC_TYPE_30FPS</constant></entry>
1224 <entry>3</entry>
1225 <entry>30 frames per second, &ie; NTSC video.</entry>
1226 </row>
1227 <row>
1228 <entry><constant>V4L2_TC_TYPE_50FPS</constant></entry>
1229 <entry>4</entry>
1230 <entry></entry>
1231 </row>
1232 <row>
1233 <entry><constant>V4L2_TC_TYPE_60FPS</constant></entry>
1234 <entry>5</entry>
1235 <entry></entry>
1236 </row>
1237 </tbody>
1238 </tgroup>
1239 </table>
1240
1241 <table frame="none" pgwide="1" id="timecode-flags">
1242 <title>Timecode Flags</title>
1243 <tgroup cols="3">
1244 &cs-def;
1245 <tbody valign="top">
1246 <row>
1247 <entry><constant>V4L2_TC_FLAG_DROPFRAME</constant></entry>
1248 <entry>0x0001</entry>
1249 <entry>Indicates "drop frame" semantics for counting frames
1250in 29.97 fps material. When set, frame numbers 0 and 1 at the start of
1251each minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the
1252count.</entry>
1253 </row>
1254 <row>
1255 <entry><constant>V4L2_TC_FLAG_COLORFRAME</constant></entry>
1256 <entry>0x0002</entry>
1257 <entry>The "color frame" flag.</entry>
1258 </row>
1259 <row>
1260 <entry><constant>V4L2_TC_USERBITS_field</constant></entry>
1261 <entry>0x000C</entry>
1262 <entry>Field mask for the "binary group flags".</entry>
1263 </row>
1264 <row>
1265 <entry><constant>V4L2_TC_USERBITS_USERDEFINED</constant></entry>
1266 <entry>0x0000</entry>
1267 <entry>Unspecified format.</entry>
1268 </row>
1269 <row>
1270 <entry><constant>V4L2_TC_USERBITS_8BITCHARS</constant></entry>
1271 <entry>0x0008</entry>
1272 <entry>8-bit ISO characters.</entry>
1273 </row>
1274 </tbody>
1275 </tgroup>
1276 </table>
1277 </section>
1278 </section>
1279
1280 <section id="field-order">
1281 <title>Field Order</title>
1282
1283 <para>We have to distinguish between progressive and interlaced
1284video. Progressive video transmits all lines of a video image
1285sequentially. Interlaced video divides an image into two fields,
1286containing only the odd and even lines of the image, respectively.
1287Alternating the so called odd and even field are transmitted, and due
1288to a small delay between fields a cathode ray TV displays the lines
1289interleaved, yielding the original frame. This curious technique was
1290invented because at refresh rates similar to film the image would
1291fade out too quickly. Transmitting fields reduces the flicker without
1292the necessity of doubling the frame rate and with it the bandwidth
1293required for each channel.</para>
1294
1295 <para>It is important to understand a video camera does not expose
1296one frame at a time, merely transmitting the frames separated into
1297fields. The fields are in fact captured at two different instances in
1298time. An object on screen may well move between one field and the
1299next. For applications analysing motion it is of paramount importance
1300to recognize which field of a frame is older, the <emphasis>temporal
1301order</emphasis>.</para>
1302
1303 <para>When the driver provides or accepts images field by field
1304rather than interleaved, it is also important applications understand
1305how the fields combine to frames. We distinguish between top (aka odd) and
1306bottom (aka even) fields, the <emphasis>spatial order</emphasis>: The first line
1307of the top field is the first line of an interlaced frame, the first
1308line of the bottom field is the second line of that frame.</para>
1309
1310 <para>However because fields were captured one after the other,
1311arguing whether a frame commences with the top or bottom field is
1312pointless. Any two successive top and bottom, or bottom and top fields
1313yield a valid frame. Only when the source was progressive to begin
1314with, &eg; when transferring film to video, two fields may come from
1315the same frame, creating a natural order.</para>
1316
1317 <para>Counter to intuition the top field is not necessarily the
1318older field. Whether the older field contains the top or bottom lines
1319is a convention determined by the video standard. Hence the
1320distinction between temporal and spatial order of fields. The diagrams
1321below should make this clearer.</para>
1322
1323 <para>All video capture and output devices must report the current
1324field order. Some drivers may permit the selection of a different
1325order, to this end applications initialize the
1326<structfield>field</structfield> field of &v4l2-pix-format; before
1327calling the &VIDIOC-S-FMT; ioctl. If this is not desired it should
1328have the value <constant>V4L2_FIELD_ANY</constant> (0).</para>
1329
1330 <table frame="none" pgwide="1" id="v4l2-field">
1331 <title>enum v4l2_field</title>
1332 <tgroup cols="3">
1333 &cs-def;
1334 <tbody valign="top">
1335 <row>
1336 <entry><constant>V4L2_FIELD_ANY</constant></entry>
1337 <entry>0</entry>
1338 <entry>Applications request this field order when any
1339one of the <constant>V4L2_FIELD_NONE</constant>,
1340<constant>V4L2_FIELD_TOP</constant>,
1341<constant>V4L2_FIELD_BOTTOM</constant>, or
1342<constant>V4L2_FIELD_INTERLACED</constant> formats is acceptable.
1343Drivers choose depending on hardware capabilities or e.&nbsp;g. the
1344requested image size, and return the actual field order. &v4l2-buffer;
1345<structfield>field</structfield> can never be
1346<constant>V4L2_FIELD_ANY</constant>.</entry>
1347 </row>
1348 <row>
1349 <entry><constant>V4L2_FIELD_NONE</constant></entry>
1350 <entry>1</entry>
1351 <entry>Images are in progressive format, not interlaced.
1352The driver may also indicate this order when it cannot distinguish
1353between <constant>V4L2_FIELD_TOP</constant> and
1354<constant>V4L2_FIELD_BOTTOM</constant>.</entry>
1355 </row>
1356 <row>
1357 <entry><constant>V4L2_FIELD_TOP</constant></entry>
1358 <entry>2</entry>
1359 <entry>Images consist of the top (aka odd) field only.</entry>
1360 </row>
1361 <row>
1362 <entry><constant>V4L2_FIELD_BOTTOM</constant></entry>
1363 <entry>3</entry>
1364 <entry>Images consist of the bottom (aka even) field only.
1365Applications may wish to prevent a device from capturing interlaced
1366images because they will have "comb" or "feathering" artefacts around
1367moving objects.</entry>
1368 </row>
1369 <row>
1370 <entry><constant>V4L2_FIELD_INTERLACED</constant></entry>
1371 <entry>4</entry>
1372 <entry>Images contain both fields, interleaved line by
1373line. The temporal order of the fields (whether the top or bottom
1374field is first transmitted) depends on the current video standard.
1375M/NTSC transmits the bottom field first, all other standards the top
1376field first.</entry>
1377 </row>
1378 <row>
1379 <entry><constant>V4L2_FIELD_SEQ_TB</constant></entry>
1380 <entry>5</entry>
1381 <entry>Images contain both fields, the top field lines
1382are stored first in memory, immediately followed by the bottom field
1383lines. Fields are always stored in temporal order, the older one first
1384in memory. Image sizes refer to the frame, not fields.</entry>
1385 </row>
1386 <row>
1387 <entry><constant>V4L2_FIELD_SEQ_BT</constant></entry>
1388 <entry>6</entry>
1389 <entry>Images contain both fields, the bottom field
1390lines are stored first in memory, immediately followed by the top
1391field lines. Fields are always stored in temporal order, the older one
1392first in memory. Image sizes refer to the frame, not fields.</entry>
1393 </row>
1394 <row>
1395 <entry><constant>V4L2_FIELD_ALTERNATE</constant></entry>
1396 <entry>7</entry>
1397 <entry>The two fields of a frame are passed in separate
1398buffers, in temporal order, &ie; the older one first. To indicate the field
1399parity (whether the current field is a top or bottom field) the driver
1400or application, depending on data direction, must set &v4l2-buffer;
1401<structfield>field</structfield> to
1402<constant>V4L2_FIELD_TOP</constant> or
1403<constant>V4L2_FIELD_BOTTOM</constant>. Any two successive fields pair
1404to build a frame. If fields are successive, without any dropped fields
1405between them (fields can drop individually), can be determined from
1406the &v4l2-buffer; <structfield>sequence</structfield> field. Image
1407sizes refer to the frame, not fields. This format cannot be selected
1408when using the read/write I/O method.<!-- Where it's indistinguishable
1409from V4L2_FIELD_SEQ_*. --></entry>
1410 </row>
1411 <row>
1412 <entry><constant>V4L2_FIELD_INTERLACED_TB</constant></entry>
1413 <entry>8</entry>
1414 <entry>Images contain both fields, interleaved line by
1415line, top field first. The top field is transmitted first.</entry>
1416 </row>
1417 <row>
1418 <entry><constant>V4L2_FIELD_INTERLACED_BT</constant></entry>
1419 <entry>9</entry>
1420 <entry>Images contain both fields, interleaved line by
1421line, top field first. The bottom field is transmitted first.</entry>
1422 </row>
1423 </tbody>
1424 </tgroup>
1425 </table>
1426
1427 <figure id="fieldseq-tb">
1428 <title>Field Order, Top Field First Transmitted</title>
1429 <mediaobject>
1430 <imageobject>
1431 <imagedata fileref="fieldseq_tb.pdf" format="PS" />
1432 </imageobject>
1433 <imageobject>
1434 <imagedata fileref="fieldseq_tb.gif" format="GIF" />
1435 </imageobject>
1436 </mediaobject>
1437 </figure>
1438
1439 <figure id="fieldseq-bt">
1440 <title>Field Order, Bottom Field First Transmitted</title>
1441 <mediaobject>
1442 <imageobject>
1443 <imagedata fileref="fieldseq_bt.pdf" format="PS" />
1444 </imageobject>
1445 <imageobject>
1446 <imagedata fileref="fieldseq_bt.gif" format="GIF" />
1447 </imageobject>
1448 </mediaobject>
1449 </figure>
1450 </section>
diff --git a/Documentation/DocBook/media/v4l/keytable.c.xml b/Documentation/DocBook/media/v4l/keytable.c.xml
new file mode 100644
index 00000000000..d53254a3be1
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/keytable.c.xml
@@ -0,0 +1,172 @@
1<programlisting>
2/* keytable.c - This program allows checking/replacing keys at IR
3
4 Copyright (C) 2006-2009 Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 2 of the License.
9
10 This program 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
13 GNU General Public License for more details.
14 */
15
16#include &lt;ctype.h&gt;
17#include &lt;errno.h&gt;
18#include &lt;fcntl.h&gt;
19#include &lt;stdio.h&gt;
20#include &lt;stdlib.h&gt;
21#include &lt;string.h&gt;
22#include &lt;linux/input.h&gt;
23#include &lt;sys/ioctl.h&gt;
24
25#include "parse.h"
26
27void prtcode (int *codes)
28{
29 struct parse_key *p;
30
31 for (p=keynames;p-&gt;name!=NULL;p++) {
32 if (p-&gt;value == (unsigned)codes[1]) {
33 printf("scancode 0x%04x = %s (0x%02x)\n", codes[0], p-&gt;name, codes[1]);
34 return;
35 }
36 }
37
38 if (isprint (codes[1]))
39 printf("scancode %d = '%c' (0x%02x)\n", codes[0], codes[1], codes[1]);
40 else
41 printf("scancode %d = 0x%02x\n", codes[0], codes[1]);
42}
43
44int parse_code(char *string)
45{
46 struct parse_key *p;
47
48 for (p=keynames;p-&gt;name!=NULL;p++) {
49 if (!strcasecmp(p-&gt;name, string)) {
50 return p-&gt;value;
51 }
52 }
53 return -1;
54}
55
56int main (int argc, char *argv[])
57{
58 int fd;
59 unsigned int i, j;
60 int codes[2];
61
62 if (argc&lt;2 || argc&gt;4) {
63 printf ("usage: %s &lt;device&gt; to get table; or\n"
64 " %s &lt;device&gt; &lt;scancode&gt; &lt;keycode&gt;\n"
65 " %s &lt;device&gt; &lt;keycode_file&gt;\n",*argv,*argv,*argv);
66 return -1;
67 }
68
69 if ((fd = open(argv[1], O_RDONLY)) &lt; 0) {
70 perror("Couldn't open input device");
71 return(-1);
72 }
73
74 if (argc==4) {
75 int value;
76
77 value=parse_code(argv[3]);
78
79 if (value==-1) {
80 value = strtol(argv[3], NULL, 0);
81 if (errno)
82 perror("value");
83 }
84
85 codes [0] = (unsigned) strtol(argv[2], NULL, 0);
86 codes [1] = (unsigned) value;
87
88 if(ioctl(fd, EVIOCSKEYCODE, codes))
89 perror ("EVIOCSKEYCODE");
90
91 if(ioctl(fd, EVIOCGKEYCODE, codes)==0)
92 prtcode(codes);
93 return 0;
94 }
95
96 if (argc==3) {
97 FILE *fin;
98 int value;
99 char *scancode, *keycode, s[2048];
100
101 fin=fopen(argv[2],"r");
102 if (fin==NULL) {
103 perror ("opening keycode file");
104 return -1;
105 }
106
107 /* Clears old table */
108 for (j = 0; j &lt; 256; j++) {
109 for (i = 0; i &lt; 256; i++) {
110 codes[0] = (j &lt;&lt; 8) | i;
111 codes[1] = KEY_RESERVED;
112 ioctl(fd, EVIOCSKEYCODE, codes);
113 }
114 }
115
116 while (fgets(s,sizeof(s),fin)) {
117 scancode=strtok(s,"\n\t =:");
118 if (!scancode) {
119 perror ("parsing input file scancode");
120 return -1;
121 }
122 if (!strcasecmp(scancode, "scancode")) {
123 scancode = strtok(NULL,"\n\t =:");
124 if (!scancode) {
125 perror ("parsing input file scancode");
126 return -1;
127 }
128 }
129
130 keycode=strtok(NULL,"\n\t =:(");
131 if (!keycode) {
132 perror ("parsing input file keycode");
133 return -1;
134 }
135
136 // printf ("parsing %s=%s:", scancode, keycode);
137 value=parse_code(keycode);
138 // printf ("\tvalue=%d\n",value);
139
140 if (value==-1) {
141 value = strtol(keycode, NULL, 0);
142 if (errno)
143 perror("value");
144 }
145
146 codes [0] = (unsigned) strtol(scancode, NULL, 0);
147 codes [1] = (unsigned) value;
148
149 // printf("\t%04x=%04x\n",codes[0], codes[1]);
150 if(ioctl(fd, EVIOCSKEYCODE, codes)) {
151 fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]);
152 perror ("EVIOCSKEYCODE");
153 }
154
155 if(ioctl(fd, EVIOCGKEYCODE, codes)==0)
156 prtcode(codes);
157 }
158 return 0;
159 }
160
161 /* Get scancode table */
162 for (j = 0; j &lt; 256; j++) {
163 for (i = 0; i &lt; 256; i++) {
164 codes[0] = (j &lt;&lt; 8) | i;
165 if (!ioctl(fd, EVIOCGKEYCODE, codes) &amp;&amp; codes[1] != KEY_RESERVED)
166 prtcode(codes);
167 }
168 }
169 return 0;
170}
171
172</programlisting>
diff --git a/Documentation/DocBook/media/v4l/libv4l.xml b/Documentation/DocBook/media/v4l/libv4l.xml
new file mode 100644
index 00000000000..d3b71e20003
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/libv4l.xml
@@ -0,0 +1,160 @@
1<title>Libv4l Userspace Library</title>
2<section id="libv4l-introduction">
3 <title>Introduction</title>
4
5 <para>libv4l is a collection of libraries which adds a thin abstraction
6layer on top of video4linux2 devices. The purpose of this (thin) layer
7is to make it easy for application writers to support a wide variety of
8devices without having to write separate code for different devices in the
9same class.</para>
10<para>An example of using libv4l is provided by
11<link linkend='v4l2grab-example'>v4l2grab</link>.
12</para>
13
14 <para>libv4l consists of 3 different libraries:</para>
15 <section>
16 <title>libv4lconvert</title>
17
18 <para>libv4lconvert is a library that converts several
19different pixelformats found in V4L2 drivers into a few common RGB and
20YUY formats.</para>
21 <para>It currently accepts the following V4L2 driver formats:
22<link linkend="V4L2-PIX-FMT-BGR24"><constant>V4L2_PIX_FMT_BGR24</constant></link>,
23<link linkend="V4L2-PIX-FMT-HM12"><constant>V4L2_PIX_FMT_HM12</constant></link>,
24<link linkend="V4L2-PIX-FMT-JPEG"><constant>V4L2_PIX_FMT_JPEG</constant></link>,
25<link linkend="V4L2-PIX-FMT-MJPEG"><constant>V4L2_PIX_FMT_MJPEG</constant></link>,
26<link linkend="V4L2-PIX-FMT-MR97310A"><constant>V4L2_PIX_FMT_MR97310A</constant></link>,
27<link linkend="V4L2-PIX-FMT-OV511"><constant>V4L2_PIX_FMT_OV511</constant></link>,
28<link linkend="V4L2-PIX-FMT-OV518"><constant>V4L2_PIX_FMT_OV518</constant></link>,
29<link linkend="V4L2-PIX-FMT-PAC207"><constant>V4L2_PIX_FMT_PAC207</constant></link>,
30<link linkend="V4L2-PIX-FMT-PJPG"><constant>V4L2_PIX_FMT_PJPG</constant></link>,
31<link linkend="V4L2-PIX-FMT-RGB24"><constant>V4L2_PIX_FMT_RGB24</constant></link>,
32<link linkend="V4L2-PIX-FMT-SBGGR8"><constant>V4L2_PIX_FMT_SBGGR8</constant></link>,
33<link linkend="V4L2-PIX-FMT-SGBRG8"><constant>V4L2_PIX_FMT_SGBRG8</constant></link>,
34<link linkend="V4L2-PIX-FMT-SGRBG8"><constant>V4L2_PIX_FMT_SGRBG8</constant></link>,
35<link linkend="V4L2-PIX-FMT-SN9C10X"><constant>V4L2_PIX_FMT_SN9C10X</constant></link>,
36<link linkend="V4L2-PIX-FMT-SN9C20X-I420"><constant>V4L2_PIX_FMT_SN9C20X_I420</constant></link>,
37<link linkend="V4L2-PIX-FMT-SPCA501"><constant>V4L2_PIX_FMT_SPCA501</constant></link>,
38<link linkend="V4L2-PIX-FMT-SPCA505"><constant>V4L2_PIX_FMT_SPCA505</constant></link>,
39<link linkend="V4L2-PIX-FMT-SPCA508"><constant>V4L2_PIX_FMT_SPCA508</constant></link>,
40<link linkend="V4L2-PIX-FMT-SPCA561"><constant>V4L2_PIX_FMT_SPCA561</constant></link>,
41<link linkend="V4L2-PIX-FMT-SQ905C"><constant>V4L2_PIX_FMT_SQ905C</constant></link>,
42<constant>V4L2_PIX_FMT_SRGGB8</constant>,
43<link linkend="V4L2-PIX-FMT-UYVY"><constant>V4L2_PIX_FMT_UYVY</constant></link>,
44<link linkend="V4L2-PIX-FMT-YUV420"><constant>V4L2_PIX_FMT_YUV420</constant></link>,
45<link linkend="V4L2-PIX-FMT-YUYV"><constant>V4L2_PIX_FMT_YUYV</constant></link>,
46<link linkend="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></link>,
47and <link linkend="V4L2-PIX-FMT-YVYU"><constant>V4L2_PIX_FMT_YVYU</constant></link>.
48</para>
49 <para>Later on libv4lconvert was expanded to also be able to do
50various video processing functions to improve webcam video quality.
51The video processing is split in to 2 parts: libv4lconvert/control and
52libv4lconvert/processing.</para>
53
54 <para>The control part is used to offer video controls which can
55be used to control the video processing functions made available by
56 libv4lconvert/processing. These controls are stored application wide
57(until reboot) by using a persistent shared memory object.</para>
58
59 <para>libv4lconvert/processing offers the actual video
60processing functionality.</para>
61 </section>
62 <section>
63 <title>libv4l1</title>
64 <para>This library offers functions that can be used to quickly
65make v4l1 applications work with v4l2 devices. These functions work exactly
66like the normal open/close/etc, except that libv4l1 does full emulation of
67the v4l1 api on top of v4l2 drivers, in case of v4l1 drivers it
68will just pass calls through.</para>
69 <para>Since those functions are emulations of the old V4L1 API,
70it shouldn't be used for new applications.</para>
71 </section>
72 <section>
73 <title>libv4l2</title>
74 <para>This library should be used for all modern V4L2
75applications.</para>
76 <para>It provides handles to call V4L2 open/ioctl/close/poll
77methods. Instead of just providing the raw output of the device, it enhances
78the calls in the sense that it will use libv4lconvert to provide more video
79formats and to enhance the image quality.</para>
80 <para>In most cases, libv4l2 just passes the calls directly
81through to the v4l2 driver, intercepting the calls to
82<link linkend='vidioc-g-fmt'><constant>VIDIOC_TRY_FMT</constant></link>,
83<link linkend='vidioc-g-fmt'><constant>VIDIOC_G_FMT</constant></link>
84<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>
85<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>
86and <link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>
87in order to emulate the formats
88<link linkend="V4L2-PIX-FMT-BGR24"><constant>V4L2_PIX_FMT_BGR24</constant></link>,
89<link linkend="V4L2-PIX-FMT-RGB24"><constant>V4L2_PIX_FMT_RGB24</constant></link>,
90<link linkend="V4L2-PIX-FMT-YUV420"><constant>V4L2_PIX_FMT_YUV420</constant></link>,
91and <link linkend="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></link>,
92if they aren't available in the driver.
93<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>
94keeps enumerating the hardware supported formats, plus the emulated formats
95offered by libv4l at the end.
96</para>
97 <section id="libv4l-ops">
98 <title>Libv4l device control functions</title>
99 <para>The common file operation methods are provided by
100libv4l.</para>
101 <para>Those functions operate just like glibc
102open/close/dup/ioctl/read/mmap/munmap:</para>
103<itemizedlist><listitem>
104 <para>int v4l2_open(const char *file, int oflag,
105...) -
106operates like the standard <link linkend='func-open'>open()</link> function.
107</para></listitem><listitem>
108 <para>int v4l2_close(int fd) -
109operates like the standard <link linkend='func-close'>close()</link> function.
110</para></listitem><listitem>
111 <para>int v4l2_dup(int fd) -
112operates like the standard dup() function, duplicating a file handler.
113</para></listitem><listitem>
114 <para>int v4l2_ioctl (int fd, unsigned long int request, ...) -
115operates like the standard <link linkend='func-ioctl'>ioctl()</link> function.
116</para></listitem><listitem>
117 <para>int v4l2_read (int fd, void* buffer, size_t n) -
118operates like the standard <link linkend='func-read'>read()</link> function.
119</para></listitem><listitem>
120 <para>void v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset); -
121operates like the standard <link linkend='func-mmap'>mmap()</link> function.
122</para></listitem><listitem>
123 <para>int v4l2_munmap(void *_start, size_t length); -
124operates like the standard <link linkend='func-munmap'>munmap()</link> function.
125</para></listitem>
126</itemizedlist>
127 <para>Those functions provide additional control:</para>
128<itemizedlist><listitem>
129 <para>int v4l2_fd_open(int fd, int v4l2_flags) -
130opens an already opened fd for further use through v4l2lib and possibly
131modify libv4l2's default behavior through the v4l2_flags argument.
132Currently, v4l2_flags can be <constant>V4L2_DISABLE_CONVERSION</constant>,
133to disable format conversion.
134</para></listitem><listitem>
135 <para>int v4l2_set_control(int fd, int cid, int value) -
136This function takes a value of 0 - 65535, and then scales that range to
137the actual range of the given v4l control id, and then if the cid exists
138and is not locked sets the cid to the scaled value.
139</para></listitem><listitem>
140 <para>int v4l2_get_control(int fd, int cid) -
141This function returns a value of 0 - 65535, scaled to from the actual range
142of the given v4l control id. when the cid does not exist, could not be
143accessed for some reason, or some error occurred 0 is returned.
144</para></listitem>
145</itemizedlist>
146 </section>
147 </section>
148 <section>
149
150 <title>v4l1compat.so wrapper library</title>
151
152 <para>This library intercepts calls to
153open/close/ioctl/mmap/mmunmap operations and redirects them to the libv4l
154counterparts, by using LD_PRELOAD=/usr/lib/v4l1compat.so. It also
155emulates V4L1 calls via V4L2 API.</para>
156 <para>It allows usage of binary legacy applications that
157still don't use libv4l.</para>
158 </section>
159
160</section>
diff --git a/Documentation/DocBook/media/v4l/lirc_device_interface.xml b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
new file mode 100644
index 00000000000..8d7eb6bf631
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
@@ -0,0 +1,253 @@
1<section id="lirc_dev">
2<title>LIRC Device Interface</title>
3
4
5<section id="lirc_dev_intro">
6<title>Introduction</title>
7
8<para>The LIRC device interface is a bi-directional interface for
9transporting raw IR data between userspace and kernelspace. Fundamentally,
10it is just a chardev (/dev/lircX, for X = 0, 1, 2, ...), with a number
11of standard struct file_operations defined on it. With respect to
12transporting raw IR data to and fro, the essential fops are read, write
13and ioctl.</para>
14
15<para>Example dmesg output upon a driver registering w/LIRC:</para>
16 <blockquote>
17 <para>$ dmesg |grep lirc_dev</para>
18 <para>lirc_dev: IR Remote Control driver registered, major 248</para>
19 <para>rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0</para>
20 </blockquote>
21
22<para>What you should see for a chardev:</para>
23 <blockquote>
24 <para>$ ls -l /dev/lirc*</para>
25 <para>crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0</para>
26 </blockquote>
27</section>
28
29<section id="lirc_read">
30<title>LIRC read fop</title>
31
32<para>The lircd userspace daemon reads raw IR data from the LIRC chardev. The
33exact format of the data depends on what modes a driver supports, and what
34mode has been selected. lircd obtains supported modes and sets the active mode
35via the ioctl interface, detailed at <xref linkend="lirc_ioctl"/>. The generally
36preferred mode is LIRC_MODE_MODE2, in which packets containing an int value
37describing an IR signal are read from the chardev.</para>
38
39<para>See also <ulink url="http://www.lirc.org/html/technical.html">http://www.lirc.org/html/technical.html</ulink> for more info.</para>
40</section>
41
42<section id="lirc_write">
43<title>LIRC write fop</title>
44
45<para>The data written to the chardev is a pulse/space sequence of integer
46values. Pulses and spaces are only marked implicitly by their position. The
47data must start and end with a pulse, therefore, the data must always include
48an uneven number of samples. The write function must block until the data has
49been transmitted by the hardware.</para>
50</section>
51
52<section id="lirc_ioctl">
53<title>LIRC ioctl fop</title>
54
55<para>The LIRC device's ioctl definition is bound by the ioctl function
56definition of struct file_operations, leaving us with an unsigned int
57for the ioctl command and an unsigned long for the arg. For the purposes
58of ioctl portability across 32-bit and 64-bit, these values are capped
59to their 32-bit sizes.</para>
60
61<para>The following ioctls can be used to change specific hardware settings.
62In general each driver should have a default set of settings. The driver
63implementation is expected to re-apply the default settings when the device
64is closed by user-space, so that every application opening the device can rely
65on working with the default settings initially.</para>
66
67<variablelist>
68 <varlistentry>
69 <term>LIRC_GET_FEATURES</term>
70 <listitem>
71 <para>Obviously, get the underlying hardware device's features. If a driver
72 does not announce support of certain features, calling of the corresponding
73 ioctls is undefined.</para>
74 </listitem>
75 </varlistentry>
76 <varlistentry>
77 <term>LIRC_GET_SEND_MODE</term>
78 <listitem>
79 <para>Get supported transmit mode. Only LIRC_MODE_PULSE is supported by lircd.</para>
80 </listitem>
81 </varlistentry>
82 <varlistentry>
83 <term>LIRC_GET_REC_MODE</term>
84 <listitem>
85 <para>Get supported receive modes. Only LIRC_MODE_MODE2 and LIRC_MODE_LIRCCODE
86 are supported by lircd.</para>
87 </listitem>
88 </varlistentry>
89 <varlistentry>
90 <term>LIRC_GET_SEND_CARRIER</term>
91 <listitem>
92 <para>Get carrier frequency (in Hz) currently used for transmit.</para>
93 </listitem>
94 </varlistentry>
95 <varlistentry>
96 <term>LIRC_GET_REC_CARRIER</term>
97 <listitem>
98 <para>Get carrier frequency (in Hz) currently used for IR reception.</para>
99 </listitem>
100 </varlistentry>
101 <varlistentry>
102 <term>LIRC_{G,S}ET_{SEND,REC}_DUTY_CYCLE</term>
103 <listitem>
104 <para>Get/set the duty cycle (from 0 to 100) of the carrier signal. Currently,
105 no special meaning is defined for 0 or 100, but this could be used to switch
106 off carrier generation in the future, so these values should be reserved.</para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term>LIRC_GET_REC_RESOLUTION</term>
111 <listitem>
112 <para>Some receiver have maximum resolution which is defined by internal
113 sample rate or data format limitations. E.g. it's common that signals can
114 only be reported in 50 microsecond steps. This integer value is used by
115 lircd to automatically adjust the aeps tolerance value in the lircd
116 config file.</para>
117 </listitem>
118 </varlistentry>
119 <varlistentry>
120 <term>LIRC_GET_M{IN,AX}_TIMEOUT</term>
121 <listitem>
122 <para>Some devices have internal timers that can be used to detect when
123 there's no IR activity for a long time. This can help lircd in detecting
124 that a IR signal is finished and can speed up the decoding process.
125 Returns an integer value with the minimum/maximum timeout that can be
126 set. Some devices have a fixed timeout, in that case both ioctls will
127 return the same value even though the timeout cannot be changed.</para>
128 </listitem>
129 </varlistentry>
130 <varlistentry>
131 <term>LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE}</term>
132 <listitem>
133 <para>Some devices are able to filter out spikes in the incoming signal
134 using given filter rules. These ioctls return the hardware capabilities
135 that describe the bounds of the possible filters. Filter settings depend
136 on the IR protocols that are expected. lircd derives the settings from
137 all protocols definitions found in its config file.</para>
138 </listitem>
139 </varlistentry>
140 <varlistentry>
141 <term>LIRC_GET_LENGTH</term>
142 <listitem>
143 <para>Retrieves the code length in bits (only for LIRC_MODE_LIRCCODE).
144 Reads on the device must be done in blocks matching the bit count.
145 The bit could should be rounded up so that it matches full bytes.</para>
146 </listitem>
147 </varlistentry>
148 <varlistentry>
149 <term>LIRC_SET_{SEND,REC}_MODE</term>
150 <listitem>
151 <para>Set send/receive mode. Largely obsolete for send, as only
152 LIRC_MODE_PULSE is supported.</para>
153 </listitem>
154 </varlistentry>
155 <varlistentry>
156 <term>LIRC_SET_{SEND,REC}_CARRIER</term>
157 <listitem>
158 <para>Set send/receive carrier (in Hz).</para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
162 <term>LIRC_SET_TRANSMITTER_MASK</term>
163 <listitem>
164 <para>This enables the given set of transmitters. The first transmitter
165 is encoded by the least significant bit, etc. When an invalid bit mask
166 is given, i.e. a bit is set, even though the device does not have so many
167 transitters, then this ioctl returns the number of available transitters
168 and does nothing otherwise.</para>
169 </listitem>
170 </varlistentry>
171 <varlistentry>
172 <term>LIRC_SET_REC_TIMEOUT</term>
173 <listitem>
174 <para>Sets the integer value for IR inactivity timeout (cf.
175 LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT). A value of 0 (if
176 supported by the hardware) disables all hardware timeouts and data should
177 be reported as soon as possible. If the exact value cannot be set, then
178 the next possible value _greater_ than the given value should be set.</para>
179 </listitem>
180 </varlistentry>
181 <varlistentry>
182 <term>LIRC_SET_REC_TIMEOUT_REPORTS</term>
183 <listitem>
184 <para>Enable (1) or disable (0) timeout reports in LIRC_MODE_MODE2. By
185 default, timeout reports should be turned off.</para>
186 </listitem>
187 </varlistentry>
188 <varlistentry>
189 <term>LIRC_SET_REC_FILTER_{,PULSE,SPACE}</term>
190 <listitem>
191 <para>Pulses/spaces shorter than this are filtered out by hardware. If
192 filters cannot be set independently for pulse/space, the corresponding
193 ioctls must return an error and LIRC_SET_REC_FILTER shall be used instead.</para>
194 </listitem>
195 </varlistentry>
196 <varlistentry>
197 <term>LIRC_SET_MEASURE_CARRIER_MODE</term>
198 <listitem>
199 <para>Enable (1)/disable (0) measure mode. If enabled, from the next key
200 press on, the driver will send LIRC_MODE2_FREQUENCY packets. By default
201 this should be turned off.</para>
202 </listitem>
203 </varlistentry>
204 <varlistentry>
205 <term>LIRC_SET_REC_{DUTY_CYCLE,CARRIER}_RANGE</term>
206 <listitem>
207 <para>To set a range use LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE
208 with the lower bound first and later LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER
209 with the upper bound.</para>
210 </listitem>
211 </varlistentry>
212 <varlistentry>
213 <term>LIRC_NOTIFY_DECODE</term>
214 <listitem>
215 <para>This ioctl is called by lircd whenever a successful decoding of an
216 incoming IR signal could be done. This can be used by supporting hardware
217 to give visual feedback to the user e.g. by flashing a LED.</para>
218 </listitem>
219 </varlistentry>
220 <varlistentry>
221 <term>LIRC_SETUP_{START,END}</term>
222 <listitem>
223 <para>Setting of several driver parameters can be optimized by encapsulating
224 the according ioctl calls with LIRC_SETUP_START/LIRC_SETUP_END. When a
225 driver receives a LIRC_SETUP_START ioctl it can choose to not commit
226 further setting changes to the hardware until a LIRC_SETUP_END is received.
227 But this is open to the driver implementation and every driver must also
228 handle parameter changes which are not encapsulated by LIRC_SETUP_START
229 and LIRC_SETUP_END. Drivers can also choose to ignore these ioctls.</para>
230 </listitem>
231 </varlistentry>
232 <varlistentry>
233 <term>LIRC_SET_WIDEBAND_RECEIVER</term>
234 <listitem>
235 <para>Some receivers are equipped with special wide band receiver which is intended
236 to be used to learn output of existing remote.
237 Calling that ioctl with (1) will enable it, and with (0) disable it.
238 This might be useful of receivers that have otherwise narrow band receiver
239 that prevents them to be used with some remotes.
240 Wide band receiver might also be more precise
241 On the other hand its disadvantage it usually reduced range of reception.
242 Note: wide band receiver might be implictly enabled if you enable
243 carrier reports. In that case it will be disabled as soon as you disable
244 carrier reports. Trying to disable wide band receiver while carrier
245 reports are active will do nothing.</para>
246 </listitem>
247 </varlistentry>
248</variablelist>
249<section id="lirc_dev_errors">
250 &return-value;
251</section>
252</section>
253</section>
diff --git a/Documentation/DocBook/media/v4l/media-controller.xml b/Documentation/DocBook/media/v4l/media-controller.xml
new file mode 100644
index 00000000000..873ac3a621f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-controller.xml
@@ -0,0 +1,89 @@
1<partinfo>
2 <authorgroup>
3 <author>
4 <firstname>Laurent</firstname>
5 <surname>Pinchart</surname>
6 <affiliation><address><email>laurent.pinchart@ideasonboard.com</email></address></affiliation>
7 <contrib>Initial version.</contrib>
8 </author>
9 </authorgroup>
10 <copyright>
11 <year>2010</year>
12 <holder>Laurent Pinchart</holder>
13 </copyright>
14
15 <revhistory>
16 <!-- Put document revisions here, newest first. -->
17 <revision>
18 <revnumber>1.0.0</revnumber>
19 <date>2010-11-10</date>
20 <authorinitials>lp</authorinitials>
21 <revremark>Initial revision</revremark>
22 </revision>
23 </revhistory>
24</partinfo>
25
26<title>Media Controller API</title>
27
28<chapter id="media_controller">
29 <title>Media Controller</title>
30
31 <section id="media-controller-intro">
32 <title>Introduction</title>
33 <para>Media devices increasingly handle multiple related functions. Many USB
34 cameras include microphones, video capture hardware can also output video,
35 or SoC camera interfaces also perform memory-to-memory operations similar to
36 video codecs.</para>
37 <para>Independent functions, even when implemented in the same hardware, can
38 be modelled as separate devices. A USB camera with a microphone will be
39 presented to userspace applications as V4L2 and ALSA capture devices. The
40 devices' relationships (when using a webcam, end-users shouldn't have to
41 manually select the associated USB microphone), while not made available
42 directly to applications by the drivers, can usually be retrieved from
43 sysfs.</para>
44 <para>With more and more advanced SoC devices being introduced, the current
45 approach will not scale. Device topologies are getting increasingly complex
46 and can't always be represented by a tree structure. Hardware blocks are
47 shared between different functions, creating dependencies between seemingly
48 unrelated devices.</para>
49 <para>Kernel abstraction APIs such as V4L2 and ALSA provide means for
50 applications to access hardware parameters. As newer hardware expose an
51 increasingly high number of those parameters, drivers need to guess what
52 applications really require based on limited information, thereby
53 implementing policies that belong to userspace.</para>
54 <para>The media controller API aims at solving those problems.</para>
55 </section>
56
57 <section id="media-controller-model">
58 <title>Media device model</title>
59 <para>Discovering a device internal topology, and configuring it at runtime,
60 is one of the goals of the media controller API. To achieve this, hardware
61 devices are modelled as an oriented graph of building blocks called entities
62 connected through pads.</para>
63 <para>An entity is a basic media hardware or software building block. It can
64 correspond to a large variety of logical blocks such as physical hardware
65 devices (CMOS sensor for instance), logical hardware devices (a building
66 block in a System-on-Chip image processing pipeline), DMA channels or
67 physical connectors.</para>
68 <para>A pad is a connection endpoint through which an entity can interact
69 with other entities. Data (not restricted to video) produced by an entity
70 flows from the entity's output to one or more entity inputs. Pads should not
71 be confused with physical pins at chip boundaries.</para>
72 <para>A link is a point-to-point oriented connection between two pads,
73 either on the same entity or on different entities. Data flows from a source
74 pad to a sink pad.</para>
75 </section>
76</chapter>
77
78<appendix id="media-user-func">
79 <title>Function Reference</title>
80 <!-- Keep this alphabetically sorted. -->
81 &sub-media-func-open;
82 &sub-media-func-close;
83 &sub-media-func-ioctl;
84 <!-- All ioctls go here. -->
85 &sub-media-ioc-device-info;
86 &sub-media-ioc-enum-entities;
87 &sub-media-ioc-enum-links;
88 &sub-media-ioc-setup-link;
89</appendix>
diff --git a/Documentation/DocBook/media/v4l/media-func-close.xml b/Documentation/DocBook/media/v4l/media-func-close.xml
new file mode 100644
index 00000000000..be149c802ae
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-func-close.xml
@@ -0,0 +1,59 @@
1<refentry id="media-func-close">
2 <refmeta>
3 <refentrytitle>media close()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-close</refname>
9 <refpurpose>Close a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;unistd.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>close</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 </funcprototype>
19 </funcsynopsis>
20 </refsynopsisdiv>
21
22 <refsect1>
23 <title>Arguments</title>
24
25 <variablelist>
26 <varlistentry>
27 <term><parameter>fd</parameter></term>
28 <listitem>
29 <para>&fd;</para>
30 </listitem>
31 </varlistentry>
32 </variablelist>
33 </refsect1>
34
35 <refsect1>
36 <title>Description</title>
37
38 <para>Closes the media device. Resources associated with the file descriptor
39 are freed. The device configuration remain unchanged.</para>
40 </refsect1>
41
42 <refsect1>
43 <title>Return Value</title>
44
45 <para><function>close</function> returns 0 on success. On error, -1 is
46 returned, and <varname>errno</varname> is set appropriately. Possible error
47 codes are:</para>
48
49 <variablelist>
50 <varlistentry>
51 <term><errorcode>EBADF</errorcode></term>
52 <listitem>
53 <para><parameter>fd</parameter> is not a valid open file descriptor.
54 </para>
55 </listitem>
56 </varlistentry>
57 </variablelist>
58 </refsect1>
59</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-func-ioctl.xml b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
new file mode 100644
index 00000000000..39478d0fbca
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
@@ -0,0 +1,73 @@
1<refentry id="media-func-ioctl">
2 <refmeta>
3 <refentrytitle>media ioctl()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-ioctl</refname>
9 <refpurpose>Control a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;sys/ioctl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>void *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>Media ioctl request code as defined in the media.h header file,
38 for example MEDIA_IOC_SETUP_LINK.</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para>Pointer to a request-specific structure.</para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52 <para>The <function>ioctl()</function> function manipulates media device
53 parameters. The argument <parameter>fd</parameter> must be an open file
54 descriptor.</para>
55 <para>The ioctl <parameter>request</parameter> code specifies the media
56 function to be called. It has encoded in it whether the argument is an
57 input, output or read/write parameter, and the size of the argument
58 <parameter>argp</parameter> in bytes.</para>
59 <para>Macros and structures definitions specifying media ioctl requests and
60 their parameters are located in the media.h header file. All media ioctl
61 requests, their respective function and parameters are specified in
62 <xref linkend="media-user-func" />.</para>
63 </refsect1>
64
65 <refsect1>
66 &return-value;
67
68 <para>Request-specific error codes are listed in the
69 individual requests descriptions.</para>
70 <para>When an ioctl that takes an output or read/write parameter fails,
71 the parameter remains unmodified.</para>
72 </refsect1>
73</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-func-open.xml b/Documentation/DocBook/media/v4l/media-func-open.xml
new file mode 100644
index 00000000000..f7df034dc9e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-func-open.xml
@@ -0,0 +1,94 @@
1<refentry id="media-func-open">
2 <refmeta>
3 <refentrytitle>media open()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-open</refname>
9 <refpurpose>Open a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;fcntl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>open</function></funcdef>
17 <paramdef>const char *<parameter>device_name</parameter></paramdef>
18 <paramdef>int <parameter>flags</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>device_name</parameter></term>
29 <listitem>
30 <para>Device to be opened.</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>flags</parameter></term>
35 <listitem>
36 <para>Open flags. Access mode must be either <constant>O_RDONLY</constant>
37 or <constant>O_RDWR</constant>. Other flags have no effect.</para>
38 </listitem>
39 </varlistentry>
40 </variablelist>
41 </refsect1>
42 <refsect1>
43 <title>Description</title>
44 <para>To open a media device applications call <function>open()</function>
45 with the desired device name. The function has no side effects; the device
46 configuration remain unchanged.</para>
47 <para>When the device is opened in read-only mode, attemps to modify its
48 configuration will result in an error, and <varname>errno</varname> will be
49 set to <errorcode>EBADF</errorcode>.</para>
50 </refsect1>
51 <refsect1>
52 <title>Return Value</title>
53
54 <para><function>open</function> returns the new file descriptor on success.
55 On error, -1 is returned, and <varname>errno</varname> is set appropriately.
56 Possible error codes are:</para>
57
58 <variablelist>
59 <varlistentry>
60 <term><errorcode>EACCES</errorcode></term>
61 <listitem>
62 <para>The requested access to the file is not allowed.</para>
63 </listitem>
64 </varlistentry>
65 <varlistentry>
66 <term><errorcode>EMFILE</errorcode></term>
67 <listitem>
68 <para>The process already has the maximum number of files open.
69 </para>
70 </listitem>
71 </varlistentry>
72 <varlistentry>
73 <term><errorcode>ENFILE</errorcode></term>
74 <listitem>
75 <para>The system limit on the total number of open files has been
76 reached.</para>
77 </listitem>
78 </varlistentry>
79 <varlistentry>
80 <term><errorcode>ENOMEM</errorcode></term>
81 <listitem>
82 <para>Insufficient kernel memory was available.</para>
83 </listitem>
84 </varlistentry>
85 <varlistentry>
86 <term><errorcode>ENXIO</errorcode></term>
87 <listitem>
88 <para>No device corresponding to this device special file exists.
89 </para>
90 </listitem>
91 </varlistentry>
92 </variablelist>
93 </refsect1>
94</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-ioc-device-info.xml b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
new file mode 100644
index 00000000000..2ce521419e6
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
@@ -0,0 +1,132 @@
1<refentry id="media-ioc-device-info">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_DEVICE_INFO</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_DEVICE_INFO</refname>
9 <refpurpose>Query device information</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_device_info *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_DEVICE_INFO</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>All media devices must support the <constant>MEDIA_IOC_DEVICE_INFO</constant>
53 ioctl. To query device information, applications call the ioctl with a
54 pointer to a &media-device-info;. The driver fills the structure and returns
55 the information to the application.
56 The ioctl never fails.</para>
57
58 <table pgwide="1" frame="none" id="media-device-info">
59 <title>struct <structname>media_device_info</structname></title>
60 <tgroup cols="3">
61 &cs-str;
62 <tbody valign="top">
63 <row>
64 <entry>char</entry>
65 <entry><structfield>driver</structfield>[16]</entry>
66 <entry><para>Name of the driver implementing the media API as a
67 NUL-terminated ASCII string. The driver version is stored in the
68 <structfield>driver_version</structfield> field.</para>
69 <para>Driver specific applications can use this information to
70 verify the driver identity. It is also useful to work around
71 known bugs, or to identify drivers in error reports.</para></entry>
72 </row>
73 <row>
74 <entry>char</entry>
75 <entry><structfield>model</structfield>[32]</entry>
76 <entry>Device model name as a NUL-terminated UTF-8 string. The
77 device version is stored in the <structfield>device_version</structfield>
78 field and is not be appended to the model name.</entry>
79 </row>
80 <row>
81 <entry>char</entry>
82 <entry><structfield>serial</structfield>[40]</entry>
83 <entry>Serial number as a NUL-terminated ASCII string.</entry>
84 </row>
85 <row>
86 <entry>char</entry>
87 <entry><structfield>bus_info</structfield>[32]</entry>
88 <entry>Location of the device in the system as a NUL-terminated
89 ASCII string. This includes the bus type name (PCI, USB, ...) and a
90 bus-specific identifier.</entry>
91 </row>
92 <row>
93 <entry>__u32</entry>
94 <entry><structfield>media_version</structfield></entry>
95 <entry>Media API version, formatted with the
96 <constant>KERNEL_VERSION()</constant> macro.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>hw_revision</structfield></entry>
101 <entry>Hardware device revision in a driver-specific format.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>media_version</structfield></entry>
106 <entry>Media device driver version, formatted with the
107 <constant>KERNEL_VERSION()</constant> macro. Together with the
108 <structfield>driver</structfield> field this identifies a particular
109 driver.</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>reserved</structfield>[31]</entry>
114 <entry>Reserved for future extensions. Drivers and applications must
115 set this array to zero.</entry>
116 </row>
117 </tbody>
118 </tgroup>
119 </table>
120 <para>The <structfield>serial</structfield> and <structfield>bus_info</structfield>
121 fields can be used to distinguish between multiple instances of otherwise
122 identical hardware. The serial number takes precedence when provided and can
123 be assumed to be unique. If the serial number is an empty string, the
124 <structfield>bus_info</structfield> field can be used instead. The
125 <structfield>bus_info</structfield> field is guaranteed to be unique, but
126 can vary across reboots or device unplug/replug.</para>
127 </refsect1>
128
129 <refsect1>
130 &return-value;
131 </refsect1>
132</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml
new file mode 100644
index 00000000000..576b68b33f2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml
@@ -0,0 +1,308 @@
1<refentry id="media-ioc-enum-entities">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_ENUM_ENTITIES</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_ENUM_ENTITIES</refname>
9 <refpurpose>Enumerate entities and their properties</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_entity_desc *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_ENUM_ENTITIES</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51 <para>To query the attributes of an entity, applications set the id field
52 of a &media-entity-desc; structure and call the MEDIA_IOC_ENUM_ENTITIES
53 ioctl with a pointer to this structure. The driver fills the rest of the
54 structure or returns an &EINVAL; when the id is invalid.</para>
55 <para>Entities can be enumerated by or'ing the id with the
56 <constant>MEDIA_ENT_ID_FLAG_NEXT</constant> flag. The driver will return
57 information about the entity with the smallest id strictly larger than the
58 requested one ('next entity'), or the &EINVAL; if there is none.</para>
59 <para>Entity IDs can be non-contiguous. Applications must
60 <emphasis>not</emphasis> try to enumerate entities by calling
61 MEDIA_IOC_ENUM_ENTITIES with increasing id's until they get an error.</para>
62 <para>Two or more entities that share a common non-zero
63 <structfield>group_id</structfield> value are considered as logically
64 grouped. Groups are used to report
65 <itemizedlist>
66 <listitem><para>ALSA, VBI and video nodes that carry the same media
67 stream</para></listitem>
68 <listitem><para>lens and flash controllers associated with a sensor</para></listitem>
69 </itemizedlist>
70 </para>
71
72 <table pgwide="1" frame="none" id="media-entity-desc">
73 <title>struct <structname>media_entity_desc</structname></title>
74 <tgroup cols="5">
75 <colspec colname="c1" />
76 <colspec colname="c2" />
77 <colspec colname="c3" />
78 <colspec colname="c4" />
79 <colspec colname="c5" />
80 <tbody valign="top">
81 <row>
82 <entry>__u32</entry>
83 <entry><structfield>id</structfield></entry>
84 <entry></entry>
85 <entry></entry>
86 <entry>Entity id, set by the application. When the id is or'ed with
87 <constant>MEDIA_ENT_ID_FLAG_NEXT</constant>, the driver clears the
88 flag and returns the first entity with a larger id.</entry>
89 </row>
90 <row>
91 <entry>char</entry>
92 <entry><structfield>name</structfield>[32]</entry>
93 <entry></entry>
94 <entry></entry>
95 <entry>Entity name as an UTF-8 NULL-terminated string.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>type</structfield></entry>
100 <entry></entry>
101 <entry></entry>
102 <entry>Entity type, see <xref linkend="media-entity-type" /> for details.</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>revision</structfield></entry>
107 <entry></entry>
108 <entry></entry>
109 <entry>Entity revision in a driver/hardware specific format.</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>flags</structfield></entry>
114 <entry></entry>
115 <entry></entry>
116 <entry>Entity flags, see <xref linkend="media-entity-flag" /> for details.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>group_id</structfield></entry>
121 <entry></entry>
122 <entry></entry>
123 <entry>Entity group ID</entry>
124 </row>
125 <row>
126 <entry>__u16</entry>
127 <entry><structfield>pads</structfield></entry>
128 <entry></entry>
129 <entry></entry>
130 <entry>Number of pads</entry>
131 </row>
132 <row>
133 <entry>__u16</entry>
134 <entry><structfield>links</structfield></entry>
135 <entry></entry>
136 <entry></entry>
137 <entry>Total number of outbound links. Inbound links are not counted
138 in this field.</entry>
139 </row>
140 <row>
141 <entry>union</entry>
142 </row>
143 <row>
144 <entry></entry>
145 <entry>struct</entry>
146 <entry><structfield>v4l</structfield></entry>
147 <entry></entry>
148 <entry>Valid for V4L sub-devices and nodes only.</entry>
149 </row>
150 <row>
151 <entry></entry>
152 <entry></entry>
153 <entry>__u32</entry>
154 <entry><structfield>major</structfield></entry>
155 <entry>V4L device node major number. For V4L sub-devices with no
156 device node, set by the driver to 0.</entry>
157 </row>
158 <row>
159 <entry></entry>
160 <entry></entry>
161 <entry>__u32</entry>
162 <entry><structfield>minor</structfield></entry>
163 <entry>V4L device node minor number. For V4L sub-devices with no
164 device node, set by the driver to 0.</entry>
165 </row>
166 <row>
167 <entry></entry>
168 <entry>struct</entry>
169 <entry><structfield>fb</structfield></entry>
170 <entry></entry>
171 <entry>Valid for frame buffer nodes only.</entry>
172 </row>
173 <row>
174 <entry></entry>
175 <entry></entry>
176 <entry>__u32</entry>
177 <entry><structfield>major</structfield></entry>
178 <entry>Frame buffer device node major number.</entry>
179 </row>
180 <row>
181 <entry></entry>
182 <entry></entry>
183 <entry>__u32</entry>
184 <entry><structfield>minor</structfield></entry>
185 <entry>Frame buffer device node minor number.</entry>
186 </row>
187 <row>
188 <entry></entry>
189 <entry>struct</entry>
190 <entry><structfield>alsa</structfield></entry>
191 <entry></entry>
192 <entry>Valid for ALSA devices only.</entry>
193 </row>
194 <row>
195 <entry></entry>
196 <entry></entry>
197 <entry>__u32</entry>
198 <entry><structfield>card</structfield></entry>
199 <entry>ALSA card number</entry>
200 </row>
201 <row>
202 <entry></entry>
203 <entry></entry>
204 <entry>__u32</entry>
205 <entry><structfield>device</structfield></entry>
206 <entry>ALSA device number</entry>
207 </row>
208 <row>
209 <entry></entry>
210 <entry></entry>
211 <entry>__u32</entry>
212 <entry><structfield>subdevice</structfield></entry>
213 <entry>ALSA sub-device number</entry>
214 </row>
215 <row>
216 <entry></entry>
217 <entry>int</entry>
218 <entry><structfield>dvb</structfield></entry>
219 <entry></entry>
220 <entry>DVB card number</entry>
221 </row>
222 <row>
223 <entry></entry>
224 <entry>__u8</entry>
225 <entry><structfield>raw</structfield>[180]</entry>
226 <entry></entry>
227 <entry></entry>
228 </row>
229 </tbody>
230 </tgroup>
231 </table>
232
233 <table frame="none" pgwide="1" id="media-entity-type">
234 <title>Media entity types</title>
235 <tgroup cols="2">
236 <colspec colname="c1"/>
237 <colspec colname="c2"/>
238 <tbody valign="top">
239 <row>
240 <entry><constant>MEDIA_ENT_T_DEVNODE</constant></entry>
241 <entry>Unknown device node</entry>
242 </row>
243 <row>
244 <entry><constant>MEDIA_ENT_T_DEVNODE_V4L</constant></entry>
245 <entry>V4L video, radio or vbi device node</entry>
246 </row>
247 <row>
248 <entry><constant>MEDIA_ENT_T_DEVNODE_FB</constant></entry>
249 <entry>Frame buffer device node</entry>
250 </row>
251 <row>
252 <entry><constant>MEDIA_ENT_T_DEVNODE_ALSA</constant></entry>
253 <entry>ALSA card</entry>
254 </row>
255 <row>
256 <entry><constant>MEDIA_ENT_T_DEVNODE_DVB</constant></entry>
257 <entry>DVB card</entry>
258 </row>
259 <row>
260 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV</constant></entry>
261 <entry>Unknown V4L sub-device</entry>
262 </row>
263 <row>
264 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_SENSOR</constant></entry>
265 <entry>Video sensor</entry>
266 </row>
267 <row>
268 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_FLASH</constant></entry>
269 <entry>Flash controller</entry>
270 </row>
271 <row>
272 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry>
273 <entry>Lens controller</entry>
274 </row>
275 </tbody>
276 </tgroup>
277 </table>
278
279 <table frame="none" pgwide="1" id="media-entity-flag">
280 <title>Media entity flags</title>
281 <tgroup cols="2">
282 <colspec colname="c1"/>
283 <colspec colname="c2"/>
284 <tbody valign="top">
285 <row>
286 <entry><constant>MEDIA_ENT_FL_DEFAULT</constant></entry>
287 <entry>Default entity for its type. Used to discover the default
288 audio, VBI and video devices, the default camera sensor, ...</entry>
289 </row>
290 </tbody>
291 </tgroup>
292 </table>
293 </refsect1>
294
295 <refsect1>
296 &return-value;
297
298 <variablelist>
299 <varlistentry>
300 <term><errorcode>EINVAL</errorcode></term>
301 <listitem>
302 <para>The &media-entity-desc; <structfield>id</structfield> references
303 a non-existing entity.</para>
304 </listitem>
305 </varlistentry>
306 </variablelist>
307 </refsect1>
308</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml
new file mode 100644
index 00000000000..355df43badc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml
@@ -0,0 +1,207 @@
1<refentry id="media-ioc-enum-links">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_ENUM_LINKS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_ENUM_LINKS</refname>
9 <refpurpose>Enumerate all pads and links for a given entity</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_links_enum *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_ENUM_LINKS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To enumerate pads and/or links for a given entity, applications set
53 the entity field of a &media-links-enum; structure and initialize the
54 &media-pad-desc; and &media-link-desc; structure arrays pointed by the
55 <structfield>pads</structfield> and <structfield>links</structfield> fields.
56 They then call the MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this
57 structure.</para>
58 <para>If the <structfield>pads</structfield> field is not NULL, the driver
59 fills the <structfield>pads</structfield> array with information about the
60 entity's pads. The array must have enough room to store all the entity's
61 pads. The number of pads can be retrieved with the &MEDIA-IOC-ENUM-ENTITIES;
62 ioctl.</para>
63 <para>If the <structfield>links</structfield> field is not NULL, the driver
64 fills the <structfield>links</structfield> array with information about the
65 entity's outbound links. The array must have enough room to store all the
66 entity's outbound links. The number of outbound links can be retrieved with
67 the &MEDIA-IOC-ENUM-ENTITIES; ioctl.</para>
68 <para>Only forward links that originate at one of the entity's source pads
69 are returned during the enumeration process.</para>
70
71 <table pgwide="1" frame="none" id="media-links-enum">
72 <title>struct <structname>media_links_enum</structname></title>
73 <tgroup cols="3">
74 &cs-str;
75 <tbody valign="top">
76 <row>
77 <entry>__u32</entry>
78 <entry><structfield>entity</structfield></entry>
79 <entry>Entity id, set by the application.</entry>
80 </row>
81 <row>
82 <entry>struct &media-pad-desc;</entry>
83 <entry>*<structfield>pads</structfield></entry>
84 <entry>Pointer to a pads array allocated by the application. Ignored
85 if NULL.</entry>
86 </row>
87 <row>
88 <entry>struct &media-link-desc;</entry>
89 <entry>*<structfield>links</structfield></entry>
90 <entry>Pointer to a links array allocated by the application. Ignored
91 if NULL.</entry>
92 </row>
93 </tbody>
94 </tgroup>
95 </table>
96
97 <table pgwide="1" frame="none" id="media-pad-desc">
98 <title>struct <structname>media_pad_desc</structname></title>
99 <tgroup cols="3">
100 &cs-str;
101 <tbody valign="top">
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>entity</structfield></entry>
105 <entry>ID of the entity this pad belongs to.</entry>
106 </row>
107 <row>
108 <entry>__u16</entry>
109 <entry><structfield>index</structfield></entry>
110 <entry>0-based pad index.</entry>
111 </row>
112 <row>
113 <entry>__u32</entry>
114 <entry><structfield>flags</structfield></entry>
115 <entry>Pad flags, see <xref linkend="media-pad-flag" /> for more details.</entry>
116 </row>
117 </tbody>
118 </tgroup>
119 </table>
120
121 <table frame="none" pgwide="1" id="media-pad-flag">
122 <title>Media pad flags</title>
123 <tgroup cols="2">
124 <colspec colname="c1"/>
125 <colspec colname="c2"/>
126 <tbody valign="top">
127 <row>
128 <entry><constant>MEDIA_PAD_FL_SINK</constant></entry>
129 <entry>Input pad, relative to the entity. Input pads sink data and
130 are targets of links.</entry>
131 </row>
132 <row>
133 <entry><constant>MEDIA_PAD_FL_SOURCE</constant></entry>
134 <entry>Output pad, relative to the entity. Output pads source data
135 and are origins of links.</entry>
136 </row>
137 </tbody>
138 </tgroup>
139 </table>
140
141 <table pgwide="1" frame="none" id="media-link-desc">
142 <title>struct <structname>media_link_desc</structname></title>
143 <tgroup cols="3">
144 &cs-str;
145 <tbody valign="top">
146 <row>
147 <entry>struct &media-pad-desc;</entry>
148 <entry><structfield>source</structfield></entry>
149 <entry>Pad at the origin of this link.</entry>
150 </row>
151 <row>
152 <entry>struct &media-pad-desc;</entry>
153 <entry><structfield>sink</structfield></entry>
154 <entry>Pad at the target of this link.</entry>
155 </row>
156 <row>
157 <entry>__u32</entry>
158 <entry><structfield>flags</structfield></entry>
159 <entry>Link flags, see <xref linkend="media-link-flag" /> for more details.</entry>
160 </row>
161 </tbody>
162 </tgroup>
163 </table>
164
165 <table frame="none" pgwide="1" id="media-link-flag">
166 <title>Media link flags</title>
167 <tgroup cols="2">
168 <colspec colname="c1"/>
169 <colspec colname="c2"/>
170 <tbody valign="top">
171 <row>
172 <entry><constant>MEDIA_LNK_FL_ENABLED</constant></entry>
173 <entry>The link is enabled and can be used to transfer media data.
174 When two or more links target a sink pad, only one of them can be
175 enabled at a time.</entry>
176 </row>
177 <row>
178 <entry><constant>MEDIA_LNK_FL_IMMUTABLE</constant></entry>
179 <entry>The link enabled state can't be modified at runtime. An
180 immutable link is always enabled.</entry>
181 </row>
182 <row>
183 <entry><constant>MEDIA_LNK_FL_DYNAMIC</constant></entry>
184 <entry>The link enabled state can be modified during streaming. This
185 flag is set by drivers and is read-only for applications.</entry>
186 </row>
187 </tbody>
188 </tgroup>
189 </table>
190 <para>One and only one of <constant>MEDIA_PAD_FL_SINK</constant> and
191 <constant>MEDIA_PAD_FL_SOURCE</constant> must be set for every pad.</para>
192 </refsect1>
193
194 <refsect1>
195 &return-value;
196
197 <variablelist>
198 <varlistentry>
199 <term><errorcode>EINVAL</errorcode></term>
200 <listitem>
201 <para>The &media-links-enum; <structfield>id</structfield> references
202 a non-existing entity.</para>
203 </listitem>
204 </varlistentry>
205 </variablelist>
206 </refsect1>
207</refentry>
diff --git a/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml b/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml
new file mode 100644
index 00000000000..fc2e522ee65
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml
@@ -0,0 +1,84 @@
1<refentry id="media-ioc-setup-link">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_SETUP_LINK</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_SETUP_LINK</refname>
9 <refpurpose>Modify the properties of a link</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_link_desc *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_SETUP_LINK</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To change link properties applications fill a &media-link-desc; with
53 link identification information (source and sink pad) and the new requested
54 link flags. They then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to
55 that structure.</para>
56 <para>The only configurable property is the <constant>ENABLED</constant>
57 link flag to enable/disable a link. Links marked with the
58 <constant>IMMUTABLE</constant> link flag can not be enabled or disabled.
59 </para>
60 <para>Link configuration has no side effect on other links. If an enabled
61 link at the sink pad prevents the link from being enabled, the driver
62 returns with an &EBUSY;.</para>
63 <para>Only links marked with the <constant>DYNAMIC</constant> link flag can
64 be enabled/disabled while streaming media data. Attempting to enable or
65 disable a streaming non-dynamic link will return an &EBUSY;.</para>
66 <para>If the specified link can't be found the driver returns with an
67 &EINVAL;.</para>
68 </refsect1>
69
70 <refsect1>
71 &return-value;
72
73 <variablelist>
74 <varlistentry>
75 <term><errorcode>EINVAL</errorcode></term>
76 <listitem>
77 <para>The &media-link-desc; references a non-existing link, or the
78 link is immutable and an attempt to modify its configuration was made.
79 </para>
80 </listitem>
81 </varlistentry>
82 </variablelist>
83 </refsect1>
84</refentry>
diff --git a/Documentation/DocBook/media/v4l/pipeline.pdf b/Documentation/DocBook/media/v4l/pipeline.pdf
new file mode 100644
index 00000000000..ee3e37f04b6
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pipeline.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/pixfmt-grey.xml b/Documentation/DocBook/media/v4l/pixfmt-grey.xml
new file mode 100644
index 00000000000..bee970d3f76
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-grey.xml
@@ -0,0 +1,62 @@
1 <refentry id="V4L2-PIX-FMT-GREY">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_GREY ('GREY')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_GREY</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image. It is really a degenerate
14Y'CbCr format which simply contains no Cb or Cr data.</para>
15
16 <example>
17 <title><constant>V4L2_PIX_FMT_GREY</constant> 4 &times; 4
18pixel image</title>
19
20 <formalpara>
21 <title>Byte Order.</title>
22 <para>Each cell is one byte.
23 <informaltable frame="none">
24 <tgroup cols="5" align="center">
25 <colspec align="left" colwidth="2*" />
26 <tbody valign="top">
27 <row>
28 <entry>start&nbsp;+&nbsp;0:</entry>
29 <entry>Y'<subscript>00</subscript></entry>
30 <entry>Y'<subscript>01</subscript></entry>
31 <entry>Y'<subscript>02</subscript></entry>
32 <entry>Y'<subscript>03</subscript></entry>
33 </row>
34 <row>
35 <entry>start&nbsp;+&nbsp;4:</entry>
36 <entry>Y'<subscript>10</subscript></entry>
37 <entry>Y'<subscript>11</subscript></entry>
38 <entry>Y'<subscript>12</subscript></entry>
39 <entry>Y'<subscript>13</subscript></entry>
40 </row>
41 <row>
42 <entry>start&nbsp;+&nbsp;8:</entry>
43 <entry>Y'<subscript>20</subscript></entry>
44 <entry>Y'<subscript>21</subscript></entry>
45 <entry>Y'<subscript>22</subscript></entry>
46 <entry>Y'<subscript>23</subscript></entry>
47 </row>
48 <row>
49 <entry>start&nbsp;+&nbsp;12:</entry>
50 <entry>Y'<subscript>30</subscript></entry>
51 <entry>Y'<subscript>31</subscript></entry>
52 <entry>Y'<subscript>32</subscript></entry>
53 <entry>Y'<subscript>33</subscript></entry>
54 </row>
55 </tbody>
56 </tgroup>
57 </informaltable>
58 </para>
59 </formalpara>
60 </example>
61 </refsect1>
62 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-m420.xml b/Documentation/DocBook/media/v4l/pixfmt-m420.xml
new file mode 100644
index 00000000000..aadae92c5d0
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-m420.xml
@@ -0,0 +1,139 @@
1 <refentry id="V4L2-PIX-FMT-M420">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_M420 ('M420')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_M420</constant></refname>
8 <refpurpose>Format with &frac12; horizontal and vertical chroma
9 resolution, also known as YUV 4:2:0. Hybrid plane line-interleaved
10 layout.</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>M420 is a YUV format with &frac12; horizontal and vertical chroma
16 subsampling (YUV 4:2:0). Pixels are organized as interleaved luma and
17 chroma planes. Two lines of luma data are followed by one line of chroma
18 data.</para>
19 <para>The luma plane has one byte per pixel. The chroma plane contains
20 interleaved CbCr pixels subsampled by &frac12; in the horizontal and
21 vertical directions. Each CbCr pair belongs to four pixels. For example,
22Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
23Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
24Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.</para>
25
26 <para>All line lengths are identical: if the Y lines include pad bytes
27 so do the CbCr lines.</para>
28
29 <example>
30 <title><constant>V4L2_PIX_FMT_M420</constant> 4 &times; 4
31pixel image</title>
32
33 <formalpara>
34 <title>Byte Order.</title>
35 <para>Each cell is one byte.
36 <informaltable frame="none">
37 <tgroup cols="5" align="center">
38 <colspec align="left" colwidth="2*" />
39 <tbody valign="top">
40 <row>
41 <entry>start&nbsp;+&nbsp;0:</entry>
42 <entry>Y'<subscript>00</subscript></entry>
43 <entry>Y'<subscript>01</subscript></entry>
44 <entry>Y'<subscript>02</subscript></entry>
45 <entry>Y'<subscript>03</subscript></entry>
46 </row>
47 <row>
48 <entry>start&nbsp;+&nbsp;4:</entry>
49 <entry>Y'<subscript>10</subscript></entry>
50 <entry>Y'<subscript>11</subscript></entry>
51 <entry>Y'<subscript>12</subscript></entry>
52 <entry>Y'<subscript>13</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;8:</entry>
56 <entry>Cb<subscript>00</subscript></entry>
57 <entry>Cr<subscript>00</subscript></entry>
58 <entry>Cb<subscript>01</subscript></entry>
59 <entry>Cr<subscript>01</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start&nbsp;+&nbsp;20:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row>
76 <entry>start&nbsp;+&nbsp;24:</entry>
77 <entry>Cb<subscript>10</subscript></entry>
78 <entry>Cr<subscript>10</subscript></entry>
79 <entry>Cb<subscript>11</subscript></entry>
80 <entry>Cr<subscript>11</subscript></entry>
81 </row>
82 </tbody>
83 </tgroup>
84 </informaltable>
85 </para>
86 </formalpara>
87
88 <formalpara>
89 <title>Color Sample Location.</title>
90 <para>
91 <informaltable frame="none">
92 <tgroup cols="7" align="center">
93 <tbody valign="top">
94 <row>
95 <entry></entry>
96 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
97 <entry>2</entry><entry></entry><entry>3</entry>
98 </row>
99 <row>
100 <entry>0</entry>
101 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
102 <entry>Y</entry><entry></entry><entry>Y</entry>
103 </row>
104 <row>
105 <entry></entry>
106 <entry></entry><entry>C</entry><entry></entry><entry></entry>
107 <entry></entry><entry>C</entry><entry></entry>
108 </row>
109 <row>
110 <entry>1</entry>
111 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
112 <entry>Y</entry><entry></entry><entry>Y</entry>
113 </row>
114 <row>
115 <entry></entry>
116 </row>
117 <row>
118 <entry>2</entry>
119 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
120 <entry>Y</entry><entry></entry><entry>Y</entry>
121 </row>
122 <row>
123 <entry></entry>
124 <entry></entry><entry>C</entry><entry></entry><entry></entry>
125 <entry></entry><entry>C</entry><entry></entry>
126 </row>
127 <row>
128 <entry>3</entry>
129 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
130 <entry>Y</entry><entry></entry><entry>Y</entry>
131 </row>
132 </tbody>
133 </tgroup>
134 </informaltable>
135 </para>
136 </formalpara>
137 </example>
138 </refsect1>
139 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12.xml
new file mode 100644
index 00000000000..84dd4fd7cb8
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv12.xml
@@ -0,0 +1,143 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV12"><constant>V4L2_PIX_FMT_NV12</constant></refname>
8 <refname id="V4L2-PIX-FMT-NV21"><constant>V4L2_PIX_FMT_NV21</constant></refname>
9 <refpurpose>Formats with &frac12; horizontal and vertical
10chroma resolution, also known as YUV 4:2:0. One luminance and one
11chrominance plane with alternating chroma samples as opposed to
12<constant>V4L2_PIX_FMT_YVU420</constant></refpurpose>
13 </refnamediv>
14 <refsect1>
15 <title>Description</title>
16
17 <para>These are two-plane versions of the YUV 4:2:0 format.
18The three components are separated into two sub-images or planes. The
19Y plane is first. The Y plane has one byte per pixel. For
20<constant>V4L2_PIX_FMT_NV12</constant>, a combined CbCr plane
21immediately follows the Y plane in memory. The CbCr plane is the same
22width, in bytes, as the Y plane (and of the image), but is half as
23tall in pixels. Each CbCr pair belongs to four pixels. For example,
24Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
25Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
26Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
27<constant>V4L2_PIX_FMT_NV21</constant> is the same except the Cb and
28Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
29
30 <para>If the Y plane has pad bytes after each row, then the
31CbCr plane has as many pad bytes after its rows.</para>
32
33 <example>
34 <title><constant>V4L2_PIX_FMT_NV12</constant> 4 &times; 4
35pixel image</title>
36
37 <formalpara>
38 <title>Byte Order.</title>
39 <para>Each cell is one byte.
40 <informaltable frame="none">
41 <tgroup cols="5" align="center">
42 <colspec align="left" colwidth="2*" />
43 <tbody valign="top">
44 <row>
45 <entry>start&nbsp;+&nbsp;0:</entry>
46 <entry>Y'<subscript>00</subscript></entry>
47 <entry>Y'<subscript>01</subscript></entry>
48 <entry>Y'<subscript>02</subscript></entry>
49 <entry>Y'<subscript>03</subscript></entry>
50 </row>
51 <row>
52 <entry>start&nbsp;+&nbsp;4:</entry>
53 <entry>Y'<subscript>10</subscript></entry>
54 <entry>Y'<subscript>11</subscript></entry>
55 <entry>Y'<subscript>12</subscript></entry>
56 <entry>Y'<subscript>13</subscript></entry>
57 </row>
58 <row>
59 <entry>start&nbsp;+&nbsp;8:</entry>
60 <entry>Y'<subscript>20</subscript></entry>
61 <entry>Y'<subscript>21</subscript></entry>
62 <entry>Y'<subscript>22</subscript></entry>
63 <entry>Y'<subscript>23</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;12:</entry>
67 <entry>Y'<subscript>30</subscript></entry>
68 <entry>Y'<subscript>31</subscript></entry>
69 <entry>Y'<subscript>32</subscript></entry>
70 <entry>Y'<subscript>33</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;16:</entry>
74 <entry>Cb<subscript>00</subscript></entry>
75 <entry>Cr<subscript>00</subscript></entry>
76 <entry>Cb<subscript>01</subscript></entry>
77 <entry>Cr<subscript>01</subscript></entry>
78 </row>
79 <row>
80 <entry>start&nbsp;+&nbsp;20:</entry>
81 <entry>Cb<subscript>10</subscript></entry>
82 <entry>Cr<subscript>10</subscript></entry>
83 <entry>Cb<subscript>11</subscript></entry>
84 <entry>Cr<subscript>11</subscript></entry>
85 </row>
86 </tbody>
87 </tgroup>
88 </informaltable>
89 </para>
90 </formalpara>
91
92 <formalpara>
93 <title>Color Sample Location.</title>
94 <para>
95 <informaltable frame="none">
96 <tgroup cols="7" align="center">
97 <tbody valign="top">
98 <row>
99 <entry></entry>
100 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
101 <entry>2</entry><entry></entry><entry>3</entry>
102 </row>
103 <row>
104 <entry>0</entry>
105 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry></entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry></entry>
110 <entry></entry><entry>C</entry><entry></entry><entry></entry>
111 <entry></entry><entry>C</entry><entry></entry>
112 </row>
113 <row>
114 <entry>1</entry>
115 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry>
117 </row>
118 <row>
119 <entry></entry>
120 </row>
121 <row>
122 <entry>2</entry>
123 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
124 <entry>Y</entry><entry></entry><entry>Y</entry>
125 </row>
126 <row>
127 <entry></entry>
128 <entry></entry><entry>C</entry><entry></entry><entry></entry>
129 <entry></entry><entry>C</entry><entry></entry>
130 </row>
131 <row>
132 <entry>3</entry>
133 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry>
135 </row>
136 </tbody>
137 </tgroup>
138 </informaltable>
139 </para>
140 </formalpara>
141 </example>
142 </refsect1>
143 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml
new file mode 100644
index 00000000000..a990b34d911
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml
@@ -0,0 +1,153 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV12M"><constant>V4L2_PIX_FMT_NV12M</constant></refname>
8 <refname id="V4L2-PIX-FMT-NV21M"><constant>V4L2_PIX_FMT_NV21M</constant></refname>
9 <refname id="V4L2-PIX-FMT-NV12MT_16X16"><constant>V4L2_PIX_FMT_NV12MT_16X16</constant></refname>
10 <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV12</constant> and <constant>V4L2_PIX_FMT_NV21</constant> with planes
11 non contiguous in memory. </refpurpose>
12 </refnamediv>
13 <refsect1>
14 <title>Description</title>
15
16 <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
17The three components are separated into two sub-images or planes.
18<constant>V4L2_PIX_FMT_NV12M</constant> differs from <constant>V4L2_PIX_FMT_NV12
19</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
20plane do not necessarily immediately follows the luma plane.
21The luminance data occupies the first plane. The Y plane has one byte per pixel.
22In the second plane there is a chrominance data with alternating chroma samples.
23The CbCr plane is the same width, in bytes, as the Y plane (and of the image),
24but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example,
25Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
26Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
27Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
28<constant>V4L2_PIX_FMT_NV12MT_16X16</constant> is the tiled version of
29<constant>V4L2_PIX_FMT_NV12M</constant> with 16x16 macroblock tiles. Here pixels
30are arranged in 16x16 2D tiles and tiles are arranged in linear order in memory.
31<constant>V4L2_PIX_FMT_NV21M</constant> is the same as <constant>V4L2_PIX_FMT_NV12M</constant>
32except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
33
34 <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be
35used only in drivers and applications that support the multi-planar API,
36described in <xref linkend="planar-apis"/>. </para>
37
38 <para>If the Y plane has pad bytes after each row, then the
39CbCr plane has as many pad bytes after its rows.</para>
40
41 <example>
42 <title><constant>V4L2_PIX_FMT_NV12M</constant> 4 &times; 4 pixel image</title>
43
44 <formalpara>
45 <title>Byte Order.</title>
46 <para>Each cell is one byte.
47 <informaltable frame="none">
48 <tgroup cols="5" align="center">
49 <colspec align="left" colwidth="2*" />
50 <tbody valign="top">
51 <row>
52 <entry>start0&nbsp;+&nbsp;0:</entry>
53 <entry>Y'<subscript>00</subscript></entry>
54 <entry>Y'<subscript>01</subscript></entry>
55 <entry>Y'<subscript>02</subscript></entry>
56 <entry>Y'<subscript>03</subscript></entry>
57 </row>
58 <row>
59 <entry>start0&nbsp;+&nbsp;4:</entry>
60 <entry>Y'<subscript>10</subscript></entry>
61 <entry>Y'<subscript>11</subscript></entry>
62 <entry>Y'<subscript>12</subscript></entry>
63 <entry>Y'<subscript>13</subscript></entry>
64 </row>
65 <row>
66 <entry>start0&nbsp;+&nbsp;8:</entry>
67 <entry>Y'<subscript>20</subscript></entry>
68 <entry>Y'<subscript>21</subscript></entry>
69 <entry>Y'<subscript>22</subscript></entry>
70 <entry>Y'<subscript>23</subscript></entry>
71 </row>
72 <row>
73 <entry>start0&nbsp;+&nbsp;12:</entry>
74 <entry>Y'<subscript>30</subscript></entry>
75 <entry>Y'<subscript>31</subscript></entry>
76 <entry>Y'<subscript>32</subscript></entry>
77 <entry>Y'<subscript>33</subscript></entry>
78 </row>
79 <row>
80 <entry></entry>
81 </row>
82 <row>
83 <entry>start1&nbsp;+&nbsp;0:</entry>
84 <entry>Cb<subscript>00</subscript></entry>
85 <entry>Cr<subscript>00</subscript></entry>
86 <entry>Cb<subscript>01</subscript></entry>
87 <entry>Cr<subscript>01</subscript></entry>
88 </row>
89 <row>
90 <entry>start1&nbsp;+&nbsp;4:</entry>
91 <entry>Cb<subscript>10</subscript></entry>
92 <entry>Cr<subscript>10</subscript></entry>
93 <entry>Cb<subscript>11</subscript></entry>
94 <entry>Cr<subscript>11</subscript></entry>
95 </row>
96 </tbody>
97 </tgroup>
98 </informaltable>
99 </para>
100 </formalpara>
101
102 <formalpara>
103 <title>Color Sample Location.</title>
104 <para>
105 <informaltable frame="none">
106 <tgroup cols="7" align="center">
107 <tbody valign="top">
108 <row>
109 <entry></entry>
110 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
111 <entry>2</entry><entry></entry><entry>3</entry>
112 </row>
113 <row>
114 <entry>0</entry>
115 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry>
117 </row>
118 <row>
119 <entry></entry>
120 <entry></entry><entry>C</entry><entry></entry><entry></entry>
121 <entry></entry><entry>C</entry><entry></entry>
122 </row>
123 <row>
124 <entry>1</entry>
125 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry>
127 </row>
128 <row>
129 <entry></entry>
130 </row>
131 <row>
132 <entry>2</entry>
133 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry>
135 </row>
136 <row>
137 <entry></entry>
138 <entry></entry><entry>C</entry><entry></entry><entry></entry>
139 <entry></entry><entry>C</entry><entry></entry>
140 </row>
141 <row>
142 <entry>3</entry>
143 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
144 <entry>Y</entry><entry></entry><entry>Y</entry>
145 </row>
146 </tbody>
147 </tgroup>
148 </informaltable>
149 </para>
150 </formalpara>
151 </example>
152 </refsect1>
153 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml
new file mode 100644
index 00000000000..2f82b1da8df
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml
@@ -0,0 +1,66 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV12MT ('TM12')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV12MT"><constant>V4L2_PIX_FMT_NV12MT
8</constant></refname>
9 <refpurpose>Formats with &frac12; horizontal and vertical
10chroma resolution. This format has two planes - one for luminance and one for
11chrominance. Chroma samples are interleaved. The difference to
12<constant>V4L2_PIX_FMT_NV12</constant> is the memory layout. Pixels are
13grouped in macroblocks of 64x32 size. The order of macroblocks in memory is
14also not standard.
15 </refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>This is the two-plane versions of the YUV 4:2:0 format where data
21is grouped into 64x32 macroblocks. The three components are separated into two
22sub-images or planes. The Y plane has one byte per pixel and pixels are grouped
23into 64x32 macroblocks. The CbCr plane has the same width, in bytes, as the Y
24plane (and the image), but is half as tall in pixels. The chroma plane is also
25grouped into 64x32 macroblocks.</para>
26 <para>Width of the buffer has to be aligned to the multiple of 128, and
27height alignment is 32. Every four adjactent buffers - two horizontally and two
28vertically are grouped together and are located in memory in Z or flipped Z
29order. </para>
30 <para>Layout of macroblocks in memory is presented in the following
31figure.</para>
32 <para><figure id="nv12mt">
33 <title><constant>V4L2_PIX_FMT_NV12MT</constant> macroblock Z shape
34memory layout</title>
35 <mediaobject>
36 <imageobject>
37 <imagedata fileref="nv12mt.gif" format="GIF" />
38 </imageobject>
39 </mediaobject>
40 </figure>
41 The requirement that width is multiple of 128 is implemented because,
42the Z shape cannot be cut in half horizontally. In case the vertical resolution
43of macroblocks is odd then the last row of macroblocks is arranged in a linear
44order. </para>
45 <para>In case of chroma the layout is identical. Cb and Cr samples are
46interleaved. Height of the buffer is aligned to 32.
47 </para>
48 <example>
49 <title>Memory layout of macroblocks in <constant>V4L2_PIX_FMT_NV12
50</constant> format pixel image - extreme case</title>
51 <para>
52 <figure id="nv12mt_ex">
53 <title>Example <constant>V4L2_PIX_FMT_NV12MT</constant> memory
54layout of macroblocks</title>
55 <mediaobject>
56 <imageobject>
57 <imagedata fileref="nv12mt_example.gif" format="GIF" />
58 </imageobject>
59 </mediaobject>
60 </figure>
61 Memory layout of macroblocks of <constant>V4L2_PIX_FMT_NV12MT
62</constant> format in most extreme case.
63 </para>
64 </example>
65 </refsect1>
66 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16.xml
new file mode 100644
index 00000000000..8ae1f8a810d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv16.xml
@@ -0,0 +1,166 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV16"><constant>V4L2_PIX_FMT_NV16</constant></refname>
8 <refname id="V4L2-PIX-FMT-NV61"><constant>V4L2_PIX_FMT_NV61</constant></refname>
9 <refpurpose>Formats with &frac12; horizontal
10chroma resolution, also known as YUV 4:2:2. One luminance and one
11chrominance plane with alternating chroma samples as opposed to
12<constant>V4L2_PIX_FMT_YVU420</constant></refpurpose>
13 </refnamediv>
14 <refsect1>
15 <title>Description</title>
16
17 <para>These are two-plane versions of the YUV 4:2:2 format.
18The three components are separated into two sub-images or planes. The
19Y plane is first. The Y plane has one byte per pixel. For
20<constant>V4L2_PIX_FMT_NV16</constant>, a combined CbCr plane
21immediately follows the Y plane in memory. The CbCr plane is the same
22width and height, in bytes, as the Y plane (and of the image).
23Each CbCr pair belongs to two pixels. For example,
24Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
25Y'<subscript>00</subscript>, Y'<subscript>01</subscript>.
26<constant>V4L2_PIX_FMT_NV61</constant> is the same except the Cb and
27Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
28
29 <para>If the Y plane has pad bytes after each row, then the
30CbCr plane has as many pad bytes after its rows.</para>
31
32 <example>
33 <title><constant>V4L2_PIX_FMT_NV16</constant> 4 &times; 4
34pixel image</title>
35
36 <formalpara>
37 <title>Byte Order.</title>
38 <para>Each cell is one byte.
39 <informaltable frame="none">
40 <tgroup cols="5" align="center">
41 <colspec align="left" colwidth="2*" />
42 <tbody valign="top">
43 <row>
44 <entry>start&nbsp;+&nbsp;0:</entry>
45 <entry>Y'<subscript>00</subscript></entry>
46 <entry>Y'<subscript>01</subscript></entry>
47 <entry>Y'<subscript>02</subscript></entry>
48 <entry>Y'<subscript>03</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;4:</entry>
52 <entry>Y'<subscript>10</subscript></entry>
53 <entry>Y'<subscript>11</subscript></entry>
54 <entry>Y'<subscript>12</subscript></entry>
55 <entry>Y'<subscript>13</subscript></entry>
56 </row>
57 <row>
58 <entry>start&nbsp;+&nbsp;8:</entry>
59 <entry>Y'<subscript>20</subscript></entry>
60 <entry>Y'<subscript>21</subscript></entry>
61 <entry>Y'<subscript>22</subscript></entry>
62 <entry>Y'<subscript>23</subscript></entry>
63 </row>
64 <row>
65 <entry>start&nbsp;+&nbsp;12:</entry>
66 <entry>Y'<subscript>30</subscript></entry>
67 <entry>Y'<subscript>31</subscript></entry>
68 <entry>Y'<subscript>32</subscript></entry>
69 <entry>Y'<subscript>33</subscript></entry>
70 </row>
71 <row>
72 <entry>start&nbsp;+&nbsp;16:</entry>
73 <entry>Cb<subscript>00</subscript></entry>
74 <entry>Cr<subscript>00</subscript></entry>
75 <entry>Cb<subscript>01</subscript></entry>
76 <entry>Cr<subscript>01</subscript></entry>
77 </row>
78 <row>
79 <entry>start&nbsp;+&nbsp;20:</entry>
80 <entry>Cb<subscript>10</subscript></entry>
81 <entry>Cr<subscript>10</subscript></entry>
82 <entry>Cb<subscript>11</subscript></entry>
83 <entry>Cr<subscript>11</subscript></entry>
84 </row>
85 <row>
86 <entry>start&nbsp;+&nbsp;24:</entry>
87 <entry>Cb<subscript>20</subscript></entry>
88 <entry>Cr<subscript>20</subscript></entry>
89 <entry>Cb<subscript>21</subscript></entry>
90 <entry>Cr<subscript>21</subscript></entry>
91 </row>
92 <row>
93 <entry>start&nbsp;+&nbsp;28:</entry>
94 <entry>Cb<subscript>30</subscript></entry>
95 <entry>Cr<subscript>30</subscript></entry>
96 <entry>Cb<subscript>31</subscript></entry>
97 <entry>Cr<subscript>31</subscript></entry>
98 </row>
99 </tbody>
100 </tgroup>
101 </informaltable>
102 </para>
103 </formalpara>
104
105 <formalpara>
106 <title>Color Sample Location.</title>
107 <para>
108 <informaltable frame="none">
109 <tgroup cols="7" align="center">
110 <tbody valign="top">
111 <row>
112 <entry></entry>
113 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
114 <entry>2</entry><entry></entry><entry>3</entry>
115 </row>
116 <row>
117 <entry>0</entry>
118 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
119 <entry>Y</entry><entry></entry><entry>Y</entry>
120 </row>
121 <row>
122 <entry></entry>
123 <entry></entry><entry>C</entry><entry></entry><entry></entry>
124 <entry></entry><entry>C</entry><entry></entry>
125 </row>
126 <row>
127 <entry>1</entry>
128 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
129 <entry>Y</entry><entry></entry><entry>Y</entry>
130 </row>
131 <row>
132 <entry></entry>
133 <entry></entry><entry>C</entry><entry></entry><entry></entry>
134 <entry></entry><entry>C</entry><entry></entry>
135 </row>
136 <row>
137 <entry></entry>
138 </row>
139 <row>
140 <entry>2</entry>
141 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
142 <entry>Y</entry><entry></entry><entry>Y</entry>
143 </row>
144 <row>
145 <entry></entry>
146 <entry></entry><entry>C</entry><entry></entry><entry></entry>
147 <entry></entry><entry>C</entry><entry></entry>
148 </row>
149 <row>
150 <entry>3</entry>
151 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
152 <entry>Y</entry><entry></entry><entry>Y</entry>
153 </row>
154 <row>
155 <entry></entry>
156 <entry></entry><entry>C</entry><entry></entry><entry></entry>
157 <entry></entry><entry>C</entry><entry></entry>
158 </row>
159 </tbody>
160 </tgroup>
161 </informaltable>
162 </para>
163 </formalpara>
164 </example>
165 </refsect1>
166 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv24.xml b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml
new file mode 100644
index 00000000000..fb255f2ca9d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml
@@ -0,0 +1,121 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV24"><constant>V4L2_PIX_FMT_NV24</constant></refname>
8 <refname id="V4L2-PIX-FMT-NV42"><constant>V4L2_PIX_FMT_NV42</constant></refname>
9 <refpurpose>Formats with full horizontal and vertical
10chroma resolutions, also known as YUV 4:4:4. One luminance and one
11chrominance plane with alternating chroma samples as opposed to
12<constant>V4L2_PIX_FMT_YVU420</constant></refpurpose>
13 </refnamediv>
14 <refsect1>
15 <title>Description</title>
16
17 <para>These are two-plane versions of the YUV 4:4:4 format. The three
18 components are separated into two sub-images or planes. The Y plane is
19 first, with each Y sample stored in one byte per pixel. For
20 <constant>V4L2_PIX_FMT_NV24</constant>, a combined CbCr plane
21 immediately follows the Y plane in memory. The CbCr plane has the same
22 width and height, in pixels, as the Y plane (and the image). Each line
23 contains one CbCr pair per pixel, with each Cb and Cr sample stored in
24 one byte. <constant>V4L2_PIX_FMT_NV42</constant> is the same except that
25 the Cb and Cr samples are swapped, the CrCb plane starts with a Cr
26 sample.</para>
27
28 <para>If the Y plane has pad bytes after each row, then the CbCr plane
29 has twice as many pad bytes after its rows.</para>
30
31 <example>
32 <title><constant>V4L2_PIX_FMT_NV24</constant> 4 &times; 4
33pixel image</title>
34
35 <formalpara>
36 <title>Byte Order.</title>
37 <para>Each cell is one byte.
38 <informaltable frame="none">
39 <tgroup cols="9" align="center">
40 <colspec align="left" colwidth="2*" />
41 <tbody valign="top">
42 <row>
43 <entry>start&nbsp;+&nbsp;0:</entry>
44 <entry>Y'<subscript>00</subscript></entry>
45 <entry>Y'<subscript>01</subscript></entry>
46 <entry>Y'<subscript>02</subscript></entry>
47 <entry>Y'<subscript>03</subscript></entry>
48 </row>
49 <row>
50 <entry>start&nbsp;+&nbsp;4:</entry>
51 <entry>Y'<subscript>10</subscript></entry>
52 <entry>Y'<subscript>11</subscript></entry>
53 <entry>Y'<subscript>12</subscript></entry>
54 <entry>Y'<subscript>13</subscript></entry>
55 </row>
56 <row>
57 <entry>start&nbsp;+&nbsp;8:</entry>
58 <entry>Y'<subscript>20</subscript></entry>
59 <entry>Y'<subscript>21</subscript></entry>
60 <entry>Y'<subscript>22</subscript></entry>
61 <entry>Y'<subscript>23</subscript></entry>
62 </row>
63 <row>
64 <entry>start&nbsp;+&nbsp;12:</entry>
65 <entry>Y'<subscript>30</subscript></entry>
66 <entry>Y'<subscript>31</subscript></entry>
67 <entry>Y'<subscript>32</subscript></entry>
68 <entry>Y'<subscript>33</subscript></entry>
69 </row>
70 <row>
71 <entry>start&nbsp;+&nbsp;16:</entry>
72 <entry>Cb<subscript>00</subscript></entry>
73 <entry>Cr<subscript>00</subscript></entry>
74 <entry>Cb<subscript>01</subscript></entry>
75 <entry>Cr<subscript>01</subscript></entry>
76 <entry>Cb<subscript>02</subscript></entry>
77 <entry>Cr<subscript>02</subscript></entry>
78 <entry>Cb<subscript>03</subscript></entry>
79 <entry>Cr<subscript>03</subscript></entry>
80 </row>
81 <row>
82 <entry>start&nbsp;+&nbsp;24:</entry>
83 <entry>Cb<subscript>10</subscript></entry>
84 <entry>Cr<subscript>10</subscript></entry>
85 <entry>Cb<subscript>11</subscript></entry>
86 <entry>Cr<subscript>11</subscript></entry>
87 <entry>Cb<subscript>12</subscript></entry>
88 <entry>Cr<subscript>12</subscript></entry>
89 <entry>Cb<subscript>13</subscript></entry>
90 <entry>Cr<subscript>13</subscript></entry>
91 </row>
92 <row>
93 <entry>start&nbsp;+&nbsp;32:</entry>
94 <entry>Cb<subscript>20</subscript></entry>
95 <entry>Cr<subscript>20</subscript></entry>
96 <entry>Cb<subscript>21</subscript></entry>
97 <entry>Cr<subscript>21</subscript></entry>
98 <entry>Cb<subscript>22</subscript></entry>
99 <entry>Cr<subscript>22</subscript></entry>
100 <entry>Cb<subscript>23</subscript></entry>
101 <entry>Cr<subscript>23</subscript></entry>
102 </row>
103 <row>
104 <entry>start&nbsp;+&nbsp;40:</entry>
105 <entry>Cb<subscript>30</subscript></entry>
106 <entry>Cr<subscript>30</subscript></entry>
107 <entry>Cb<subscript>31</subscript></entry>
108 <entry>Cr<subscript>31</subscript></entry>
109 <entry>Cb<subscript>32</subscript></entry>
110 <entry>Cr<subscript>32</subscript></entry>
111 <entry>Cb<subscript>33</subscript></entry>
112 <entry>Cr<subscript>33</subscript></entry>
113 </row>
114 </tbody>
115 </tgroup>
116 </informaltable>
117 </para>
118 </formalpara>
119 </example>
120 </refsect1>
121 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
new file mode 100644
index 00000000000..166c8d65e4f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
@@ -0,0 +1,935 @@
1<refentry id="packed-rgb">
2 <refmeta>
3 <refentrytitle>Packed RGB formats</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname>Packed RGB formats</refname>
8 <refpurpose>Packed RGB formats</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>These formats are designed to match the pixel formats of
14typical PC graphics frame buffers. They occupy 8, 16, 24 or 32 bits
15per pixel. These are all packed-pixel formats, meaning all the data
16for a pixel lie next to each other in memory.</para>
17
18 <para>When one of these formats is used, drivers shall report the
19colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
20
21 <table pgwide="1" frame="none" id="rgb-formats">
22 <title>Packed RGB Image Formats</title>
23 <tgroup cols="37" align="center">
24 <colspec colname="id" align="left" />
25 <colspec colname="fourcc" />
26 <colspec colname="bit" />
27
28 <colspec colnum="4" colname="b07" align="center" />
29 <colspec colnum="5" colname="b06" align="center" />
30 <colspec colnum="6" colname="b05" align="center" />
31 <colspec colnum="7" colname="b04" align="center" />
32 <colspec colnum="8" colname="b03" align="center" />
33 <colspec colnum="9" colname="b02" align="center" />
34 <colspec colnum="10" colname="b01" align="center" />
35 <colspec colnum="11" colname="b00" align="center" />
36
37 <colspec colnum="13" colname="b17" align="center" />
38 <colspec colnum="14" colname="b16" align="center" />
39 <colspec colnum="15" colname="b15" align="center" />
40 <colspec colnum="16" colname="b14" align="center" />
41 <colspec colnum="17" colname="b13" align="center" />
42 <colspec colnum="18" colname="b12" align="center" />
43 <colspec colnum="19" colname="b11" align="center" />
44 <colspec colnum="20" colname="b10" align="center" />
45
46 <colspec colnum="22" colname="b27" align="center" />
47 <colspec colnum="23" colname="b26" align="center" />
48 <colspec colnum="24" colname="b25" align="center" />
49 <colspec colnum="25" colname="b24" align="center" />
50 <colspec colnum="26" colname="b23" align="center" />
51 <colspec colnum="27" colname="b22" align="center" />
52 <colspec colnum="28" colname="b21" align="center" />
53 <colspec colnum="29" colname="b20" align="center" />
54
55 <colspec colnum="31" colname="b37" align="center" />
56 <colspec colnum="32" colname="b36" align="center" />
57 <colspec colnum="33" colname="b35" align="center" />
58 <colspec colnum="34" colname="b34" align="center" />
59 <colspec colnum="35" colname="b33" align="center" />
60 <colspec colnum="36" colname="b32" align="center" />
61 <colspec colnum="37" colname="b31" align="center" />
62 <colspec colnum="38" colname="b30" align="center" />
63
64 <spanspec namest="b07" nameend="b00" spanname="b0" />
65 <spanspec namest="b17" nameend="b10" spanname="b1" />
66 <spanspec namest="b27" nameend="b20" spanname="b2" />
67 <spanspec namest="b37" nameend="b30" spanname="b3" />
68 <thead>
69 <row>
70 <entry>Identifier</entry>
71 <entry>Code</entry>
72 <entry>&nbsp;</entry>
73 <entry spanname="b0">Byte&nbsp;0 in memory</entry>
74 <entry spanname="b1">Byte&nbsp;1</entry>
75 <entry spanname="b2">Byte&nbsp;2</entry>
76 <entry spanname="b3">Byte&nbsp;3</entry>
77 </row>
78 <row>
79 <entry>&nbsp;</entry>
80 <entry>&nbsp;</entry>
81 <entry>Bit</entry>
82 <entry>7</entry>
83 <entry>6</entry>
84 <entry>5</entry>
85 <entry>4</entry>
86 <entry>3</entry>
87 <entry>2</entry>
88 <entry>1</entry>
89 <entry>0</entry>
90 <entry>&nbsp;</entry>
91 <entry>7</entry>
92 <entry>6</entry>
93 <entry>5</entry>
94 <entry>4</entry>
95 <entry>3</entry>
96 <entry>2</entry>
97 <entry>1</entry>
98 <entry>0</entry>
99 <entry>&nbsp;</entry>
100 <entry>7</entry>
101 <entry>6</entry>
102 <entry>5</entry>
103 <entry>4</entry>
104 <entry>3</entry>
105 <entry>2</entry>
106 <entry>1</entry>
107 <entry>0</entry>
108 <entry>&nbsp;</entry>
109 <entry>7</entry>
110 <entry>6</entry>
111 <entry>5</entry>
112 <entry>4</entry>
113 <entry>3</entry>
114 <entry>2</entry>
115 <entry>1</entry>
116 <entry>0</entry>
117 </row>
118 </thead>
119 <tbody valign="top">
120 <row id="V4L2-PIX-FMT-RGB332">
121 <entry><constant>V4L2_PIX_FMT_RGB332</constant></entry>
122 <entry>'RGB1'</entry>
123 <entry></entry>
124 <entry>b<subscript>1</subscript></entry>
125 <entry>b<subscript>0</subscript></entry>
126 <entry>g<subscript>2</subscript></entry>
127 <entry>g<subscript>1</subscript></entry>
128 <entry>g<subscript>0</subscript></entry>
129 <entry>r<subscript>2</subscript></entry>
130 <entry>r<subscript>1</subscript></entry>
131 <entry>r<subscript>0</subscript></entry>
132 </row>
133 <row id="V4L2-PIX-FMT-RGB444">
134 <entry><constant>V4L2_PIX_FMT_RGB444</constant></entry>
135 <entry>'R444'</entry>
136 <entry></entry>
137 <entry>g<subscript>3</subscript></entry>
138 <entry>g<subscript>2</subscript></entry>
139 <entry>g<subscript>1</subscript></entry>
140 <entry>g<subscript>0</subscript></entry>
141 <entry>b<subscript>3</subscript></entry>
142 <entry>b<subscript>2</subscript></entry>
143 <entry>b<subscript>1</subscript></entry>
144 <entry>b<subscript>0</subscript></entry>
145 <entry></entry>
146 <entry>a<subscript>3</subscript></entry>
147 <entry>a<subscript>2</subscript></entry>
148 <entry>a<subscript>1</subscript></entry>
149 <entry>a<subscript>0</subscript></entry>
150 <entry>r<subscript>3</subscript></entry>
151 <entry>r<subscript>2</subscript></entry>
152 <entry>r<subscript>1</subscript></entry>
153 <entry>r<subscript>0</subscript></entry>
154 </row>
155 <row id="V4L2-PIX-FMT-RGB555">
156 <entry><constant>V4L2_PIX_FMT_RGB555</constant></entry>
157 <entry>'RGBO'</entry>
158 <entry></entry>
159 <entry>g<subscript>2</subscript></entry>
160 <entry>g<subscript>1</subscript></entry>
161 <entry>g<subscript>0</subscript></entry>
162 <entry>r<subscript>4</subscript></entry>
163 <entry>r<subscript>3</subscript></entry>
164 <entry>r<subscript>2</subscript></entry>
165 <entry>r<subscript>1</subscript></entry>
166 <entry>r<subscript>0</subscript></entry>
167 <entry></entry>
168 <entry>a</entry>
169 <entry>b<subscript>4</subscript></entry>
170 <entry>b<subscript>3</subscript></entry>
171 <entry>b<subscript>2</subscript></entry>
172 <entry>b<subscript>1</subscript></entry>
173 <entry>b<subscript>0</subscript></entry>
174 <entry>g<subscript>4</subscript></entry>
175 <entry>g<subscript>3</subscript></entry>
176 </row>
177 <row id="V4L2-PIX-FMT-RGB565">
178 <entry><constant>V4L2_PIX_FMT_RGB565</constant></entry>
179 <entry>'RGBP'</entry>
180 <entry></entry>
181 <entry>g<subscript>2</subscript></entry>
182 <entry>g<subscript>1</subscript></entry>
183 <entry>g<subscript>0</subscript></entry>
184 <entry>r<subscript>4</subscript></entry>
185 <entry>r<subscript>3</subscript></entry>
186 <entry>r<subscript>2</subscript></entry>
187 <entry>r<subscript>1</subscript></entry>
188 <entry>r<subscript>0</subscript></entry>
189 <entry></entry>
190 <entry>b<subscript>4</subscript></entry>
191 <entry>b<subscript>3</subscript></entry>
192 <entry>b<subscript>2</subscript></entry>
193 <entry>b<subscript>1</subscript></entry>
194 <entry>b<subscript>0</subscript></entry>
195 <entry>g<subscript>5</subscript></entry>
196 <entry>g<subscript>4</subscript></entry>
197 <entry>g<subscript>3</subscript></entry>
198 </row>
199 <row id="V4L2-PIX-FMT-RGB555X">
200 <entry><constant>V4L2_PIX_FMT_RGB555X</constant></entry>
201 <entry>'RGBQ'</entry>
202 <entry></entry>
203 <entry>a</entry>
204 <entry>b<subscript>4</subscript></entry>
205 <entry>b<subscript>3</subscript></entry>
206 <entry>b<subscript>2</subscript></entry>
207 <entry>b<subscript>1</subscript></entry>
208 <entry>b<subscript>0</subscript></entry>
209 <entry>g<subscript>4</subscript></entry>
210 <entry>g<subscript>3</subscript></entry>
211 <entry></entry>
212 <entry>g<subscript>2</subscript></entry>
213 <entry>g<subscript>1</subscript></entry>
214 <entry>g<subscript>0</subscript></entry>
215 <entry>r<subscript>4</subscript></entry>
216 <entry>r<subscript>3</subscript></entry>
217 <entry>r<subscript>2</subscript></entry>
218 <entry>r<subscript>1</subscript></entry>
219 <entry>r<subscript>0</subscript></entry>
220 </row>
221 <row id="V4L2-PIX-FMT-RGB565X">
222 <entry><constant>V4L2_PIX_FMT_RGB565X</constant></entry>
223 <entry>'RGBR'</entry>
224 <entry></entry>
225 <entry>b<subscript>4</subscript></entry>
226 <entry>b<subscript>3</subscript></entry>
227 <entry>b<subscript>2</subscript></entry>
228 <entry>b<subscript>1</subscript></entry>
229 <entry>b<subscript>0</subscript></entry>
230 <entry>g<subscript>5</subscript></entry>
231 <entry>g<subscript>4</subscript></entry>
232 <entry>g<subscript>3</subscript></entry>
233 <entry></entry>
234 <entry>g<subscript>2</subscript></entry>
235 <entry>g<subscript>1</subscript></entry>
236 <entry>g<subscript>0</subscript></entry>
237 <entry>r<subscript>4</subscript></entry>
238 <entry>r<subscript>3</subscript></entry>
239 <entry>r<subscript>2</subscript></entry>
240 <entry>r<subscript>1</subscript></entry>
241 <entry>r<subscript>0</subscript></entry>
242 </row>
243 <row id="V4L2-PIX-FMT-BGR666">
244 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
245 <entry>'BGRH'</entry>
246 <entry></entry>
247 <entry>b<subscript>5</subscript></entry>
248 <entry>b<subscript>4</subscript></entry>
249 <entry>b<subscript>3</subscript></entry>
250 <entry>b<subscript>2</subscript></entry>
251 <entry>b<subscript>1</subscript></entry>
252 <entry>b<subscript>0</subscript></entry>
253 <entry>g<subscript>5</subscript></entry>
254 <entry>g<subscript>4</subscript></entry>
255 <entry></entry>
256 <entry>g<subscript>3</subscript></entry>
257 <entry>g<subscript>2</subscript></entry>
258 <entry>g<subscript>1</subscript></entry>
259 <entry>g<subscript>0</subscript></entry>
260 <entry>r<subscript>5</subscript></entry>
261 <entry>r<subscript>4</subscript></entry>
262 <entry>r<subscript>3</subscript></entry>
263 <entry>r<subscript>2</subscript></entry>
264 <entry></entry>
265 <entry>r<subscript>1</subscript></entry>
266 <entry>r<subscript>0</subscript></entry>
267 <entry></entry>
268 <entry></entry>
269 <entry></entry>
270 <entry></entry>
271 <entry></entry>
272 <entry></entry>
273 <entry></entry>
274 <entry></entry>
275 <entry></entry>
276 <entry></entry>
277 <entry></entry>
278 <entry></entry>
279 <entry></entry>
280 <entry></entry>
281 </row>
282 <row id="V4L2-PIX-FMT-BGR24">
283 <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
284 <entry>'BGR3'</entry>
285 <entry></entry>
286 <entry>b<subscript>7</subscript></entry>
287 <entry>b<subscript>6</subscript></entry>
288 <entry>b<subscript>5</subscript></entry>
289 <entry>b<subscript>4</subscript></entry>
290 <entry>b<subscript>3</subscript></entry>
291 <entry>b<subscript>2</subscript></entry>
292 <entry>b<subscript>1</subscript></entry>
293 <entry>b<subscript>0</subscript></entry>
294 <entry></entry>
295 <entry>g<subscript>7</subscript></entry>
296 <entry>g<subscript>6</subscript></entry>
297 <entry>g<subscript>5</subscript></entry>
298 <entry>g<subscript>4</subscript></entry>
299 <entry>g<subscript>3</subscript></entry>
300 <entry>g<subscript>2</subscript></entry>
301 <entry>g<subscript>1</subscript></entry>
302 <entry>g<subscript>0</subscript></entry>
303 <entry></entry>
304 <entry>r<subscript>7</subscript></entry>
305 <entry>r<subscript>6</subscript></entry>
306 <entry>r<subscript>5</subscript></entry>
307 <entry>r<subscript>4</subscript></entry>
308 <entry>r<subscript>3</subscript></entry>
309 <entry>r<subscript>2</subscript></entry>
310 <entry>r<subscript>1</subscript></entry>
311 <entry>r<subscript>0</subscript></entry>
312 </row>
313 <row id="V4L2-PIX-FMT-RGB24">
314 <entry><constant>V4L2_PIX_FMT_RGB24</constant></entry>
315 <entry>'RGB3'</entry>
316 <entry></entry>
317 <entry>r<subscript>7</subscript></entry>
318 <entry>r<subscript>6</subscript></entry>
319 <entry>r<subscript>5</subscript></entry>
320 <entry>r<subscript>4</subscript></entry>
321 <entry>r<subscript>3</subscript></entry>
322 <entry>r<subscript>2</subscript></entry>
323 <entry>r<subscript>1</subscript></entry>
324 <entry>r<subscript>0</subscript></entry>
325 <entry></entry>
326 <entry>g<subscript>7</subscript></entry>
327 <entry>g<subscript>6</subscript></entry>
328 <entry>g<subscript>5</subscript></entry>
329 <entry>g<subscript>4</subscript></entry>
330 <entry>g<subscript>3</subscript></entry>
331 <entry>g<subscript>2</subscript></entry>
332 <entry>g<subscript>1</subscript></entry>
333 <entry>g<subscript>0</subscript></entry>
334 <entry></entry>
335 <entry>b<subscript>7</subscript></entry>
336 <entry>b<subscript>6</subscript></entry>
337 <entry>b<subscript>5</subscript></entry>
338 <entry>b<subscript>4</subscript></entry>
339 <entry>b<subscript>3</subscript></entry>
340 <entry>b<subscript>2</subscript></entry>
341 <entry>b<subscript>1</subscript></entry>
342 <entry>b<subscript>0</subscript></entry>
343 </row>
344 <row id="V4L2-PIX-FMT-BGR32">
345 <entry><constant>V4L2_PIX_FMT_BGR32</constant></entry>
346 <entry>'BGR4'</entry>
347 <entry></entry>
348 <entry>b<subscript>7</subscript></entry>
349 <entry>b<subscript>6</subscript></entry>
350 <entry>b<subscript>5</subscript></entry>
351 <entry>b<subscript>4</subscript></entry>
352 <entry>b<subscript>3</subscript></entry>
353 <entry>b<subscript>2</subscript></entry>
354 <entry>b<subscript>1</subscript></entry>
355 <entry>b<subscript>0</subscript></entry>
356 <entry></entry>
357 <entry>g<subscript>7</subscript></entry>
358 <entry>g<subscript>6</subscript></entry>
359 <entry>g<subscript>5</subscript></entry>
360 <entry>g<subscript>4</subscript></entry>
361 <entry>g<subscript>3</subscript></entry>
362 <entry>g<subscript>2</subscript></entry>
363 <entry>g<subscript>1</subscript></entry>
364 <entry>g<subscript>0</subscript></entry>
365 <entry></entry>
366 <entry>r<subscript>7</subscript></entry>
367 <entry>r<subscript>6</subscript></entry>
368 <entry>r<subscript>5</subscript></entry>
369 <entry>r<subscript>4</subscript></entry>
370 <entry>r<subscript>3</subscript></entry>
371 <entry>r<subscript>2</subscript></entry>
372 <entry>r<subscript>1</subscript></entry>
373 <entry>r<subscript>0</subscript></entry>
374 <entry></entry>
375 <entry>a<subscript>7</subscript></entry>
376 <entry>a<subscript>6</subscript></entry>
377 <entry>a<subscript>5</subscript></entry>
378 <entry>a<subscript>4</subscript></entry>
379 <entry>a<subscript>3</subscript></entry>
380 <entry>a<subscript>2</subscript></entry>
381 <entry>a<subscript>1</subscript></entry>
382 <entry>a<subscript>0</subscript></entry>
383 </row>
384 <row id="V4L2-PIX-FMT-RGB32">
385 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
386 <entry>'RGB4'</entry>
387 <entry></entry>
388 <entry>r<subscript>7</subscript></entry>
389 <entry>r<subscript>6</subscript></entry>
390 <entry>r<subscript>5</subscript></entry>
391 <entry>r<subscript>4</subscript></entry>
392 <entry>r<subscript>3</subscript></entry>
393 <entry>r<subscript>2</subscript></entry>
394 <entry>r<subscript>1</subscript></entry>
395 <entry>r<subscript>0</subscript></entry>
396 <entry></entry>
397 <entry>g<subscript>7</subscript></entry>
398 <entry>g<subscript>6</subscript></entry>
399 <entry>g<subscript>5</subscript></entry>
400 <entry>g<subscript>4</subscript></entry>
401 <entry>g<subscript>3</subscript></entry>
402 <entry>g<subscript>2</subscript></entry>
403 <entry>g<subscript>1</subscript></entry>
404 <entry>g<subscript>0</subscript></entry>
405 <entry></entry>
406 <entry>b<subscript>7</subscript></entry>
407 <entry>b<subscript>6</subscript></entry>
408 <entry>b<subscript>5</subscript></entry>
409 <entry>b<subscript>4</subscript></entry>
410 <entry>b<subscript>3</subscript></entry>
411 <entry>b<subscript>2</subscript></entry>
412 <entry>b<subscript>1</subscript></entry>
413 <entry>b<subscript>0</subscript></entry>
414 <entry></entry>
415 <entry>a<subscript>7</subscript></entry>
416 <entry>a<subscript>6</subscript></entry>
417 <entry>a<subscript>5</subscript></entry>
418 <entry>a<subscript>4</subscript></entry>
419 <entry>a<subscript>3</subscript></entry>
420 <entry>a<subscript>2</subscript></entry>
421 <entry>a<subscript>1</subscript></entry>
422 <entry>a<subscript>0</subscript></entry>
423 </row>
424 </tbody>
425 </tgroup>
426 </table>
427
428 <para>Bit 7 is the most significant bit. The value of a = alpha
429bits is undefined when reading from the driver, ignored when writing
430to the driver, except when alpha blending has been negotiated for a
431<link linkend="overlay">Video Overlay</link> or <link linkend="osd">
432Video Output Overlay</link> or when alpha component has been configured
433for a <link linkend="capture">Video Capture</link> by means of <link
434linkend="v4l2-alpha-component"> <constant>V4L2_CID_ALPHA_COMPONENT
435</constant> </link> control.</para>
436
437 <example>
438 <title><constant>V4L2_PIX_FMT_BGR24</constant> 4 &times; 4 pixel
439image</title>
440
441 <formalpara>
442 <title>Byte Order.</title>
443 <para>Each cell is one byte.
444 <informaltable frame="none">
445 <tgroup cols="13" align="center">
446 <colspec align="left" colwidth="2*" />
447 <tbody valign="top">
448 <row>
449 <entry>start&nbsp;+&nbsp;0:</entry>
450 <entry>B<subscript>00</subscript></entry>
451 <entry>G<subscript>00</subscript></entry>
452 <entry>R<subscript>00</subscript></entry>
453 <entry>B<subscript>01</subscript></entry>
454 <entry>G<subscript>01</subscript></entry>
455 <entry>R<subscript>01</subscript></entry>
456 <entry>B<subscript>02</subscript></entry>
457 <entry>G<subscript>02</subscript></entry>
458 <entry>R<subscript>02</subscript></entry>
459 <entry>B<subscript>03</subscript></entry>
460 <entry>G<subscript>03</subscript></entry>
461 <entry>R<subscript>03</subscript></entry>
462 </row>
463 <row>
464 <entry>start&nbsp;+&nbsp;12:</entry>
465 <entry>B<subscript>10</subscript></entry>
466 <entry>G<subscript>10</subscript></entry>
467 <entry>R<subscript>10</subscript></entry>
468 <entry>B<subscript>11</subscript></entry>
469 <entry>G<subscript>11</subscript></entry>
470 <entry>R<subscript>11</subscript></entry>
471 <entry>B<subscript>12</subscript></entry>
472 <entry>G<subscript>12</subscript></entry>
473 <entry>R<subscript>12</subscript></entry>
474 <entry>B<subscript>13</subscript></entry>
475 <entry>G<subscript>13</subscript></entry>
476 <entry>R<subscript>13</subscript></entry>
477 </row>
478 <row>
479 <entry>start&nbsp;+&nbsp;24:</entry>
480 <entry>B<subscript>20</subscript></entry>
481 <entry>G<subscript>20</subscript></entry>
482 <entry>R<subscript>20</subscript></entry>
483 <entry>B<subscript>21</subscript></entry>
484 <entry>G<subscript>21</subscript></entry>
485 <entry>R<subscript>21</subscript></entry>
486 <entry>B<subscript>22</subscript></entry>
487 <entry>G<subscript>22</subscript></entry>
488 <entry>R<subscript>22</subscript></entry>
489 <entry>B<subscript>23</subscript></entry>
490 <entry>G<subscript>23</subscript></entry>
491 <entry>R<subscript>23</subscript></entry>
492 </row>
493 <row>
494 <entry>start&nbsp;+&nbsp;36:</entry>
495 <entry>B<subscript>30</subscript></entry>
496 <entry>G<subscript>30</subscript></entry>
497 <entry>R<subscript>30</subscript></entry>
498 <entry>B<subscript>31</subscript></entry>
499 <entry>G<subscript>31</subscript></entry>
500 <entry>R<subscript>31</subscript></entry>
501 <entry>B<subscript>32</subscript></entry>
502 <entry>G<subscript>32</subscript></entry>
503 <entry>R<subscript>32</subscript></entry>
504 <entry>B<subscript>33</subscript></entry>
505 <entry>G<subscript>33</subscript></entry>
506 <entry>R<subscript>33</subscript></entry>
507 </row>
508 </tbody>
509 </tgroup>
510 </informaltable>
511 </para>
512 </formalpara>
513 </example>
514
515 <important>
516 <para>Drivers may interpret these formats differently.</para>
517 </important>
518
519 <para>Some RGB formats above are uncommon and were probably
520defined in error. Drivers may interpret them as in <xref
521 linkend="rgb-formats-corrected" />.</para>
522
523 <table pgwide="1" frame="none" id="rgb-formats-corrected">
524 <title>Packed RGB Image Formats (corrected)</title>
525 <tgroup cols="37" align="center">
526 <colspec colname="id" align="left" />
527 <colspec colname="fourcc" />
528 <colspec colname="bit" />
529
530 <colspec colnum="4" colname="b07" align="center" />
531 <colspec colnum="5" colname="b06" align="center" />
532 <colspec colnum="6" colname="b05" align="center" />
533 <colspec colnum="7" colname="b04" align="center" />
534 <colspec colnum="8" colname="b03" align="center" />
535 <colspec colnum="9" colname="b02" align="center" />
536 <colspec colnum="10" colname="b01" align="center" />
537 <colspec colnum="11" colname="b00" align="center" />
538
539 <colspec colnum="13" colname="b17" align="center" />
540 <colspec colnum="14" colname="b16" align="center" />
541 <colspec colnum="15" colname="b15" align="center" />
542 <colspec colnum="16" colname="b14" align="center" />
543 <colspec colnum="17" colname="b13" align="center" />
544 <colspec colnum="18" colname="b12" align="center" />
545 <colspec colnum="19" colname="b11" align="center" />
546 <colspec colnum="20" colname="b10" align="center" />
547
548 <colspec colnum="22" colname="b27" align="center" />
549 <colspec colnum="23" colname="b26" align="center" />
550 <colspec colnum="24" colname="b25" align="center" />
551 <colspec colnum="25" colname="b24" align="center" />
552 <colspec colnum="26" colname="b23" align="center" />
553 <colspec colnum="27" colname="b22" align="center" />
554 <colspec colnum="28" colname="b21" align="center" />
555 <colspec colnum="29" colname="b20" align="center" />
556
557 <colspec colnum="31" colname="b37" align="center" />
558 <colspec colnum="32" colname="b36" align="center" />
559 <colspec colnum="33" colname="b35" align="center" />
560 <colspec colnum="34" colname="b34" align="center" />
561 <colspec colnum="35" colname="b33" align="center" />
562 <colspec colnum="36" colname="b32" align="center" />
563 <colspec colnum="37" colname="b31" align="center" />
564 <colspec colnum="38" colname="b30" align="center" />
565
566 <spanspec namest="b07" nameend="b00" spanname="b0" />
567 <spanspec namest="b17" nameend="b10" spanname="b1" />
568 <spanspec namest="b27" nameend="b20" spanname="b2" />
569 <spanspec namest="b37" nameend="b30" spanname="b3" />
570 <thead>
571 <row>
572 <entry>Identifier</entry>
573 <entry>Code</entry>
574 <entry>&nbsp;</entry>
575 <entry spanname="b0">Byte&nbsp;0 in memory</entry>
576 <entry spanname="b1">Byte&nbsp;1</entry>
577 <entry spanname="b2">Byte&nbsp;2</entry>
578 <entry spanname="b3">Byte&nbsp;3</entry>
579 </row>
580 <row>
581 <entry>&nbsp;</entry>
582 <entry>&nbsp;</entry>
583 <entry>Bit</entry>
584 <entry>7</entry>
585 <entry>6</entry>
586 <entry>5</entry>
587 <entry>4</entry>
588 <entry>3</entry>
589 <entry>2</entry>
590 <entry>1</entry>
591 <entry>0</entry>
592 <entry>&nbsp;</entry>
593 <entry>7</entry>
594 <entry>6</entry>
595 <entry>5</entry>
596 <entry>4</entry>
597 <entry>3</entry>
598 <entry>2</entry>
599 <entry>1</entry>
600 <entry>0</entry>
601 <entry>&nbsp;</entry>
602 <entry>7</entry>
603 <entry>6</entry>
604 <entry>5</entry>
605 <entry>4</entry>
606 <entry>3</entry>
607 <entry>2</entry>
608 <entry>1</entry>
609 <entry>0</entry>
610 <entry>&nbsp;</entry>
611 <entry>7</entry>
612 <entry>6</entry>
613 <entry>5</entry>
614 <entry>4</entry>
615 <entry>3</entry>
616 <entry>2</entry>
617 <entry>1</entry>
618 <entry>0</entry>
619 </row>
620 </thead>
621 <tbody valign="top">
622 <row><!-- id="V4L2-PIX-FMT-RGB332" -->
623 <entry><constant>V4L2_PIX_FMT_RGB332</constant></entry>
624 <entry>'RGB1'</entry>
625 <entry></entry>
626 <entry>r<subscript>2</subscript></entry>
627 <entry>r<subscript>1</subscript></entry>
628 <entry>r<subscript>0</subscript></entry>
629 <entry>g<subscript>2</subscript></entry>
630 <entry>g<subscript>1</subscript></entry>
631 <entry>g<subscript>0</subscript></entry>
632 <entry>b<subscript>1</subscript></entry>
633 <entry>b<subscript>0</subscript></entry>
634 </row>
635 <row><!-- id="V4L2-PIX-FMT-RGB444" -->
636 <entry><constant>V4L2_PIX_FMT_RGB444</constant></entry>
637 <entry>'R444'</entry>
638 <entry></entry>
639 <entry>g<subscript>3</subscript></entry>
640 <entry>g<subscript>2</subscript></entry>
641 <entry>g<subscript>1</subscript></entry>
642 <entry>g<subscript>0</subscript></entry>
643 <entry>b<subscript>3</subscript></entry>
644 <entry>b<subscript>2</subscript></entry>
645 <entry>b<subscript>1</subscript></entry>
646 <entry>b<subscript>0</subscript></entry>
647 <entry></entry>
648 <entry>a<subscript>3</subscript></entry>
649 <entry>a<subscript>2</subscript></entry>
650 <entry>a<subscript>1</subscript></entry>
651 <entry>a<subscript>0</subscript></entry>
652 <entry>r<subscript>3</subscript></entry>
653 <entry>r<subscript>2</subscript></entry>
654 <entry>r<subscript>1</subscript></entry>
655 <entry>r<subscript>0</subscript></entry>
656 </row>
657 <row><!-- id="V4L2-PIX-FMT-RGB555" -->
658 <entry><constant>V4L2_PIX_FMT_RGB555</constant></entry>
659 <entry>'RGBO'</entry>
660 <entry></entry>
661 <entry>g<subscript>2</subscript></entry>
662 <entry>g<subscript>1</subscript></entry>
663 <entry>g<subscript>0</subscript></entry>
664 <entry>b<subscript>4</subscript></entry>
665 <entry>b<subscript>3</subscript></entry>
666 <entry>b<subscript>2</subscript></entry>
667 <entry>b<subscript>1</subscript></entry>
668 <entry>b<subscript>0</subscript></entry>
669 <entry></entry>
670 <entry>a</entry>
671 <entry>r<subscript>4</subscript></entry>
672 <entry>r<subscript>3</subscript></entry>
673 <entry>r<subscript>2</subscript></entry>
674 <entry>r<subscript>1</subscript></entry>
675 <entry>r<subscript>0</subscript></entry>
676 <entry>g<subscript>4</subscript></entry>
677 <entry>g<subscript>3</subscript></entry>
678 </row>
679 <row><!-- id="V4L2-PIX-FMT-RGB565" -->
680 <entry><constant>V4L2_PIX_FMT_RGB565</constant></entry>
681 <entry>'RGBP'</entry>
682 <entry></entry>
683 <entry>g<subscript>2</subscript></entry>
684 <entry>g<subscript>1</subscript></entry>
685 <entry>g<subscript>0</subscript></entry>
686 <entry>b<subscript>4</subscript></entry>
687 <entry>b<subscript>3</subscript></entry>
688 <entry>b<subscript>2</subscript></entry>
689 <entry>b<subscript>1</subscript></entry>
690 <entry>b<subscript>0</subscript></entry>
691 <entry></entry>
692 <entry>r<subscript>4</subscript></entry>
693 <entry>r<subscript>3</subscript></entry>
694 <entry>r<subscript>2</subscript></entry>
695 <entry>r<subscript>1</subscript></entry>
696 <entry>r<subscript>0</subscript></entry>
697 <entry>g<subscript>5</subscript></entry>
698 <entry>g<subscript>4</subscript></entry>
699 <entry>g<subscript>3</subscript></entry>
700 </row>
701 <row><!-- id="V4L2-PIX-FMT-RGB555X" -->
702 <entry><constant>V4L2_PIX_FMT_RGB555X</constant></entry>
703 <entry>'RGBQ'</entry>
704 <entry></entry>
705 <entry>a</entry>
706 <entry>r<subscript>4</subscript></entry>
707 <entry>r<subscript>3</subscript></entry>
708 <entry>r<subscript>2</subscript></entry>
709 <entry>r<subscript>1</subscript></entry>
710 <entry>r<subscript>0</subscript></entry>
711 <entry>g<subscript>4</subscript></entry>
712 <entry>g<subscript>3</subscript></entry>
713 <entry></entry>
714 <entry>g<subscript>2</subscript></entry>
715 <entry>g<subscript>1</subscript></entry>
716 <entry>g<subscript>0</subscript></entry>
717 <entry>b<subscript>4</subscript></entry>
718 <entry>b<subscript>3</subscript></entry>
719 <entry>b<subscript>2</subscript></entry>
720 <entry>b<subscript>1</subscript></entry>
721 <entry>b<subscript>0</subscript></entry>
722 </row>
723 <row><!-- id="V4L2-PIX-FMT-RGB565X" -->
724 <entry><constant>V4L2_PIX_FMT_RGB565X</constant></entry>
725 <entry>'RGBR'</entry>
726 <entry></entry>
727 <entry>r<subscript>4</subscript></entry>
728 <entry>r<subscript>3</subscript></entry>
729 <entry>r<subscript>2</subscript></entry>
730 <entry>r<subscript>1</subscript></entry>
731 <entry>r<subscript>0</subscript></entry>
732 <entry>g<subscript>5</subscript></entry>
733 <entry>g<subscript>4</subscript></entry>
734 <entry>g<subscript>3</subscript></entry>
735 <entry></entry>
736 <entry>g<subscript>2</subscript></entry>
737 <entry>g<subscript>1</subscript></entry>
738 <entry>g<subscript>0</subscript></entry>
739 <entry>b<subscript>4</subscript></entry>
740 <entry>b<subscript>3</subscript></entry>
741 <entry>b<subscript>2</subscript></entry>
742 <entry>b<subscript>1</subscript></entry>
743 <entry>b<subscript>0</subscript></entry>
744 </row>
745 <row><!-- id="V4L2-PIX-FMT-BGR666" -->
746 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
747 <entry>'BGRH'</entry>
748 <entry></entry>
749 <entry>b<subscript>5</subscript></entry>
750 <entry>b<subscript>4</subscript></entry>
751 <entry>b<subscript>3</subscript></entry>
752 <entry>b<subscript>2</subscript></entry>
753 <entry>b<subscript>1</subscript></entry>
754 <entry>b<subscript>0</subscript></entry>
755 <entry>g<subscript>5</subscript></entry>
756 <entry>g<subscript>4</subscript></entry>
757 <entry></entry>
758 <entry>g<subscript>3</subscript></entry>
759 <entry>g<subscript>2</subscript></entry>
760 <entry>g<subscript>1</subscript></entry>
761 <entry>g<subscript>0</subscript></entry>
762 <entry>r<subscript>5</subscript></entry>
763 <entry>r<subscript>4</subscript></entry>
764 <entry>r<subscript>3</subscript></entry>
765 <entry>r<subscript>2</subscript></entry>
766 <entry></entry>
767 <entry>r<subscript>1</subscript></entry>
768 <entry>r<subscript>0</subscript></entry>
769 <entry></entry>
770 <entry></entry>
771 <entry></entry>
772 <entry></entry>
773 <entry></entry>
774 <entry></entry>
775 <entry></entry>
776 <entry></entry>
777 <entry></entry>
778 <entry></entry>
779 <entry></entry>
780 <entry></entry>
781 <entry></entry>
782 <entry></entry>
783 </row>
784 <row><!-- id="V4L2-PIX-FMT-BGR24" -->
785 <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
786 <entry>'BGR3'</entry>
787 <entry></entry>
788 <entry>b<subscript>7</subscript></entry>
789 <entry>b<subscript>6</subscript></entry>
790 <entry>b<subscript>5</subscript></entry>
791 <entry>b<subscript>4</subscript></entry>
792 <entry>b<subscript>3</subscript></entry>
793 <entry>b<subscript>2</subscript></entry>
794 <entry>b<subscript>1</subscript></entry>
795 <entry>b<subscript>0</subscript></entry>
796 <entry></entry>
797 <entry>g<subscript>7</subscript></entry>
798 <entry>g<subscript>6</subscript></entry>
799 <entry>g<subscript>5</subscript></entry>
800 <entry>g<subscript>4</subscript></entry>
801 <entry>g<subscript>3</subscript></entry>
802 <entry>g<subscript>2</subscript></entry>
803 <entry>g<subscript>1</subscript></entry>
804 <entry>g<subscript>0</subscript></entry>
805 <entry></entry>
806 <entry>r<subscript>7</subscript></entry>
807 <entry>r<subscript>6</subscript></entry>
808 <entry>r<subscript>5</subscript></entry>
809 <entry>r<subscript>4</subscript></entry>
810 <entry>r<subscript>3</subscript></entry>
811 <entry>r<subscript>2</subscript></entry>
812 <entry>r<subscript>1</subscript></entry>
813 <entry>r<subscript>0</subscript></entry>
814 </row>
815 <row><!-- id="V4L2-PIX-FMT-RGB24" -->
816 <entry><constant>V4L2_PIX_FMT_RGB24</constant></entry>
817 <entry>'RGB3'</entry>
818 <entry></entry>
819 <entry>r<subscript>7</subscript></entry>
820 <entry>r<subscript>6</subscript></entry>
821 <entry>r<subscript>5</subscript></entry>
822 <entry>r<subscript>4</subscript></entry>
823 <entry>r<subscript>3</subscript></entry>
824 <entry>r<subscript>2</subscript></entry>
825 <entry>r<subscript>1</subscript></entry>
826 <entry>r<subscript>0</subscript></entry>
827 <entry></entry>
828 <entry>g<subscript>7</subscript></entry>
829 <entry>g<subscript>6</subscript></entry>
830 <entry>g<subscript>5</subscript></entry>
831 <entry>g<subscript>4</subscript></entry>
832 <entry>g<subscript>3</subscript></entry>
833 <entry>g<subscript>2</subscript></entry>
834 <entry>g<subscript>1</subscript></entry>
835 <entry>g<subscript>0</subscript></entry>
836 <entry></entry>
837 <entry>b<subscript>7</subscript></entry>
838 <entry>b<subscript>6</subscript></entry>
839 <entry>b<subscript>5</subscript></entry>
840 <entry>b<subscript>4</subscript></entry>
841 <entry>b<subscript>3</subscript></entry>
842 <entry>b<subscript>2</subscript></entry>
843 <entry>b<subscript>1</subscript></entry>
844 <entry>b<subscript>0</subscript></entry>
845 </row>
846 <row><!-- id="V4L2-PIX-FMT-BGR32" -->
847 <entry><constant>V4L2_PIX_FMT_BGR32</constant></entry>
848 <entry>'BGR4'</entry>
849 <entry></entry>
850 <entry>b<subscript>7</subscript></entry>
851 <entry>b<subscript>6</subscript></entry>
852 <entry>b<subscript>5</subscript></entry>
853 <entry>b<subscript>4</subscript></entry>
854 <entry>b<subscript>3</subscript></entry>
855 <entry>b<subscript>2</subscript></entry>
856 <entry>b<subscript>1</subscript></entry>
857 <entry>b<subscript>0</subscript></entry>
858 <entry></entry>
859 <entry>g<subscript>7</subscript></entry>
860 <entry>g<subscript>6</subscript></entry>
861 <entry>g<subscript>5</subscript></entry>
862 <entry>g<subscript>4</subscript></entry>
863 <entry>g<subscript>3</subscript></entry>
864 <entry>g<subscript>2</subscript></entry>
865 <entry>g<subscript>1</subscript></entry>
866 <entry>g<subscript>0</subscript></entry>
867 <entry></entry>
868 <entry>r<subscript>7</subscript></entry>
869 <entry>r<subscript>6</subscript></entry>
870 <entry>r<subscript>5</subscript></entry>
871 <entry>r<subscript>4</subscript></entry>
872 <entry>r<subscript>3</subscript></entry>
873 <entry>r<subscript>2</subscript></entry>
874 <entry>r<subscript>1</subscript></entry>
875 <entry>r<subscript>0</subscript></entry>
876 <entry></entry>
877 <entry>a<subscript>7</subscript></entry>
878 <entry>a<subscript>6</subscript></entry>
879 <entry>a<subscript>5</subscript></entry>
880 <entry>a<subscript>4</subscript></entry>
881 <entry>a<subscript>3</subscript></entry>
882 <entry>a<subscript>2</subscript></entry>
883 <entry>a<subscript>1</subscript></entry>
884 <entry>a<subscript>0</subscript></entry>
885 </row>
886 <row><!-- id="V4L2-PIX-FMT-RGB32" -->
887 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
888 <entry>'RGB4'</entry>
889 <entry></entry>
890 <entry>a<subscript>7</subscript></entry>
891 <entry>a<subscript>6</subscript></entry>
892 <entry>a<subscript>5</subscript></entry>
893 <entry>a<subscript>4</subscript></entry>
894 <entry>a<subscript>3</subscript></entry>
895 <entry>a<subscript>2</subscript></entry>
896 <entry>a<subscript>1</subscript></entry>
897 <entry>a<subscript>0</subscript></entry>
898 <entry></entry>
899 <entry>r<subscript>7</subscript></entry>
900 <entry>r<subscript>6</subscript></entry>
901 <entry>r<subscript>5</subscript></entry>
902 <entry>r<subscript>4</subscript></entry>
903 <entry>r<subscript>3</subscript></entry>
904 <entry>r<subscript>2</subscript></entry>
905 <entry>r<subscript>1</subscript></entry>
906 <entry>r<subscript>0</subscript></entry>
907 <entry></entry>
908 <entry>g<subscript>7</subscript></entry>
909 <entry>g<subscript>6</subscript></entry>
910 <entry>g<subscript>5</subscript></entry>
911 <entry>g<subscript>4</subscript></entry>
912 <entry>g<subscript>3</subscript></entry>
913 <entry>g<subscript>2</subscript></entry>
914 <entry>g<subscript>1</subscript></entry>
915 <entry>g<subscript>0</subscript></entry>
916 <entry></entry>
917 <entry>b<subscript>7</subscript></entry>
918 <entry>b<subscript>6</subscript></entry>
919 <entry>b<subscript>5</subscript></entry>
920 <entry>b<subscript>4</subscript></entry>
921 <entry>b<subscript>3</subscript></entry>
922 <entry>b<subscript>2</subscript></entry>
923 <entry>b<subscript>1</subscript></entry>
924 <entry>b<subscript>0</subscript></entry>
925 </row>
926 </tbody>
927 </tgroup>
928 </table>
929
930 <para>A test utility to determine which RGB formats a driver
931actually supports is available from the LinuxTV v4l-dvb repository.
932See &v4l-dvb; for access instructions.</para>
933
934 </refsect1>
935 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml
new file mode 100644
index 00000000000..33fa5a47a86
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml
@@ -0,0 +1,236 @@
1<refentry id="packed-yuv">
2 <refmeta>
3 <refentrytitle>Packed YUV formats</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname>Packed YUV formats</refname>
8 <refpurpose>Packed YUV formats</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>Similar to the packed RGB formats these formats store
14the Y, Cb and Cr component of each pixel in one 16 or 32 bit
15word.</para>
16
17 <table pgwide="1" frame="none">
18 <title>Packed YUV Image Formats</title>
19 <tgroup cols="37" align="center">
20 <colspec colname="id" align="left" />
21 <colspec colname="fourcc" />
22 <colspec colname="bit" />
23
24 <colspec colnum="4" colname="b07" align="center" />
25 <colspec colnum="5" colname="b06" align="center" />
26 <colspec colnum="6" colname="b05" align="center" />
27 <colspec colnum="7" colname="b04" align="center" />
28 <colspec colnum="8" colname="b03" align="center" />
29 <colspec colnum="9" colname="b02" align="center" />
30 <colspec colnum="10" colname="b01" align="center" />
31 <colspec colnum="11" colname="b00" align="center" />
32
33 <colspec colnum="13" colname="b17" align="center" />
34 <colspec colnum="14" colname="b16" align="center" />
35 <colspec colnum="15" colname="b15" align="center" />
36 <colspec colnum="16" colname="b14" align="center" />
37 <colspec colnum="17" colname="b13" align="center" />
38 <colspec colnum="18" colname="b12" align="center" />
39 <colspec colnum="19" colname="b11" align="center" />
40 <colspec colnum="20" colname="b10" align="center" />
41
42 <colspec colnum="22" colname="b27" align="center" />
43 <colspec colnum="23" colname="b26" align="center" />
44 <colspec colnum="24" colname="b25" align="center" />
45 <colspec colnum="25" colname="b24" align="center" />
46 <colspec colnum="26" colname="b23" align="center" />
47 <colspec colnum="27" colname="b22" align="center" />
48 <colspec colnum="28" colname="b21" align="center" />
49 <colspec colnum="29" colname="b20" align="center" />
50
51 <colspec colnum="31" colname="b37" align="center" />
52 <colspec colnum="32" colname="b36" align="center" />
53 <colspec colnum="33" colname="b35" align="center" />
54 <colspec colnum="34" colname="b34" align="center" />
55 <colspec colnum="35" colname="b33" align="center" />
56 <colspec colnum="36" colname="b32" align="center" />
57 <colspec colnum="37" colname="b31" align="center" />
58 <colspec colnum="38" colname="b30" align="center" />
59
60 <spanspec namest="b07" nameend="b00" spanname="b0" />
61 <spanspec namest="b17" nameend="b10" spanname="b1" />
62 <spanspec namest="b27" nameend="b20" spanname="b2" />
63 <spanspec namest="b37" nameend="b30" spanname="b3" />
64 <thead>
65 <row>
66 <entry>Identifier</entry>
67 <entry>Code</entry>
68 <entry>&nbsp;</entry>
69 <entry spanname="b0">Byte&nbsp;0 in memory</entry>
70 <entry spanname="b1">Byte&nbsp;1</entry>
71 <entry spanname="b2">Byte&nbsp;2</entry>
72 <entry spanname="b3">Byte&nbsp;3</entry>
73 </row>
74 <row>
75 <entry>&nbsp;</entry>
76 <entry>&nbsp;</entry>
77 <entry>Bit</entry>
78 <entry>7</entry>
79 <entry>6</entry>
80 <entry>5</entry>
81 <entry>4</entry>
82 <entry>3</entry>
83 <entry>2</entry>
84 <entry>1</entry>
85 <entry>0</entry>
86 <entry>&nbsp;</entry>
87 <entry>7</entry>
88 <entry>6</entry>
89 <entry>5</entry>
90 <entry>4</entry>
91 <entry>3</entry>
92 <entry>2</entry>
93 <entry>1</entry>
94 <entry>0</entry>
95 <entry>&nbsp;</entry>
96 <entry>7</entry>
97 <entry>6</entry>
98 <entry>5</entry>
99 <entry>4</entry>
100 <entry>3</entry>
101 <entry>2</entry>
102 <entry>1</entry>
103 <entry>0</entry>
104 <entry>&nbsp;</entry>
105 <entry>7</entry>
106 <entry>6</entry>
107 <entry>5</entry>
108 <entry>4</entry>
109 <entry>3</entry>
110 <entry>2</entry>
111 <entry>1</entry>
112 <entry>0</entry>
113 </row>
114 </thead>
115 <tbody valign="top">
116 <row id="V4L2-PIX-FMT-YUV444">
117 <entry><constant>V4L2_PIX_FMT_YUV444</constant></entry>
118 <entry>'Y444'</entry>
119 <entry></entry>
120 <entry>Cb<subscript>3</subscript></entry>
121 <entry>Cb<subscript>2</subscript></entry>
122 <entry>Cb<subscript>1</subscript></entry>
123 <entry>Cb<subscript>0</subscript></entry>
124 <entry>Cr<subscript>3</subscript></entry>
125 <entry>Cr<subscript>2</subscript></entry>
126 <entry>Cr<subscript>1</subscript></entry>
127 <entry>Cr<subscript>0</subscript></entry>
128 <entry></entry>
129 <entry>a<subscript>3</subscript></entry>
130 <entry>a<subscript>2</subscript></entry>
131 <entry>a<subscript>1</subscript></entry>
132 <entry>a<subscript>0</subscript></entry>
133 <entry>Y'<subscript>3</subscript></entry>
134 <entry>Y'<subscript>2</subscript></entry>
135 <entry>Y'<subscript>1</subscript></entry>
136 <entry>Y'<subscript>0</subscript></entry>
137 </row>
138
139 <row id="V4L2-PIX-FMT-YUV555">
140 <entry><constant>V4L2_PIX_FMT_YUV555</constant></entry>
141 <entry>'YUVO'</entry>
142 <entry></entry>
143 <entry>Cb<subscript>2</subscript></entry>
144 <entry>Cb<subscript>1</subscript></entry>
145 <entry>Cb<subscript>0</subscript></entry>
146 <entry>Cr<subscript>4</subscript></entry>
147 <entry>Cr<subscript>3</subscript></entry>
148 <entry>Cr<subscript>2</subscript></entry>
149 <entry>Cr<subscript>1</subscript></entry>
150 <entry>Cr<subscript>0</subscript></entry>
151 <entry></entry>
152 <entry>a</entry>
153 <entry>Y'<subscript>4</subscript></entry>
154 <entry>Y'<subscript>3</subscript></entry>
155 <entry>Y'<subscript>2</subscript></entry>
156 <entry>Y'<subscript>1</subscript></entry>
157 <entry>Y'<subscript>0</subscript></entry>
158 <entry>Cb<subscript>4</subscript></entry>
159 <entry>Cb<subscript>3</subscript></entry>
160 </row>
161
162 <row id="V4L2-PIX-FMT-YUV565">
163 <entry><constant>V4L2_PIX_FMT_YUV565</constant></entry>
164 <entry>'YUVP'</entry>
165 <entry></entry>
166 <entry>Cb<subscript>2</subscript></entry>
167 <entry>Cb<subscript>1</subscript></entry>
168 <entry>Cb<subscript>0</subscript></entry>
169 <entry>Cr<subscript>4</subscript></entry>
170 <entry>Cr<subscript>3</subscript></entry>
171 <entry>Cr<subscript>2</subscript></entry>
172 <entry>Cr<subscript>1</subscript></entry>
173 <entry>Cr<subscript>0</subscript></entry>
174 <entry></entry>
175 <entry>Y'<subscript>4</subscript></entry>
176 <entry>Y'<subscript>3</subscript></entry>
177 <entry>Y'<subscript>2</subscript></entry>
178 <entry>Y'<subscript>1</subscript></entry>
179 <entry>Y'<subscript>0</subscript></entry>
180 <entry>Cb<subscript>5</subscript></entry>
181 <entry>Cb<subscript>4</subscript></entry>
182 <entry>Cb<subscript>3</subscript></entry>
183 </row>
184
185 <row id="V4L2-PIX-FMT-YUV32">
186 <entry><constant>V4L2_PIX_FMT_YUV32</constant></entry>
187 <entry>'YUV4'</entry>
188 <entry></entry>
189 <entry>a<subscript>7</subscript></entry>
190 <entry>a<subscript>6</subscript></entry>
191 <entry>a<subscript>5</subscript></entry>
192 <entry>a<subscript>4</subscript></entry>
193 <entry>a<subscript>3</subscript></entry>
194 <entry>a<subscript>2</subscript></entry>
195 <entry>a<subscript>1</subscript></entry>
196 <entry>a<subscript>0</subscript></entry>
197 <entry></entry>
198 <entry>Y'<subscript>7</subscript></entry>
199 <entry>Y'<subscript>6</subscript></entry>
200 <entry>Y'<subscript>5</subscript></entry>
201 <entry>Y'<subscript>4</subscript></entry>
202 <entry>Y'<subscript>3</subscript></entry>
203 <entry>Y'<subscript>2</subscript></entry>
204 <entry>Y'<subscript>1</subscript></entry>
205 <entry>Y'<subscript>0</subscript></entry>
206 <entry></entry>
207 <entry>Cb<subscript>7</subscript></entry>
208 <entry>Cb<subscript>6</subscript></entry>
209 <entry>Cb<subscript>5</subscript></entry>
210 <entry>Cb<subscript>4</subscript></entry>
211 <entry>Cb<subscript>3</subscript></entry>
212 <entry>Cb<subscript>2</subscript></entry>
213 <entry>Cb<subscript>1</subscript></entry>
214 <entry>Cb<subscript>0</subscript></entry>
215 <entry></entry>
216 <entry>Cr<subscript>7</subscript></entry>
217 <entry>Cr<subscript>6</subscript></entry>
218 <entry>Cr<subscript>5</subscript></entry>
219 <entry>Cr<subscript>4</subscript></entry>
220 <entry>Cr<subscript>3</subscript></entry>
221 <entry>Cr<subscript>2</subscript></entry>
222 <entry>Cr<subscript>1</subscript></entry>
223 <entry>Cr<subscript>0</subscript></entry>
224 </row>
225 </tbody>
226 </tgroup>
227 </table>
228
229 <para>Bit 7 is the most significant bit. The value of a = alpha
230bits is undefined when reading from the driver, ignored when writing
231to the driver, except when alpha blending has been negotiated for a
232<link linkend="overlay">Video Overlay</link> or <link
233linkend="osd">Video Output Overlay</link>.</para>
234
235 </refsect1>
236 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
new file mode 100644
index 00000000000..6494b05d84a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
@@ -0,0 +1,83 @@
1<refentry id="V4L2-PIX-FMT-SBGGR16">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SBGGR16 ('BYR2')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This format is similar to <link
14linkend="V4L2-PIX-FMT-SBGGR8">
15<constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
16a depth of 16 bits. The least significant byte is stored at lower
17memory addresses (little-endian). Note the actual sampling precision
18may be lower than 16 bits, for example 10 bits per pixel with values
19in range 0 to 1023.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>B<subscript>00low</subscript></entry>
35 <entry>B<subscript>00high</subscript></entry>
36 <entry>G<subscript>01low</subscript></entry>
37 <entry>G<subscript>01high</subscript></entry>
38 <entry>B<subscript>02low</subscript></entry>
39 <entry>B<subscript>02high</subscript></entry>
40 <entry>G<subscript>03low</subscript></entry>
41 <entry>G<subscript>03high</subscript></entry>
42 </row>
43 <row>
44 <entry>start&nbsp;+&nbsp;8:</entry>
45 <entry>G<subscript>10low</subscript></entry>
46 <entry>G<subscript>10high</subscript></entry>
47 <entry>R<subscript>11low</subscript></entry>
48 <entry>R<subscript>11high</subscript></entry>
49 <entry>G<subscript>12low</subscript></entry>
50 <entry>G<subscript>12high</subscript></entry>
51 <entry>R<subscript>13low</subscript></entry>
52 <entry>R<subscript>13high</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;16:</entry>
56 <entry>B<subscript>20low</subscript></entry>
57 <entry>B<subscript>20high</subscript></entry>
58 <entry>G<subscript>21low</subscript></entry>
59 <entry>G<subscript>21high</subscript></entry>
60 <entry>B<subscript>22low</subscript></entry>
61 <entry>B<subscript>22high</subscript></entry>
62 <entry>G<subscript>23low</subscript></entry>
63 <entry>G<subscript>23high</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;24:</entry>
67 <entry>G<subscript>30low</subscript></entry>
68 <entry>G<subscript>30high</subscript></entry>
69 <entry>R<subscript>31low</subscript></entry>
70 <entry>R<subscript>31high</subscript></entry>
71 <entry>G<subscript>32low</subscript></entry>
72 <entry>G<subscript>32high</subscript></entry>
73 <entry>R<subscript>33low</subscript></entry>
74 <entry>R<subscript>33high</subscript></entry>
75 </row>
76 </tbody>
77 </tgroup>
78 </informaltable>
79 </para>
80 </formalpara>
81 </example>
82 </refsect1>
83</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml
new file mode 100644
index 00000000000..5eaf2b42d3f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SBGGR8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SBGGR8 ('BA81')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SBGGR8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a blue and green value, the second row of a green and
18red value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SBGGR8</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>B<subscript>00</subscript></entry>
35 <entry>G<subscript>01</subscript></entry>
36 <entry>B<subscript>02</subscript></entry>
37 <entry>G<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>G<subscript>10</subscript></entry>
42 <entry>R<subscript>11</subscript></entry>
43 <entry>G<subscript>12</subscript></entry>
44 <entry>R<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>B<subscript>20</subscript></entry>
49 <entry>G<subscript>21</subscript></entry>
50 <entry>B<subscript>22</subscript></entry>
51 <entry>G<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>G<subscript>30</subscript></entry>
56 <entry>R<subscript>31</subscript></entry>
57 <entry>G<subscript>32</subscript></entry>
58 <entry>R<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml b/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml
new file mode 100644
index 00000000000..fee65dca79c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SGBRG8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SGBRG8 ('GBRG')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SGBRG8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a green and blue value, the second row of a red and
18green value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SGBRG8</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>G<subscript>00</subscript></entry>
35 <entry>B<subscript>01</subscript></entry>
36 <entry>G<subscript>02</subscript></entry>
37 <entry>B<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>R<subscript>10</subscript></entry>
42 <entry>G<subscript>11</subscript></entry>
43 <entry>R<subscript>12</subscript></entry>
44 <entry>G<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>G<subscript>20</subscript></entry>
49 <entry>B<subscript>21</subscript></entry>
50 <entry>G<subscript>22</subscript></entry>
51 <entry>B<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>R<subscript>30</subscript></entry>
56 <entry>G<subscript>31</subscript></entry>
57 <entry>R<subscript>32</subscript></entry>
58 <entry>G<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml b/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml
new file mode 100644
index 00000000000..19727ab4c75
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SGRBG8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SGRBG8 ('GRBG')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SGRBG8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a green and blue value, the second row of a red and
18green value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SGRBG8</constant> 4 &times;
234 pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>G<subscript>00</subscript></entry>
35 <entry>R<subscript>01</subscript></entry>
36 <entry>G<subscript>02</subscript></entry>
37 <entry>R<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>R<subscript>10</subscript></entry>
42 <entry>B<subscript>11</subscript></entry>
43 <entry>R<subscript>12</subscript></entry>
44 <entry>B<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>G<subscript>20</subscript></entry>
49 <entry>R<subscript>21</subscript></entry>
50 <entry>G<subscript>22</subscript></entry>
51 <entry>R<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>R<subscript>30</subscript></entry>
56 <entry>B<subscript>31</subscript></entry>
57 <entry>R<subscript>32</subscript></entry>
58 <entry>B<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
new file mode 100644
index 00000000000..c1c62a9acc2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
@@ -0,0 +1,90 @@
1 <refentry id="pixfmt-srggb10">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB10 ('RG10'),
4 V4L2_PIX_FMT_SGRBG10 ('BA10'),
5 V4L2_PIX_FMT_SGBRG10 ('GB10'),
6 V4L2_PIX_FMT_SBGGR10 ('BG10'),
7 </refentrytitle>
8 &manvol;
9 </refmeta>
10 <refnamediv>
11 <refname id="V4L2-PIX-FMT-SRGGB10"><constant>V4L2_PIX_FMT_SRGGB10</constant></refname>
12 <refname id="V4L2-PIX-FMT-SGRBG10"><constant>V4L2_PIX_FMT_SGRBG10</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG10"><constant>V4L2_PIX_FMT_SGBRG10</constant></refname>
14 <refname id="V4L2-PIX-FMT-SBGGR10"><constant>V4L2_PIX_FMT_SBGGR10</constant></refname>
15 <refpurpose>10-bit Bayer formats expanded to 16 bits</refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>The following four pixel formats are raw sRGB / Bayer formats with
2110 bits per colour. Each colour component is stored in a 16-bit word, with 6
22unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
23and n/2 blue or red samples, with alternating red and blue rows. Bytes are
24stored in memory in little endian order. They are conventionally described
25as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
26formats</para>
27
28 <example>
29 <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
30pixel image</title>
31
32 <formalpara>
33 <title>Byte Order.</title>
34 <para>Each cell is one byte, high 6 bits in high bytes are 0.
35 <informaltable frame="none">
36 <tgroup cols="5" align="center">
37 <colspec align="left" colwidth="2*" />
38 <tbody valign="top">
39 <row>
40 <entry>start&nbsp;+&nbsp;0:</entry>
41 <entry>B<subscript>00low</subscript></entry>
42 <entry>B<subscript>00high</subscript></entry>
43 <entry>G<subscript>01low</subscript></entry>
44 <entry>G<subscript>01high</subscript></entry>
45 <entry>B<subscript>02low</subscript></entry>
46 <entry>B<subscript>02high</subscript></entry>
47 <entry>G<subscript>03low</subscript></entry>
48 <entry>G<subscript>03high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;8:</entry>
52 <entry>G<subscript>10low</subscript></entry>
53 <entry>G<subscript>10high</subscript></entry>
54 <entry>R<subscript>11low</subscript></entry>
55 <entry>R<subscript>11high</subscript></entry>
56 <entry>G<subscript>12low</subscript></entry>
57 <entry>G<subscript>12high</subscript></entry>
58 <entry>R<subscript>13low</subscript></entry>
59 <entry>R<subscript>13high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>B<subscript>20low</subscript></entry>
64 <entry>B<subscript>20high</subscript></entry>
65 <entry>G<subscript>21low</subscript></entry>
66 <entry>G<subscript>21high</subscript></entry>
67 <entry>B<subscript>22low</subscript></entry>
68 <entry>B<subscript>22high</subscript></entry>
69 <entry>G<subscript>23low</subscript></entry>
70 <entry>G<subscript>23high</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;24:</entry>
74 <entry>G<subscript>30low</subscript></entry>
75 <entry>G<subscript>30high</subscript></entry>
76 <entry>R<subscript>31low</subscript></entry>
77 <entry>R<subscript>31high</subscript></entry>
78 <entry>G<subscript>32low</subscript></entry>
79 <entry>G<subscript>32high</subscript></entry>
80 <entry>R<subscript>33low</subscript></entry>
81 <entry>R<subscript>33high</subscript></entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </informaltable>
86 </para>
87 </formalpara>
88 </example>
89 </refsect1>
90</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml
new file mode 100644
index 00000000000..2d3f0b1aefe
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml
@@ -0,0 +1,28 @@
1 <refentry id="pixfmt-srggb10dpcm8">
2 <refmeta>
3 <refentrytitle>
4 V4L2_PIX_FMT_SBGGR10DPCM8 ('bBA8'),
5 V4L2_PIX_FMT_SGBRG10DPCM8 ('bGA8'),
6 V4L2_PIX_FMT_SGRBG10DPCM8 ('BD10'),
7 V4L2_PIX_FMT_SRGGB10DPCM8 ('bRA8'),
8 </refentrytitle>
9 &manvol;
10 </refmeta>
11 <refnamediv>
12 <refname id="V4L2-PIX-FMT-SBGGR10DPCM8"><constant>V4L2_PIX_FMT_SBGGR10DPCM8</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG10DPCM8"><constant>V4L2_PIX_FMT_SGBRG10DPCM8</constant></refname>
14 <refname id="V4L2-PIX-FMT-SGRBG10DPCM8"><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></refname>
15 <refname id="V4L2-PIX-FMT-SRGGB10DPCM8"><constant>V4L2_PIX_FMT_SRGGB10DPCM8</constant></refname>
16 <refpurpose>10-bit Bayer formats compressed to 8 bits</refpurpose>
17 </refnamediv>
18 <refsect1>
19 <title>Description</title>
20
21 <para>The following four pixel formats are raw sRGB / Bayer formats
22 with 10 bits per colour compressed to 8 bits each, using DPCM
23 compression. DPCM, differential pulse-code modulation, is lossy.
24 Each colour component consumes 8 bits of memory. In other respects
25 this format is similar to <xref linkend="pixfmt-srggb10" />.</para>
26
27 </refsect1>
28 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
new file mode 100644
index 00000000000..9ba4fb690bc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
@@ -0,0 +1,90 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB12 ('RG12'),
4 V4L2_PIX_FMT_SGRBG12 ('BA12'),
5 V4L2_PIX_FMT_SGBRG12 ('GB12'),
6 V4L2_PIX_FMT_SBGGR12 ('BG12'),
7 </refentrytitle>
8 &manvol;
9 </refmeta>
10 <refnamediv>
11 <refname id="V4L2-PIX-FMT-SRGGB12"><constant>V4L2_PIX_FMT_SRGGB12</constant></refname>
12 <refname id="V4L2-PIX-FMT-SGRBG12"><constant>V4L2_PIX_FMT_SGRBG12</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG12"><constant>V4L2_PIX_FMT_SGBRG12</constant></refname>
14 <refname id="V4L2-PIX-FMT-SBGGR12"><constant>V4L2_PIX_FMT_SBGGR12</constant></refname>
15 <refpurpose>12-bit Bayer formats expanded to 16 bits</refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>The following four pixel formats are raw sRGB / Bayer formats with
2112 bits per colour. Each colour component is stored in a 16-bit word, with 6
22unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
23and n/2 blue or red samples, with alternating red and blue rows. Bytes are
24stored in memory in little endian order. They are conventionally described
25as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
26formats</para>
27
28 <example>
29 <title><constant>V4L2_PIX_FMT_SBGGR12</constant> 4 &times; 4
30pixel image</title>
31
32 <formalpara>
33 <title>Byte Order.</title>
34 <para>Each cell is one byte, high 6 bits in high bytes are 0.
35 <informaltable frame="none">
36 <tgroup cols="5" align="center">
37 <colspec align="left" colwidth="2*" />
38 <tbody valign="top">
39 <row>
40 <entry>start&nbsp;+&nbsp;0:</entry>
41 <entry>B<subscript>00low</subscript></entry>
42 <entry>B<subscript>00high</subscript></entry>
43 <entry>G<subscript>01low</subscript></entry>
44 <entry>G<subscript>01high</subscript></entry>
45 <entry>B<subscript>02low</subscript></entry>
46 <entry>B<subscript>02high</subscript></entry>
47 <entry>G<subscript>03low</subscript></entry>
48 <entry>G<subscript>03high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;8:</entry>
52 <entry>G<subscript>10low</subscript></entry>
53 <entry>G<subscript>10high</subscript></entry>
54 <entry>R<subscript>11low</subscript></entry>
55 <entry>R<subscript>11high</subscript></entry>
56 <entry>G<subscript>12low</subscript></entry>
57 <entry>G<subscript>12high</subscript></entry>
58 <entry>R<subscript>13low</subscript></entry>
59 <entry>R<subscript>13high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>B<subscript>20low</subscript></entry>
64 <entry>B<subscript>20high</subscript></entry>
65 <entry>G<subscript>21low</subscript></entry>
66 <entry>G<subscript>21high</subscript></entry>
67 <entry>B<subscript>22low</subscript></entry>
68 <entry>B<subscript>22high</subscript></entry>
69 <entry>G<subscript>23low</subscript></entry>
70 <entry>G<subscript>23high</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;24:</entry>
74 <entry>G<subscript>30low</subscript></entry>
75 <entry>G<subscript>30high</subscript></entry>
76 <entry>R<subscript>31low</subscript></entry>
77 <entry>R<subscript>31high</subscript></entry>
78 <entry>G<subscript>32low</subscript></entry>
79 <entry>G<subscript>32high</subscript></entry>
80 <entry>R<subscript>33low</subscript></entry>
81 <entry>R<subscript>33high</subscript></entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </informaltable>
86 </para>
87 </formalpara>
88 </example>
89 </refsect1>
90</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb8.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb8.xml
new file mode 100644
index 00000000000..2570e3be3cf
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SRGGB8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB8 ('RGGB')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SRGGB8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a red and green value, the second row of a green and
18blue value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SRGGB8</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>R<subscript>00</subscript></entry>
35 <entry>G<subscript>01</subscript></entry>
36 <entry>R<subscript>02</subscript></entry>
37 <entry>G<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>G<subscript>10</subscript></entry>
42 <entry>B<subscript>11</subscript></entry>
43 <entry>G<subscript>12</subscript></entry>
44 <entry>B<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>R<subscript>20</subscript></entry>
49 <entry>G<subscript>21</subscript></entry>
50 <entry>R<subscript>22</subscript></entry>
51 <entry>G<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>G<subscript>30</subscript></entry>
56 <entry>B<subscript>31</subscript></entry>
57 <entry>G<subscript>32</subscript></entry>
58 <entry>B<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml b/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml
new file mode 100644
index 00000000000..b1f6801a17f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml
@@ -0,0 +1,120 @@
1 <refentry id="V4L2-PIX-FMT-UYVY">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_UYVY ('UYVY')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_UYVY</constant></refname>
8 <refpurpose>Variation of
9<constant>V4L2_PIX_FMT_YUYV</constant> with different order of samples
10in memory</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>In this format each four bytes is two pixels. Each four
16bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
17the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
18components have half the horizontal resolution of the Y
19component.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_UYVY</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="9" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>Cb<subscript>00</subscript></entry>
35 <entry>Y'<subscript>00</subscript></entry>
36 <entry>Cr<subscript>00</subscript></entry>
37 <entry>Y'<subscript>01</subscript></entry>
38 <entry>Cb<subscript>01</subscript></entry>
39 <entry>Y'<subscript>02</subscript></entry>
40 <entry>Cr<subscript>01</subscript></entry>
41 <entry>Y'<subscript>03</subscript></entry>
42 </row>
43 <row>
44 <entry>start&nbsp;+&nbsp;8:</entry>
45 <entry>Cb<subscript>10</subscript></entry>
46 <entry>Y'<subscript>10</subscript></entry>
47 <entry>Cr<subscript>10</subscript></entry>
48 <entry>Y'<subscript>11</subscript></entry>
49 <entry>Cb<subscript>11</subscript></entry>
50 <entry>Y'<subscript>12</subscript></entry>
51 <entry>Cr<subscript>11</subscript></entry>
52 <entry>Y'<subscript>13</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;16:</entry>
56 <entry>Cb<subscript>20</subscript></entry>
57 <entry>Y'<subscript>20</subscript></entry>
58 <entry>Cr<subscript>20</subscript></entry>
59 <entry>Y'<subscript>21</subscript></entry>
60 <entry>Cb<subscript>21</subscript></entry>
61 <entry>Y'<subscript>22</subscript></entry>
62 <entry>Cr<subscript>21</subscript></entry>
63 <entry>Y'<subscript>23</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;24:</entry>
67 <entry>Cb<subscript>30</subscript></entry>
68 <entry>Y'<subscript>30</subscript></entry>
69 <entry>Cr<subscript>30</subscript></entry>
70 <entry>Y'<subscript>31</subscript></entry>
71 <entry>Cb<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Cr<subscript>31</subscript></entry>
74 <entry>Y'<subscript>33</subscript></entry>
75 </row>
76 </tbody>
77 </tgroup>
78 </informaltable>
79 </para>
80 </formalpara>
81
82 <formalpara>
83 <title>Color Sample Location.</title>
84 <para>
85 <informaltable frame="none">
86 <tgroup cols="7" align="center">
87 <tbody valign="top">
88 <row>
89 <entry></entry>
90 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
91 <entry>2</entry><entry></entry><entry>3</entry>
92 </row>
93 <row>
94 <entry>0</entry>
95 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
96 <entry>Y</entry><entry>C</entry><entry>Y</entry>
97 </row>
98 <row>
99 <entry>1</entry>
100 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
101 <entry>Y</entry><entry>C</entry><entry>Y</entry>
102 </row>
103 <row>
104 <entry>2</entry>
105 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry>C</entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry>3</entry>
110 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
111 <entry>Y</entry><entry>C</entry><entry>Y</entry>
112 </row>
113 </tbody>
114 </tgroup>
115 </informaltable>
116 </para>
117 </formalpara>
118 </example>
119 </refsect1>
120 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml b/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml
new file mode 100644
index 00000000000..82803408b38
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml
@@ -0,0 +1,120 @@
1 <refentry id="V4L2-PIX-FMT-VYUY">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_VYUY ('VYUY')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_VYUY</constant></refname>
8 <refpurpose>Variation of
9<constant>V4L2_PIX_FMT_YUYV</constant> with different order of samples
10in memory</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>In this format each four bytes is two pixels. Each four
16bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
17the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
18components have half the horizontal resolution of the Y
19component.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_VYUY</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="9" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>Cr<subscript>00</subscript></entry>
35 <entry>Y'<subscript>00</subscript></entry>
36 <entry>Cb<subscript>00</subscript></entry>
37 <entry>Y'<subscript>01</subscript></entry>
38 <entry>Cr<subscript>01</subscript></entry>
39 <entry>Y'<subscript>02</subscript></entry>
40 <entry>Cb<subscript>01</subscript></entry>
41 <entry>Y'<subscript>03</subscript></entry>
42 </row>
43 <row>
44 <entry>start&nbsp;+&nbsp;8:</entry>
45 <entry>Cr<subscript>10</subscript></entry>
46 <entry>Y'<subscript>10</subscript></entry>
47 <entry>Cb<subscript>10</subscript></entry>
48 <entry>Y'<subscript>11</subscript></entry>
49 <entry>Cr<subscript>11</subscript></entry>
50 <entry>Y'<subscript>12</subscript></entry>
51 <entry>Cb<subscript>11</subscript></entry>
52 <entry>Y'<subscript>13</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;16:</entry>
56 <entry>Cr<subscript>20</subscript></entry>
57 <entry>Y'<subscript>20</subscript></entry>
58 <entry>Cb<subscript>20</subscript></entry>
59 <entry>Y'<subscript>21</subscript></entry>
60 <entry>Cr<subscript>21</subscript></entry>
61 <entry>Y'<subscript>22</subscript></entry>
62 <entry>Cb<subscript>21</subscript></entry>
63 <entry>Y'<subscript>23</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;24:</entry>
67 <entry>Cr<subscript>30</subscript></entry>
68 <entry>Y'<subscript>30</subscript></entry>
69 <entry>Cb<subscript>30</subscript></entry>
70 <entry>Y'<subscript>31</subscript></entry>
71 <entry>Cr<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Cb<subscript>31</subscript></entry>
74 <entry>Y'<subscript>33</subscript></entry>
75 </row>
76 </tbody>
77 </tgroup>
78 </informaltable>
79 </para>
80 </formalpara>
81
82 <formalpara>
83 <title>Color Sample Location.</title>
84 <para>
85 <informaltable frame="none">
86 <tgroup cols="7" align="center">
87 <tbody valign="top">
88 <row>
89 <entry></entry>
90 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
91 <entry>2</entry><entry></entry><entry>3</entry>
92 </row>
93 <row>
94 <entry>0</entry>
95 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
96 <entry>Y</entry><entry>C</entry><entry>Y</entry>
97 </row>
98 <row>
99 <entry>1</entry>
100 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
101 <entry>Y</entry><entry>C</entry><entry>Y</entry>
102 </row>
103 <row>
104 <entry>2</entry>
105 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry>C</entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry>3</entry>
110 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
111 <entry>Y</entry><entry>C</entry><entry>Y</entry>
112 </row>
113 </tbody>
114 </tgroup>
115 </informaltable>
116 </para>
117 </formalpara>
118 </example>
119 </refsect1>
120 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y10.xml b/Documentation/DocBook/media/v4l/pixfmt-y10.xml
new file mode 100644
index 00000000000..d065043db8d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y10.xml
@@ -0,0 +1,79 @@
1<refentry id="V4L2-PIX-FMT-Y10">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y10 ('Y10 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y10</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 10 bits per pixel. Pixels
14are stored in 16-bit words with unused high bits padded with 0. The least
15significant byte is stored at lower memory addresses (little-endian).</para>
16
17 <example>
18 <title><constant>V4L2_PIX_FMT_Y10</constant> 4 &times; 4
19pixel image</title>
20
21 <formalpara>
22 <title>Byte Order.</title>
23 <para>Each cell is one byte.
24 <informaltable frame="none">
25 <tgroup cols="9" align="center">
26 <colspec align="left" colwidth="2*" />
27 <tbody valign="top">
28 <row>
29 <entry>start&nbsp;+&nbsp;0:</entry>
30 <entry>Y'<subscript>00low</subscript></entry>
31 <entry>Y'<subscript>00high</subscript></entry>
32 <entry>Y'<subscript>01low</subscript></entry>
33 <entry>Y'<subscript>01high</subscript></entry>
34 <entry>Y'<subscript>02low</subscript></entry>
35 <entry>Y'<subscript>02high</subscript></entry>
36 <entry>Y'<subscript>03low</subscript></entry>
37 <entry>Y'<subscript>03high</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;8:</entry>
41 <entry>Y'<subscript>10low</subscript></entry>
42 <entry>Y'<subscript>10high</subscript></entry>
43 <entry>Y'<subscript>11low</subscript></entry>
44 <entry>Y'<subscript>11high</subscript></entry>
45 <entry>Y'<subscript>12low</subscript></entry>
46 <entry>Y'<subscript>12high</subscript></entry>
47 <entry>Y'<subscript>13low</subscript></entry>
48 <entry>Y'<subscript>13high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;16:</entry>
52 <entry>Y'<subscript>20low</subscript></entry>
53 <entry>Y'<subscript>20high</subscript></entry>
54 <entry>Y'<subscript>21low</subscript></entry>
55 <entry>Y'<subscript>21high</subscript></entry>
56 <entry>Y'<subscript>22low</subscript></entry>
57 <entry>Y'<subscript>22high</subscript></entry>
58 <entry>Y'<subscript>23low</subscript></entry>
59 <entry>Y'<subscript>23high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;24:</entry>
63 <entry>Y'<subscript>30low</subscript></entry>
64 <entry>Y'<subscript>30high</subscript></entry>
65 <entry>Y'<subscript>31low</subscript></entry>
66 <entry>Y'<subscript>31high</subscript></entry>
67 <entry>Y'<subscript>32low</subscript></entry>
68 <entry>Y'<subscript>32high</subscript></entry>
69 <entry>Y'<subscript>33low</subscript></entry>
70 <entry>Y'<subscript>33high</subscript></entry>
71 </row>
72 </tbody>
73 </tgroup>
74 </informaltable>
75 </para>
76 </formalpara>
77 </example>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y10b.xml b/Documentation/DocBook/media/v4l/pixfmt-y10b.xml
new file mode 100644
index 00000000000..adb0ad808c9
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y10b.xml
@@ -0,0 +1,43 @@
1<refentry id="V4L2-PIX-FMT-Y10BPACK">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y10BPACK ('Y10B')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y10BPACK</constant></refname>
8 <refpurpose>Grey-scale image as a bit-packed array</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a packed grey-scale image format with a depth of 10 bits per
14 pixel. Pixels are stored in a bit-packed array of 10bit bits per pixel,
15 with no padding between them and with the most significant bits coming
16 first from the left.</para>
17
18 <example>
19 <title><constant>V4L2_PIX_FMT_Y10BPACK</constant> 4 pixel data stream taking 5 bytes</title>
20
21 <formalpara>
22 <title>Bit-packed representation</title>
23 <para>pixels cross the byte boundary and have a ratio of 5 bytes for each 4
24 pixels.
25 <informaltable frame="all">
26 <tgroup cols="5" align="center">
27 <colspec align="left" colwidth="2*" />
28 <tbody valign="top">
29 <row>
30 <entry>Y'<subscript>00[9:2]</subscript></entry>
31 <entry>Y'<subscript>00[1:0]</subscript>Y'<subscript>01[9:4]</subscript></entry>
32 <entry>Y'<subscript>01[3:0]</subscript>Y'<subscript>02[9:6]</subscript></entry>
33 <entry>Y'<subscript>02[5:0]</subscript>Y'<subscript>03[9:8]</subscript></entry>
34 <entry>Y'<subscript>03[7:0]</subscript></entry>
35 </row>
36 </tbody>
37 </tgroup>
38 </informaltable>
39 </para>
40 </formalpara>
41 </example>
42 </refsect1>
43</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y12.xml b/Documentation/DocBook/media/v4l/pixfmt-y12.xml
new file mode 100644
index 00000000000..ff417b858cc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y12.xml
@@ -0,0 +1,79 @@
1<refentry id="V4L2-PIX-FMT-Y12">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y12 ('Y12 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y12</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 12 bits per pixel. Pixels
14are stored in 16-bit words with unused high bits padded with 0. The least
15significant byte is stored at lower memory addresses (little-endian).</para>
16
17 <example>
18 <title><constant>V4L2_PIX_FMT_Y12</constant> 4 &times; 4
19pixel image</title>
20
21 <formalpara>
22 <title>Byte Order.</title>
23 <para>Each cell is one byte.
24 <informaltable frame="none">
25 <tgroup cols="9" align="center">
26 <colspec align="left" colwidth="2*" />
27 <tbody valign="top">
28 <row>
29 <entry>start&nbsp;+&nbsp;0:</entry>
30 <entry>Y'<subscript>00low</subscript></entry>
31 <entry>Y'<subscript>00high</subscript></entry>
32 <entry>Y'<subscript>01low</subscript></entry>
33 <entry>Y'<subscript>01high</subscript></entry>
34 <entry>Y'<subscript>02low</subscript></entry>
35 <entry>Y'<subscript>02high</subscript></entry>
36 <entry>Y'<subscript>03low</subscript></entry>
37 <entry>Y'<subscript>03high</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;8:</entry>
41 <entry>Y'<subscript>10low</subscript></entry>
42 <entry>Y'<subscript>10high</subscript></entry>
43 <entry>Y'<subscript>11low</subscript></entry>
44 <entry>Y'<subscript>11high</subscript></entry>
45 <entry>Y'<subscript>12low</subscript></entry>
46 <entry>Y'<subscript>12high</subscript></entry>
47 <entry>Y'<subscript>13low</subscript></entry>
48 <entry>Y'<subscript>13high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;16:</entry>
52 <entry>Y'<subscript>20low</subscript></entry>
53 <entry>Y'<subscript>20high</subscript></entry>
54 <entry>Y'<subscript>21low</subscript></entry>
55 <entry>Y'<subscript>21high</subscript></entry>
56 <entry>Y'<subscript>22low</subscript></entry>
57 <entry>Y'<subscript>22high</subscript></entry>
58 <entry>Y'<subscript>23low</subscript></entry>
59 <entry>Y'<subscript>23high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;24:</entry>
63 <entry>Y'<subscript>30low</subscript></entry>
64 <entry>Y'<subscript>30high</subscript></entry>
65 <entry>Y'<subscript>31low</subscript></entry>
66 <entry>Y'<subscript>31high</subscript></entry>
67 <entry>Y'<subscript>32low</subscript></entry>
68 <entry>Y'<subscript>32high</subscript></entry>
69 <entry>Y'<subscript>33low</subscript></entry>
70 <entry>Y'<subscript>33high</subscript></entry>
71 </row>
72 </tbody>
73 </tgroup>
74 </informaltable>
75 </para>
76 </formalpara>
77 </example>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y16.xml b/Documentation/DocBook/media/v4l/pixfmt-y16.xml
new file mode 100644
index 00000000000..ff4f727d562
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y16.xml
@@ -0,0 +1,81 @@
1<refentry id="V4L2-PIX-FMT-Y16">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y16 ('Y16 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y16</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 16 bits per
14pixel. The least significant byte is stored at lower memory addresses
15(little-endian). Note the actual sampling precision may be lower than
1616 bits, for example 10 bits per pixel with values in range 0 to
171023.</para>
18
19 <example>
20 <title><constant>V4L2_PIX_FMT_Y16</constant> 4 &times; 4
21pixel image</title>
22
23 <formalpara>
24 <title>Byte Order.</title>
25 <para>Each cell is one byte.
26 <informaltable frame="none">
27 <tgroup cols="9" align="center">
28 <colspec align="left" colwidth="2*" />
29 <tbody valign="top">
30 <row>
31 <entry>start&nbsp;+&nbsp;0:</entry>
32 <entry>Y'<subscript>00low</subscript></entry>
33 <entry>Y'<subscript>00high</subscript></entry>
34 <entry>Y'<subscript>01low</subscript></entry>
35 <entry>Y'<subscript>01high</subscript></entry>
36 <entry>Y'<subscript>02low</subscript></entry>
37 <entry>Y'<subscript>02high</subscript></entry>
38 <entry>Y'<subscript>03low</subscript></entry>
39 <entry>Y'<subscript>03high</subscript></entry>
40 </row>
41 <row>
42 <entry>start&nbsp;+&nbsp;8:</entry>
43 <entry>Y'<subscript>10low</subscript></entry>
44 <entry>Y'<subscript>10high</subscript></entry>
45 <entry>Y'<subscript>11low</subscript></entry>
46 <entry>Y'<subscript>11high</subscript></entry>
47 <entry>Y'<subscript>12low</subscript></entry>
48 <entry>Y'<subscript>12high</subscript></entry>
49 <entry>Y'<subscript>13low</subscript></entry>
50 <entry>Y'<subscript>13high</subscript></entry>
51 </row>
52 <row>
53 <entry>start&nbsp;+&nbsp;16:</entry>
54 <entry>Y'<subscript>20low</subscript></entry>
55 <entry>Y'<subscript>20high</subscript></entry>
56 <entry>Y'<subscript>21low</subscript></entry>
57 <entry>Y'<subscript>21high</subscript></entry>
58 <entry>Y'<subscript>22low</subscript></entry>
59 <entry>Y'<subscript>22high</subscript></entry>
60 <entry>Y'<subscript>23low</subscript></entry>
61 <entry>Y'<subscript>23high</subscript></entry>
62 </row>
63 <row>
64 <entry>start&nbsp;+&nbsp;24:</entry>
65 <entry>Y'<subscript>30low</subscript></entry>
66 <entry>Y'<subscript>30high</subscript></entry>
67 <entry>Y'<subscript>31low</subscript></entry>
68 <entry>Y'<subscript>31high</subscript></entry>
69 <entry>Y'<subscript>32low</subscript></entry>
70 <entry>Y'<subscript>32high</subscript></entry>
71 <entry>Y'<subscript>33low</subscript></entry>
72 <entry>Y'<subscript>33high</subscript></entry>
73 </row>
74 </tbody>
75 </tgroup>
76 </informaltable>
77 </para>
78 </formalpara>
79 </example>
80 </refsect1>
81</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y41p.xml b/Documentation/DocBook/media/v4l/pixfmt-y41p.xml
new file mode 100644
index 00000000000..98dcb91d291
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y41p.xml
@@ -0,0 +1,149 @@
1 <refentry id="V4L2-PIX-FMT-Y41P">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y41P ('Y41P')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y41P</constant></refname>
8 <refpurpose>Format with &frac14; horizontal chroma
9resolution, also known as YUV 4:1:1</refpurpose>
10 </refnamediv>
11 <refsect1>
12 <title>Description</title>
13
14 <para>In this format each 12 bytes is eight pixels. In the
15twelve bytes are two CbCr pairs and eight Y's. The first CbCr pair
16goes with the first four Y's, and the second CbCr pair goes with the
17other four Y's. The Cb and Cr components have one fourth the
18horizontal resolution of the Y component.</para>
19
20 <para>Do not confuse this format with <link
21linkend="V4L2-PIX-FMT-YUV411P"><constant>V4L2_PIX_FMT_YUV411P</constant></link>.
22Y41P is derived from "YUV 4:1:1 <emphasis>packed</emphasis>", while
23YUV411P stands for "YUV 4:1:1 <emphasis>planar</emphasis>".</para>
24
25 <example>
26 <title><constant>V4L2_PIX_FMT_Y41P</constant> 8 &times; 4
27pixel image</title>
28
29 <formalpara>
30 <title>Byte Order</title>
31 <para>Each cell is one byte.
32 <informaltable frame="none">
33 <tgroup cols="13" align="center">
34 <colspec align="left" colwidth="2*" />
35 <tbody valign="top">
36 <row>
37 <entry>start&nbsp;+&nbsp;0:</entry>
38 <entry>Cb<subscript>00</subscript></entry>
39 <entry>Y'<subscript>00</subscript></entry>
40 <entry>Cr<subscript>00</subscript></entry>
41 <entry>Y'<subscript>01</subscript></entry>
42 <entry>Cb<subscript>01</subscript></entry>
43 <entry>Y'<subscript>02</subscript></entry>
44 <entry>Cr<subscript>01</subscript></entry>
45 <entry>Y'<subscript>03</subscript></entry>
46 <entry>Y'<subscript>04</subscript></entry>
47 <entry>Y'<subscript>05</subscript></entry>
48 <entry>Y'<subscript>06</subscript></entry>
49 <entry>Y'<subscript>07</subscript></entry>
50 </row>
51 <row>
52 <entry>start&nbsp;+&nbsp;12:</entry>
53 <entry>Cb<subscript>10</subscript></entry>
54 <entry>Y'<subscript>10</subscript></entry>
55 <entry>Cr<subscript>10</subscript></entry>
56 <entry>Y'<subscript>11</subscript></entry>
57 <entry>Cb<subscript>11</subscript></entry>
58 <entry>Y'<subscript>12</subscript></entry>
59 <entry>Cr<subscript>11</subscript></entry>
60 <entry>Y'<subscript>13</subscript></entry>
61 <entry>Y'<subscript>14</subscript></entry>
62 <entry>Y'<subscript>15</subscript></entry>
63 <entry>Y'<subscript>16</subscript></entry>
64 <entry>Y'<subscript>17</subscript></entry>
65 </row>
66 <row>
67 <entry>start&nbsp;+&nbsp;24:</entry>
68 <entry>Cb<subscript>20</subscript></entry>
69 <entry>Y'<subscript>20</subscript></entry>
70 <entry>Cr<subscript>20</subscript></entry>
71 <entry>Y'<subscript>21</subscript></entry>
72 <entry>Cb<subscript>21</subscript></entry>
73 <entry>Y'<subscript>22</subscript></entry>
74 <entry>Cr<subscript>21</subscript></entry>
75 <entry>Y'<subscript>23</subscript></entry>
76 <entry>Y'<subscript>24</subscript></entry>
77 <entry>Y'<subscript>25</subscript></entry>
78 <entry>Y'<subscript>26</subscript></entry>
79 <entry>Y'<subscript>27</subscript></entry>
80 </row>
81 <row>
82 <entry>start&nbsp;+&nbsp;36:</entry>
83 <entry>Cb<subscript>30</subscript></entry>
84 <entry>Y'<subscript>30</subscript></entry>
85 <entry>Cr<subscript>30</subscript></entry>
86 <entry>Y'<subscript>31</subscript></entry>
87 <entry>Cb<subscript>31</subscript></entry>
88 <entry>Y'<subscript>32</subscript></entry>
89 <entry>Cr<subscript>31</subscript></entry>
90 <entry>Y'<subscript>33</subscript></entry>
91 <entry>Y'<subscript>34</subscript></entry>
92 <entry>Y'<subscript>35</subscript></entry>
93 <entry>Y'<subscript>36</subscript></entry>
94 <entry>Y'<subscript>37</subscript></entry>
95 </row>
96 </tbody>
97 </tgroup>
98 </informaltable></para>
99 </formalpara>
100
101 <formalpara>
102 <title>Color Sample Location.</title>
103 <para>
104 <informaltable frame="none">
105 <tgroup cols="15" align="center">
106 <tbody valign="top">
107 <row>
108 <entry></entry>
109 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
110 <entry>2</entry><entry></entry><entry>3</entry><entry></entry>
111 <entry>4</entry><entry></entry><entry>5</entry><entry></entry>
112 <entry>6</entry><entry></entry><entry>7</entry>
113 </row>
114 <row>
115 <entry>0</entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
117 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
118 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
119 <entry>Y</entry><entry></entry><entry>Y</entry>
120 </row>
121 <row>
122 <entry>1</entry>
123 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
124 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
125 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry>
127 </row>
128 <row>
129 <entry>2</entry>
130 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
131 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
132 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
133 <entry>Y</entry><entry></entry><entry>Y</entry>
134 </row>
135 <row>
136 <entry>3</entry>
137 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
138 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
139 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
140 <entry>Y</entry><entry></entry><entry>Y</entry>
141 </row>
142 </tbody>
143 </tgroup>
144 </informaltable>
145 </para>
146 </formalpara>
147 </example>
148 </refsect1>
149 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml
new file mode 100644
index 00000000000..0869dce5f92
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml
@@ -0,0 +1,133 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-YVU410"><constant>V4L2_PIX_FMT_YVU410</constant></refname>
8 <refname id="V4L2-PIX-FMT-YUV410"><constant>V4L2_PIX_FMT_YUV410</constant></refname>
9 <refpurpose>Planar formats with &frac14; horizontal and
10vertical chroma resolution, also known as YUV 4:1:0</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>These are planar formats, as opposed to a packed format.
16The three components are separated into three sub-images or planes.
17The Y plane is first. The Y plane has one byte per pixel. For
18<constant>V4L2_PIX_FMT_YVU410</constant>, the Cr plane immediately
19follows the Y plane in memory. The Cr plane is &frac14; the width and
20&frac14; the height of the Y plane (and of the image). Each Cr belongs
21to 16 pixels, a four-by-four square of the image. Following the Cr
22plane is the Cb plane, just like the Cr plane.
23<constant>V4L2_PIX_FMT_YUV410</constant> is the same, except the Cb
24plane comes first, then the Cr plane.</para>
25
26 <para>If the Y plane has pad bytes after each row, then the Cr
27and Cb planes have &frac14; as many pad bytes after their rows. In
28other words, four Cx rows (including padding) are exactly as long as
29one Y row (including padding).</para>
30
31 <example>
32 <title><constant>V4L2_PIX_FMT_YVU410</constant> 4 &times; 4
33pixel image</title>
34
35 <formalpara>
36 <title>Byte Order.</title>
37 <para>Each cell is one byte.
38 <informaltable frame="none">
39 <tgroup cols="5" align="center">
40 <colspec align="left" colwidth="2*" />
41 <tbody valign="top">
42 <row>
43 <entry>start&nbsp;+&nbsp;0:</entry>
44 <entry>Y'<subscript>00</subscript></entry>
45 <entry>Y'<subscript>01</subscript></entry>
46 <entry>Y'<subscript>02</subscript></entry>
47 <entry>Y'<subscript>03</subscript></entry>
48 </row>
49 <row>
50 <entry>start&nbsp;+&nbsp;4:</entry>
51 <entry>Y'<subscript>10</subscript></entry>
52 <entry>Y'<subscript>11</subscript></entry>
53 <entry>Y'<subscript>12</subscript></entry>
54 <entry>Y'<subscript>13</subscript></entry>
55 </row>
56 <row>
57 <entry>start&nbsp;+&nbsp;8:</entry>
58 <entry>Y'<subscript>20</subscript></entry>
59 <entry>Y'<subscript>21</subscript></entry>
60 <entry>Y'<subscript>22</subscript></entry>
61 <entry>Y'<subscript>23</subscript></entry>
62 </row>
63 <row>
64 <entry>start&nbsp;+&nbsp;12:</entry>
65 <entry>Y'<subscript>30</subscript></entry>
66 <entry>Y'<subscript>31</subscript></entry>
67 <entry>Y'<subscript>32</subscript></entry>
68 <entry>Y'<subscript>33</subscript></entry>
69 </row>
70 <row>
71 <entry>start&nbsp;+&nbsp;16:</entry>
72 <entry>Cr<subscript>00</subscript></entry>
73 </row>
74 <row>
75 <entry>start&nbsp;+&nbsp;17:</entry>
76 <entry>Cb<subscript>00</subscript></entry>
77 </row>
78 </tbody>
79 </tgroup>
80 </informaltable>
81 </para>
82 </formalpara>
83
84 <formalpara>
85 <title>Color Sample Location.</title>
86 <para>
87 <informaltable frame="none">
88 <tgroup cols="7" align="center">
89 <tbody valign="top">
90 <row>
91 <entry></entry>
92 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
93 <entry>2</entry><entry></entry><entry>3</entry>
94 </row>
95 <row>
96 <entry>0</entry>
97 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
98 <entry>Y</entry><entry></entry><entry>Y</entry>
99 </row>
100 <row>
101 <entry></entry>
102 </row>
103 <row>
104 <entry>1</entry>
105 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry></entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry></entry>
110 <entry></entry><entry></entry><entry></entry><entry>C</entry>
111 <entry></entry><entry></entry><entry></entry>
112 </row>
113 <row>
114 <entry>2</entry>
115 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry>
117 </row>
118 <row>
119 <entry></entry>
120 </row>
121 <row>
122 <entry>3</entry>
123 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
124 <entry>Y</entry><entry></entry><entry>Y</entry>
125 </row>
126 </tbody>
127 </tgroup>
128 </informaltable>
129 </para>
130 </formalpara>
131 </example>
132 </refsect1>
133 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml
new file mode 100644
index 00000000000..086dc731bf0
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml
@@ -0,0 +1,147 @@
1 <refentry id="V4L2-PIX-FMT-YUV411P">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YUV411P ('411P')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_YUV411P</constant></refname>
8 <refpurpose>Format with &frac14; horizontal chroma resolution,
9also known as YUV 4:1:1. Planar layout as opposed to
10<constant>V4L2_PIX_FMT_Y41P</constant></refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>This format is not commonly used. This is a planar
16format similar to the 4:2:2 planar format except with half as many
17chroma. The three components are separated into three sub-images or
18planes. The Y plane is first. The Y plane has one byte per pixel. The
19Cb plane immediately follows the Y plane in memory. The Cb plane is
20&frac14; the width of the Y plane (and of the image). Each Cb belongs
21to 4 pixels all on the same row. For example,
22Cb<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>02</subscript> and
24Y'<subscript>03</subscript>. Following the Cb plane is the Cr plane,
25just like the Cb plane.</para>
26
27 <para>If the Y plane has pad bytes after each row, then the Cr
28and Cb planes have &frac14; as many pad bytes after their rows. In
29other words, four C x rows (including padding) is exactly as long as
30one Y row (including padding).</para>
31
32 <example>
33 <title><constant>V4L2_PIX_FMT_YUV411P</constant> 4 &times; 4
34pixel image</title>
35
36 <formalpara>
37 <title>Byte Order.</title>
38 <para>Each cell is one byte.
39 <informaltable frame="none">
40 <tgroup cols="5" align="center">
41 <colspec align="left" colwidth="2*" />
42 <tbody valign="top">
43 <row>
44 <entry>start&nbsp;+&nbsp;0:</entry>
45 <entry>Y'<subscript>00</subscript></entry>
46 <entry>Y'<subscript>01</subscript></entry>
47 <entry>Y'<subscript>02</subscript></entry>
48 <entry>Y'<subscript>03</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;4:</entry>
52 <entry>Y'<subscript>10</subscript></entry>
53 <entry>Y'<subscript>11</subscript></entry>
54 <entry>Y'<subscript>12</subscript></entry>
55 <entry>Y'<subscript>13</subscript></entry>
56 </row>
57 <row>
58 <entry>start&nbsp;+&nbsp;8:</entry>
59 <entry>Y'<subscript>20</subscript></entry>
60 <entry>Y'<subscript>21</subscript></entry>
61 <entry>Y'<subscript>22</subscript></entry>
62 <entry>Y'<subscript>23</subscript></entry>
63 </row>
64 <row>
65 <entry>start&nbsp;+&nbsp;12:</entry>
66 <entry>Y'<subscript>30</subscript></entry>
67 <entry>Y'<subscript>31</subscript></entry>
68 <entry>Y'<subscript>32</subscript></entry>
69 <entry>Y'<subscript>33</subscript></entry>
70 </row>
71 <row>
72 <entry>start&nbsp;+&nbsp;16:</entry>
73 <entry>Cb<subscript>00</subscript></entry>
74 </row>
75 <row>
76 <entry>start&nbsp;+&nbsp;17:</entry>
77 <entry>Cb<subscript>10</subscript></entry>
78 </row>
79 <row>
80 <entry>start&nbsp;+&nbsp;18:</entry>
81 <entry>Cb<subscript>20</subscript></entry>
82 </row>
83 <row>
84 <entry>start&nbsp;+&nbsp;19:</entry>
85 <entry>Cb<subscript>30</subscript></entry>
86 </row>
87 <row>
88 <entry>start&nbsp;+&nbsp;20:</entry>
89 <entry>Cr<subscript>00</subscript></entry>
90 </row>
91 <row>
92 <entry>start&nbsp;+&nbsp;21:</entry>
93 <entry>Cr<subscript>10</subscript></entry>
94 </row>
95 <row>
96 <entry>start&nbsp;+&nbsp;22:</entry>
97 <entry>Cr<subscript>20</subscript></entry>
98 </row>
99 <row>
100 <entry>start&nbsp;+&nbsp;23:</entry>
101 <entry>Cr<subscript>30</subscript></entry>
102 </row>
103 </tbody>
104 </tgroup>
105 </informaltable>
106 </para>
107 </formalpara>
108
109 <formalpara>
110 <title>Color Sample Location.</title>
111 <para>
112 <informaltable frame="none">
113 <tgroup cols="7" align="center">
114 <tbody valign="top">
115 <row>
116 <entry></entry>
117 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
118 <entry>2</entry><entry></entry><entry>3</entry>
119 </row>
120 <row>
121 <entry>0</entry>
122 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
123 <entry>Y</entry><entry></entry><entry>Y</entry>
124 </row>
125 <row>
126 <entry>1</entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
128 <entry>Y</entry><entry></entry><entry>Y</entry>
129 </row>
130 <row>
131 <entry>2</entry>
132 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
133 <entry>Y</entry><entry></entry><entry>Y</entry>
134 </row>
135 <row>
136 <entry>3</entry>
137 <entry>Y</entry><entry></entry><entry>Y</entry><entry>C</entry>
138 <entry>Y</entry><entry></entry><entry>Y</entry>
139 </row>
140 </tbody>
141 </tgroup>
142 </informaltable>
143 </para>
144 </formalpara>
145 </example>
146 </refsect1>
147 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml
new file mode 100644
index 00000000000..48649fac159
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml
@@ -0,0 +1,149 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></refname>
8 <refname id="V4L2-PIX-FMT-YUV420"><constant>V4L2_PIX_FMT_YUV420</constant></refname>
9 <refpurpose>Planar formats with &frac12; horizontal and
10vertical chroma resolution, also known as YUV 4:2:0</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>These are planar formats, as opposed to a packed format.
16The three components are separated into three sub- images or planes.
17The Y plane is first. The Y plane has one byte per pixel. For
18<constant>V4L2_PIX_FMT_YVU420</constant>, the Cr plane immediately
19follows the Y plane in memory. The Cr plane is half the width and half
20the height of the Y plane (and of the image). Each Cr belongs to four
21pixels, a two-by-two square of the image. For example,
22Cr<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24Y'<subscript>11</subscript>. Following the Cr plane is the Cb plane,
25just like the Cr plane. <constant>V4L2_PIX_FMT_YUV420</constant> is
26the same except the Cb plane comes first, then the Cr plane.</para>
27
28 <para>If the Y plane has pad bytes after each row, then the Cr
29and Cb planes have half as many pad bytes after their rows. In other
30words, two Cx rows (including padding) is exactly as long as one Y row
31(including padding).</para>
32
33 <example>
34 <title><constant>V4L2_PIX_FMT_YVU420</constant> 4 &times; 4
35pixel image</title>
36
37 <formalpara>
38 <title>Byte Order.</title>
39 <para>Each cell is one byte.
40 <informaltable frame="none">
41 <tgroup cols="5" align="center">
42 <colspec align="left" colwidth="2*" />
43 <tbody valign="top">
44 <row>
45 <entry>start&nbsp;+&nbsp;0:</entry>
46 <entry>Y'<subscript>00</subscript></entry>
47 <entry>Y'<subscript>01</subscript></entry>
48 <entry>Y'<subscript>02</subscript></entry>
49 <entry>Y'<subscript>03</subscript></entry>
50 </row>
51 <row>
52 <entry>start&nbsp;+&nbsp;4:</entry>
53 <entry>Y'<subscript>10</subscript></entry>
54 <entry>Y'<subscript>11</subscript></entry>
55 <entry>Y'<subscript>12</subscript></entry>
56 <entry>Y'<subscript>13</subscript></entry>
57 </row>
58 <row>
59 <entry>start&nbsp;+&nbsp;8:</entry>
60 <entry>Y'<subscript>20</subscript></entry>
61 <entry>Y'<subscript>21</subscript></entry>
62 <entry>Y'<subscript>22</subscript></entry>
63 <entry>Y'<subscript>23</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;12:</entry>
67 <entry>Y'<subscript>30</subscript></entry>
68 <entry>Y'<subscript>31</subscript></entry>
69 <entry>Y'<subscript>32</subscript></entry>
70 <entry>Y'<subscript>33</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;16:</entry>
74 <entry>Cr<subscript>00</subscript></entry>
75 <entry>Cr<subscript>01</subscript></entry>
76 </row>
77 <row>
78 <entry>start&nbsp;+&nbsp;18:</entry>
79 <entry>Cr<subscript>10</subscript></entry>
80 <entry>Cr<subscript>11</subscript></entry>
81 </row>
82 <row>
83 <entry>start&nbsp;+&nbsp;20:</entry>
84 <entry>Cb<subscript>00</subscript></entry>
85 <entry>Cb<subscript>01</subscript></entry>
86 </row>
87 <row>
88 <entry>start&nbsp;+&nbsp;22:</entry>
89 <entry>Cb<subscript>10</subscript></entry>
90 <entry>Cb<subscript>11</subscript></entry>
91 </row>
92 </tbody>
93 </tgroup>
94 </informaltable>
95 </para>
96 </formalpara>
97
98 <formalpara>
99 <title>Color Sample Location.</title>
100 <para>
101 <informaltable frame="none">
102 <tgroup cols="7" align="center">
103 <tbody valign="top">
104 <row>
105 <entry></entry>
106 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
107 <entry>2</entry><entry></entry><entry>3</entry>
108 </row>
109 <row>
110 <entry>0</entry>
111 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
112 <entry>Y</entry><entry></entry><entry>Y</entry>
113 </row>
114 <row>
115 <entry></entry>
116 <entry></entry><entry>C</entry><entry></entry><entry></entry>
117 <entry></entry><entry>C</entry><entry></entry>
118 </row>
119 <row>
120 <entry>1</entry>
121 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
122 <entry>Y</entry><entry></entry><entry>Y</entry>
123 </row>
124 <row>
125 <entry></entry>
126 </row>
127 <row>
128 <entry>2</entry>
129 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
130 <entry>Y</entry><entry></entry><entry>Y</entry>
131 </row>
132 <row>
133 <entry></entry>
134 <entry></entry><entry>C</entry><entry></entry><entry></entry>
135 <entry></entry><entry>C</entry><entry></entry>
136 </row>
137 <row>
138 <entry>3</entry>
139 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
140 <entry>Y</entry><entry></entry><entry>Y</entry>
141 </row>
142 </tbody>
143 </tgroup>
144 </informaltable>
145 </para>
146 </formalpara>
147 </example>
148 </refsect1>
149 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml
new file mode 100644
index 00000000000..60308f1eefd
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml
@@ -0,0 +1,154 @@
1 <refentry id="V4L2-PIX-FMT-YUV420M">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YUV420M ('YM12')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname> <constant>V4L2_PIX_FMT_YUV420M</constant></refname>
8 <refpurpose>Variation of <constant>V4L2_PIX_FMT_YUV420</constant>
9 with planes non contiguous in memory. </refpurpose>
10 </refnamediv>
11
12 <refsect1>
13 <title>Description</title>
14
15 <para>This is a multi-planar format, as opposed to a packed format.
16The three components are separated into three sub- images or planes.
17
18The Y plane is first. The Y plane has one byte per pixel. The Cb data
19constitutes the second plane which is half the width and half
20the height of the Y plane (and of the image). Each Cb belongs to four
21pixels, a two-by-two square of the image. For example,
22Cb<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24Y'<subscript>11</subscript>. The Cr data, just like the Cb plane, is
25in the third plane. </para>
26
27 <para>If the Y plane has pad bytes after each row, then the Cb
28and Cr planes have half as many pad bytes after their rows. In other
29words, two Cx rows (including padding) is exactly as long as one Y row
30(including padding).</para>
31
32 <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be
33used only in drivers and applications that support the multi-planar API,
34described in <xref linkend="planar-apis"/>. </para>
35
36 <example>
37 <title><constant>V4L2_PIX_FMT_YVU420M</constant> 4 &times; 4
38pixel image</title>
39
40 <formalpara>
41 <title>Byte Order.</title>
42 <para>Each cell is one byte.
43 <informaltable frame="none">
44 <tgroup cols="5" align="center">
45 <colspec align="left" colwidth="2*" />
46 <tbody valign="top">
47 <row>
48 <entry>start0&nbsp;+&nbsp;0:</entry>
49 <entry>Y'<subscript>00</subscript></entry>
50 <entry>Y'<subscript>01</subscript></entry>
51 <entry>Y'<subscript>02</subscript></entry>
52 <entry>Y'<subscript>03</subscript></entry>
53 </row>
54 <row>
55 <entry>start0&nbsp;+&nbsp;4:</entry>
56 <entry>Y'<subscript>10</subscript></entry>
57 <entry>Y'<subscript>11</subscript></entry>
58 <entry>Y'<subscript>12</subscript></entry>
59 <entry>Y'<subscript>13</subscript></entry>
60 </row>
61 <row>
62 <entry>start0&nbsp;+&nbsp;8:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start0&nbsp;+&nbsp;12:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row><entry></entry></row>
76 <row>
77 <entry>start1&nbsp;+&nbsp;0:</entry>
78 <entry>Cb<subscript>00</subscript></entry>
79 <entry>Cb<subscript>01</subscript></entry>
80 </row>
81 <row>
82 <entry>start1&nbsp;+&nbsp;2:</entry>
83 <entry>Cb<subscript>10</subscript></entry>
84 <entry>Cb<subscript>11</subscript></entry>
85 </row>
86 <row><entry></entry></row>
87 <row>
88 <entry>start2&nbsp;+&nbsp;0:</entry>
89 <entry>Cr<subscript>00</subscript></entry>
90 <entry>Cr<subscript>01</subscript></entry>
91 </row>
92 <row>
93 <entry>start2&nbsp;+&nbsp;2:</entry>
94 <entry>Cr<subscript>10</subscript></entry>
95 <entry>Cr<subscript>11</subscript></entry>
96 </row>
97 </tbody>
98 </tgroup>
99 </informaltable>
100 </para>
101 </formalpara>
102
103 <formalpara>
104 <title>Color Sample Location.</title>
105 <para>
106 <informaltable frame="none">
107 <tgroup cols="7" align="center">
108 <tbody valign="top">
109 <row>
110 <entry></entry>
111 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
112 <entry>2</entry><entry></entry><entry>3</entry>
113 </row>
114 <row>
115 <entry>0</entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
117 <entry>Y</entry><entry></entry><entry>Y</entry>
118 </row>
119 <row>
120 <entry></entry>
121 <entry></entry><entry>C</entry><entry></entry><entry></entry>
122 <entry></entry><entry>C</entry><entry></entry>
123 </row>
124 <row>
125 <entry>1</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry>
128 </row>
129 <row>
130 <entry></entry>
131 </row>
132 <row>
133 <entry>2</entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
135 <entry>Y</entry><entry></entry><entry>Y</entry>
136 </row>
137 <row>
138 <entry></entry>
139 <entry></entry><entry>C</entry><entry></entry><entry></entry>
140 <entry></entry><entry>C</entry><entry></entry>
141 </row>
142 <row>
143 <entry>3</entry>
144 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
145 <entry>Y</entry><entry></entry><entry>Y</entry>
146 </row>
147 </tbody>
148 </tgroup>
149 </informaltable>
150 </para>
151 </formalpara>
152 </example>
153 </refsect1>
154 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml
new file mode 100644
index 00000000000..4ce6463fe0a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml
@@ -0,0 +1,153 @@
1 <refentry id="V4L2-PIX-FMT-YUV422P">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YUV422P ('422P')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_YUV422P</constant></refname>
8 <refpurpose>Format with &frac12; horizontal chroma resolution,
9also known as YUV 4:2:2. Planar layout as opposed to
10<constant>V4L2_PIX_FMT_YUYV</constant></refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>This format is not commonly used. This is a planar
16version of the YUYV format. The three components are separated into
17three sub-images or planes. The Y plane is first. The Y plane has one
18byte per pixel. The Cb plane immediately follows the Y plane in
19memory. The Cb plane is half the width of the Y plane (and of the
20image). Each Cb belongs to two pixels. For example,
21Cb<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
22Y'<subscript>01</subscript>. Following the Cb plane is the Cr plane,
23just like the Cb plane.</para>
24
25 <para>If the Y plane has pad bytes after each row, then the Cr
26and Cb planes have half as many pad bytes after their rows. In other
27words, two Cx rows (including padding) is exactly as long as one Y row
28(including padding).</para>
29
30 <example>
31 <title><constant>V4L2_PIX_FMT_YUV422P</constant> 4 &times; 4
32pixel image</title>
33
34 <formalpara>
35 <title>Byte Order.</title>
36 <para>Each cell is one byte.
37 <informaltable frame="none">
38 <tgroup cols="5" align="center">
39 <colspec align="left" colwidth="2*" />
40 <tbody valign="top">
41 <row>
42 <entry>start&nbsp;+&nbsp;0:</entry>
43 <entry>Y'<subscript>00</subscript></entry>
44 <entry>Y'<subscript>01</subscript></entry>
45 <entry>Y'<subscript>02</subscript></entry>
46 <entry>Y'<subscript>03</subscript></entry>
47 </row>
48 <row>
49 <entry>start&nbsp;+&nbsp;4:</entry>
50 <entry>Y'<subscript>10</subscript></entry>
51 <entry>Y'<subscript>11</subscript></entry>
52 <entry>Y'<subscript>12</subscript></entry>
53 <entry>Y'<subscript>13</subscript></entry>
54 </row>
55 <row>
56 <entry>start&nbsp;+&nbsp;8:</entry>
57 <entry>Y'<subscript>20</subscript></entry>
58 <entry>Y'<subscript>21</subscript></entry>
59 <entry>Y'<subscript>22</subscript></entry>
60 <entry>Y'<subscript>23</subscript></entry>
61 </row>
62 <row>
63 <entry>start&nbsp;+&nbsp;12:</entry>
64 <entry>Y'<subscript>30</subscript></entry>
65 <entry>Y'<subscript>31</subscript></entry>
66 <entry>Y'<subscript>32</subscript></entry>
67 <entry>Y'<subscript>33</subscript></entry>
68 </row>
69 <row>
70 <entry>start&nbsp;+&nbsp;16:</entry>
71 <entry>Cb<subscript>00</subscript></entry>
72 <entry>Cb<subscript>01</subscript></entry>
73 </row>
74 <row>
75 <entry>start&nbsp;+&nbsp;18:</entry>
76 <entry>Cb<subscript>10</subscript></entry>
77 <entry>Cb<subscript>11</subscript></entry>
78 </row>
79 <row>
80 <entry>start&nbsp;+&nbsp;20:</entry>
81 <entry>Cb<subscript>20</subscript></entry>
82 <entry>Cb<subscript>21</subscript></entry>
83 </row>
84 <row>
85 <entry>start&nbsp;+&nbsp;22:</entry>
86 <entry>Cb<subscript>30</subscript></entry>
87 <entry>Cb<subscript>31</subscript></entry>
88 </row>
89 <row>
90 <entry>start&nbsp;+&nbsp;24:</entry>
91 <entry>Cr<subscript>00</subscript></entry>
92 <entry>Cr<subscript>01</subscript></entry>
93 </row>
94 <row>
95 <entry>start&nbsp;+&nbsp;26:</entry>
96 <entry>Cr<subscript>10</subscript></entry>
97 <entry>Cr<subscript>11</subscript></entry>
98 </row>
99 <row>
100 <entry>start&nbsp;+&nbsp;28:</entry>
101 <entry>Cr<subscript>20</subscript></entry>
102 <entry>Cr<subscript>21</subscript></entry>
103 </row>
104 <row>
105 <entry>start&nbsp;+&nbsp;30:</entry>
106 <entry>Cr<subscript>30</subscript></entry>
107 <entry>Cr<subscript>31</subscript></entry>
108 </row>
109 </tbody>
110 </tgroup>
111 </informaltable>
112 </para>
113 </formalpara>
114
115 <formalpara>
116 <title>Color Sample Location.</title>
117 <para>
118 <informaltable frame="none">
119 <tgroup cols="7" align="center">
120 <tbody valign="top">
121 <row>
122 <entry></entry>
123 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
124 <entry>2</entry><entry></entry><entry>3</entry>
125 </row>
126 <row>
127 <entry>0</entry>
128 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
129 <entry>Y</entry><entry>C</entry><entry>Y</entry>
130 </row>
131 <row>
132 <entry>1</entry>
133 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
134 <entry>Y</entry><entry>C</entry><entry>Y</entry>
135 </row>
136 <row>
137 <entry>2</entry>
138 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
139 <entry>Y</entry><entry>C</entry><entry>Y</entry>
140 </row>
141 <row>
142 <entry>3</entry>
143 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
144 <entry>Y</entry><entry>C</entry><entry>Y</entry>
145 </row>
146 </tbody>
147 </tgroup>
148 </informaltable>
149 </para>
150 </formalpara>
151 </example>
152 </refsect1>
153 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml b/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml
new file mode 100644
index 00000000000..58384092251
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml
@@ -0,0 +1,120 @@
1 <refentry id="V4L2-PIX-FMT-YUYV">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YUYV ('YUYV')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_YUYV</constant></refname>
8 <refpurpose>Packed format with &frac12; horizontal chroma
9resolution, also known as YUV 4:2:2</refpurpose>
10 </refnamediv>
11 <refsect1>
12 <title>Description</title>
13
14 <para>In this format each four bytes is two pixels. Each four
15bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
16the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
17components have half the horizontal resolution of the Y component.
18<constant>V4L2_PIX_FMT_YUYV </constant> is known in the Windows
19environment as YUY2.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_YUYV</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="9" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>Y'<subscript>00</subscript></entry>
35 <entry>Cb<subscript>00</subscript></entry>
36 <entry>Y'<subscript>01</subscript></entry>
37 <entry>Cr<subscript>00</subscript></entry>
38 <entry>Y'<subscript>02</subscript></entry>
39 <entry>Cb<subscript>01</subscript></entry>
40 <entry>Y'<subscript>03</subscript></entry>
41 <entry>Cr<subscript>01</subscript></entry>
42 </row>
43 <row>
44 <entry>start&nbsp;+&nbsp;8:</entry>
45 <entry>Y'<subscript>10</subscript></entry>
46 <entry>Cb<subscript>10</subscript></entry>
47 <entry>Y'<subscript>11</subscript></entry>
48 <entry>Cr<subscript>10</subscript></entry>
49 <entry>Y'<subscript>12</subscript></entry>
50 <entry>Cb<subscript>11</subscript></entry>
51 <entry>Y'<subscript>13</subscript></entry>
52 <entry>Cr<subscript>11</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;16:</entry>
56 <entry>Y'<subscript>20</subscript></entry>
57 <entry>Cb<subscript>20</subscript></entry>
58 <entry>Y'<subscript>21</subscript></entry>
59 <entry>Cr<subscript>20</subscript></entry>
60 <entry>Y'<subscript>22</subscript></entry>
61 <entry>Cb<subscript>21</subscript></entry>
62 <entry>Y'<subscript>23</subscript></entry>
63 <entry>Cr<subscript>21</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;24:</entry>
67 <entry>Y'<subscript>30</subscript></entry>
68 <entry>Cb<subscript>30</subscript></entry>
69 <entry>Y'<subscript>31</subscript></entry>
70 <entry>Cr<subscript>30</subscript></entry>
71 <entry>Y'<subscript>32</subscript></entry>
72 <entry>Cb<subscript>31</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 <entry>Cr<subscript>31</subscript></entry>
75 </row>
76 </tbody>
77 </tgroup>
78 </informaltable>
79 </para>
80 </formalpara>
81
82 <formalpara>
83 <title>Color Sample Location.</title>
84 <para>
85 <informaltable frame="none">
86 <tgroup cols="7" align="center">
87 <tbody valign="top">
88 <row>
89 <entry></entry>
90 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
91 <entry>2</entry><entry></entry><entry>3</entry>
92 </row>
93 <row>
94 <entry>0</entry>
95 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
96 <entry>Y</entry><entry>C</entry><entry>Y</entry>
97 </row>
98 <row>
99 <entry>1</entry>
100 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
101 <entry>Y</entry><entry>C</entry><entry>Y</entry>
102 </row>
103 <row>
104 <entry>2</entry>
105 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry>C</entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry>3</entry>
110 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
111 <entry>Y</entry><entry>C</entry><entry>Y</entry>
112 </row>
113 </tbody>
114 </tgroup>
115 </informaltable>
116 </para>
117 </formalpara>
118 </example>
119 </refsect1>
120 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml
new file mode 100644
index 00000000000..2330667907c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml
@@ -0,0 +1,154 @@
1 <refentry id="V4L2-PIX-FMT-YVU420M">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YVU420M ('YM21')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname> <constant>V4L2_PIX_FMT_YVU420M</constant></refname>
8 <refpurpose>Variation of <constant>V4L2_PIX_FMT_YVU420</constant>
9 with planes non contiguous in memory. </refpurpose>
10 </refnamediv>
11
12 <refsect1>
13 <title>Description</title>
14
15 <para>This is a multi-planar format, as opposed to a packed format.
16The three components are separated into three sub-images or planes.
17
18The Y plane is first. The Y plane has one byte per pixel. The Cr data
19constitutes the second plane which is half the width and half
20the height of the Y plane (and of the image). Each Cr belongs to four
21pixels, a two-by-two square of the image. For example,
22Cr<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24Y'<subscript>11</subscript>. The Cb data, just like the Cr plane, constitutes
25the third plane. </para>
26
27 <para>If the Y plane has pad bytes after each row, then the Cr
28and Cb planes have half as many pad bytes after their rows. In other
29words, two Cx rows (including padding) is exactly as long as one Y row
30(including padding).</para>
31
32 <para><constant>V4L2_PIX_FMT_YVU420M</constant> is intended to be
33used only in drivers and applications that support the multi-planar API,
34described in <xref linkend="planar-apis"/>. </para>
35
36 <example>
37 <title><constant>V4L2_PIX_FMT_YVU420M</constant> 4 &times; 4
38pixel image</title>
39
40 <formalpara>
41 <title>Byte Order.</title>
42 <para>Each cell is one byte.
43 <informaltable frame="none">
44 <tgroup cols="5" align="center">
45 <colspec align="left" colwidth="2*" />
46 <tbody valign="top">
47 <row>
48 <entry>start0&nbsp;+&nbsp;0:</entry>
49 <entry>Y'<subscript>00</subscript></entry>
50 <entry>Y'<subscript>01</subscript></entry>
51 <entry>Y'<subscript>02</subscript></entry>
52 <entry>Y'<subscript>03</subscript></entry>
53 </row>
54 <row>
55 <entry>start0&nbsp;+&nbsp;4:</entry>
56 <entry>Y'<subscript>10</subscript></entry>
57 <entry>Y'<subscript>11</subscript></entry>
58 <entry>Y'<subscript>12</subscript></entry>
59 <entry>Y'<subscript>13</subscript></entry>
60 </row>
61 <row>
62 <entry>start0&nbsp;+&nbsp;8:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start0&nbsp;+&nbsp;12:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row><entry></entry></row>
76 <row>
77 <entry>start1&nbsp;+&nbsp;0:</entry>
78 <entry>Cr<subscript>00</subscript></entry>
79 <entry>Cr<subscript>01</subscript></entry>
80 </row>
81 <row>
82 <entry>start1&nbsp;+&nbsp;2:</entry>
83 <entry>Cr<subscript>10</subscript></entry>
84 <entry>Cr<subscript>11</subscript></entry>
85 </row>
86 <row><entry></entry></row>
87 <row>
88 <entry>start2&nbsp;+&nbsp;0:</entry>
89 <entry>Cb<subscript>00</subscript></entry>
90 <entry>Cb<subscript>01</subscript></entry>
91 </row>
92 <row>
93 <entry>start2&nbsp;+&nbsp;2:</entry>
94 <entry>Cb<subscript>10</subscript></entry>
95 <entry>Cb<subscript>11</subscript></entry>
96 </row>
97 </tbody>
98 </tgroup>
99 </informaltable>
100 </para>
101 </formalpara>
102
103 <formalpara>
104 <title>Color Sample Location.</title>
105 <para>
106 <informaltable frame="none">
107 <tgroup cols="7" align="center">
108 <tbody valign="top">
109 <row>
110 <entry></entry>
111 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
112 <entry>2</entry><entry></entry><entry>3</entry>
113 </row>
114 <row>
115 <entry>0</entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
117 <entry>Y</entry><entry></entry><entry>Y</entry>
118 </row>
119 <row>
120 <entry></entry>
121 <entry></entry><entry>C</entry><entry></entry><entry></entry>
122 <entry></entry><entry>C</entry><entry></entry>
123 </row>
124 <row>
125 <entry>1</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry>
128 </row>
129 <row>
130 <entry></entry>
131 </row>
132 <row>
133 <entry>2</entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
135 <entry>Y</entry><entry></entry><entry>Y</entry>
136 </row>
137 <row>
138 <entry></entry>
139 <entry></entry><entry>C</entry><entry></entry><entry></entry>
140 <entry></entry><entry>C</entry><entry></entry>
141 </row>
142 <row>
143 <entry>3</entry>
144 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
145 <entry>Y</entry><entry></entry><entry>Y</entry>
146 </row>
147 </tbody>
148 </tgroup>
149 </informaltable>
150 </para>
151 </formalpara>
152 </example>
153 </refsect1>
154 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml b/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml
new file mode 100644
index 00000000000..bfffdc76d3d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml
@@ -0,0 +1,120 @@
1 <refentry id="V4L2-PIX-FMT-YVYU">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YVYU ('YVYU')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_YVYU</constant></refname>
8 <refpurpose>Variation of
9<constant>V4L2_PIX_FMT_YUYV</constant> with different order of samples
10in memory</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>In this format each four bytes is two pixels. Each four
16bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
17the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
18components have half the horizontal resolution of the Y
19component.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_YVYU</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="9" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>Y'<subscript>00</subscript></entry>
35 <entry>Cr<subscript>00</subscript></entry>
36 <entry>Y'<subscript>01</subscript></entry>
37 <entry>Cb<subscript>00</subscript></entry>
38 <entry>Y'<subscript>02</subscript></entry>
39 <entry>Cr<subscript>01</subscript></entry>
40 <entry>Y'<subscript>03</subscript></entry>
41 <entry>Cb<subscript>01</subscript></entry>
42 </row>
43 <row>
44 <entry>start&nbsp;+&nbsp;8:</entry>
45 <entry>Y'<subscript>10</subscript></entry>
46 <entry>Cr<subscript>10</subscript></entry>
47 <entry>Y'<subscript>11</subscript></entry>
48 <entry>Cb<subscript>10</subscript></entry>
49 <entry>Y'<subscript>12</subscript></entry>
50 <entry>Cr<subscript>11</subscript></entry>
51 <entry>Y'<subscript>13</subscript></entry>
52 <entry>Cb<subscript>11</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;16:</entry>
56 <entry>Y'<subscript>20</subscript></entry>
57 <entry>Cr<subscript>20</subscript></entry>
58 <entry>Y'<subscript>21</subscript></entry>
59 <entry>Cb<subscript>20</subscript></entry>
60 <entry>Y'<subscript>22</subscript></entry>
61 <entry>Cr<subscript>21</subscript></entry>
62 <entry>Y'<subscript>23</subscript></entry>
63 <entry>Cb<subscript>21</subscript></entry>
64 </row>
65 <row>
66 <entry>start&nbsp;+&nbsp;24:</entry>
67 <entry>Y'<subscript>30</subscript></entry>
68 <entry>Cr<subscript>30</subscript></entry>
69 <entry>Y'<subscript>31</subscript></entry>
70 <entry>Cb<subscript>30</subscript></entry>
71 <entry>Y'<subscript>32</subscript></entry>
72 <entry>Cr<subscript>31</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 <entry>Cb<subscript>31</subscript></entry>
75 </row>
76 </tbody>
77 </tgroup>
78 </informaltable>
79 </para>
80 </formalpara>
81
82 <formalpara>
83 <title>Color Sample Location.</title>
84 <para>
85 <informaltable frame="none">
86 <tgroup cols="7" align="center">
87 <tbody valign="top">
88 <row>
89 <entry></entry>
90 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
91 <entry>2</entry><entry></entry><entry>3</entry>
92 </row>
93 <row>
94 <entry>0</entry>
95 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
96 <entry>Y</entry><entry>C</entry><entry>Y</entry>
97 </row>
98 <row>
99 <entry>1</entry>
100 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
101 <entry>Y</entry><entry>C</entry><entry>Y</entry>
102 </row>
103 <row>
104 <entry>2</entry>
105 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
106 <entry>Y</entry><entry>C</entry><entry>Y</entry>
107 </row>
108 <row>
109 <entry>3</entry>
110 <entry>Y</entry><entry>C</entry><entry>Y</entry><entry></entry>
111 <entry>Y</entry><entry>C</entry><entry>Y</entry>
112 </row>
113 </tbody>
114 </tgroup>
115 </informaltable>
116 </para>
117 </formalpara>
118 </example>
119 </refsect1>
120 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
new file mode 100644
index 00000000000..bf94f417592
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -0,0 +1,1040 @@
1 <title>Image Formats</title>
2
3 <para>The V4L2 API was primarily designed for devices exchanging
4image data with applications. The
5<structname>v4l2_pix_format</structname> and <structname>v4l2_pix_format_mplane
6</structname> structures define the format and layout of an image in memory.
7The former is used with the single-planar API, while the latter is used with the
8multi-planar version (see <xref linkend="planar-apis"/>). Image formats are
9negotiated with the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video
10capturing and output, for overlay frame buffer formats see also
11&VIDIOC-G-FBUF;.)</para>
12
13<section>
14 <title>Single-planar format structure</title>
15 <table pgwide="1" frame="none" id="v4l2-pix-format">
16 <title>struct <structname>v4l2_pix_format</structname></title>
17 <tgroup cols="3">
18 &cs-str;
19 <tbody valign="top">
20 <row>
21 <entry>__u32</entry>
22 <entry><structfield>width</structfield></entry>
23 <entry>Image width in pixels.</entry>
24 </row>
25 <row>
26 <entry>__u32</entry>
27 <entry><structfield>height</structfield></entry>
28 <entry>Image height in pixels.</entry>
29 </row>
30 <row>
31 <entry spanname="hspan">Applications set these fields to
32request an image size, drivers return the closest possible values. In
33case of planar formats the <structfield>width</structfield> and
34<structfield>height</structfield> applies to the largest plane. To
35avoid ambiguities drivers must return values rounded up to a multiple
36of the scale factor of any smaller planes. For example when the image
37format is YUV 4:2:0, <structfield>width</structfield> and
38<structfield>height</structfield> must be multiples of two.</entry>
39 </row>
40 <row>
41 <entry>__u32</entry>
42 <entry><structfield>pixelformat</structfield></entry>
43 <entry>The pixel format or type of compression, set by the
44application. This is a little endian <link
45linkend="v4l2-fourcc">four character code</link>. V4L2 defines
46standard RGB formats in <xref linkend="rgb-formats" />, YUV formats in <xref
47linkend="yuv-formats" />, and reserved codes in <xref
48linkend="reserved-formats" /></entry>
49 </row>
50 <row>
51 <entry>&v4l2-field;</entry>
52 <entry><structfield>field</structfield></entry>
53 <entry>Video images are typically interlaced. Applications
54can request to capture or output only the top or bottom field, or both
55fields interlaced or sequentially stored in one buffer or alternating
56in separate buffers. Drivers return the actual field order selected.
57For details see <xref linkend="field-order" />.</entry>
58 </row>
59 <row>
60 <entry>__u32</entry>
61 <entry><structfield>bytesperline</structfield></entry>
62 <entry>Distance in bytes between the leftmost pixels in two
63adjacent lines.</entry>
64 </row>
65 <row>
66 <entry spanname="hspan"><para>Both applications and drivers
67can set this field to request padding bytes at the end of each line.
68Drivers however may ignore the value requested by the application,
69returning <structfield>width</structfield> times bytes per pixel or a
70larger value required by the hardware. That implies applications can
71just set this field to zero to get a reasonable
72default.</para><para>Video hardware may access padding bytes,
73therefore they must reside in accessible memory. Consider cases where
74padding bytes after the last line of an image cross a system page
75boundary. Input devices may write padding bytes, the value is
76undefined. Output devices ignore the contents of padding
77bytes.</para><para>When the image format is planar the
78<structfield>bytesperline</structfield> value applies to the largest
79plane and is divided by the same factor as the
80<structfield>width</structfield> field for any smaller planes. For
81example the Cb and Cr planes of a YUV 4:2:0 image have half as many
82padding bytes following each line as the Y plane. To avoid ambiguities
83drivers must return a <structfield>bytesperline</structfield> value
84rounded up to a multiple of the scale factor.</para></entry>
85 </row>
86 <row>
87 <entry>__u32</entry>
88 <entry><structfield>sizeimage</structfield></entry>
89 <entry>Size in bytes of the buffer to hold a complete image,
90set by the driver. Usually this is
91<structfield>bytesperline</structfield> times
92<structfield>height</structfield>. When the image consists of variable
93length compressed data this is the maximum number of bytes required to
94hold an image.</entry>
95 </row>
96 <row>
97 <entry>&v4l2-colorspace;</entry>
98 <entry><structfield>colorspace</structfield></entry>
99 <entry>This information supplements the
100<structfield>pixelformat</structfield> and must be set by the driver,
101see <xref linkend="colorspaces" />.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>priv</structfield></entry>
106 <entry>Reserved for custom (driver defined) additional
107information about formats. When not used drivers and applications must
108set this field to zero.</entry>
109 </row>
110 </tbody>
111 </tgroup>
112 </table>
113</section>
114
115<section>
116 <title>Multi-planar format structures</title>
117 <para>The <structname>v4l2_plane_pix_format</structname> structures define
118 size and layout for each of the planes in a multi-planar format.
119 The <structname>v4l2_pix_format_mplane</structname> structure contains
120 information common to all planes (such as image width and height) and
121 an array of <structname>v4l2_plane_pix_format</structname> structures,
122 describing all planes of that format.</para>
123 <table pgwide="1" frame="none" id="v4l2-plane-pix-format">
124 <title>struct <structname>v4l2_plane_pix_format</structname></title>
125 <tgroup cols="3">
126 &cs-str;
127 <tbody valign="top">
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>sizeimage</structfield></entry>
131 <entry>Maximum size in bytes required for image data in this plane.
132 </entry>
133 </row>
134 <row>
135 <entry>__u16</entry>
136 <entry><structfield>bytesperline</structfield></entry>
137 <entry>Distance in bytes between the leftmost pixels in two adjacent
138 lines.</entry>
139 </row>
140 <row>
141 <entry>__u16</entry>
142 <entry><structfield>reserved[7]</structfield></entry>
143 <entry>Reserved for future extensions. Should be zeroed by the
144 application.</entry>
145 </row>
146 </tbody>
147 </tgroup>
148 </table>
149 <table pgwide="1" frame="none" id="v4l2-pix-format-mplane">
150 <title>struct <structname>v4l2_pix_format_mplane</structname></title>
151 <tgroup cols="3">
152 &cs-str;
153 <tbody valign="top">
154 <row>
155 <entry>__u32</entry>
156 <entry><structfield>width</structfield></entry>
157 <entry>Image width in pixels.</entry>
158 </row>
159 <row>
160 <entry>__u32</entry>
161 <entry><structfield>height</structfield></entry>
162 <entry>Image height in pixels.</entry>
163 </row>
164 <row>
165 <entry>__u32</entry>
166 <entry><structfield>pixelformat</structfield></entry>
167 <entry>The pixel format. Both single- and multi-planar four character
168codes can be used.</entry>
169 </row>
170 <row>
171 <entry>&v4l2-field;</entry>
172 <entry><structfield>field</structfield></entry>
173 <entry>See &v4l2-pix-format;.</entry>
174 </row>
175 <row>
176 <entry>&v4l2-colorspace;</entry>
177 <entry><structfield>colorspace</structfield></entry>
178 <entry>See &v4l2-pix-format;.</entry>
179 </row>
180 <row>
181 <entry>&v4l2-plane-pix-format;</entry>
182 <entry><structfield>plane_fmt[VIDEO_MAX_PLANES]</structfield></entry>
183 <entry>An array of structures describing format of each plane this
184 pixel format consists of. The number of valid entries in this array
185 has to be put in the <structfield>num_planes</structfield>
186 field.</entry>
187 </row>
188 <row>
189 <entry>__u8</entry>
190 <entry><structfield>num_planes</structfield></entry>
191 <entry>Number of planes (i.e. separate memory buffers) for this format
192 and the number of valid entries in the
193 <structfield>plane_fmt</structfield> array.</entry>
194 </row>
195 <row>
196 <entry>__u8</entry>
197 <entry><structfield>reserved[11]</structfield></entry>
198 <entry>Reserved for future extensions. Should be zeroed by the
199 application.</entry>
200 </row>
201 </tbody>
202 </tgroup>
203 </table>
204</section>
205
206 <section>
207 <title>Standard Image Formats</title>
208
209 <para>In order to exchange images between drivers and
210applications, it is necessary to have standard image data formats
211which both sides will interpret the same way. V4L2 includes several
212such formats, and this section is intended to be an unambiguous
213specification of the standard image data formats in V4L2.</para>
214
215 <para>V4L2 drivers are not limited to these formats, however.
216Driver-specific formats are possible. In that case the application may
217depend on a codec to convert images to one of the standard formats
218when needed. But the data can still be stored and retrieved in the
219proprietary format. For example, a device may support a proprietary
220compressed format. Applications can still capture and save the data in
221the compressed format, saving much disk space, and later use a codec
222to convert the images to the X Windows screen format when the video is
223to be displayed.</para>
224
225 <para>Even so, ultimately, some standard formats are needed, so
226the V4L2 specification would not be complete without well-defined
227standard formats.</para>
228
229 <para>The V4L2 standard formats are mainly uncompressed formats. The
230pixels are always arranged in memory from left to right, and from top
231to bottom. The first byte of data in the image buffer is always for
232the leftmost pixel of the topmost row. Following that is the pixel
233immediately to its right, and so on until the end of the top row of
234pixels. Following the rightmost pixel of the row there may be zero or
235more bytes of padding to guarantee that each row of pixel data has a
236certain alignment. Following the pad bytes, if any, is data for the
237leftmost pixel of the second row from the top, and so on. The last row
238has just as many pad bytes after it as the other rows.</para>
239
240 <para>In V4L2 each format has an identifier which looks like
241<constant>PIX_FMT_XXX</constant>, defined in the <link
242linkend="videodev">videodev.h</link> header file. These identifiers
243represent <link linkend="v4l2-fourcc">four character (FourCC) codes</link>
244which are also listed below, however they are not the same as those
245used in the Windows world.</para>
246
247 <para>For some formats, data is stored in separate, discontiguous
248memory buffers. Those formats are identified by a separate set of FourCC codes
249and are referred to as "multi-planar formats". For example, a YUV422 frame is
250normally stored in one memory buffer, but it can also be placed in two or three
251separate buffers, with Y component in one buffer and CbCr components in another
252in the 2-planar version or with each component in its own buffer in the
2533-planar case. Those sub-buffers are referred to as "planes".</para>
254 </section>
255
256 <section id="colorspaces">
257 <title>Colorspaces</title>
258
259 <para>[intro]</para>
260
261 <!-- See proposal by Billy Biggs, video4linux-list@redhat.com
262on 11 Oct 2002, subject: "Re: [V4L] Re: v4l2 api", and
263http://vektor.theorem.ca/graphics/ycbcr/ and
264http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html -->
265
266 <para>
267 <variablelist>
268 <varlistentry>
269 <term>Gamma Correction</term>
270 <listitem>
271 <para>[to do]</para>
272 <para>E'<subscript>R</subscript> = f(R)</para>
273 <para>E'<subscript>G</subscript> = f(G)</para>
274 <para>E'<subscript>B</subscript> = f(B)</para>
275 </listitem>
276 </varlistentry>
277 <varlistentry>
278 <term>Construction of luminance and color-difference
279signals</term>
280 <listitem>
281 <para>[to do]</para>
282 <para>E'<subscript>Y</subscript> =
283Coeff<subscript>R</subscript> E'<subscript>R</subscript>
284+ Coeff<subscript>G</subscript> E'<subscript>G</subscript>
285+ Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
286 <para>(E'<subscript>R</subscript> - E'<subscript>Y</subscript>) = E'<subscript>R</subscript>
287- Coeff<subscript>R</subscript> E'<subscript>R</subscript>
288- Coeff<subscript>G</subscript> E'<subscript>G</subscript>
289- Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
290 <para>(E'<subscript>B</subscript> - E'<subscript>Y</subscript>) = E'<subscript>B</subscript>
291- Coeff<subscript>R</subscript> E'<subscript>R</subscript>
292- Coeff<subscript>G</subscript> E'<subscript>G</subscript>
293- Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
294 </listitem>
295 </varlistentry>
296 <varlistentry>
297 <term>Re-normalized color-difference signals</term>
298 <listitem>
299 <para>The color-difference signals are scaled back to unity
300range [-0.5;+0.5]:</para>
301 <para>K<subscript>B</subscript> = 0.5 / (1 - Coeff<subscript>B</subscript>)</para>
302 <para>K<subscript>R</subscript> = 0.5 / (1 - Coeff<subscript>R</subscript>)</para>
303 <para>P<subscript>B</subscript> =
304K<subscript>B</subscript> (E'<subscript>B</subscript> - E'<subscript>Y</subscript>) =
305 0.5 (Coeff<subscript>R</subscript> / Coeff<subscript>B</subscript>) E'<subscript>R</subscript>
306+ 0.5 (Coeff<subscript>G</subscript> / Coeff<subscript>B</subscript>) E'<subscript>G</subscript>
307+ 0.5 E'<subscript>B</subscript></para>
308 <para>P<subscript>R</subscript> =
309K<subscript>R</subscript> (E'<subscript>R</subscript> - E'<subscript>Y</subscript>) =
310 0.5 E'<subscript>R</subscript>
311+ 0.5 (Coeff<subscript>G</subscript> / Coeff<subscript>R</subscript>) E'<subscript>G</subscript>
312+ 0.5 (Coeff<subscript>B</subscript> / Coeff<subscript>R</subscript>) E'<subscript>B</subscript></para>
313 </listitem>
314 </varlistentry>
315 <varlistentry>
316 <term>Quantization</term>
317 <listitem>
318 <para>[to do]</para>
319 <para>Y' = (Lum. Levels - 1) &middot; E'<subscript>Y</subscript> + Lum. Offset</para>
320 <para>C<subscript>B</subscript> = (Chrom. Levels - 1)
321&middot; P<subscript>B</subscript> + Chrom. Offset</para>
322 <para>C<subscript>R</subscript> = (Chrom. Levels - 1)
323&middot; P<subscript>R</subscript> + Chrom. Offset</para>
324 <para>Rounding to the nearest integer and clamping to the range
325[0;255] finally yields the digital color components Y'CbCr
326stored in YUV images.</para>
327 </listitem>
328 </varlistentry>
329 </variablelist>
330 </para>
331
332 <example>
333 <title>ITU-R Rec. BT.601 color conversion</title>
334
335 <para>Forward Transformation</para>
336
337 <programlisting>
338int ER, EG, EB; /* gamma corrected RGB input [0;255] */
339int Y1, Cb, Cr; /* output [0;255] */
340
341double r, g, b; /* temporaries */
342double y1, pb, pr;
343
344int
345clamp (double x)
346{
347 int r = x; /* round to nearest */
348
349 if (r &lt; 0) return 0;
350 else if (r &gt; 255) return 255;
351 else return r;
352}
353
354r = ER / 255.0;
355g = EG / 255.0;
356b = EB / 255.0;
357
358y1 = 0.299 * r + 0.587 * g + 0.114 * b;
359pb = -0.169 * r - 0.331 * g + 0.5 * b;
360pr = 0.5 * r - 0.419 * g - 0.081 * b;
361
362Y1 = clamp (219 * y1 + 16);
363Cb = clamp (224 * pb + 128);
364Cr = clamp (224 * pr + 128);
365
366/* or shorter */
367
368y1 = 0.299 * ER + 0.587 * EG + 0.114 * EB;
369
370Y1 = clamp ( (219 / 255.0) * y1 + 16);
371Cb = clamp (((224 / 255.0) / (2 - 2 * 0.114)) * (EB - y1) + 128);
372Cr = clamp (((224 / 255.0) / (2 - 2 * 0.299)) * (ER - y1) + 128);
373 </programlisting>
374
375 <para>Inverse Transformation</para>
376
377 <programlisting>
378int Y1, Cb, Cr; /* gamma pre-corrected input [0;255] */
379int ER, EG, EB; /* output [0;255] */
380
381double r, g, b; /* temporaries */
382double y1, pb, pr;
383
384int
385clamp (double x)
386{
387 int r = x; /* round to nearest */
388
389 if (r &lt; 0) return 0;
390 else if (r &gt; 255) return 255;
391 else return r;
392}
393
394y1 = (255 / 219.0) * (Y1 - 16);
395pb = (255 / 224.0) * (Cb - 128);
396pr = (255 / 224.0) * (Cr - 128);
397
398r = 1.0 * y1 + 0 * pb + 1.402 * pr;
399g = 1.0 * y1 - 0.344 * pb - 0.714 * pr;
400b = 1.0 * y1 + 1.772 * pb + 0 * pr;
401
402ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
403EG = clamp (g * 255);
404EB = clamp (b * 255);
405 </programlisting>
406 </example>
407
408 <table pgwide="1" id="v4l2-colorspace" orient="land">
409 <title>enum v4l2_colorspace</title>
410 <tgroup cols="11" align="center">
411 <colspec align="left" />
412 <colspec align="center" />
413 <colspec align="left" />
414 <colspec colname="cr" />
415 <colspec colname="cg" />
416 <colspec colname="cb" />
417 <colspec colname="wp" />
418 <colspec colname="gc" />
419 <colspec colname="lum" />
420 <colspec colname="qy" />
421 <colspec colname="qc" />
422 <spanspec namest="cr" nameend="cb" spanname="chrom" />
423 <spanspec namest="qy" nameend="qc" spanname="quant" />
424 <spanspec namest="lum" nameend="qc" spanname="spam" />
425 <thead>
426 <row>
427 <entry morerows="1">Identifier</entry>
428 <entry morerows="1">Value</entry>
429 <entry morerows="1">Description</entry>
430 <entry spanname="chrom">Chromaticities<footnote>
431 <para>The coordinates of the color primaries are
432given in the CIE system (1931)</para>
433 </footnote></entry>
434 <entry morerows="1">White Point</entry>
435 <entry morerows="1">Gamma Correction</entry>
436 <entry morerows="1">Luminance E'<subscript>Y</subscript></entry>
437 <entry spanname="quant">Quantization</entry>
438 </row>
439 <row>
440 <entry>Red</entry>
441 <entry>Green</entry>
442 <entry>Blue</entry>
443 <entry>Y'</entry>
444 <entry>Cb, Cr</entry>
445 </row>
446 </thead>
447 <tbody valign="top">
448 <row>
449 <entry><constant>V4L2_COLORSPACE_SMPTE170M</constant></entry>
450 <entry>1</entry>
451 <entry>NTSC/PAL according to <xref linkend="smpte170m" />,
452<xref linkend="itu601" /></entry>
453 <entry>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</entry>
454 <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</entry>
455 <entry>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</entry>
456 <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
457 Illuminant D<subscript>65</subscript></entry>
458 <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
4591.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
460 <entry>0.299&nbsp;E'<subscript>R</subscript>
461+&nbsp;0.587&nbsp;E'<subscript>G</subscript>
462+&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
463 <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
464 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
465 </row>
466 <row>
467 <entry><constant>V4L2_COLORSPACE_SMPTE240M</constant></entry>
468 <entry>2</entry>
469 <entry>1125-Line (US) HDTV, see <xref
470linkend="smpte240m" /></entry>
471 <entry>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</entry>
472 <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</entry>
473 <entry>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</entry>
474 <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
475 Illuminant D<subscript>65</subscript></entry>
476 <entry>E' = 4&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.0228,
4771.1115&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.1115&nbsp;for&nbsp;0.0228&nbsp;&lt;&nbsp;I</entry>
478 <entry>0.212&nbsp;E'<subscript>R</subscript>
479+&nbsp;0.701&nbsp;E'<subscript>G</subscript>
480+&nbsp;0.087&nbsp;E'<subscript>B</subscript></entry>
481 <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
482 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
483 </row>
484 <row>
485 <entry><constant>V4L2_COLORSPACE_REC709</constant></entry>
486 <entry>3</entry>
487 <entry>HDTV and modern devices, see <xref
488linkend="itu709" /></entry>
489 <entry>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</entry>
490 <entry>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</entry>
491 <entry>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</entry>
492 <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
493 Illuminant D<subscript>65</subscript></entry>
494 <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
4951.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
496 <entry>0.2125&nbsp;E'<subscript>R</subscript>
497+&nbsp;0.7154&nbsp;E'<subscript>G</subscript>
498+&nbsp;0.0721&nbsp;E'<subscript>B</subscript></entry>
499 <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
500 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
501 </row>
502 <row>
503 <entry><constant>V4L2_COLORSPACE_BT878</constant></entry>
504 <entry>4</entry>
505 <entry>Broken Bt878 extents<footnote>
506 <para>The ubiquitous Bt878 video capture chip
507quantizes E'<subscript>Y</subscript> to 238 levels, yielding a range
508of Y' = 16 &hellip; 253, unlike Rec. 601 Y' = 16 &hellip;
509235. This is not a typo in the Bt878 documentation, it has been
510implemented in silicon. The chroma extents are unclear.</para>
511 </footnote>, <xref linkend="itu601" /></entry>
512 <entry>?</entry>
513 <entry>?</entry>
514 <entry>?</entry>
515 <entry>?</entry>
516 <entry>?</entry>
517 <entry>0.299&nbsp;E'<subscript>R</subscript>
518+&nbsp;0.587&nbsp;E'<subscript>G</subscript>
519+&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
520 <entry><emphasis>237</emphasis>&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
521 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128 (probably)</entry>
522 </row>
523 <row>
524 <entry><constant>V4L2_COLORSPACE_470_SYSTEM_M</constant></entry>
525 <entry>5</entry>
526 <entry>M/NTSC<footnote>
527 <para>No identifier exists for M/PAL which uses
528the chromaticities of M/NTSC, the remaining parameters are equal to B and
529G/PAL.</para>
530 </footnote> according to <xref linkend="itu470" />, <xref
531 linkend="itu601" /></entry>
532 <entry>x&nbsp;=&nbsp;0.67, y&nbsp;=&nbsp;0.33</entry>
533 <entry>x&nbsp;=&nbsp;0.21, y&nbsp;=&nbsp;0.71</entry>
534 <entry>x&nbsp;=&nbsp;0.14, y&nbsp;=&nbsp;0.08</entry>
535 <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.316, Illuminant C</entry>
536 <entry>?</entry>
537 <entry>0.299&nbsp;E'<subscript>R</subscript>
538+&nbsp;0.587&nbsp;E'<subscript>G</subscript>
539+&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
540 <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
541 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
542 </row>
543 <row>
544 <entry><constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant></entry>
545 <entry>6</entry>
546 <entry>625-line PAL and SECAM systems according to <xref
547linkend="itu470" />, <xref linkend="itu601" /></entry>
548 <entry>x&nbsp;=&nbsp;0.64, y&nbsp;=&nbsp;0.33</entry>
549 <entry>x&nbsp;=&nbsp;0.29, y&nbsp;=&nbsp;0.60</entry>
550 <entry>x&nbsp;=&nbsp;0.15, y&nbsp;=&nbsp;0.06</entry>
551 <entry>x&nbsp;=&nbsp;0.313, y&nbsp;=&nbsp;0.329,
552Illuminant D<subscript>65</subscript></entry>
553 <entry>?</entry>
554 <entry>0.299&nbsp;E'<subscript>R</subscript>
555+&nbsp;0.587&nbsp;E'<subscript>G</subscript>
556+&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
557 <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
558 <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
559 </row>
560 <row>
561 <entry><constant>V4L2_COLORSPACE_JPEG</constant></entry>
562 <entry>7</entry>
563 <entry>JPEG Y'CbCr, see <xref linkend="jfif" />, <xref linkend="itu601" /></entry>
564 <entry>?</entry>
565 <entry>?</entry>
566 <entry>?</entry>
567 <entry>?</entry>
568 <entry>?</entry>
569 <entry>0.299&nbsp;E'<subscript>R</subscript>
570+&nbsp;0.587&nbsp;E'<subscript>G</subscript>
571+&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
572 <entry>256&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16<footnote>
573 <para>Note JFIF quantizes
574Y'P<subscript>B</subscript>P<subscript>R</subscript> in range [0;+1] and
575[-0.5;+0.5] to <emphasis>257</emphasis> levels, however Y'CbCr signals
576are still clamped to [0;255].</para>
577 </footnote></entry>
578 <entry>256&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
579 </row>
580 <row>
581 <entry><constant>V4L2_COLORSPACE_SRGB</constant></entry>
582 <entry>8</entry>
583 <entry>[?]</entry>
584 <entry>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</entry>
585 <entry>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</entry>
586 <entry>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</entry>
587 <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
588 Illuminant D<subscript>65</subscript></entry>
589 <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
5901.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
591 <entry spanname="spam">n/a</entry>
592 </row>
593 </tbody>
594 </tgroup>
595 </table>
596 </section>
597
598 <section id="pixfmt-indexed">
599 <title>Indexed Format</title>
600
601 <para>In this format each pixel is represented by an 8 bit index
602into a 256 entry ARGB palette. It is intended for <link
603linkend="osd">Video Output Overlays</link> only. There are no ioctls to
604access the palette, this must be done with ioctls of the Linux framebuffer API.</para>
605
606 <table pgwide="0" frame="none">
607 <title>Indexed Image Format</title>
608 <tgroup cols="37" align="center">
609 <colspec colname="id" align="left" />
610 <colspec colname="fourcc" />
611 <colspec colname="bit" />
612
613 <colspec colnum="4" colname="b07" align="center" />
614 <colspec colnum="5" colname="b06" align="center" />
615 <colspec colnum="6" colname="b05" align="center" />
616 <colspec colnum="7" colname="b04" align="center" />
617 <colspec colnum="8" colname="b03" align="center" />
618 <colspec colnum="9" colname="b02" align="center" />
619 <colspec colnum="10" colname="b01" align="center" />
620 <colspec colnum="11" colname="b00" align="center" />
621
622 <spanspec namest="b07" nameend="b00" spanname="b0" />
623 <spanspec namest="b17" nameend="b10" spanname="b1" />
624 <spanspec namest="b27" nameend="b20" spanname="b2" />
625 <spanspec namest="b37" nameend="b30" spanname="b3" />
626 <thead>
627 <row>
628 <entry>Identifier</entry>
629 <entry>Code</entry>
630 <entry>&nbsp;</entry>
631 <entry spanname="b0">Byte&nbsp;0</entry>
632 </row>
633 <row>
634 <entry>&nbsp;</entry>
635 <entry>&nbsp;</entry>
636 <entry>Bit</entry>
637 <entry>7</entry>
638 <entry>6</entry>
639 <entry>5</entry>
640 <entry>4</entry>
641 <entry>3</entry>
642 <entry>2</entry>
643 <entry>1</entry>
644 <entry>0</entry>
645 </row>
646 </thead>
647 <tbody valign="top">
648 <row id="V4L2-PIX-FMT-PAL8">
649 <entry><constant>V4L2_PIX_FMT_PAL8</constant></entry>
650 <entry>'PAL8'</entry>
651 <entry></entry>
652 <entry>i<subscript>7</subscript></entry>
653 <entry>i<subscript>6</subscript></entry>
654 <entry>i<subscript>5</subscript></entry>
655 <entry>i<subscript>4</subscript></entry>
656 <entry>i<subscript>3</subscript></entry>
657 <entry>i<subscript>2</subscript></entry>
658 <entry>i<subscript>1</subscript></entry>
659 <entry>i<subscript>0</subscript></entry>
660 </row>
661 </tbody>
662 </tgroup>
663 </table>
664 </section>
665
666 <section id="pixfmt-rgb">
667 <title>RGB Formats</title>
668
669 &sub-packed-rgb;
670 &sub-sbggr8;
671 &sub-sgbrg8;
672 &sub-sgrbg8;
673 &sub-srggb8;
674 &sub-sbggr16;
675 &sub-srggb10;
676 &sub-srggb10dpcm8;
677 &sub-srggb12;
678 </section>
679
680 <section id="yuv-formats">
681 <title>YUV Formats</title>
682
683 <para>YUV is the format native to TV broadcast and composite video
684signals. It separates the brightness information (Y) from the color
685information (U and V or Cb and Cr). The color information consists of
686red and blue <emphasis>color difference</emphasis> signals, this way
687the green component can be reconstructed by subtracting from the
688brightness component. See <xref linkend="colorspaces" /> for conversion
689examples. YUV was chosen because early television would only transmit
690brightness information. To add color in a way compatible with existing
691receivers a new signal carrier was added to transmit the color
692difference signals. Secondary in the YUV format the U and V components
693usually have lower resolution than the Y component. This is an analog
694video compression technique taking advantage of a property of the
695human visual system, being more sensitive to brightness
696information.</para>
697
698 &sub-packed-yuv;
699 &sub-grey;
700 &sub-y10;
701 &sub-y12;
702 &sub-y10b;
703 &sub-y16;
704 &sub-yuyv;
705 &sub-uyvy;
706 &sub-yvyu;
707 &sub-vyuy;
708 &sub-y41p;
709 &sub-yuv420;
710 &sub-yuv420m;
711 &sub-yvu420m;
712 &sub-yuv410;
713 &sub-yuv422p;
714 &sub-yuv411p;
715 &sub-nv12;
716 &sub-nv12m;
717 &sub-nv12mt;
718 &sub-nv16;
719 &sub-nv24;
720 &sub-m420;
721 </section>
722
723 <section>
724 <title>Compressed Formats</title>
725
726 <table pgwide="1" frame="none" id="compressed-formats">
727 <title>Compressed Image Formats</title>
728 <tgroup cols="3" align="left">
729 &cs-def;
730 <thead>
731 <row>
732 <entry>Identifier</entry>
733 <entry>Code</entry>
734 <entry>Details</entry>
735 </row>
736 </thead>
737 <tbody valign="top">
738 <row id="V4L2-PIX-FMT-JPEG">
739 <entry><constant>V4L2_PIX_FMT_JPEG</constant></entry>
740 <entry>'JPEG'</entry>
741 <entry>TBD. See also &VIDIOC-G-JPEGCOMP;,
742 &VIDIOC-S-JPEGCOMP;.</entry>
743 </row>
744 <row id="V4L2-PIX-FMT-MPEG">
745 <entry><constant>V4L2_PIX_FMT_MPEG</constant></entry>
746 <entry>'MPEG'</entry>
747 <entry>MPEG multiplexed stream. The actual format is determined by
748extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
749<xref linkend="mpeg-control-id" />.</entry>
750 </row>
751 <row id="V4L2-PIX-FMT-H264">
752 <entry><constant>V4L2_PIX_FMT_H264</constant></entry>
753 <entry>'H264'</entry>
754 <entry>H264 video elementary stream with start codes.</entry>
755 </row>
756 <row id="V4L2-PIX-FMT-H264-NO-SC">
757 <entry><constant>V4L2_PIX_FMT_H264_NO_SC</constant></entry>
758 <entry>'AVC1'</entry>
759 <entry>H264 video elementary stream without start codes.</entry>
760 </row>
761 <row id="V4L2-PIX-FMT-H264-MVC">
762 <entry><constant>V4L2_PIX_FMT_H264_MVC</constant></entry>
763 <entry>'MVC'</entry>
764 <entry>H264 MVC video elementary stream.</entry>
765 </row>
766 <row id="V4L2-PIX-FMT-H263">
767 <entry><constant>V4L2_PIX_FMT_H263</constant></entry>
768 <entry>'H263'</entry>
769 <entry>H263 video elementary stream.</entry>
770 </row>
771 <row id="V4L2-PIX-FMT-MPEG1">
772 <entry><constant>V4L2_PIX_FMT_MPEG1</constant></entry>
773 <entry>'MPG1'</entry>
774 <entry>MPEG1 video elementary stream.</entry>
775 </row>
776 <row id="V4L2-PIX-FMT-MPEG2">
777 <entry><constant>V4L2_PIX_FMT_MPEG2</constant></entry>
778 <entry>'MPG2'</entry>
779 <entry>MPEG2 video elementary stream.</entry>
780 </row>
781 <row id="V4L2-PIX-FMT-MPEG4">
782 <entry><constant>V4L2_PIX_FMT_MPEG4</constant></entry>
783 <entry>'MPG4'</entry>
784 <entry>MPEG4 video elementary stream.</entry>
785 </row>
786 <row id="V4L2-PIX-FMT-XVID">
787 <entry><constant>V4L2_PIX_FMT_XVID</constant></entry>
788 <entry>'XVID'</entry>
789 <entry>Xvid video elementary stream.</entry>
790 </row>
791 <row id="V4L2-PIX-FMT-VC1-ANNEX-G">
792 <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_G</constant></entry>
793 <entry>'VC1G'</entry>
794 <entry>VC1, SMPTE 421M Annex G compliant stream.</entry>
795 </row>
796 <row id="V4L2-PIX-FMT-VC1-ANNEX-L">
797 <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_L</constant></entry>
798 <entry>'VC1L'</entry>
799 <entry>VC1, SMPTE 421M Annex L compliant stream.</entry>
800 </row>
801 <row id="V4L2-PIX-FMT-VP8">
802 <entry><constant>V4L2_PIX_FMT_VP8</constant></entry>
803 <entry>'VP8'</entry>
804 <entry>VP8 video elementary stream.</entry>
805 </row>
806 </tbody>
807 </tgroup>
808 </table>
809 </section>
810
811 <section id="pixfmt-reserved">
812 <title>Reserved Format Identifiers</title>
813
814 <para>These formats are not defined by this specification, they
815are just listed for reference and to avoid naming conflicts. If you
816want to register your own format, send an e-mail to the linux-media mailing
817list &v4l-ml; for inclusion in the <filename>videodev2.h</filename>
818file. If you want to share your format with other developers add a
819link to your documentation and send a copy to the linux-media mailing list
820for inclusion in this section. If you think your format should be listed
821in a standard format section please make a proposal on the linux-media mailing
822list.</para>
823
824 <table pgwide="1" frame="none" id="reserved-formats">
825 <title>Reserved Image Formats</title>
826 <tgroup cols="3" align="left">
827 &cs-def;
828 <thead>
829 <row>
830 <entry>Identifier</entry>
831 <entry>Code</entry>
832 <entry>Details</entry>
833 </row>
834 </thead>
835 <tbody valign="top">
836 <row id="V4L2-PIX-FMT-DV">
837 <entry><constant>V4L2_PIX_FMT_DV</constant></entry>
838 <entry>'dvsd'</entry>
839 <entry>unknown</entry>
840 </row>
841 <row id="V4L2-PIX-FMT-ET61X251">
842 <entry><constant>V4L2_PIX_FMT_ET61X251</constant></entry>
843 <entry>'E625'</entry>
844 <entry>Compressed format of the ET61X251 driver.</entry>
845 </row>
846 <row id="V4L2-PIX-FMT-HI240">
847 <entry><constant>V4L2_PIX_FMT_HI240</constant></entry>
848 <entry>'HI24'</entry>
849 <entry><para>8 bit RGB format used by the BTTV driver.</para></entry>
850 </row>
851 <row id="V4L2-PIX-FMT-HM12">
852 <entry><constant>V4L2_PIX_FMT_HM12</constant></entry>
853 <entry>'HM12'</entry>
854 <entry><para>YUV 4:2:0 format used by the
855IVTV driver, <ulink url="http://www.ivtvdriver.org/">
856http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the
857kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename>
858</para></entry>
859 </row>
860 <row id="V4L2-PIX-FMT-CPIA1">
861 <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry>
862 <entry>'CPIA'</entry>
863 <entry>YUV format used by the gspca cpia1 driver.</entry>
864 </row>
865 <row id="V4L2-PIX-FMT-JPGL">
866 <entry><constant>V4L2_PIX_FMT_JPGL</constant></entry>
867 <entry>'JPGL'</entry>
868 <entry>JPEG-Light format (Pegasus Lossless JPEG)
869 used in Divio webcams NW 80x.</entry>
870 </row>
871 <row id="V4L2-PIX-FMT-SPCA501">
872 <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry>
873 <entry>'S501'</entry>
874 <entry>YUYV per line used by the gspca driver.</entry>
875 </row>
876 <row id="V4L2-PIX-FMT-SPCA505">
877 <entry><constant>V4L2_PIX_FMT_SPCA505</constant></entry>
878 <entry>'S505'</entry>
879 <entry>YYUV per line used by the gspca driver.</entry>
880 </row>
881 <row id="V4L2-PIX-FMT-SPCA508">
882 <entry><constant>V4L2_PIX_FMT_SPCA508</constant></entry>
883 <entry>'S508'</entry>
884 <entry>YUVY per line used by the gspca driver.</entry>
885 </row>
886 <row id="V4L2-PIX-FMT-SPCA561">
887 <entry><constant>V4L2_PIX_FMT_SPCA561</constant></entry>
888 <entry>'S561'</entry>
889 <entry>Compressed GBRG Bayer format used by the gspca driver.</entry>
890 </row>
891 <row id="V4L2-PIX-FMT-PAC207">
892 <entry><constant>V4L2_PIX_FMT_PAC207</constant></entry>
893 <entry>'P207'</entry>
894 <entry>Compressed BGGR Bayer format used by the gspca driver.</entry>
895 </row>
896 <row id="V4L2-PIX-FMT-MR97310A">
897 <entry><constant>V4L2_PIX_FMT_MR97310A</constant></entry>
898 <entry>'M310'</entry>
899 <entry>Compressed BGGR Bayer format used by the gspca driver.</entry>
900 </row>
901 <row id="V4L2-PIX-FMT-JL2005BCD">
902 <entry><constant>V4L2_PIX_FMT_JL2005BCD</constant></entry>
903 <entry>'JL20'</entry>
904 <entry>JPEG compressed RGGB Bayer format used by the gspca driver.</entry>
905 </row>
906 <row id="V4L2-PIX-FMT-OV511">
907 <entry><constant>V4L2_PIX_FMT_OV511</constant></entry>
908 <entry>'O511'</entry>
909 <entry>OV511 JPEG format used by the gspca driver.</entry>
910 </row>
911 <row id="V4L2-PIX-FMT-OV518">
912 <entry><constant>V4L2_PIX_FMT_OV518</constant></entry>
913 <entry>'O518'</entry>
914 <entry>OV518 JPEG format used by the gspca driver.</entry>
915 </row>
916 <row id="V4L2-PIX-FMT-PJPG">
917 <entry><constant>V4L2_PIX_FMT_PJPG</constant></entry>
918 <entry>'PJPG'</entry>
919 <entry>Pixart 73xx JPEG format used by the gspca driver.</entry>
920 </row>
921 <row id="V4L2-PIX-FMT-SE401">
922 <entry><constant>V4L2_PIX_FMT_SE401</constant></entry>
923 <entry>'S401'</entry>
924 <entry>Compressed RGB format used by the gspca se401 driver</entry>
925 </row>
926 <row id="V4L2-PIX-FMT-SQ905C">
927 <entry><constant>V4L2_PIX_FMT_SQ905C</constant></entry>
928 <entry>'905C'</entry>
929 <entry>Compressed RGGB bayer format used by the gspca driver.</entry>
930 </row>
931 <row id="V4L2-PIX-FMT-MJPEG">
932 <entry><constant>V4L2_PIX_FMT_MJPEG</constant></entry>
933 <entry>'MJPG'</entry>
934 <entry>Compressed format used by the Zoran driver</entry>
935 </row>
936 <row id="V4L2-PIX-FMT-PWC1">
937 <entry><constant>V4L2_PIX_FMT_PWC1</constant></entry>
938 <entry>'PWC1'</entry>
939 <entry>Compressed format of the PWC driver.</entry>
940 </row>
941 <row id="V4L2-PIX-FMT-PWC2">
942 <entry><constant>V4L2_PIX_FMT_PWC2</constant></entry>
943 <entry>'PWC2'</entry>
944 <entry>Compressed format of the PWC driver.</entry>
945 </row>
946 <row id="V4L2-PIX-FMT-SN9C10X">
947 <entry><constant>V4L2_PIX_FMT_SN9C10X</constant></entry>
948 <entry>'S910'</entry>
949 <entry>Compressed format of the SN9C102 driver.</entry>
950 </row>
951 <row id="V4L2-PIX-FMT-SN9C20X-I420">
952 <entry><constant>V4L2_PIX_FMT_SN9C20X_I420</constant></entry>
953 <entry>'S920'</entry>
954 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
955 </row>
956 <row id="V4L2-PIX-FMT-SN9C2028">
957 <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry>
958 <entry>'SONX'</entry>
959 <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry>
960 </row>
961 <row id="V4L2-PIX-FMT-STV0680">
962 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
963 <entry>'S680'</entry>
964 <entry>Bayer format of the gspca stv0680 driver.</entry>
965 </row>
966 <row id="V4L2-PIX-FMT-WNVA">
967 <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry>
968 <entry>'WNVA'</entry>
969 <entry><para>Used by the Winnov Videum driver, <ulink
970url="http://www.thedirks.org/winnov/">
971http://www.thedirks.org/winnov/</ulink></para></entry>
972 </row>
973 <row id="V4L2-PIX-FMT-TM6000">
974 <entry><constant>V4L2_PIX_FMT_TM6000</constant></entry>
975 <entry>'TM60'</entry>
976 <entry><para>Used by Trident tm6000</para></entry>
977 </row>
978 <row id="V4L2-PIX-FMT-CIT-YYVYUY">
979 <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry>
980 <entry>'CITV'</entry>
981 <entry><para>Used by xirlink CIT, found at IBM webcams.</para>
982 <para>Uses one line of Y then 1 line of VYUY</para>
983 </entry>
984 </row>
985 <row id="V4L2-PIX-FMT-KONICA420">
986 <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry>
987 <entry>'KONI'</entry>
988 <entry><para>Used by Konica webcams.</para>
989 <para>YUV420 planar in blocks of 256 pixels.</para>
990 </entry>
991 </row>
992 <row id="V4L2-PIX-FMT-YYUV">
993 <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry>
994 <entry>'YYUV'</entry>
995 <entry>unknown</entry>
996 </row>
997 <row id="V4L2-PIX-FMT-Y4">
998 <entry><constant>V4L2_PIX_FMT_Y4</constant></entry>
999 <entry>'Y04 '</entry>
1000 <entry>Old 4-bit greyscale format. Only the most significant 4 bits of each byte are used,
1001the other bits are set to 0.</entry>
1002 </row>
1003 <row id="V4L2-PIX-FMT-Y6">
1004 <entry><constant>V4L2_PIX_FMT_Y6</constant></entry>
1005 <entry>'Y06 '</entry>
1006 <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used,
1007the other bits are set to 0.</entry>
1008 </row>
1009 <row id="V4L2-PIX-FMT-S5C-UYVY-JPG">
1010 <entry><constant>V4L2_PIX_FMT_S5C_UYVY_JPG</constant></entry>
1011 <entry>'S5CI'</entry>
1012 <entry>Two-planar format used by Samsung S5C73MX cameras. The
1013first plane contains interleaved JPEG and UYVY image data, followed by meta data
1014in form of an array of offsets to the UYVY data blocks. The actual pointer array
1015follows immediately the interleaved JPEG/UYVY data, the number of entries in
1016this array equals the height of the UYVY image. Each entry is a 4-byte unsigned
1017integer in big endian order and it's an offset to a single pixel line of the
1018UYVY image. The first plane can start either with JPEG or UYVY data chunk. The
1019size of a single UYVY block equals the UYVY image's width multiplied by 2. The
1020size of a JPEG chunk depends on the image and can vary with each line.
1021<para>The second plane, at an offset of 4084 bytes, contains a 4-byte offset to
1022the pointer array in the first plane. This offset is followed by a 4-byte value
1023indicating size of the pointer array. All numbers in the second plane are also
1024in big endian order. Remaining data in the second plane is undefined. The
1025information in the second plane allows to easily find location of the pointer
1026array, which can be different for each frame. The size of the pointer array is
1027constant for given UYVY image height.</para>
1028<para>In order to extract UYVY and JPEG frames an application can initially set
1029a data pointer to the start of first plane and then add an offset from the first
1030entry of the pointers table. Such a pointer indicates start of an UYVY image
1031pixel line. Whole UYVY line can be copied to a separate buffer. These steps
1032should be repeated for each line, i.e. the number of entries in the pointer
1033array. Anything what's in between the UYVY lines is JPEG data and should be
1034concatenated to form the JPEG stream. </para>
1035</entry>
1036 </row>
1037 </tbody>
1038 </tgroup>
1039 </table>
1040 </section>
diff --git a/Documentation/DocBook/media/v4l/planar-apis.xml b/Documentation/DocBook/media/v4l/planar-apis.xml
new file mode 100644
index 00000000000..878ce204048
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/planar-apis.xml
@@ -0,0 +1,62 @@
1<section id="planar-apis">
2 <title>Single- and multi-planar APIs</title>
3
4 <para>Some devices require data for each input or output video frame
5 to be placed in discontiguous memory buffers. In such cases, one
6 video frame has to be addressed using more than one memory address, i.e. one
7 pointer per "plane". A plane is a sub-buffer of the current frame. For
8 examples of such formats see <xref linkend="pixfmt" />.</para>
9
10 <para>Initially, V4L2 API did not support multi-planar buffers and a set of
11 extensions has been introduced to handle them. Those extensions constitute
12 what is being referred to as the "multi-planar API".</para>
13
14 <para>Some of the V4L2 API calls and structures are interpreted differently,
15 depending on whether single- or multi-planar API is being used. An application
16 can choose whether to use one or the other by passing a corresponding buffer
17 type to its ioctl calls. Multi-planar versions of buffer types are suffixed
18 with an `_MPLANE' string. For a list of available multi-planar buffer types
19 see &v4l2-buf-type;.
20 </para>
21
22 <section>
23 <title>Multi-planar formats</title>
24 <para>Multi-planar API introduces new multi-planar formats. Those formats
25 use a separate set of FourCC codes. It is important to distinguish between
26 the multi-planar API and a multi-planar format. Multi-planar API calls can
27 handle all single-planar formats as well (as long as they are passed in
28 multi-planar API structures), while the single-planar API cannot
29 handle multi-planar formats.</para>
30 </section>
31
32 <section>
33 <title>Calls that distinguish between single and multi-planar APIs</title>
34 <variablelist>
35 <varlistentry>
36 <term>&VIDIOC-QUERYCAP;</term>
37 <listitem><para>Two additional multi-planar capabilities are added. They can
38 be set together with non-multi-planar ones for devices that handle
39 both single- and multi-planar formats.</para></listitem>
40 </varlistentry>
41 <varlistentry>
42 <term>&VIDIOC-G-FMT;, &VIDIOC-S-FMT;, &VIDIOC-TRY-FMT;</term>
43 <listitem><para>New structures for describing multi-planar formats are added:
44 &v4l2-pix-format-mplane; and &v4l2-plane-pix-format;. Drivers may
45 define new multi-planar formats, which have distinct FourCC codes from
46 the existing single-planar ones.</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term>&VIDIOC-QBUF;, &VIDIOC-DQBUF;, &VIDIOC-QUERYBUF;</term>
51 <listitem><para>A new &v4l2-plane; structure for describing planes is added.
52 Arrays of this structure are passed in the new
53 <structfield>m.planes</structfield> field of &v4l2-buffer;.</para>
54 </listitem>
55 </varlistentry>
56 <varlistentry>
57 <term>&VIDIOC-REQBUFS;</term>
58 <listitem><para>Will allocate multi-planar buffers as requested.</para></listitem>
59 </varlistentry>
60 </variablelist>
61 </section>
62</section>
diff --git a/Documentation/DocBook/media/v4l/remote_controllers.xml b/Documentation/DocBook/media/v4l/remote_controllers.xml
new file mode 100644
index 00000000000..160e464d44b
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/remote_controllers.xml
@@ -0,0 +1,177 @@
1<title>Remote Controllers</title>
2<section id="Remote_controllers_Intro">
3<title>Introduction</title>
4
5<para>Currently, most analog and digital devices have a Infrared input for remote controllers. Each
6manufacturer has their own type of control. It is not rare for the same manufacturer to ship different
7types of controls, depending on the device.</para>
8<para>Unfortunately, for several years, there was no effort to create uniform IR keycodes for
9different devices. This caused the same IR keyname to be mapped completely differently on
10different IR devices. This resulted that the same IR keyname to be mapped completely different on
11different IR's. Due to that, V4L2 API now specifies a standard for mapping Media keys on IR.</para>
12<para>This standard should be used by both V4L/DVB drivers and userspace applications</para>
13<para>The modules register the remote as keyboard within the linux input layer. This means that the IR key strokes will look like normal keyboard key strokes (if CONFIG_INPUT_KEYBOARD is enabled). Using the event devices (CONFIG_INPUT_EVDEV) it is possible for applications to access the remote via /dev/input/event devices.</para>
14
15<table pgwide="1" frame="none" id="rc_standard_keymap">
16<title>IR default keymapping</title>
17<tgroup cols="3">
18&cs-str;
19<tbody valign="top">
20<row>
21<entry>Key code</entry>
22<entry>Meaning</entry>
23<entry>Key examples on IR</entry>
24</row>
25
26<row><entry><emphasis role="bold">Numeric keys</emphasis></entry></row>
27
28<row><entry><constant>KEY_0</constant></entry><entry>Keyboard digit 0</entry><entry>0</entry></row>
29<row><entry><constant>KEY_1</constant></entry><entry>Keyboard digit 1</entry><entry>1</entry></row>
30<row><entry><constant>KEY_2</constant></entry><entry>Keyboard digit 2</entry><entry>2</entry></row>
31<row><entry><constant>KEY_3</constant></entry><entry>Keyboard digit 3</entry><entry>3</entry></row>
32<row><entry><constant>KEY_4</constant></entry><entry>Keyboard digit 4</entry><entry>4</entry></row>
33<row><entry><constant>KEY_5</constant></entry><entry>Keyboard digit 5</entry><entry>5</entry></row>
34<row><entry><constant>KEY_6</constant></entry><entry>Keyboard digit 6</entry><entry>6</entry></row>
35<row><entry><constant>KEY_7</constant></entry><entry>Keyboard digit 7</entry><entry>7</entry></row>
36<row><entry><constant>KEY_8</constant></entry><entry>Keyboard digit 8</entry><entry>8</entry></row>
37<row><entry><constant>KEY_9</constant></entry><entry>Keyboard digit 9</entry><entry>9</entry></row>
38
39<row><entry><emphasis role="bold">Movie play control</emphasis></entry></row>
40
41<row><entry><constant>KEY_FORWARD</constant></entry><entry>Instantly advance in time</entry><entry>&gt;&gt; / FORWARD</entry></row>
42<row><entry><constant>KEY_BACK</constant></entry><entry>Instantly go back in time</entry><entry>&lt;&lt;&lt; / BACK</entry></row>
43<row><entry><constant>KEY_FASTFORWARD</constant></entry><entry>Play movie faster</entry><entry>&gt;&gt;&gt; / FORWARD</entry></row>
44<row><entry><constant>KEY_REWIND</constant></entry><entry>Play movie back</entry><entry>REWIND / BACKWARD</entry></row>
45<row><entry><constant>KEY_NEXT</constant></entry><entry>Select next chapter / sub-chapter / interval</entry><entry>NEXT / SKIP</entry></row>
46<row><entry><constant>KEY_PREVIOUS</constant></entry><entry>Select previous chapter / sub-chapter / interval</entry><entry>&lt;&lt; / PREV / PREVIOUS</entry></row>
47<row><entry><constant>KEY_AGAIN</constant></entry><entry>Repeat the video or a video interval</entry><entry>REPEAT / LOOP / RECALL</entry></row>
48<row><entry><constant>KEY_PAUSE</constant></entry><entry>Pause sroweam</entry><entry>PAUSE / FREEZE</entry></row>
49<row><entry><constant>KEY_PLAY</constant></entry><entry>Play movie at the normal timeshift</entry><entry>NORMAL TIMESHIFT / LIVE / &gt;</entry></row>
50<row><entry><constant>KEY_PLAYPAUSE</constant></entry><entry>Alternate between play and pause</entry><entry>PLAY / PAUSE</entry></row>
51<row><entry><constant>KEY_STOP</constant></entry><entry>Stop sroweam</entry><entry>STOP</entry></row>
52<row><entry><constant>KEY_RECORD</constant></entry><entry>Start/stop recording sroweam</entry><entry>CAPTURE / REC / RECORD/PAUSE</entry></row>
53<row><entry><constant>KEY_CAMERA</constant></entry><entry>Take a picture of the image</entry><entry>CAMERA ICON / CAPTURE / SNAPSHOT</entry></row>
54<row><entry><constant>KEY_SHUFFLE</constant></entry><entry>Enable shuffle mode</entry><entry>SHUFFLE</entry></row>
55<row><entry><constant>KEY_TIME</constant></entry><entry>Activate time shift mode</entry><entry>TIME SHIFT</entry></row>
56<row><entry><constant>KEY_TITLE</constant></entry><entry>Allow changing the chapter</entry><entry>CHAPTER</entry></row>
57<row><entry><constant>KEY_SUBTITLE</constant></entry><entry>Allow changing the subtitle</entry><entry>SUBTITLE</entry></row>
58
59<row><entry><emphasis role="bold">Image control</emphasis></entry></row>
60
61<row><entry><constant>KEY_BRIGHTNESSDOWN</constant></entry><entry>Decrease Brightness</entry><entry>BRIGHTNESS DECREASE</entry></row>
62<row><entry><constant>KEY_BRIGHTNESSUP</constant></entry><entry>Increase Brightness</entry><entry>BRIGHTNESS INCREASE</entry></row>
63
64<row><entry><constant>KEY_ANGLE</constant></entry><entry>Switch video camera angle (on videos with more than one angle stored)</entry><entry>ANGLE / SWAP</entry></row>
65<row><entry><constant>KEY_EPG</constant></entry><entry>Open the Elecrowonic Play Guide (EPG)</entry><entry>EPG / GUIDE</entry></row>
66<row><entry><constant>KEY_TEXT</constant></entry><entry>Activate/change closed caption mode</entry><entry>CLOSED CAPTION/TELETEXT / DVD TEXT / TELETEXT / TTX</entry></row>
67
68<row><entry><emphasis role="bold">Audio control</emphasis></entry></row>
69
70<row><entry><constant>KEY_AUDIO</constant></entry><entry>Change audio source</entry><entry>AUDIO SOURCE / AUDIO / MUSIC</entry></row>
71<row><entry><constant>KEY_MUTE</constant></entry><entry>Mute/unmute audio</entry><entry>MUTE / DEMUTE / UNMUTE</entry></row>
72<row><entry><constant>KEY_VOLUMEDOWN</constant></entry><entry>Decrease volume</entry><entry>VOLUME- / VOLUME DOWN</entry></row>
73<row><entry><constant>KEY_VOLUMEUP</constant></entry><entry>Increase volume</entry><entry>VOLUME+ / VOLUME UP</entry></row>
74<row><entry><constant>KEY_MODE</constant></entry><entry>Change sound mode</entry><entry>MONO/STEREO</entry></row>
75<row><entry><constant>KEY_LANGUAGE</constant></entry><entry>Select Language</entry><entry>1ST / 2ND LANGUAGE / DVD LANG / MTS/SAP / MTS SEL</entry></row>
76
77<row><entry><emphasis role="bold">Channel control</emphasis></entry></row>
78
79<row><entry><constant>KEY_CHANNEL</constant></entry><entry>Go to the next favorite channel</entry><entry>ALT / CHANNEL / CH SURFING / SURF / FAV</entry></row>
80<row><entry><constant>KEY_CHANNELDOWN</constant></entry><entry>Decrease channel sequencially</entry><entry>CHANNEL - / CHANNEL DOWN / DOWN</entry></row>
81<row><entry><constant>KEY_CHANNELUP</constant></entry><entry>Increase channel sequencially</entry><entry>CHANNEL + / CHANNEL UP / UP</entry></row>
82<row><entry><constant>KEY_DIGITS</constant></entry><entry>Use more than one digit for channel</entry><entry>PLUS / 100/ 1xx / xxx / -/-- / Single Double Triple Digit</entry></row>
83<row><entry><constant>KEY_SEARCH</constant></entry><entry>Start channel autoscan</entry><entry>SCAN / AUTOSCAN</entry></row>
84
85<row><entry><emphasis role="bold">Colored keys</emphasis></entry></row>
86
87<row><entry><constant>KEY_BLUE</constant></entry><entry>IR Blue key</entry><entry>BLUE</entry></row>
88<row><entry><constant>KEY_GREEN</constant></entry><entry>IR Green Key</entry><entry>GREEN</entry></row>
89<row><entry><constant>KEY_RED</constant></entry><entry>IR Red key</entry><entry>RED</entry></row>
90<row><entry><constant>KEY_YELLOW</constant></entry><entry>IR Yellow key</entry><entry> YELLOW</entry></row>
91
92<row><entry><emphasis role="bold">Media selection</emphasis></entry></row>
93
94<row><entry><constant>KEY_CD</constant></entry><entry>Change input source to Compact Disc</entry><entry>CD</entry></row>
95<row><entry><constant>KEY_DVD</constant></entry><entry>Change input to DVD</entry><entry>DVD / DVD MENU</entry></row>
96<row><entry><constant>KEY_EJECTCLOSECD</constant></entry><entry>Open/close the CD/DVD player</entry><entry>-&gt; ) / CLOSE / OPEN</entry></row>
97
98<row><entry><constant>KEY_MEDIA</constant></entry><entry>Turn on/off Media application</entry><entry>PC/TV / TURN ON/OFF APP</entry></row>
99<row><entry><constant>KEY_PC</constant></entry><entry>Selects from TV to PC</entry><entry>PC</entry></row>
100<row><entry><constant>KEY_RADIO</constant></entry><entry>Put into AM/FM radio mode</entry><entry>RADIO / TV/FM / TV/RADIO / FM / FM/RADIO</entry></row>
101<row><entry><constant>KEY_TV</constant></entry><entry>Select tv mode</entry><entry>TV / LIVE TV</entry></row>
102<row><entry><constant>KEY_TV2</constant></entry><entry>Select Cable mode</entry><entry>AIR/CBL</entry></row>
103<row><entry><constant>KEY_VCR</constant></entry><entry>Select VCR mode</entry><entry>VCR MODE / DTR</entry></row>
104<row><entry><constant>KEY_VIDEO</constant></entry><entry>Alternate between input modes</entry><entry>SOURCE / SELECT / DISPLAY / SWITCH INPUTS / VIDEO</entry></row>
105
106<row><entry><emphasis role="bold">Power control</emphasis></entry></row>
107
108<row><entry><constant>KEY_POWER</constant></entry><entry>Turn on/off computer</entry><entry>SYSTEM POWER / COMPUTER POWER</entry></row>
109<row><entry><constant>KEY_POWER2</constant></entry><entry>Turn on/off application</entry><entry>TV ON/OFF / POWER</entry></row>
110<row><entry><constant>KEY_SLEEP</constant></entry><entry>Activate sleep timer</entry><entry>SLEEP / SLEEP TIMER</entry></row>
111<row><entry><constant>KEY_SUSPEND</constant></entry><entry>Put computer into suspend mode</entry><entry>STANDBY / SUSPEND</entry></row>
112
113<row><entry><emphasis role="bold">Window control</emphasis></entry></row>
114
115<row><entry><constant>KEY_CLEAR</constant></entry><entry>Stop sroweam and return to default input video/audio</entry><entry>CLEAR / RESET / BOSS KEY</entry></row>
116<row><entry><constant>KEY_CYCLEWINDOWS</constant></entry><entry>Minimize windows and move to the next one</entry><entry>ALT-TAB / MINIMIZE / DESKTOP</entry></row>
117<row><entry><constant>KEY_FAVORITES</constant></entry><entry>Open the favorites sroweam window</entry><entry>TV WALL / Favorites</entry></row>
118<row><entry><constant>KEY_MENU</constant></entry><entry>Call application menu</entry><entry>2ND CONTROLS (USA: MENU) / DVD/MENU / SHOW/HIDE CTRL</entry></row>
119<row><entry><constant>KEY_NEW</constant></entry><entry>Open/Close Picture in Picture</entry><entry>PIP</entry></row>
120<row><entry><constant>KEY_OK</constant></entry><entry>Send a confirmation code to application</entry><entry>OK / ENTER / RETURN</entry></row>
121<row><entry><constant>KEY_SCREEN</constant></entry><entry>Select screen aspect ratio</entry><entry>4:3 16:9 SELECT</entry></row>
122<row><entry><constant>KEY_ZOOM</constant></entry><entry>Put device into zoom/full screen mode</entry><entry>ZOOM / FULL SCREEN / ZOOM+ / HIDE PANNEL / SWITCH</entry></row>
123
124<row><entry><emphasis role="bold">Navigation keys</emphasis></entry></row>
125
126<row><entry><constant>KEY_ESC</constant></entry><entry>Cancel current operation</entry><entry>CANCEL / BACK</entry></row>
127<row><entry><constant>KEY_HELP</constant></entry><entry>Open a Help window</entry><entry>HELP</entry></row>
128<row><entry><constant>KEY_HOMEPAGE</constant></entry><entry>Navigate to Homepage</entry><entry>HOME</entry></row>
129<row><entry><constant>KEY_INFO</constant></entry><entry>Open On Screen Display</entry><entry>DISPLAY INFORMATION / OSD</entry></row>
130<row><entry><constant>KEY_WWW</constant></entry><entry>Open the default browser</entry><entry>WEB</entry></row>
131<row><entry><constant>KEY_UP</constant></entry><entry>Up key</entry><entry>UP</entry></row>
132<row><entry><constant>KEY_DOWN</constant></entry><entry>Down key</entry><entry>DOWN</entry></row>
133<row><entry><constant>KEY_LEFT</constant></entry><entry>Left key</entry><entry>LEFT</entry></row>
134<row><entry><constant>KEY_RIGHT</constant></entry><entry>Right key</entry><entry>RIGHT</entry></row>
135
136<row><entry><emphasis role="bold">Miscellaneous keys</emphasis></entry></row>
137
138<row><entry><constant>KEY_DOT</constant></entry><entry>Return a dot</entry><entry>.</entry></row>
139<row><entry><constant>KEY_FN</constant></entry><entry>Select a function</entry><entry>FUNCTION</entry></row>
140
141</tbody>
142</tgroup>
143</table>
144
145<para>It should be noticed that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to:</para>
146
147<table pgwide="1" frame="none" id="rc_keymap_notes">
148<title>Notes</title>
149<tgroup cols="1">
150&cs-str;
151<tbody valign="top">
152<row>
153<entry>On simpler IR's, without separate channel keys, you need to map UP as <constant>KEY_CHANNELUP</constant></entry>
154</row><row>
155<entry>On simpler IR's, without separate channel keys, you need to map DOWN as <constant>KEY_CHANNELDOWN</constant></entry>
156</row><row>
157<entry>On simpler IR's, without separate volume keys, you need to map LEFT as <constant>KEY_VOLUMEDOWN</constant></entry>
158</row><row>
159<entry>On simpler IR's, without separate volume keys, you need to map RIGHT as <constant>KEY_VOLUMEUP</constant></entry>
160</row>
161</tbody>
162</tgroup>
163</table>
164
165</section>
166
167<section id="Remote_controllers_table_change">
168<title>Changing default Remote Controller mappings</title>
169<para>The event interface provides two ioctls to be used against
170the /dev/input/event device, to allow changing the default
171keymapping.</para>
172
173<para>This program demonstrates how to replace the keymap tables.</para>
174&sub-keytable-c;
175</section>
176
177&sub-lirc_device_interface;
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
new file mode 100644
index 00000000000..4c238ce068b
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -0,0 +1,325 @@
1<section id="selection-api">
2
3 <title>Experimental API for cropping, composing and scaling</title>
4
5 <note>
6 <title>Experimental</title>
7
8 <para>This is an <link linkend="experimental">experimental</link>
9interface and may change in the future.</para>
10 </note>
11
12 <section>
13 <title>Introduction</title>
14
15<para>Some video capture devices can sample a subsection of a picture and
16shrink or enlarge it to an image of arbitrary size. Next, the devices can
17insert the image into larger one. Some video output devices can crop part of an
18input image, scale it up or down and insert it at an arbitrary scan line and
19horizontal offset into a video signal. We call these abilities cropping,
20scaling and composing.</para>
21
22<para>On a video <emphasis>capture</emphasis> device the source is a video
23signal, and the cropping target determine the area actually sampled. The sink
24is an image stored in a memory buffer. The composing area specifies which part
25of the buffer is actually written to by the hardware. </para>
26
27<para>On a video <emphasis>output</emphasis> device the source is an image in a
28memory buffer, and the cropping target is a part of an image to be shown on a
29display. The sink is the display or the graphics screen. The application may
30select the part of display where the image should be displayed. The size and
31position of such a window is controlled by the compose target.</para>
32
33<para>Rectangles for all cropping and composing targets are defined even if the
34device does supports neither cropping nor composing. Their size and position
35will be fixed in such a case. If the device does not support scaling then the
36cropping and composing rectangles have the same size.</para>
37
38 </section>
39
40 <section>
41 <title>Selection targets</title>
42
43 <para>
44 <figure id="sel-targets-capture">
45 <title>Cropping and composing targets</title>
46 <mediaobject>
47 <imageobject>
48 <imagedata fileref="selection.png" format="PNG" />
49 </imageobject>
50 <textobject>
51 <phrase>Targets used by a cropping, composing and scaling
52 process</phrase>
53 </textobject>
54 </mediaobject>
55 </figure>
56 </para>
57
58 <para>See <xref linkend="v4l2-selection-targets" /> for more
59 information.</para>
60 </section>
61
62 <section>
63
64 <title>Configuration</title>
65
66<para>Applications can use the <link linkend="vidioc-g-selection">selection
67API</link> to select an area in a video signal or a buffer, and to query for
68default settings and hardware limits.</para>
69
70<para>Video hardware can have various cropping, composing and scaling
71limitations. It may only scale up or down, support only discrete scaling
72factors, or have different scaling abilities in the horizontal and vertical
73directions. Also it may not support scaling at all. At the same time the
74cropping/composing rectangles may have to be aligned, and both the source and
75the sink may have arbitrary upper and lower size limits. Therefore, as usual,
76drivers are expected to adjust the requested parameters and return the actual
77values selected. An application can control the rounding behaviour using <link
78linkend="v4l2-selection-flags"> constraint flags </link>.</para>
79
80 <section>
81
82 <title>Configuration of video capture</title>
83
84<para>See figure <xref linkend="sel-targets-capture" /> for examples of the
85selection targets available for a video capture device. It is recommended to
86configure the cropping targets before to the composing targets.</para>
87
88<para>The range of coordinates of the top left corner, width and height of
89areas that can be sampled is given by the <constant> V4L2_SEL_TGT_CROP_BOUNDS
90</constant> target. It is recommended for the driver developers to put the
91top/left corner at position <constant> (0,0) </constant>. The rectangle's
92coordinates are expressed in pixels.</para>
93
94<para>The top left corner, width and height of the source rectangle, that is
95the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP
96</constant> target. It uses the same coordinate system as <constant>
97V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie
98completely inside the capture boundaries. The driver may further adjust the
99requested size and/or position according to hardware limitations.</para>
100
101<para>Each capture device has a default source rectangle, given by the
102<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant> target. This rectangle shall
103over what the driver writer considers the complete picture. Drivers shall set
104the active crop rectangle to the default when the driver is first loaded, but
105not later.</para>
106
107<para>The composing targets refer to a memory buffer. The limits of composing
108coordinates are obtained using <constant> V4L2_SEL_TGT_COMPOSE_BOUNDS
109</constant>. All coordinates are expressed in pixels. The rectangle's top/left
110corner must be located at position <constant> (0,0) </constant>. The width and
111height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>.
112</para>
113
114<para>The part of a buffer into which the image is inserted by the hardware is
115controlled by the <constant> V4L2_SEL_TGT_COMPOSE </constant> target.
116The rectangle's coordinates are also expressed in the same coordinate system as
117the bounds rectangle. The composing rectangle must lie completely inside bounds
118rectangle. The driver must adjust the composing rectangle to fit to the
119bounding limits. Moreover, the driver can perform other adjustments according
120to hardware limitations. The application can control rounding behaviour using
121<link linkend="v4l2-selection-flags"> constraint flags </link>.</para>
122
123<para>For capture devices the default composing rectangle is queried using
124<constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the
125bounding rectangle.</para>
126
127<para>The part of a buffer that is modified by the hardware is given by
128<constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels
129defined using <constant> V4L2_SEL_TGT_COMPOSE </constant> plus all
130padding data modified by hardware during insertion process. All pixels outside
131this rectangle <emphasis>must not</emphasis> be changed by the hardware. The
132content of pixels that lie inside the padded area but outside active area is
133undefined. The application can use the padded and active rectangles to detect
134where the rubbish pixels are located and remove them if needed.</para>
135
136 </section>
137
138 <section>
139
140 <title>Configuration of video output</title>
141
142<para>For output devices targets and ioctls are used similarly to the video
143capture case. The <emphasis> composing </emphasis> rectangle refers to the
144insertion of an image into a video signal. The cropping rectangles refer to a
145memory buffer. It is recommended to configure the composing targets before to
146the cropping targets.</para>
147
148<para>The cropping targets refer to the memory buffer that contains an image to
149be inserted into a video signal or graphical screen. The limits of cropping
150coordinates are obtained using <constant> V4L2_SEL_TGT_CROP_BOUNDS </constant>.
151All coordinates are expressed in pixels. The top/left corner is always point
152<constant> (0,0) </constant>. The width and height is equal to the image size
153specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para>
154
155<para>The top left corner, width and height of the source rectangle, that is
156the area from which image date are processed by the hardware, is given by the
157<constant> V4L2_SEL_TGT_CROP </constant>. Its coordinates are expressed
158in in the same coordinate system as the bounds rectangle. The active cropping
159area must lie completely inside the crop boundaries and the driver may further
160adjust the requested size and/or position according to hardware
161limitations.</para>
162
163<para>For output devices the default cropping rectangle is queried using
164<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant>. It is usually equal to the
165bounding rectangle.</para>
166
167<para>The part of a video signal or graphics display where the image is
168inserted by the hardware is controlled by <constant>
169V4L2_SEL_TGT_COMPOSE </constant> target. The rectangle's coordinates
170are expressed in pixels. The composing rectangle must lie completely inside the
171bounds rectangle. The driver must adjust the area to fit to the bounding
172limits. Moreover, the driver can perform other adjustments according to
173hardware limitations. </para>
174
175<para>The device has a default composing rectangle, given by the <constant>
176V4L2_SEL_TGT_COMPOSE_DEFAULT </constant> target. This rectangle shall cover what
177the driver writer considers the complete picture. It is recommended for the
178driver developers to put the top/left corner at position <constant> (0,0)
179</constant>. Drivers shall set the active composing rectangle to the default
180one when the driver is first loaded.</para>
181
182<para>The devices may introduce additional content to video signal other than
183an image from memory buffers. It includes borders around an image. However,
184such a padded area is driver-dependent feature not covered by this document.
185Driver developers are encouraged to keep padded rectangle equal to active one.
186The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED
187</constant> identifier. It must contain all pixels from the <constant>
188V4L2_SEL_TGT_COMPOSE </constant> target.</para>
189
190 </section>
191
192 <section>
193
194 <title>Scaling control</title>
195
196<para>An application can detect if scaling is performed by comparing the width
197and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP
198</constant> and <constant> V4L2_SEL_TGT_COMPOSE </constant> targets. If
199these are not equal then the scaling is applied. The application can compute
200the scaling ratios using these values.</para>
201
202 </section>
203
204 </section>
205
206 <section>
207
208 <title>Comparison with old cropping API</title>
209
210<para>The selection API was introduced to cope with deficiencies of previous
211<link linkend="crop"> API </link>, that was designed to control simple capture
212devices. Later the cropping API was adopted by video output drivers. The ioctls
213are used to select a part of the display were the video signal is inserted. It
214should be considered as an API abuse because the described operation is
215actually the composing. The selection API makes a clear distinction between
216composing and cropping operations by setting the appropriate targets. The V4L2
217API lacks any support for composing to and cropping from an image inside a
218memory buffer. The application could configure a capture device to fill only a
219part of an image by abusing V4L2 API. Cropping a smaller image from a larger
220one is achieved by setting the field
221&v4l2-pix-format;<structfield>::bytesperline</structfield>. Introducing an image offsets
222could be done by modifying field &v4l2-buffer;<structfield>::m_userptr</structfield>
223before calling <constant> VIDIOC_QBUF </constant>. Those
224operations should be avoided because they are not portable (endianness), and do
225not work for macroblock and Bayer formats and mmap buffers. The selection API
226deals with configuration of buffer cropping/composing in a clear, intuitive and
227portable way. Next, with the selection API the concepts of the padded target
228and constraints flags are introduced. Finally, &v4l2-crop; and &v4l2-cropcap;
229have no reserved fields. Therefore there is no way to extend their functionality.
230The new &v4l2-selection; provides a lot of place for future
231extensions. Driver developers are encouraged to implement only selection API.
232The former cropping API would be simulated using the new one. </para>
233
234 </section>
235
236 <section>
237 <title>Examples</title>
238 <example>
239 <title>Resetting the cropping parameters</title>
240
241 <para>(A video capture device is assumed; change <constant>
242V4L2_BUF_TYPE_VIDEO_CAPTURE </constant> for other devices; change target to
243<constant> V4L2_SEL_TGT_COMPOSE_* </constant> family to configure composing
244area)</para>
245
246 <programlisting>
247
248 &v4l2-selection; sel = {
249 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
250 .target = V4L2_SEL_TGT_CROP_DEFAULT,
251 };
252 ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel);
253 if (ret)
254 exit(-1);
255 sel.target = V4L2_SEL_TGT_CROP;
256 ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
257 if (ret)
258 exit(-1);
259
260 </programlisting>
261 </example>
262
263 <example>
264 <title>Simple downscaling</title>
265 <para>Setting a composing area on output of size of <emphasis> at most
266</emphasis> half of limit placed at a center of a display.</para>
267 <programlisting>
268
269 &v4l2-selection; sel = {
270 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
271 .target = V4L2_SEL_TGT_COMPOSE_BOUNDS,
272 };
273 struct v4l2_rect r;
274
275 ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel);
276 if (ret)
277 exit(-1);
278 /* setting smaller compose rectangle */
279 r.width = sel.r.width / 2;
280 r.height = sel.r.height / 2;
281 r.left = sel.r.width / 4;
282 r.top = sel.r.height / 4;
283 sel.r = r;
284 sel.target = V4L2_SEL_TGT_COMPOSE;
285 sel.flags = V4L2_SEL_FLAG_LE;
286 ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
287 if (ret)
288 exit(-1);
289
290 </programlisting>
291 </example>
292
293 <example>
294 <title>Querying for scaling factors</title>
295 <para>A video output device is assumed; change <constant>
296V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para>
297 <programlisting>
298
299 &v4l2-selection; compose = {
300 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
301 .target = V4L2_SEL_TGT_COMPOSE,
302 };
303 &v4l2-selection; crop = {
304 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
305 .target = V4L2_SEL_TGT_CROP,
306 };
307 double hscale, vscale;
308
309 ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;compose);
310 if (ret)
311 exit(-1);
312 ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;crop);
313 if (ret)
314 exit(-1);
315
316 /* computing scaling factors */
317 hscale = (double)compose.r.width / crop.r.width;
318 vscale = (double)compose.r.height / crop.r.height;
319
320 </programlisting>
321 </example>
322
323 </section>
324
325</section>
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml
new file mode 100644
index 00000000000..7502f784b8c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/selections-common.xml
@@ -0,0 +1,164 @@
1<section id="v4l2-selections-common">
2
3 <title>Common selection definitions</title>
4
5 <para>While the <link linkend="selection-api">V4L2 selection
6 API</link> and <link linkend="v4l2-subdev-selections">V4L2 subdev
7 selection APIs</link> are very similar, there's one fundamental
8 difference between the two. On sub-device API, the selection
9 rectangle refers to the media bus format, and is bound to a
10 sub-device's pad. On the V4L2 interface the selection rectangles
11 refer to the in-memory pixel format.</para>
12
13 <para>This section defines the common definitions of the
14 selection interfaces on the two APIs.</para>
15
16 <section id="v4l2-selection-targets">
17
18 <title>Selection targets</title>
19
20 <para>The precise meaning of the selection targets may be
21 dependent on which of the two interfaces they are used.</para>
22
23 <table pgwide="1" frame="none" id="v4l2-selection-targets-table">
24 <title>Selection target definitions</title>
25 <tgroup cols="5">
26 <colspec colname="c1" />
27 <colspec colname="c2" />
28 <colspec colname="c3" />
29 <colspec colname="c4" />
30 <colspec colname="c5" />
31 &cs-def;
32 <thead>
33 <row rowsep="1">
34 <entry align="left">Target name</entry>
35 <entry align="left">id</entry>
36 <entry align="left">Definition</entry>
37 <entry align="left">Valid for V4L2</entry>
38 <entry align="left">Valid for V4L2 subdev</entry>
39 </row>
40 </thead>
41 <tbody valign="top">
42 <row>
43 <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
44 <entry>0x0000</entry>
45 <entry>Crop rectangle. Defines the cropped area.</entry>
46 <entry>Yes</entry>
47 <entry>Yes</entry>
48 </row>
49 <row>
50 <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
51 <entry>0x0001</entry>
52 <entry>Suggested cropping rectangle that covers the "whole picture".</entry>
53 <entry>Yes</entry>
54 <entry>No</entry>
55 </row>
56 <row>
57 <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
58 <entry>0x0002</entry>
59 <entry>Bounds of the crop rectangle. All valid crop
60 rectangles fit inside the crop bounds rectangle.
61 </entry>
62 <entry>Yes</entry>
63 <entry>Yes</entry>
64 </row>
65 <row>
66 <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
67 <entry>0x0100</entry>
68 <entry>Compose rectangle. Used to configure scaling
69 and composition.</entry>
70 <entry>Yes</entry>
71 <entry>Yes</entry>
72 </row>
73 <row>
74 <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
75 <entry>0x0101</entry>
76 <entry>Suggested composition rectangle that covers the "whole picture".</entry>
77 <entry>Yes</entry>
78 <entry>No</entry>
79 </row>
80 <row>
81 <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
82 <entry>0x0102</entry>
83 <entry>Bounds of the compose rectangle. All valid compose
84 rectangles fit inside the compose bounds rectangle.</entry>
85 <entry>Yes</entry>
86 <entry>Yes</entry>
87 </row>
88 <row>
89 <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
90 <entry>0x0103</entry>
91 <entry>The active area and all padding pixels that are inserted or
92 modified by hardware.</entry>
93 <entry>Yes</entry>
94 <entry>No</entry>
95 </row>
96 </tbody>
97 </tgroup>
98 </table>
99
100 </section>
101
102 <section id="v4l2-selection-flags">
103
104 <title>Selection flags</title>
105
106 <table pgwide="1" frame="none" id="v4l2-selection-flags-table">
107 <title>Selection flag definitions</title>
108 <tgroup cols="5">
109 <colspec colname="c1" />
110 <colspec colname="c2" />
111 <colspec colname="c3" />
112 <colspec colname="c4" />
113 <colspec colname="c5" />
114 &cs-def;
115 <thead>
116 <row rowsep="1">
117 <entry align="left">Flag name</entry>
118 <entry align="left">id</entry>
119 <entry align="left">Definition</entry>
120 <entry align="left">Valid for V4L2</entry>
121 <entry align="left">Valid for V4L2 subdev</entry>
122 </row>
123 </thead>
124 <tbody valign="top">
125 <row>
126 <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
127 <entry>(1 &lt;&lt; 0)</entry>
128 <entry>Suggest the driver it should choose greater or
129 equal rectangle (in size) than was requested. Albeit the
130 driver may choose a lesser size, it will only do so due to
131 hardware limitations. Without this flag (and
132 <constant>V4L2_SEL_FLAG_LE</constant>) the
133 behaviour is to choose the closest possible
134 rectangle.</entry>
135 <entry>Yes</entry>
136 <entry>Yes</entry>
137 </row>
138 <row>
139 <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
140 <entry>(1 &lt;&lt; 1)</entry>
141 <entry>Suggest the driver it
142 should choose lesser or equal rectangle (in size) than was
143 requested. Albeit the driver may choose a greater size, it
144 will only do so due to hardware limitations.</entry>
145 <entry>Yes</entry>
146 <entry>Yes</entry>
147 </row>
148 <row>
149 <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
150 <entry>(1 &lt;&lt; 2)</entry>
151 <entry>The configuration must not be propagated to any
152 further processing steps. If this flag is not given, the
153 configuration is propagated inside the subdevice to all
154 further processing steps.</entry>
155 <entry>No</entry>
156 <entry>Yes</entry>
157 </row>
158 </tbody>
159 </tgroup>
160 </table>
161
162 </section>
163
164</section>
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
new file mode 100644
index 00000000000..a0a936455fa
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -0,0 +1,2613 @@
1<section id="v4l2-mbus-format">
2 <title>Media Bus Formats</title>
3
4 <table pgwide="1" frame="none" id="v4l2-mbus-framefmt">
5 <title>struct <structname>v4l2_mbus_framefmt</structname></title>
6 <tgroup cols="3">
7 &cs-str;
8 <tbody valign="top">
9 <row>
10 <entry>__u32</entry>
11 <entry><structfield>width</structfield></entry>
12 <entry>Image width, in pixels.</entry>
13 </row>
14 <row>
15 <entry>__u32</entry>
16 <entry><structfield>height</structfield></entry>
17 <entry>Image height, in pixels.</entry>
18 </row>
19 <row>
20 <entry>__u32</entry>
21 <entry><structfield>code</structfield></entry>
22 <entry>Format code, from &v4l2-mbus-pixelcode;.</entry>
23 </row>
24 <row>
25 <entry>__u32</entry>
26 <entry><structfield>field</structfield></entry>
27 <entry>Field order, from &v4l2-field;. See
28 <xref linkend="field-order" /> for details.</entry>
29 </row>
30 <row>
31 <entry>__u32</entry>
32 <entry><structfield>colorspace</structfield></entry>
33 <entry>Image colorspace, from &v4l2-colorspace;. See
34 <xref linkend="colorspaces" /> for details.</entry>
35 </row>
36 <row>
37 <entry>__u32</entry>
38 <entry><structfield>reserved</structfield>[7]</entry>
39 <entry>Reserved for future extensions. Applications and drivers must
40 set the array to zero.</entry>
41 </row>
42 </tbody>
43 </tgroup>
44 </table>
45
46 <section id="v4l2-mbus-pixelcode">
47 <title>Media Bus Pixel Codes</title>
48
49 <para>The media bus pixel codes describe image formats as flowing over
50 physical busses (both between separate physical components and inside SoC
51 devices). This should not be confused with the V4L2 pixel formats that
52 describe, using four character codes, image formats as stored in memory.
53 </para>
54
55 <para>While there is a relationship between image formats on busses and
56 image formats in memory (a raw Bayer image won't be magically converted to
57 JPEG just by storing it to memory), there is no one-to-one correspondance
58 between them.</para>
59
60 <section>
61 <title>Packed RGB Formats</title>
62
63 <para>Those formats transfer pixel data as red, green and blue components.
64 The format code is made of the following information.
65 <itemizedlist>
66 <listitem><para>The red, green and blue components order code, as encoded in a
67 pixel sample. Possible values are RGB and BGR.</para></listitem>
68 <listitem><para>The number of bits per component, for each component. The values
69 can be different for all components. Common values are 555 and 565.</para>
70 </listitem>
71 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
72 the bus width must be transferred in multiple samples. Common values are
73 1 and 2.</para></listitem>
74 <listitem><para>The bus width.</para></listitem>
75 <listitem><para>For formats where the total number of bits per pixel is smaller
76 than the number of bus samples per pixel times the bus width, a padding
77 value stating if the bytes are padded in their most high order bits
78 (PADHI) or low order bits (PADLO).</para></listitem>
79 <listitem><para>For formats where the number of bus samples per pixel is larger
80 than 1, an endianness value stating if the pixel is transferred MSB first
81 (BE) or LSB first (LE).</para></listitem>
82 </itemizedlist>
83 </para>
84
85 <para>For instance, a format where pixels are encoded as 5-bits red, 5-bits
86 green and 5-bit blue values padded on the high bit, transferred as 2 8-bit
87 samples per pixel with the most significant bits (padding, red and half of
88 the green value) transferred first will be named
89 <constant>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</constant>.
90 </para>
91
92 <para>The following tables list existing packet RGB formats.</para>
93
94 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-rgb">
95 <title>RGB formats</title>
96 <tgroup cols="11">
97 <colspec colname="id" align="left" />
98 <colspec colname="code" align="center"/>
99 <colspec colname="bit" />
100 <colspec colnum="4" colname="b07" align="center" />
101 <colspec colnum="5" colname="b06" align="center" />
102 <colspec colnum="6" colname="b05" align="center" />
103 <colspec colnum="7" colname="b04" align="center" />
104 <colspec colnum="8" colname="b03" align="center" />
105 <colspec colnum="9" colname="b02" align="center" />
106 <colspec colnum="10" colname="b01" align="center" />
107 <colspec colnum="11" colname="b00" align="center" />
108 <spanspec namest="b07" nameend="b00" spanname="b0" />
109 <thead>
110 <row>
111 <entry>Identifier</entry>
112 <entry>Code</entry>
113 <entry></entry>
114 <entry spanname="b0">Data organization</entry>
115 </row>
116 <row>
117 <entry></entry>
118 <entry></entry>
119 <entry>Bit</entry>
120 <entry>7</entry>
121 <entry>6</entry>
122 <entry>5</entry>
123 <entry>4</entry>
124 <entry>3</entry>
125 <entry>2</entry>
126 <entry>1</entry>
127 <entry>0</entry>
128 </row>
129 </thead>
130 <tbody valign="top">
131 <row id="V4L2-MBUS-FMT-RGB444-2X8-PADHI-BE">
132 <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE</entry>
133 <entry>0x1001</entry>
134 <entry></entry>
135 <entry>0</entry>
136 <entry>0</entry>
137 <entry>0</entry>
138 <entry>0</entry>
139 <entry>r<subscript>3</subscript></entry>
140 <entry>r<subscript>2</subscript></entry>
141 <entry>r<subscript>1</subscript></entry>
142 <entry>r<subscript>0</subscript></entry>
143 </row>
144 <row>
145 <entry></entry>
146 <entry></entry>
147 <entry></entry>
148 <entry>g<subscript>3</subscript></entry>
149 <entry>g<subscript>2</subscript></entry>
150 <entry>g<subscript>1</subscript></entry>
151 <entry>g<subscript>0</subscript></entry>
152 <entry>b<subscript>3</subscript></entry>
153 <entry>b<subscript>2</subscript></entry>
154 <entry>b<subscript>1</subscript></entry>
155 <entry>b<subscript>0</subscript></entry>
156 </row>
157 <row id="V4L2-MBUS-FMT-RGB444-2X8-PADHI-LE">
158 <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE</entry>
159 <entry>0x1002</entry>
160 <entry></entry>
161 <entry>g<subscript>3</subscript></entry>
162 <entry>g<subscript>2</subscript></entry>
163 <entry>g<subscript>1</subscript></entry>
164 <entry>g<subscript>0</subscript></entry>
165 <entry>b<subscript>3</subscript></entry>
166 <entry>b<subscript>2</subscript></entry>
167 <entry>b<subscript>1</subscript></entry>
168 <entry>b<subscript>0</subscript></entry>
169 </row>
170 <row>
171 <entry></entry>
172 <entry></entry>
173 <entry></entry>
174 <entry>0</entry>
175 <entry>0</entry>
176 <entry>0</entry>
177 <entry>0</entry>
178 <entry>r<subscript>3</subscript></entry>
179 <entry>r<subscript>2</subscript></entry>
180 <entry>r<subscript>1</subscript></entry>
181 <entry>r<subscript>0</subscript></entry>
182 </row>
183 <row id="V4L2-MBUS-FMT-RGB555-2X8-PADHI-BE">
184 <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</entry>
185 <entry>0x1003</entry>
186 <entry></entry>
187 <entry>0</entry>
188 <entry>r<subscript>4</subscript></entry>
189 <entry>r<subscript>3</subscript></entry>
190 <entry>r<subscript>2</subscript></entry>
191 <entry>r<subscript>1</subscript></entry>
192 <entry>r<subscript>0</subscript></entry>
193 <entry>g<subscript>4</subscript></entry>
194 <entry>g<subscript>3</subscript></entry>
195 </row>
196 <row>
197 <entry></entry>
198 <entry></entry>
199 <entry></entry>
200 <entry>g<subscript>2</subscript></entry>
201 <entry>g<subscript>1</subscript></entry>
202 <entry>g<subscript>0</subscript></entry>
203 <entry>b<subscript>4</subscript></entry>
204 <entry>b<subscript>3</subscript></entry>
205 <entry>b<subscript>2</subscript></entry>
206 <entry>b<subscript>1</subscript></entry>
207 <entry>b<subscript>0</subscript></entry>
208 </row>
209 <row id="V4L2-MBUS-FMT-RGB555-2X8-PADHI-LE">
210 <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE</entry>
211 <entry>0x1004</entry>
212 <entry></entry>
213 <entry>g<subscript>2</subscript></entry>
214 <entry>g<subscript>1</subscript></entry>
215 <entry>g<subscript>0</subscript></entry>
216 <entry>b<subscript>4</subscript></entry>
217 <entry>b<subscript>3</subscript></entry>
218 <entry>b<subscript>2</subscript></entry>
219 <entry>b<subscript>1</subscript></entry>
220 <entry>b<subscript>0</subscript></entry>
221 </row>
222 <row>
223 <entry></entry>
224 <entry></entry>
225 <entry></entry>
226 <entry>0</entry>
227 <entry>r<subscript>4</subscript></entry>
228 <entry>r<subscript>3</subscript></entry>
229 <entry>r<subscript>2</subscript></entry>
230 <entry>r<subscript>1</subscript></entry>
231 <entry>r<subscript>0</subscript></entry>
232 <entry>g<subscript>4</subscript></entry>
233 <entry>g<subscript>3</subscript></entry>
234 </row>
235 <row id="V4L2-MBUS-FMT-BGR565-2X8-BE">
236 <entry>V4L2_MBUS_FMT_BGR565_2X8_BE</entry>
237 <entry>0x1005</entry>
238 <entry></entry>
239 <entry>b<subscript>4</subscript></entry>
240 <entry>b<subscript>3</subscript></entry>
241 <entry>b<subscript>2</subscript></entry>
242 <entry>b<subscript>1</subscript></entry>
243 <entry>b<subscript>0</subscript></entry>
244 <entry>g<subscript>5</subscript></entry>
245 <entry>g<subscript>4</subscript></entry>
246 <entry>g<subscript>3</subscript></entry>
247 </row>
248 <row>
249 <entry></entry>
250 <entry></entry>
251 <entry></entry>
252 <entry>g<subscript>2</subscript></entry>
253 <entry>g<subscript>1</subscript></entry>
254 <entry>g<subscript>0</subscript></entry>
255 <entry>r<subscript>4</subscript></entry>
256 <entry>r<subscript>3</subscript></entry>
257 <entry>r<subscript>2</subscript></entry>
258 <entry>r<subscript>1</subscript></entry>
259 <entry>r<subscript>0</subscript></entry>
260 </row>
261 <row id="V4L2-MBUS-FMT-BGR565-2X8-LE">
262 <entry>V4L2_MBUS_FMT_BGR565_2X8_LE</entry>
263 <entry>0x1006</entry>
264 <entry></entry>
265 <entry>g<subscript>2</subscript></entry>
266 <entry>g<subscript>1</subscript></entry>
267 <entry>g<subscript>0</subscript></entry>
268 <entry>r<subscript>4</subscript></entry>
269 <entry>r<subscript>3</subscript></entry>
270 <entry>r<subscript>2</subscript></entry>
271 <entry>r<subscript>1</subscript></entry>
272 <entry>r<subscript>0</subscript></entry>
273 </row>
274 <row>
275 <entry></entry>
276 <entry></entry>
277 <entry></entry>
278 <entry>b<subscript>4</subscript></entry>
279 <entry>b<subscript>3</subscript></entry>
280 <entry>b<subscript>2</subscript></entry>
281 <entry>b<subscript>1</subscript></entry>
282 <entry>b<subscript>0</subscript></entry>
283 <entry>g<subscript>5</subscript></entry>
284 <entry>g<subscript>4</subscript></entry>
285 <entry>g<subscript>3</subscript></entry>
286 </row>
287 <row id="V4L2-MBUS-FMT-RGB565-2X8-BE">
288 <entry>V4L2_MBUS_FMT_RGB565_2X8_BE</entry>
289 <entry>0x1007</entry>
290 <entry></entry>
291 <entry>r<subscript>4</subscript></entry>
292 <entry>r<subscript>3</subscript></entry>
293 <entry>r<subscript>2</subscript></entry>
294 <entry>r<subscript>1</subscript></entry>
295 <entry>r<subscript>0</subscript></entry>
296 <entry>g<subscript>5</subscript></entry>
297 <entry>g<subscript>4</subscript></entry>
298 <entry>g<subscript>3</subscript></entry>
299 </row>
300 <row>
301 <entry></entry>
302 <entry></entry>
303 <entry></entry>
304 <entry>g<subscript>2</subscript></entry>
305 <entry>g<subscript>1</subscript></entry>
306 <entry>g<subscript>0</subscript></entry>
307 <entry>b<subscript>4</subscript></entry>
308 <entry>b<subscript>3</subscript></entry>
309 <entry>b<subscript>2</subscript></entry>
310 <entry>b<subscript>1</subscript></entry>
311 <entry>b<subscript>0</subscript></entry>
312 </row>
313 <row id="V4L2-MBUS-FMT-RGB565-2X8-LE">
314 <entry>V4L2_MBUS_FMT_RGB565_2X8_LE</entry>
315 <entry>0x1008</entry>
316 <entry></entry>
317 <entry>g<subscript>2</subscript></entry>
318 <entry>g<subscript>1</subscript></entry>
319 <entry>g<subscript>0</subscript></entry>
320 <entry>b<subscript>4</subscript></entry>
321 <entry>b<subscript>3</subscript></entry>
322 <entry>b<subscript>2</subscript></entry>
323 <entry>b<subscript>1</subscript></entry>
324 <entry>b<subscript>0</subscript></entry>
325 </row>
326 <row>
327 <entry></entry>
328 <entry></entry>
329 <entry></entry>
330 <entry>r<subscript>4</subscript></entry>
331 <entry>r<subscript>3</subscript></entry>
332 <entry>r<subscript>2</subscript></entry>
333 <entry>r<subscript>1</subscript></entry>
334 <entry>r<subscript>0</subscript></entry>
335 <entry>g<subscript>5</subscript></entry>
336 <entry>g<subscript>4</subscript></entry>
337 <entry>g<subscript>3</subscript></entry>
338 </row>
339 </tbody>
340 </tgroup>
341 </table>
342 </section>
343
344 <section>
345 <title>Bayer Formats</title>
346
347 <para>Those formats transfer pixel data as red, green and blue components.
348 The format code is made of the following information.
349 <itemizedlist>
350 <listitem><para>The red, green and blue components order code, as encoded in a
351 pixel sample. The possible values are shown in <xref
352 linkend="bayer-patterns" />.</para></listitem>
353 <listitem><para>The number of bits per pixel component. All components are
354 transferred on the same number of bits. Common values are 8, 10 and 12.</para>
355 </listitem>
356 <listitem><para>If the pixel components are DPCM-compressed, a mention of the
357 DPCM compression and the number of bits per compressed pixel component.</para>
358 </listitem>
359 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
360 the bus width must be transferred in multiple samples. Common values are
361 1 and 2.</para></listitem>
362 <listitem><para>The bus width.</para></listitem>
363 <listitem><para>For formats where the total number of bits per pixel is smaller
364 than the number of bus samples per pixel times the bus width, a padding
365 value stating if the bytes are padded in their most high order bits
366 (PADHI) or low order bits (PADLO).</para></listitem>
367 <listitem><para>For formats where the number of bus samples per pixel is larger
368 than 1, an endianness value stating if the pixel is transferred MSB first
369 (BE) or LSB first (LE).</para></listitem>
370 </itemizedlist>
371 </para>
372
373 <para>For instance, a format with uncompressed 10-bit Bayer components
374 arranged in a red, green, green, blue pattern transferred as 2 8-bit
375 samples per pixel with the least significant bits transferred first will
376 be named <constant>V4L2_MBUS_FMT_SRGGB10_2X8_PADHI_LE</constant>.
377 </para>
378
379 <figure id="bayer-patterns">
380 <title>Bayer Patterns</title>
381 <mediaobject>
382 <imageobject>
383 <imagedata fileref="bayer.png" format="PNG" />
384 </imageobject>
385 <textobject>
386 <phrase>Bayer filter color patterns</phrase>
387 </textobject>
388 </mediaobject>
389 </figure>
390
391 <para>The following table lists existing packet Bayer formats. The data
392 organization is given as an example for the first pixel only.</para>
393
394 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-bayer">
395 <title>Bayer Formats</title>
396 <tgroup cols="15">
397 <colspec colname="id" align="left" />
398 <colspec colname="code" align="center"/>
399 <colspec colname="bit" />
400 <colspec colnum="4" colname="b11" align="center" />
401 <colspec colnum="5" colname="b10" align="center" />
402 <colspec colnum="6" colname="b09" align="center" />
403 <colspec colnum="7" colname="b08" align="center" />
404 <colspec colnum="8" colname="b07" align="center" />
405 <colspec colnum="9" colname="b06" align="center" />
406 <colspec colnum="10" colname="b05" align="center" />
407 <colspec colnum="11" colname="b04" align="center" />
408 <colspec colnum="12" colname="b03" align="center" />
409 <colspec colnum="13" colname="b02" align="center" />
410 <colspec colnum="14" colname="b01" align="center" />
411 <colspec colnum="15" colname="b00" align="center" />
412 <spanspec namest="b11" nameend="b00" spanname="b0" />
413 <thead>
414 <row>
415 <entry>Identifier</entry>
416 <entry>Code</entry>
417 <entry></entry>
418 <entry spanname="b0">Data organization</entry>
419 </row>
420 <row>
421 <entry></entry>
422 <entry></entry>
423 <entry>Bit</entry>
424 <entry>11</entry>
425 <entry>10</entry>
426 <entry>9</entry>
427 <entry>8</entry>
428 <entry>7</entry>
429 <entry>6</entry>
430 <entry>5</entry>
431 <entry>4</entry>
432 <entry>3</entry>
433 <entry>2</entry>
434 <entry>1</entry>
435 <entry>0</entry>
436 </row>
437 </thead>
438 <tbody valign="top">
439 <row id="V4L2-MBUS-FMT-SBGGR8-1X8">
440 <entry>V4L2_MBUS_FMT_SBGGR8_1X8</entry>
441 <entry>0x3001</entry>
442 <entry></entry>
443 <entry>-</entry>
444 <entry>-</entry>
445 <entry>-</entry>
446 <entry>-</entry>
447 <entry>b<subscript>7</subscript></entry>
448 <entry>b<subscript>6</subscript></entry>
449 <entry>b<subscript>5</subscript></entry>
450 <entry>b<subscript>4</subscript></entry>
451 <entry>b<subscript>3</subscript></entry>
452 <entry>b<subscript>2</subscript></entry>
453 <entry>b<subscript>1</subscript></entry>
454 <entry>b<subscript>0</subscript></entry>
455 </row>
456 <row id="V4L2-MBUS-FMT-SGBRG8-1X8">
457 <entry>V4L2_MBUS_FMT_SGBRG8_1X8</entry>
458 <entry>0x3013</entry>
459 <entry></entry>
460 <entry>-</entry>
461 <entry>-</entry>
462 <entry>-</entry>
463 <entry>-</entry>
464 <entry>g<subscript>7</subscript></entry>
465 <entry>g<subscript>6</subscript></entry>
466 <entry>g<subscript>5</subscript></entry>
467 <entry>g<subscript>4</subscript></entry>
468 <entry>g<subscript>3</subscript></entry>
469 <entry>g<subscript>2</subscript></entry>
470 <entry>g<subscript>1</subscript></entry>
471 <entry>g<subscript>0</subscript></entry>
472 </row>
473 <row id="V4L2-MBUS-FMT-SGRBG8-1X8">
474 <entry>V4L2_MBUS_FMT_SGRBG8_1X8</entry>
475 <entry>0x3002</entry>
476 <entry></entry>
477 <entry>-</entry>
478 <entry>-</entry>
479 <entry>-</entry>
480 <entry>-</entry>
481 <entry>g<subscript>7</subscript></entry>
482 <entry>g<subscript>6</subscript></entry>
483 <entry>g<subscript>5</subscript></entry>
484 <entry>g<subscript>4</subscript></entry>
485 <entry>g<subscript>3</subscript></entry>
486 <entry>g<subscript>2</subscript></entry>
487 <entry>g<subscript>1</subscript></entry>
488 <entry>g<subscript>0</subscript></entry>
489 </row>
490 <row id="V4L2-MBUS-FMT-SRGGB8-1X8">
491 <entry>V4L2_MBUS_FMT_SRGGB8_1X8</entry>
492 <entry>0x3014</entry>
493 <entry></entry>
494 <entry>-</entry>
495 <entry>-</entry>
496 <entry>-</entry>
497 <entry>-</entry>
498 <entry>r<subscript>7</subscript></entry>
499 <entry>r<subscript>6</subscript></entry>
500 <entry>r<subscript>5</subscript></entry>
501 <entry>r<subscript>4</subscript></entry>
502 <entry>r<subscript>3</subscript></entry>
503 <entry>r<subscript>2</subscript></entry>
504 <entry>r<subscript>1</subscript></entry>
505 <entry>r<subscript>0</subscript></entry>
506 </row>
507 <row id="V4L2-MBUS-FMT-SBGGR10-DPCM8-1X8">
508 <entry>V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8</entry>
509 <entry>0x300b</entry>
510 <entry></entry>
511 <entry>-</entry>
512 <entry>-</entry>
513 <entry>-</entry>
514 <entry>-</entry>
515 <entry>b<subscript>7</subscript></entry>
516 <entry>b<subscript>6</subscript></entry>
517 <entry>b<subscript>5</subscript></entry>
518 <entry>b<subscript>4</subscript></entry>
519 <entry>b<subscript>3</subscript></entry>
520 <entry>b<subscript>2</subscript></entry>
521 <entry>b<subscript>1</subscript></entry>
522 <entry>b<subscript>0</subscript></entry>
523 </row>
524 <row id="V4L2-MBUS-FMT-SGBRG10-DPCM8-1X8">
525 <entry>V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8</entry>
526 <entry>0x300c</entry>
527 <entry></entry>
528 <entry>-</entry>
529 <entry>-</entry>
530 <entry>-</entry>
531 <entry>-</entry>
532 <entry>g<subscript>7</subscript></entry>
533 <entry>g<subscript>6</subscript></entry>
534 <entry>g<subscript>5</subscript></entry>
535 <entry>g<subscript>4</subscript></entry>
536 <entry>g<subscript>3</subscript></entry>
537 <entry>g<subscript>2</subscript></entry>
538 <entry>g<subscript>1</subscript></entry>
539 <entry>g<subscript>0</subscript></entry>
540 </row>
541 <row id="V4L2-MBUS-FMT-SGRBG10-DPCM8-1X8">
542 <entry>V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8</entry>
543 <entry>0x3009</entry>
544 <entry></entry>
545 <entry>-</entry>
546 <entry>-</entry>
547 <entry>-</entry>
548 <entry>-</entry>
549 <entry>g<subscript>7</subscript></entry>
550 <entry>g<subscript>6</subscript></entry>
551 <entry>g<subscript>5</subscript></entry>
552 <entry>g<subscript>4</subscript></entry>
553 <entry>g<subscript>3</subscript></entry>
554 <entry>g<subscript>2</subscript></entry>
555 <entry>g<subscript>1</subscript></entry>
556 <entry>g<subscript>0</subscript></entry>
557 </row>
558 <row id="V4L2-MBUS-FMT-SRGGB10-DPCM8-1X8">
559 <entry>V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8</entry>
560 <entry>0x300d</entry>
561 <entry></entry>
562 <entry>-</entry>
563 <entry>-</entry>
564 <entry>-</entry>
565 <entry>-</entry>
566 <entry>r<subscript>7</subscript></entry>
567 <entry>r<subscript>6</subscript></entry>
568 <entry>r<subscript>5</subscript></entry>
569 <entry>r<subscript>4</subscript></entry>
570 <entry>r<subscript>3</subscript></entry>
571 <entry>r<subscript>2</subscript></entry>
572 <entry>r<subscript>1</subscript></entry>
573 <entry>r<subscript>0</subscript></entry>
574 </row>
575 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADHI-BE">
576 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE</entry>
577 <entry>0x3003</entry>
578 <entry></entry>
579 <entry>-</entry>
580 <entry>-</entry>
581 <entry>-</entry>
582 <entry>-</entry>
583 <entry>0</entry>
584 <entry>0</entry>
585 <entry>0</entry>
586 <entry>0</entry>
587 <entry>0</entry>
588 <entry>0</entry>
589 <entry>b<subscript>9</subscript></entry>
590 <entry>b<subscript>8</subscript></entry>
591 </row>
592 <row>
593 <entry></entry>
594 <entry></entry>
595 <entry></entry>
596 <entry>-</entry>
597 <entry>-</entry>
598 <entry>-</entry>
599 <entry>-</entry>
600 <entry>b<subscript>7</subscript></entry>
601 <entry>b<subscript>6</subscript></entry>
602 <entry>b<subscript>5</subscript></entry>
603 <entry>b<subscript>4</subscript></entry>
604 <entry>b<subscript>3</subscript></entry>
605 <entry>b<subscript>2</subscript></entry>
606 <entry>b<subscript>1</subscript></entry>
607 <entry>b<subscript>0</subscript></entry>
608 </row>
609 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADHI-LE">
610 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE</entry>
611 <entry>0x3004</entry>
612 <entry></entry>
613 <entry>-</entry>
614 <entry>-</entry>
615 <entry>-</entry>
616 <entry>-</entry>
617 <entry>b<subscript>7</subscript></entry>
618 <entry>b<subscript>6</subscript></entry>
619 <entry>b<subscript>5</subscript></entry>
620 <entry>b<subscript>4</subscript></entry>
621 <entry>b<subscript>3</subscript></entry>
622 <entry>b<subscript>2</subscript></entry>
623 <entry>b<subscript>1</subscript></entry>
624 <entry>b<subscript>0</subscript></entry>
625 </row>
626 <row>
627 <entry></entry>
628 <entry></entry>
629 <entry></entry>
630 <entry>-</entry>
631 <entry>-</entry>
632 <entry>-</entry>
633 <entry>-</entry>
634 <entry>0</entry>
635 <entry>0</entry>
636 <entry>0</entry>
637 <entry>0</entry>
638 <entry>0</entry>
639 <entry>0</entry>
640 <entry>b<subscript>9</subscript></entry>
641 <entry>b<subscript>8</subscript></entry>
642 </row>
643 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADLO-BE">
644 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE</entry>
645 <entry>0x3005</entry>
646 <entry></entry>
647 <entry>-</entry>
648 <entry>-</entry>
649 <entry>-</entry>
650 <entry>-</entry>
651 <entry>b<subscript>9</subscript></entry>
652 <entry>b<subscript>8</subscript></entry>
653 <entry>b<subscript>7</subscript></entry>
654 <entry>b<subscript>6</subscript></entry>
655 <entry>b<subscript>5</subscript></entry>
656 <entry>b<subscript>4</subscript></entry>
657 <entry>b<subscript>3</subscript></entry>
658 <entry>b<subscript>2</subscript></entry>
659 </row>
660 <row>
661 <entry></entry>
662 <entry></entry>
663 <entry></entry>
664 <entry>-</entry>
665 <entry>-</entry>
666 <entry>-</entry>
667 <entry>-</entry>
668 <entry>b<subscript>1</subscript></entry>
669 <entry>b<subscript>0</subscript></entry>
670 <entry>0</entry>
671 <entry>0</entry>
672 <entry>0</entry>
673 <entry>0</entry>
674 <entry>0</entry>
675 <entry>0</entry>
676 </row>
677 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADLO-LE">
678 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE</entry>
679 <entry>0x3006</entry>
680 <entry></entry>
681 <entry>-</entry>
682 <entry>-</entry>
683 <entry>-</entry>
684 <entry>-</entry>
685 <entry>b<subscript>1</subscript></entry>
686 <entry>b<subscript>0</subscript></entry>
687 <entry>0</entry>
688 <entry>0</entry>
689 <entry>0</entry>
690 <entry>0</entry>
691 <entry>0</entry>
692 <entry>0</entry>
693 </row>
694 <row>
695 <entry></entry>
696 <entry></entry>
697 <entry></entry>
698 <entry>-</entry>
699 <entry>-</entry>
700 <entry>-</entry>
701 <entry>-</entry>
702 <entry>b<subscript>9</subscript></entry>
703 <entry>b<subscript>8</subscript></entry>
704 <entry>b<subscript>7</subscript></entry>
705 <entry>b<subscript>6</subscript></entry>
706 <entry>b<subscript>5</subscript></entry>
707 <entry>b<subscript>4</subscript></entry>
708 <entry>b<subscript>3</subscript></entry>
709 <entry>b<subscript>2</subscript></entry>
710 </row>
711 <row id="V4L2-MBUS-FMT-SBGGR10-1X10">
712 <entry>V4L2_MBUS_FMT_SBGGR10_1X10</entry>
713 <entry>0x3007</entry>
714 <entry></entry>
715 <entry>-</entry>
716 <entry>-</entry>
717 <entry>b<subscript>9</subscript></entry>
718 <entry>b<subscript>8</subscript></entry>
719 <entry>b<subscript>7</subscript></entry>
720 <entry>b<subscript>6</subscript></entry>
721 <entry>b<subscript>5</subscript></entry>
722 <entry>b<subscript>4</subscript></entry>
723 <entry>b<subscript>3</subscript></entry>
724 <entry>b<subscript>2</subscript></entry>
725 <entry>b<subscript>1</subscript></entry>
726 <entry>b<subscript>0</subscript></entry>
727 </row>
728 <row id="V4L2-MBUS-FMT-SGBRG10-1X10">
729 <entry>V4L2_MBUS_FMT_SGBRG10_1X10</entry>
730 <entry>0x300e</entry>
731 <entry></entry>
732 <entry>-</entry>
733 <entry>-</entry>
734 <entry>g<subscript>9</subscript></entry>
735 <entry>g<subscript>8</subscript></entry>
736 <entry>g<subscript>7</subscript></entry>
737 <entry>g<subscript>6</subscript></entry>
738 <entry>g<subscript>5</subscript></entry>
739 <entry>g<subscript>4</subscript></entry>
740 <entry>g<subscript>3</subscript></entry>
741 <entry>g<subscript>2</subscript></entry>
742 <entry>g<subscript>1</subscript></entry>
743 <entry>g<subscript>0</subscript></entry>
744 </row>
745 <row id="V4L2-MBUS-FMT-SGRBG10-1X10">
746 <entry>V4L2_MBUS_FMT_SGRBG10_1X10</entry>
747 <entry>0x300a</entry>
748 <entry></entry>
749 <entry>-</entry>
750 <entry>-</entry>
751 <entry>g<subscript>9</subscript></entry>
752 <entry>g<subscript>8</subscript></entry>
753 <entry>g<subscript>7</subscript></entry>
754 <entry>g<subscript>6</subscript></entry>
755 <entry>g<subscript>5</subscript></entry>
756 <entry>g<subscript>4</subscript></entry>
757 <entry>g<subscript>3</subscript></entry>
758 <entry>g<subscript>2</subscript></entry>
759 <entry>g<subscript>1</subscript></entry>
760 <entry>g<subscript>0</subscript></entry>
761 </row>
762 <row id="V4L2-MBUS-FMT-SRGGB10-1X10">
763 <entry>V4L2_MBUS_FMT_SRGGB10_1X10</entry>
764 <entry>0x300f</entry>
765 <entry></entry>
766 <entry>-</entry>
767 <entry>-</entry>
768 <entry>r<subscript>9</subscript></entry>
769 <entry>r<subscript>8</subscript></entry>
770 <entry>r<subscript>7</subscript></entry>
771 <entry>r<subscript>6</subscript></entry>
772 <entry>r<subscript>5</subscript></entry>
773 <entry>r<subscript>4</subscript></entry>
774 <entry>r<subscript>3</subscript></entry>
775 <entry>r<subscript>2</subscript></entry>
776 <entry>r<subscript>1</subscript></entry>
777 <entry>r<subscript>0</subscript></entry>
778 </row>
779 <row id="V4L2-MBUS-FMT-SBGGR12-1X12">
780 <entry>V4L2_MBUS_FMT_SBGGR12_1X12</entry>
781 <entry>0x3008</entry>
782 <entry></entry>
783 <entry>b<subscript>11</subscript></entry>
784 <entry>b<subscript>10</subscript></entry>
785 <entry>b<subscript>9</subscript></entry>
786 <entry>b<subscript>8</subscript></entry>
787 <entry>b<subscript>7</subscript></entry>
788 <entry>b<subscript>6</subscript></entry>
789 <entry>b<subscript>5</subscript></entry>
790 <entry>b<subscript>4</subscript></entry>
791 <entry>b<subscript>3</subscript></entry>
792 <entry>b<subscript>2</subscript></entry>
793 <entry>b<subscript>1</subscript></entry>
794 <entry>b<subscript>0</subscript></entry>
795 </row>
796 <row id="V4L2-MBUS-FMT-SGBRG12-1X12">
797 <entry>V4L2_MBUS_FMT_SGBRG12_1X12</entry>
798 <entry>0x3010</entry>
799 <entry></entry>
800 <entry>g<subscript>11</subscript></entry>
801 <entry>g<subscript>10</subscript></entry>
802 <entry>g<subscript>9</subscript></entry>
803 <entry>g<subscript>8</subscript></entry>
804 <entry>g<subscript>7</subscript></entry>
805 <entry>g<subscript>6</subscript></entry>
806 <entry>g<subscript>5</subscript></entry>
807 <entry>g<subscript>4</subscript></entry>
808 <entry>g<subscript>3</subscript></entry>
809 <entry>g<subscript>2</subscript></entry>
810 <entry>g<subscript>1</subscript></entry>
811 <entry>g<subscript>0</subscript></entry>
812 </row>
813 <row id="V4L2-MBUS-FMT-SGRBG12-1X12">
814 <entry>V4L2_MBUS_FMT_SGRBG12_1X12</entry>
815 <entry>0x3011</entry>
816 <entry></entry>
817 <entry>g<subscript>11</subscript></entry>
818 <entry>g<subscript>10</subscript></entry>
819 <entry>g<subscript>9</subscript></entry>
820 <entry>g<subscript>8</subscript></entry>
821 <entry>g<subscript>7</subscript></entry>
822 <entry>g<subscript>6</subscript></entry>
823 <entry>g<subscript>5</subscript></entry>
824 <entry>g<subscript>4</subscript></entry>
825 <entry>g<subscript>3</subscript></entry>
826 <entry>g<subscript>2</subscript></entry>
827 <entry>g<subscript>1</subscript></entry>
828 <entry>g<subscript>0</subscript></entry>
829 </row>
830 <row id="V4L2-MBUS-FMT-SRGGB12-1X12">
831 <entry>V4L2_MBUS_FMT_SRGGB12_1X12</entry>
832 <entry>0x3012</entry>
833 <entry></entry>
834 <entry>r<subscript>11</subscript></entry>
835 <entry>r<subscript>10</subscript></entry>
836 <entry>r<subscript>9</subscript></entry>
837 <entry>r<subscript>8</subscript></entry>
838 <entry>r<subscript>7</subscript></entry>
839 <entry>r<subscript>6</subscript></entry>
840 <entry>r<subscript>5</subscript></entry>
841 <entry>r<subscript>4</subscript></entry>
842 <entry>r<subscript>3</subscript></entry>
843 <entry>r<subscript>2</subscript></entry>
844 <entry>r<subscript>1</subscript></entry>
845 <entry>r<subscript>0</subscript></entry>
846 </row>
847 </tbody>
848 </tgroup>
849 </table>
850 </section>
851
852 <section>
853 <title>Packed YUV Formats</title>
854
855 <para>Those data formats transfer pixel data as (possibly downsampled) Y, U
856 and V components. The format code is made of the following information.
857 <itemizedlist>
858 <listitem><para>The Y, U and V components order code, as transferred on the
859 bus. Possible values are YUYV, UYVY, YVYU and VYUY.</para></listitem>
860 <listitem><para>The number of bits per pixel component. All components are
861 transferred on the same number of bits. Common values are 8, 10 and 12.</para>
862 </listitem>
863 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
864 the bus width must be transferred in multiple samples. Common values are
865 1, 1.5 (encoded as 1_5) and 2.</para></listitem>
866 <listitem><para>The bus width. When the bus width is larger than the number of
867 bits per pixel component, several components are packed in a single bus
868 sample. The components are ordered as specified by the order code, with
869 components on the left of the code transferred in the high order bits.
870 Common values are 8 and 16.</para>
871 </listitem>
872 </itemizedlist>
873 </para>
874
875 <para>For instance, a format where pixels are encoded as 8-bit YUV values
876 downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in the
877 U, Y, V, Y order will be named <constant>V4L2_MBUS_FMT_UYVY8_2X8</constant>.
878 </para>
879
880 <para>The following table lisst existing packet YUV formats.</para>
881
882 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-yuv8">
883 <title>YUV Formats</title>
884 <tgroup cols="23">
885 <colspec colname="id" align="left" />
886 <colspec colname="code" align="center"/>
887 <colspec colname="bit" />
888 <colspec colnum="4" colname="b19" align="center" />
889 <colspec colnum="5" colname="b18" align="center" />
890 <colspec colnum="6" colname="b17" align="center" />
891 <colspec colnum="7" colname="b16" align="center" />
892 <colspec colnum="8" colname="b15" align="center" />
893 <colspec colnum="9" colname="b14" align="center" />
894 <colspec colnum="10" colname="b13" align="center" />
895 <colspec colnum="11" colname="b12" align="center" />
896 <colspec colnum="12" colname="b11" align="center" />
897 <colspec colnum="13" colname="b10" align="center" />
898 <colspec colnum="14" colname="b09" align="center" />
899 <colspec colnum="15" colname="b08" align="center" />
900 <colspec colnum="16" colname="b07" align="center" />
901 <colspec colnum="17" colname="b06" align="center" />
902 <colspec colnum="18" colname="b05" align="center" />
903 <colspec colnum="19" colname="b04" align="center" />
904 <colspec colnum="20" colname="b03" align="center" />
905 <colspec colnum="21" colname="b02" align="center" />
906 <colspec colnum="22" colname="b01" align="center" />
907 <colspec colnum="23" colname="b00" align="center" />
908 <spanspec namest="b19" nameend="b00" spanname="b0" />
909 <thead>
910 <row>
911 <entry>Identifier</entry>
912 <entry>Code</entry>
913 <entry></entry>
914 <entry spanname="b0">Data organization</entry>
915 </row>
916 <row>
917 <entry></entry>
918 <entry></entry>
919 <entry>Bit</entry>
920 <entry>19</entry>
921 <entry>18</entry>
922 <entry>17</entry>
923 <entry>16</entry>
924 <entry>15</entry>
925 <entry>14</entry>
926 <entry>13</entry>
927 <entry>12</entry>
928 <entry>11</entry>
929 <entry>10</entry>
930 <entry>9</entry>
931 <entry>8</entry>
932 <entry>7</entry>
933 <entry>6</entry>
934 <entry>5</entry>
935 <entry>4</entry>
936 <entry>3</entry>
937 <entry>2</entry>
938 <entry>1</entry>
939 <entry>0</entry>
940 </row>
941 </thead>
942 <tbody valign="top">
943 <row id="V4L2-MBUS-FMT-Y8-1X8">
944 <entry>V4L2_MBUS_FMT_Y8_1X8</entry>
945 <entry>0x2001</entry>
946 <entry></entry>
947 <entry>-</entry>
948 <entry>-</entry>
949 <entry>-</entry>
950 <entry>-</entry>
951 <entry>-</entry>
952 <entry>-</entry>
953 <entry>-</entry>
954 <entry>-</entry>
955 <entry>-</entry>
956 <entry>-</entry>
957 <entry>-</entry>
958 <entry>-</entry>
959 <entry>y<subscript>7</subscript></entry>
960 <entry>y<subscript>6</subscript></entry>
961 <entry>y<subscript>5</subscript></entry>
962 <entry>y<subscript>4</subscript></entry>
963 <entry>y<subscript>3</subscript></entry>
964 <entry>y<subscript>2</subscript></entry>
965 <entry>y<subscript>1</subscript></entry>
966 <entry>y<subscript>0</subscript></entry>
967 </row>
968 <row id="V4L2-MBUS-FMT-UYVY8-1_5X8">
969 <entry>V4L2_MBUS_FMT_UYVY8_1_5X8</entry>
970 <entry>0x2002</entry>
971 <entry></entry>
972 <entry>-</entry>
973 <entry>-</entry>
974 <entry>-</entry>
975 <entry>-</entry>
976 <entry>-</entry>
977 <entry>-</entry>
978 <entry>-</entry>
979 <entry>-</entry>
980 <entry>-</entry>
981 <entry>-</entry>
982 <entry>-</entry>
983 <entry>-</entry>
984 <entry>u<subscript>7</subscript></entry>
985 <entry>u<subscript>6</subscript></entry>
986 <entry>u<subscript>5</subscript></entry>
987 <entry>u<subscript>4</subscript></entry>
988 <entry>u<subscript>3</subscript></entry>
989 <entry>u<subscript>2</subscript></entry>
990 <entry>u<subscript>1</subscript></entry>
991 <entry>u<subscript>0</subscript></entry>
992 </row>
993 <row>
994 <entry></entry>
995 <entry></entry>
996 <entry></entry>
997 <entry>-</entry>
998 <entry>-</entry>
999 <entry>-</entry>
1000 <entry>-</entry>
1001 <entry>-</entry>
1002 <entry>-</entry>
1003 <entry>-</entry>
1004 <entry>-</entry>
1005 <entry>-</entry>
1006 <entry>-</entry>
1007 <entry>-</entry>
1008 <entry>-</entry>
1009 <entry>y<subscript>7</subscript></entry>
1010 <entry>y<subscript>6</subscript></entry>
1011 <entry>y<subscript>5</subscript></entry>
1012 <entry>y<subscript>4</subscript></entry>
1013 <entry>y<subscript>3</subscript></entry>
1014 <entry>y<subscript>2</subscript></entry>
1015 <entry>y<subscript>1</subscript></entry>
1016 <entry>y<subscript>0</subscript></entry>
1017 </row>
1018 <row>
1019 <entry></entry>
1020 <entry></entry>
1021 <entry></entry>
1022 <entry>-</entry>
1023 <entry>-</entry>
1024 <entry>-</entry>
1025 <entry>-</entry>
1026 <entry>-</entry>
1027 <entry>-</entry>
1028 <entry>-</entry>
1029 <entry>-</entry>
1030 <entry>-</entry>
1031 <entry>-</entry>
1032 <entry>-</entry>
1033 <entry>-</entry>
1034 <entry>y<subscript>7</subscript></entry>
1035 <entry>y<subscript>6</subscript></entry>
1036 <entry>y<subscript>5</subscript></entry>
1037 <entry>y<subscript>4</subscript></entry>
1038 <entry>y<subscript>3</subscript></entry>
1039 <entry>y<subscript>2</subscript></entry>
1040 <entry>y<subscript>1</subscript></entry>
1041 <entry>y<subscript>0</subscript></entry>
1042 </row>
1043 <row>
1044 <entry></entry>
1045 <entry></entry>
1046 <entry></entry>
1047 <entry>-</entry>
1048 <entry>-</entry>
1049 <entry>-</entry>
1050 <entry>-</entry>
1051 <entry>-</entry>
1052 <entry>-</entry>
1053 <entry>-</entry>
1054 <entry>-</entry>
1055 <entry>-</entry>
1056 <entry>-</entry>
1057 <entry>-</entry>
1058 <entry>-</entry>
1059 <entry>v<subscript>7</subscript></entry>
1060 <entry>v<subscript>6</subscript></entry>
1061 <entry>v<subscript>5</subscript></entry>
1062 <entry>v<subscript>4</subscript></entry>
1063 <entry>v<subscript>3</subscript></entry>
1064 <entry>v<subscript>2</subscript></entry>
1065 <entry>v<subscript>1</subscript></entry>
1066 <entry>v<subscript>0</subscript></entry>
1067 </row>
1068 <row>
1069 <entry></entry>
1070 <entry></entry>
1071 <entry></entry>
1072 <entry>-</entry>
1073 <entry>-</entry>
1074 <entry>-</entry>
1075 <entry>-</entry>
1076 <entry>-</entry>
1077 <entry>-</entry>
1078 <entry>-</entry>
1079 <entry>-</entry>
1080 <entry>-</entry>
1081 <entry>-</entry>
1082 <entry>-</entry>
1083 <entry>-</entry>
1084 <entry>y<subscript>7</subscript></entry>
1085 <entry>y<subscript>6</subscript></entry>
1086 <entry>y<subscript>5</subscript></entry>
1087 <entry>y<subscript>4</subscript></entry>
1088 <entry>y<subscript>3</subscript></entry>
1089 <entry>y<subscript>2</subscript></entry>
1090 <entry>y<subscript>1</subscript></entry>
1091 <entry>y<subscript>0</subscript></entry>
1092 </row>
1093 <row>
1094 <entry></entry>
1095 <entry></entry>
1096 <entry></entry>
1097 <entry>-</entry>
1098 <entry>-</entry>
1099 <entry>-</entry>
1100 <entry>-</entry>
1101 <entry>-</entry>
1102 <entry>-</entry>
1103 <entry>-</entry>
1104 <entry>-</entry>
1105 <entry>-</entry>
1106 <entry>-</entry>
1107 <entry>-</entry>
1108 <entry>-</entry>
1109 <entry>y<subscript>7</subscript></entry>
1110 <entry>y<subscript>6</subscript></entry>
1111 <entry>y<subscript>5</subscript></entry>
1112 <entry>y<subscript>4</subscript></entry>
1113 <entry>y<subscript>3</subscript></entry>
1114 <entry>y<subscript>2</subscript></entry>
1115 <entry>y<subscript>1</subscript></entry>
1116 <entry>y<subscript>0</subscript></entry>
1117 </row>
1118 <row id="V4L2-MBUS-FMT-VYUY8-1_5X8">
1119 <entry>V4L2_MBUS_FMT_VYUY8_1_5X8</entry>
1120 <entry>0x2003</entry>
1121 <entry></entry>
1122 <entry>-</entry>
1123 <entry>-</entry>
1124 <entry>-</entry>
1125 <entry>-</entry>
1126 <entry>-</entry>
1127 <entry>-</entry>
1128 <entry>-</entry>
1129 <entry>-</entry>
1130 <entry>-</entry>
1131 <entry>-</entry>
1132 <entry>-</entry>
1133 <entry>-</entry>
1134 <entry>v<subscript>7</subscript></entry>
1135 <entry>v<subscript>6</subscript></entry>
1136 <entry>v<subscript>5</subscript></entry>
1137 <entry>v<subscript>4</subscript></entry>
1138 <entry>v<subscript>3</subscript></entry>
1139 <entry>v<subscript>2</subscript></entry>
1140 <entry>v<subscript>1</subscript></entry>
1141 <entry>v<subscript>0</subscript></entry>
1142 </row>
1143 <row>
1144 <entry></entry>
1145 <entry></entry>
1146 <entry></entry>
1147 <entry>-</entry>
1148 <entry>-</entry>
1149 <entry>-</entry>
1150 <entry>-</entry>
1151 <entry>-</entry>
1152 <entry>-</entry>
1153 <entry>-</entry>
1154 <entry>-</entry>
1155 <entry>-</entry>
1156 <entry>-</entry>
1157 <entry>-</entry>
1158 <entry>-</entry>
1159 <entry>y<subscript>7</subscript></entry>
1160 <entry>y<subscript>6</subscript></entry>
1161 <entry>y<subscript>5</subscript></entry>
1162 <entry>y<subscript>4</subscript></entry>
1163 <entry>y<subscript>3</subscript></entry>
1164 <entry>y<subscript>2</subscript></entry>
1165 <entry>y<subscript>1</subscript></entry>
1166 <entry>y<subscript>0</subscript></entry>
1167 </row>
1168 <row>
1169 <entry></entry>
1170 <entry></entry>
1171 <entry></entry>
1172 <entry>-</entry>
1173 <entry>-</entry>
1174 <entry>-</entry>
1175 <entry>-</entry>
1176 <entry>-</entry>
1177 <entry>-</entry>
1178 <entry>-</entry>
1179 <entry>-</entry>
1180 <entry>-</entry>
1181 <entry>-</entry>
1182 <entry>-</entry>
1183 <entry>-</entry>
1184 <entry>y<subscript>7</subscript></entry>
1185 <entry>y<subscript>6</subscript></entry>
1186 <entry>y<subscript>5</subscript></entry>
1187 <entry>y<subscript>4</subscript></entry>
1188 <entry>y<subscript>3</subscript></entry>
1189 <entry>y<subscript>2</subscript></entry>
1190 <entry>y<subscript>1</subscript></entry>
1191 <entry>y<subscript>0</subscript></entry>
1192 </row>
1193 <row>
1194 <entry></entry>
1195 <entry></entry>
1196 <entry></entry>
1197 <entry>-</entry>
1198 <entry>-</entry>
1199 <entry>-</entry>
1200 <entry>-</entry>
1201 <entry>-</entry>
1202 <entry>-</entry>
1203 <entry>-</entry>
1204 <entry>-</entry>
1205 <entry>-</entry>
1206 <entry>-</entry>
1207 <entry>-</entry>
1208 <entry>-</entry>
1209 <entry>u<subscript>7</subscript></entry>
1210 <entry>u<subscript>6</subscript></entry>
1211 <entry>u<subscript>5</subscript></entry>
1212 <entry>u<subscript>4</subscript></entry>
1213 <entry>u<subscript>3</subscript></entry>
1214 <entry>u<subscript>2</subscript></entry>
1215 <entry>u<subscript>1</subscript></entry>
1216 <entry>u<subscript>0</subscript></entry>
1217 </row>
1218 <row>
1219 <entry></entry>
1220 <entry></entry>
1221 <entry></entry>
1222 <entry>-</entry>
1223 <entry>-</entry>
1224 <entry>-</entry>
1225 <entry>-</entry>
1226 <entry>-</entry>
1227 <entry>-</entry>
1228 <entry>-</entry>
1229 <entry>-</entry>
1230 <entry>-</entry>
1231 <entry>-</entry>
1232 <entry>-</entry>
1233 <entry>-</entry>
1234 <entry>y<subscript>7</subscript></entry>
1235 <entry>y<subscript>6</subscript></entry>
1236 <entry>y<subscript>5</subscript></entry>
1237 <entry>y<subscript>4</subscript></entry>
1238 <entry>y<subscript>3</subscript></entry>
1239 <entry>y<subscript>2</subscript></entry>
1240 <entry>y<subscript>1</subscript></entry>
1241 <entry>y<subscript>0</subscript></entry>
1242 </row>
1243 <row>
1244 <entry></entry>
1245 <entry></entry>
1246 <entry></entry>
1247 <entry>-</entry>
1248 <entry>-</entry>
1249 <entry>-</entry>
1250 <entry>-</entry>
1251 <entry>-</entry>
1252 <entry>-</entry>
1253 <entry>-</entry>
1254 <entry>-</entry>
1255 <entry>-</entry>
1256 <entry>-</entry>
1257 <entry>-</entry>
1258 <entry>-</entry>
1259 <entry>y<subscript>7</subscript></entry>
1260 <entry>y<subscript>6</subscript></entry>
1261 <entry>y<subscript>5</subscript></entry>
1262 <entry>y<subscript>4</subscript></entry>
1263 <entry>y<subscript>3</subscript></entry>
1264 <entry>y<subscript>2</subscript></entry>
1265 <entry>y<subscript>1</subscript></entry>
1266 <entry>y<subscript>0</subscript></entry>
1267 </row>
1268 <row id="V4L2-MBUS-FMT-YUYV8-1_5X8">
1269 <entry>V4L2_MBUS_FMT_YUYV8_1_5X8</entry>
1270 <entry>0x2004</entry>
1271 <entry></entry>
1272 <entry>-</entry>
1273 <entry>-</entry>
1274 <entry>-</entry>
1275 <entry>-</entry>
1276 <entry>-</entry>
1277 <entry>-</entry>
1278 <entry>-</entry>
1279 <entry>-</entry>
1280 <entry>-</entry>
1281 <entry>-</entry>
1282 <entry>-</entry>
1283 <entry>-</entry>
1284 <entry>y<subscript>7</subscript></entry>
1285 <entry>y<subscript>6</subscript></entry>
1286 <entry>y<subscript>5</subscript></entry>
1287 <entry>y<subscript>4</subscript></entry>
1288 <entry>y<subscript>3</subscript></entry>
1289 <entry>y<subscript>2</subscript></entry>
1290 <entry>y<subscript>1</subscript></entry>
1291 <entry>y<subscript>0</subscript></entry>
1292 </row>
1293 <row>
1294 <entry></entry>
1295 <entry></entry>
1296 <entry></entry>
1297 <entry>-</entry>
1298 <entry>-</entry>
1299 <entry>-</entry>
1300 <entry>-</entry>
1301 <entry>-</entry>
1302 <entry>-</entry>
1303 <entry>-</entry>
1304 <entry>-</entry>
1305 <entry>-</entry>
1306 <entry>-</entry>
1307 <entry>-</entry>
1308 <entry>-</entry>
1309 <entry>y<subscript>7</subscript></entry>
1310 <entry>y<subscript>6</subscript></entry>
1311 <entry>y<subscript>5</subscript></entry>
1312 <entry>y<subscript>4</subscript></entry>
1313 <entry>y<subscript>3</subscript></entry>
1314 <entry>y<subscript>2</subscript></entry>
1315 <entry>y<subscript>1</subscript></entry>
1316 <entry>y<subscript>0</subscript></entry>
1317 </row>
1318 <row>
1319 <entry></entry>
1320 <entry></entry>
1321 <entry></entry>
1322 <entry>-</entry>
1323 <entry>-</entry>
1324 <entry>-</entry>
1325 <entry>-</entry>
1326 <entry>-</entry>
1327 <entry>-</entry>
1328 <entry>-</entry>
1329 <entry>-</entry>
1330 <entry>-</entry>
1331 <entry>-</entry>
1332 <entry>-</entry>
1333 <entry>-</entry>
1334 <entry>u<subscript>7</subscript></entry>
1335 <entry>u<subscript>6</subscript></entry>
1336 <entry>u<subscript>5</subscript></entry>
1337 <entry>u<subscript>4</subscript></entry>
1338 <entry>u<subscript>3</subscript></entry>
1339 <entry>u<subscript>2</subscript></entry>
1340 <entry>u<subscript>1</subscript></entry>
1341 <entry>u<subscript>0</subscript></entry>
1342 </row>
1343 <row>
1344 <entry></entry>
1345 <entry></entry>
1346 <entry></entry>
1347 <entry>-</entry>
1348 <entry>-</entry>
1349 <entry>-</entry>
1350 <entry>-</entry>
1351 <entry>-</entry>
1352 <entry>-</entry>
1353 <entry>-</entry>
1354 <entry>-</entry>
1355 <entry>-</entry>
1356 <entry>-</entry>
1357 <entry>-</entry>
1358 <entry>-</entry>
1359 <entry>y<subscript>7</subscript></entry>
1360 <entry>y<subscript>6</subscript></entry>
1361 <entry>y<subscript>5</subscript></entry>
1362 <entry>y<subscript>4</subscript></entry>
1363 <entry>y<subscript>3</subscript></entry>
1364 <entry>y<subscript>2</subscript></entry>
1365 <entry>y<subscript>1</subscript></entry>
1366 <entry>y<subscript>0</subscript></entry>
1367 </row>
1368 <row>
1369 <entry></entry>
1370 <entry></entry>
1371 <entry></entry>
1372 <entry>-</entry>
1373 <entry>-</entry>
1374 <entry>-</entry>
1375 <entry>-</entry>
1376 <entry>-</entry>
1377 <entry>-</entry>
1378 <entry>-</entry>
1379 <entry>-</entry>
1380 <entry>-</entry>
1381 <entry>-</entry>
1382 <entry>-</entry>
1383 <entry>-</entry>
1384 <entry>y<subscript>7</subscript></entry>
1385 <entry>y<subscript>6</subscript></entry>
1386 <entry>y<subscript>5</subscript></entry>
1387 <entry>y<subscript>4</subscript></entry>
1388 <entry>y<subscript>3</subscript></entry>
1389 <entry>y<subscript>2</subscript></entry>
1390 <entry>y<subscript>1</subscript></entry>
1391 <entry>y<subscript>0</subscript></entry>
1392 </row>
1393 <row>
1394 <entry></entry>
1395 <entry></entry>
1396 <entry></entry>
1397 <entry>-</entry>
1398 <entry>-</entry>
1399 <entry>-</entry>
1400 <entry>-</entry>
1401 <entry>-</entry>
1402 <entry>-</entry>
1403 <entry>-</entry>
1404 <entry>-</entry>
1405 <entry>-</entry>
1406 <entry>-</entry>
1407 <entry>-</entry>
1408 <entry>-</entry>
1409 <entry>v<subscript>7</subscript></entry>
1410 <entry>v<subscript>6</subscript></entry>
1411 <entry>v<subscript>5</subscript></entry>
1412 <entry>v<subscript>4</subscript></entry>
1413 <entry>v<subscript>3</subscript></entry>
1414 <entry>v<subscript>2</subscript></entry>
1415 <entry>v<subscript>1</subscript></entry>
1416 <entry>v<subscript>0</subscript></entry>
1417 </row>
1418 <row id="V4L2-MBUS-FMT-YVYU8-1_5X8">
1419 <entry>V4L2_MBUS_FMT_YVYU8_1_5X8</entry>
1420 <entry>0x2005</entry>
1421 <entry></entry>
1422 <entry>-</entry>
1423 <entry>-</entry>
1424 <entry>-</entry>
1425 <entry>-</entry>
1426 <entry>-</entry>
1427 <entry>-</entry>
1428 <entry>-</entry>
1429 <entry>-</entry>
1430 <entry>-</entry>
1431 <entry>-</entry>
1432 <entry>-</entry>
1433 <entry>-</entry>
1434 <entry>y<subscript>7</subscript></entry>
1435 <entry>y<subscript>6</subscript></entry>
1436 <entry>y<subscript>5</subscript></entry>
1437 <entry>y<subscript>4</subscript></entry>
1438 <entry>y<subscript>3</subscript></entry>
1439 <entry>y<subscript>2</subscript></entry>
1440 <entry>y<subscript>1</subscript></entry>
1441 <entry>y<subscript>0</subscript></entry>
1442 </row>
1443 <row>
1444 <entry></entry>
1445 <entry></entry>
1446 <entry></entry>
1447 <entry>-</entry>
1448 <entry>-</entry>
1449 <entry>-</entry>
1450 <entry>-</entry>
1451 <entry>-</entry>
1452 <entry>-</entry>
1453 <entry>-</entry>
1454 <entry>-</entry>
1455 <entry>-</entry>
1456 <entry>-</entry>
1457 <entry>-</entry>
1458 <entry>-</entry>
1459 <entry>y<subscript>7</subscript></entry>
1460 <entry>y<subscript>6</subscript></entry>
1461 <entry>y<subscript>5</subscript></entry>
1462 <entry>y<subscript>4</subscript></entry>
1463 <entry>y<subscript>3</subscript></entry>
1464 <entry>y<subscript>2</subscript></entry>
1465 <entry>y<subscript>1</subscript></entry>
1466 <entry>y<subscript>0</subscript></entry>
1467 </row>
1468 <row>
1469 <entry></entry>
1470 <entry></entry>
1471 <entry></entry>
1472 <entry>-</entry>
1473 <entry>-</entry>
1474 <entry>-</entry>
1475 <entry>-</entry>
1476 <entry>-</entry>
1477 <entry>-</entry>
1478 <entry>-</entry>
1479 <entry>-</entry>
1480 <entry>-</entry>
1481 <entry>-</entry>
1482 <entry>-</entry>
1483 <entry>-</entry>
1484 <entry>v<subscript>7</subscript></entry>
1485 <entry>v<subscript>6</subscript></entry>
1486 <entry>v<subscript>5</subscript></entry>
1487 <entry>v<subscript>4</subscript></entry>
1488 <entry>v<subscript>3</subscript></entry>
1489 <entry>v<subscript>2</subscript></entry>
1490 <entry>v<subscript>1</subscript></entry>
1491 <entry>v<subscript>0</subscript></entry>
1492 </row>
1493 <row>
1494 <entry></entry>
1495 <entry></entry>
1496 <entry></entry>
1497 <entry>-</entry>
1498 <entry>-</entry>
1499 <entry>-</entry>
1500 <entry>-</entry>
1501 <entry>-</entry>
1502 <entry>-</entry>
1503 <entry>-</entry>
1504 <entry>-</entry>
1505 <entry>-</entry>
1506 <entry>-</entry>
1507 <entry>-</entry>
1508 <entry>-</entry>
1509 <entry>y<subscript>7</subscript></entry>
1510 <entry>y<subscript>6</subscript></entry>
1511 <entry>y<subscript>5</subscript></entry>
1512 <entry>y<subscript>4</subscript></entry>
1513 <entry>y<subscript>3</subscript></entry>
1514 <entry>y<subscript>2</subscript></entry>
1515 <entry>y<subscript>1</subscript></entry>
1516 <entry>y<subscript>0</subscript></entry>
1517 </row>
1518 <row>
1519 <entry></entry>
1520 <entry></entry>
1521 <entry></entry>
1522 <entry>-</entry>
1523 <entry>-</entry>
1524 <entry>-</entry>
1525 <entry>-</entry>
1526 <entry>-</entry>
1527 <entry>-</entry>
1528 <entry>-</entry>
1529 <entry>-</entry>
1530 <entry>-</entry>
1531 <entry>-</entry>
1532 <entry>-</entry>
1533 <entry>-</entry>
1534 <entry>y<subscript>7</subscript></entry>
1535 <entry>y<subscript>6</subscript></entry>
1536 <entry>y<subscript>5</subscript></entry>
1537 <entry>y<subscript>4</subscript></entry>
1538 <entry>y<subscript>3</subscript></entry>
1539 <entry>y<subscript>2</subscript></entry>
1540 <entry>y<subscript>1</subscript></entry>
1541 <entry>y<subscript>0</subscript></entry>
1542 </row>
1543 <row>
1544 <entry></entry>
1545 <entry></entry>
1546 <entry></entry>
1547 <entry>-</entry>
1548 <entry>-</entry>
1549 <entry>-</entry>
1550 <entry>-</entry>
1551 <entry>-</entry>
1552 <entry>-</entry>
1553 <entry>-</entry>
1554 <entry>-</entry>
1555 <entry>-</entry>
1556 <entry>-</entry>
1557 <entry>-</entry>
1558 <entry>-</entry>
1559 <entry>u<subscript>7</subscript></entry>
1560 <entry>u<subscript>6</subscript></entry>
1561 <entry>u<subscript>5</subscript></entry>
1562 <entry>u<subscript>4</subscript></entry>
1563 <entry>u<subscript>3</subscript></entry>
1564 <entry>u<subscript>2</subscript></entry>
1565 <entry>u<subscript>1</subscript></entry>
1566 <entry>u<subscript>0</subscript></entry>
1567 </row>
1568 <row id="V4L2-MBUS-FMT-UYVY8-2X8">
1569 <entry>V4L2_MBUS_FMT_UYVY8_2X8</entry>
1570 <entry>0x2006</entry>
1571 <entry></entry>
1572 <entry>-</entry>
1573 <entry>-</entry>
1574 <entry>-</entry>
1575 <entry>-</entry>
1576 <entry>-</entry>
1577 <entry>-</entry>
1578 <entry>-</entry>
1579 <entry>-</entry>
1580 <entry>-</entry>
1581 <entry>-</entry>
1582 <entry>-</entry>
1583 <entry>-</entry>
1584 <entry>u<subscript>7</subscript></entry>
1585 <entry>u<subscript>6</subscript></entry>
1586 <entry>u<subscript>5</subscript></entry>
1587 <entry>u<subscript>4</subscript></entry>
1588 <entry>u<subscript>3</subscript></entry>
1589 <entry>u<subscript>2</subscript></entry>
1590 <entry>u<subscript>1</subscript></entry>
1591 <entry>u<subscript>0</subscript></entry>
1592 </row>
1593 <row>
1594 <entry></entry>
1595 <entry></entry>
1596 <entry></entry>
1597 <entry>-</entry>
1598 <entry>-</entry>
1599 <entry>-</entry>
1600 <entry>-</entry>
1601 <entry>-</entry>
1602 <entry>-</entry>
1603 <entry>-</entry>
1604 <entry>-</entry>
1605 <entry>-</entry>
1606 <entry>-</entry>
1607 <entry>-</entry>
1608 <entry>-</entry>
1609 <entry>y<subscript>7</subscript></entry>
1610 <entry>y<subscript>6</subscript></entry>
1611 <entry>y<subscript>5</subscript></entry>
1612 <entry>y<subscript>4</subscript></entry>
1613 <entry>y<subscript>3</subscript></entry>
1614 <entry>y<subscript>2</subscript></entry>
1615 <entry>y<subscript>1</subscript></entry>
1616 <entry>y<subscript>0</subscript></entry>
1617 </row>
1618 <row>
1619 <entry></entry>
1620 <entry></entry>
1621 <entry></entry>
1622 <entry>-</entry>
1623 <entry>-</entry>
1624 <entry>-</entry>
1625 <entry>-</entry>
1626 <entry>-</entry>
1627 <entry>-</entry>
1628 <entry>-</entry>
1629 <entry>-</entry>
1630 <entry>-</entry>
1631 <entry>-</entry>
1632 <entry>-</entry>
1633 <entry>-</entry>
1634 <entry>v<subscript>7</subscript></entry>
1635 <entry>v<subscript>6</subscript></entry>
1636 <entry>v<subscript>5</subscript></entry>
1637 <entry>v<subscript>4</subscript></entry>
1638 <entry>v<subscript>3</subscript></entry>
1639 <entry>v<subscript>2</subscript></entry>
1640 <entry>v<subscript>1</subscript></entry>
1641 <entry>v<subscript>0</subscript></entry>
1642 </row>
1643 <row>
1644 <entry></entry>
1645 <entry></entry>
1646 <entry></entry>
1647 <entry>-</entry>
1648 <entry>-</entry>
1649 <entry>-</entry>
1650 <entry>-</entry>
1651 <entry>-</entry>
1652 <entry>-</entry>
1653 <entry>-</entry>
1654 <entry>-</entry>
1655 <entry>-</entry>
1656 <entry>-</entry>
1657 <entry>-</entry>
1658 <entry>-</entry>
1659 <entry>y<subscript>7</subscript></entry>
1660 <entry>y<subscript>6</subscript></entry>
1661 <entry>y<subscript>5</subscript></entry>
1662 <entry>y<subscript>4</subscript></entry>
1663 <entry>y<subscript>3</subscript></entry>
1664 <entry>y<subscript>2</subscript></entry>
1665 <entry>y<subscript>1</subscript></entry>
1666 <entry>y<subscript>0</subscript></entry>
1667 </row>
1668 <row id="V4L2-MBUS-FMT-VYUY8-2X8">
1669 <entry>V4L2_MBUS_FMT_VYUY8_2X8</entry>
1670 <entry>0x2007</entry>
1671 <entry></entry>
1672 <entry>-</entry>
1673 <entry>-</entry>
1674 <entry>-</entry>
1675 <entry>-</entry>
1676 <entry>-</entry>
1677 <entry>-</entry>
1678 <entry>-</entry>
1679 <entry>-</entry>
1680 <entry>-</entry>
1681 <entry>-</entry>
1682 <entry>-</entry>
1683 <entry>-</entry>
1684 <entry>v<subscript>7</subscript></entry>
1685 <entry>v<subscript>6</subscript></entry>
1686 <entry>v<subscript>5</subscript></entry>
1687 <entry>v<subscript>4</subscript></entry>
1688 <entry>v<subscript>3</subscript></entry>
1689 <entry>v<subscript>2</subscript></entry>
1690 <entry>v<subscript>1</subscript></entry>
1691 <entry>v<subscript>0</subscript></entry>
1692 </row>
1693 <row>
1694 <entry></entry>
1695 <entry></entry>
1696 <entry></entry>
1697 <entry>-</entry>
1698 <entry>-</entry>
1699 <entry>-</entry>
1700 <entry>-</entry>
1701 <entry>-</entry>
1702 <entry>-</entry>
1703 <entry>-</entry>
1704 <entry>-</entry>
1705 <entry>-</entry>
1706 <entry>-</entry>
1707 <entry>-</entry>
1708 <entry>-</entry>
1709 <entry>y<subscript>7</subscript></entry>
1710 <entry>y<subscript>6</subscript></entry>
1711 <entry>y<subscript>5</subscript></entry>
1712 <entry>y<subscript>4</subscript></entry>
1713 <entry>y<subscript>3</subscript></entry>
1714 <entry>y<subscript>2</subscript></entry>
1715 <entry>y<subscript>1</subscript></entry>
1716 <entry>y<subscript>0</subscript></entry>
1717 </row>
1718 <row>
1719 <entry></entry>
1720 <entry></entry>
1721 <entry></entry>
1722 <entry>-</entry>
1723 <entry>-</entry>
1724 <entry>-</entry>
1725 <entry>-</entry>
1726 <entry>-</entry>
1727 <entry>-</entry>
1728 <entry>-</entry>
1729 <entry>-</entry>
1730 <entry>-</entry>
1731 <entry>-</entry>
1732 <entry>-</entry>
1733 <entry>-</entry>
1734 <entry>u<subscript>7</subscript></entry>
1735 <entry>u<subscript>6</subscript></entry>
1736 <entry>u<subscript>5</subscript></entry>
1737 <entry>u<subscript>4</subscript></entry>
1738 <entry>u<subscript>3</subscript></entry>
1739 <entry>u<subscript>2</subscript></entry>
1740 <entry>u<subscript>1</subscript></entry>
1741 <entry>u<subscript>0</subscript></entry>
1742 </row>
1743 <row>
1744 <entry></entry>
1745 <entry></entry>
1746 <entry></entry>
1747 <entry>-</entry>
1748 <entry>-</entry>
1749 <entry>-</entry>
1750 <entry>-</entry>
1751 <entry>-</entry>
1752 <entry>-</entry>
1753 <entry>-</entry>
1754 <entry>-</entry>
1755 <entry>-</entry>
1756 <entry>-</entry>
1757 <entry>-</entry>
1758 <entry>-</entry>
1759 <entry>y<subscript>7</subscript></entry>
1760 <entry>y<subscript>6</subscript></entry>
1761 <entry>y<subscript>5</subscript></entry>
1762 <entry>y<subscript>4</subscript></entry>
1763 <entry>y<subscript>3</subscript></entry>
1764 <entry>y<subscript>2</subscript></entry>
1765 <entry>y<subscript>1</subscript></entry>
1766 <entry>y<subscript>0</subscript></entry>
1767 </row>
1768 <row id="V4L2-MBUS-FMT-YUYV8-2X8">
1769 <entry>V4L2_MBUS_FMT_YUYV8_2X8</entry>
1770 <entry>0x2008</entry>
1771 <entry></entry>
1772 <entry>-</entry>
1773 <entry>-</entry>
1774 <entry>-</entry>
1775 <entry>-</entry>
1776 <entry>-</entry>
1777 <entry>-</entry>
1778 <entry>-</entry>
1779 <entry>-</entry>
1780 <entry>-</entry>
1781 <entry>-</entry>
1782 <entry>-</entry>
1783 <entry>-</entry>
1784 <entry>y<subscript>7</subscript></entry>
1785 <entry>y<subscript>6</subscript></entry>
1786 <entry>y<subscript>5</subscript></entry>
1787 <entry>y<subscript>4</subscript></entry>
1788 <entry>y<subscript>3</subscript></entry>
1789 <entry>y<subscript>2</subscript></entry>
1790 <entry>y<subscript>1</subscript></entry>
1791 <entry>y<subscript>0</subscript></entry>
1792 </row>
1793 <row>
1794 <entry></entry>
1795 <entry></entry>
1796 <entry></entry>
1797 <entry>-</entry>
1798 <entry>-</entry>
1799 <entry>-</entry>
1800 <entry>-</entry>
1801 <entry>-</entry>
1802 <entry>-</entry>
1803 <entry>-</entry>
1804 <entry>-</entry>
1805 <entry>-</entry>
1806 <entry>-</entry>
1807 <entry>-</entry>
1808 <entry>-</entry>
1809 <entry>u<subscript>7</subscript></entry>
1810 <entry>u<subscript>6</subscript></entry>
1811 <entry>u<subscript>5</subscript></entry>
1812 <entry>u<subscript>4</subscript></entry>
1813 <entry>u<subscript>3</subscript></entry>
1814 <entry>u<subscript>2</subscript></entry>
1815 <entry>u<subscript>1</subscript></entry>
1816 <entry>u<subscript>0</subscript></entry>
1817 </row>
1818 <row>
1819 <entry></entry>
1820 <entry></entry>
1821 <entry></entry>
1822 <entry>-</entry>
1823 <entry>-</entry>
1824 <entry>-</entry>
1825 <entry>-</entry>
1826 <entry>-</entry>
1827 <entry>-</entry>
1828 <entry>-</entry>
1829 <entry>-</entry>
1830 <entry>-</entry>
1831 <entry>-</entry>
1832 <entry>-</entry>
1833 <entry>-</entry>
1834 <entry>y<subscript>7</subscript></entry>
1835 <entry>y<subscript>6</subscript></entry>
1836 <entry>y<subscript>5</subscript></entry>
1837 <entry>y<subscript>4</subscript></entry>
1838 <entry>y<subscript>3</subscript></entry>
1839 <entry>y<subscript>2</subscript></entry>
1840 <entry>y<subscript>1</subscript></entry>
1841 <entry>y<subscript>0</subscript></entry>
1842 </row>
1843 <row>
1844 <entry></entry>
1845 <entry></entry>
1846 <entry></entry>
1847 <entry>-</entry>
1848 <entry>-</entry>
1849 <entry>-</entry>
1850 <entry>-</entry>
1851 <entry>-</entry>
1852 <entry>-</entry>
1853 <entry>-</entry>
1854 <entry>-</entry>
1855 <entry>-</entry>
1856 <entry>-</entry>
1857 <entry>-</entry>
1858 <entry>-</entry>
1859 <entry>v<subscript>7</subscript></entry>
1860 <entry>v<subscript>6</subscript></entry>
1861 <entry>v<subscript>5</subscript></entry>
1862 <entry>v<subscript>4</subscript></entry>
1863 <entry>v<subscript>3</subscript></entry>
1864 <entry>v<subscript>2</subscript></entry>
1865 <entry>v<subscript>1</subscript></entry>
1866 <entry>v<subscript>0</subscript></entry>
1867 </row>
1868 <row id="V4L2-MBUS-FMT-YVYU8-2X8">
1869 <entry>V4L2_MBUS_FMT_YVYU8_2X8</entry>
1870 <entry>0x2009</entry>
1871 <entry></entry>
1872 <entry>-</entry>
1873 <entry>-</entry>
1874 <entry>-</entry>
1875 <entry>-</entry>
1876 <entry>-</entry>
1877 <entry>-</entry>
1878 <entry>-</entry>
1879 <entry>-</entry>
1880 <entry>-</entry>
1881 <entry>-</entry>
1882 <entry>-</entry>
1883 <entry>-</entry>
1884 <entry>y<subscript>7</subscript></entry>
1885 <entry>y<subscript>6</subscript></entry>
1886 <entry>y<subscript>5</subscript></entry>
1887 <entry>y<subscript>4</subscript></entry>
1888 <entry>y<subscript>3</subscript></entry>
1889 <entry>y<subscript>2</subscript></entry>
1890 <entry>y<subscript>1</subscript></entry>
1891 <entry>y<subscript>0</subscript></entry>
1892 </row>
1893 <row>
1894 <entry></entry>
1895 <entry></entry>
1896 <entry></entry>
1897 <entry>-</entry>
1898 <entry>-</entry>
1899 <entry>-</entry>
1900 <entry>-</entry>
1901 <entry>-</entry>
1902 <entry>-</entry>
1903 <entry>-</entry>
1904 <entry>-</entry>
1905 <entry>-</entry>
1906 <entry>-</entry>
1907 <entry>-</entry>
1908 <entry>-</entry>
1909 <entry>v<subscript>7</subscript></entry>
1910 <entry>v<subscript>6</subscript></entry>
1911 <entry>v<subscript>5</subscript></entry>
1912 <entry>v<subscript>4</subscript></entry>
1913 <entry>v<subscript>3</subscript></entry>
1914 <entry>v<subscript>2</subscript></entry>
1915 <entry>v<subscript>1</subscript></entry>
1916 <entry>v<subscript>0</subscript></entry>
1917 </row>
1918 <row>
1919 <entry></entry>
1920 <entry></entry>
1921 <entry></entry>
1922 <entry>-</entry>
1923 <entry>-</entry>
1924 <entry>-</entry>
1925 <entry>-</entry>
1926 <entry>-</entry>
1927 <entry>-</entry>
1928 <entry>-</entry>
1929 <entry>-</entry>
1930 <entry>-</entry>
1931 <entry>-</entry>
1932 <entry>-</entry>
1933 <entry>-</entry>
1934 <entry>y<subscript>7</subscript></entry>
1935 <entry>y<subscript>6</subscript></entry>
1936 <entry>y<subscript>5</subscript></entry>
1937 <entry>y<subscript>4</subscript></entry>
1938 <entry>y<subscript>3</subscript></entry>
1939 <entry>y<subscript>2</subscript></entry>
1940 <entry>y<subscript>1</subscript></entry>
1941 <entry>y<subscript>0</subscript></entry>
1942 </row>
1943 <row>
1944 <entry></entry>
1945 <entry></entry>
1946 <entry></entry>
1947 <entry>-</entry>
1948 <entry>-</entry>
1949 <entry>-</entry>
1950 <entry>-</entry>
1951 <entry>-</entry>
1952 <entry>-</entry>
1953 <entry>-</entry>
1954 <entry>-</entry>
1955 <entry>-</entry>
1956 <entry>-</entry>
1957 <entry>-</entry>
1958 <entry>-</entry>
1959 <entry>u<subscript>7</subscript></entry>
1960 <entry>u<subscript>6</subscript></entry>
1961 <entry>u<subscript>5</subscript></entry>
1962 <entry>u<subscript>4</subscript></entry>
1963 <entry>u<subscript>3</subscript></entry>
1964 <entry>u<subscript>2</subscript></entry>
1965 <entry>u<subscript>1</subscript></entry>
1966 <entry>u<subscript>0</subscript></entry>
1967 </row>
1968 <row id="V4L2-MBUS-FMT-Y10-1X10">
1969 <entry>V4L2_MBUS_FMT_Y10_1X10</entry>
1970 <entry>0x200a</entry>
1971 <entry></entry>
1972 <entry>-</entry>
1973 <entry>-</entry>
1974 <entry>-</entry>
1975 <entry>-</entry>
1976 <entry>-</entry>
1977 <entry>-</entry>
1978 <entry>-</entry>
1979 <entry>-</entry>
1980 <entry>-</entry>
1981 <entry>-</entry>
1982 <entry>y<subscript>9</subscript></entry>
1983 <entry>y<subscript>8</subscript></entry>
1984 <entry>y<subscript>7</subscript></entry>
1985 <entry>y<subscript>6</subscript></entry>
1986 <entry>y<subscript>5</subscript></entry>
1987 <entry>y<subscript>4</subscript></entry>
1988 <entry>y<subscript>3</subscript></entry>
1989 <entry>y<subscript>2</subscript></entry>
1990 <entry>y<subscript>1</subscript></entry>
1991 <entry>y<subscript>0</subscript></entry>
1992 </row>
1993 <row id="V4L2-MBUS-FMT-YUYV10-2X10">
1994 <entry>V4L2_MBUS_FMT_YUYV10_2X10</entry>
1995 <entry>0x200b</entry>
1996 <entry></entry>
1997 <entry>-</entry>
1998 <entry>-</entry>
1999 <entry>-</entry>
2000 <entry>-</entry>
2001 <entry>-</entry>
2002 <entry>-</entry>
2003 <entry>-</entry>
2004 <entry>-</entry>
2005 <entry>-</entry>
2006 <entry>-</entry>
2007 <entry>y<subscript>9</subscript></entry>
2008 <entry>y<subscript>8</subscript></entry>
2009 <entry>y<subscript>7</subscript></entry>
2010 <entry>y<subscript>6</subscript></entry>
2011 <entry>y<subscript>5</subscript></entry>
2012 <entry>y<subscript>4</subscript></entry>
2013 <entry>y<subscript>3</subscript></entry>
2014 <entry>y<subscript>2</subscript></entry>
2015 <entry>y<subscript>1</subscript></entry>
2016 <entry>y<subscript>0</subscript></entry>
2017 </row>
2018 <row>
2019 <entry></entry>
2020 <entry></entry>
2021 <entry></entry>
2022 <entry>-</entry>
2023 <entry>-</entry>
2024 <entry>-</entry>
2025 <entry>-</entry>
2026 <entry>-</entry>
2027 <entry>-</entry>
2028 <entry>-</entry>
2029 <entry>-</entry>
2030 <entry>-</entry>
2031 <entry>-</entry>
2032 <entry>u<subscript>9</subscript></entry>
2033 <entry>u<subscript>8</subscript></entry>
2034 <entry>u<subscript>7</subscript></entry>
2035 <entry>u<subscript>6</subscript></entry>
2036 <entry>u<subscript>5</subscript></entry>
2037 <entry>u<subscript>4</subscript></entry>
2038 <entry>u<subscript>3</subscript></entry>
2039 <entry>u<subscript>2</subscript></entry>
2040 <entry>u<subscript>1</subscript></entry>
2041 <entry>u<subscript>0</subscript></entry>
2042 </row>
2043 <row>
2044 <entry></entry>
2045 <entry></entry>
2046 <entry></entry>
2047 <entry>-</entry>
2048 <entry>-</entry>
2049 <entry>-</entry>
2050 <entry>-</entry>
2051 <entry>-</entry>
2052 <entry>-</entry>
2053 <entry>-</entry>
2054 <entry>-</entry>
2055 <entry>-</entry>
2056 <entry>-</entry>
2057 <entry>y<subscript>9</subscript></entry>
2058 <entry>y<subscript>8</subscript></entry>
2059 <entry>y<subscript>7</subscript></entry>
2060 <entry>y<subscript>6</subscript></entry>
2061 <entry>y<subscript>5</subscript></entry>
2062 <entry>y<subscript>4</subscript></entry>
2063 <entry>y<subscript>3</subscript></entry>
2064 <entry>y<subscript>2</subscript></entry>
2065 <entry>y<subscript>1</subscript></entry>
2066 <entry>y<subscript>0</subscript></entry>
2067 </row>
2068 <row>
2069 <entry></entry>
2070 <entry></entry>
2071 <entry></entry>
2072 <entry>-</entry>
2073 <entry>-</entry>
2074 <entry>-</entry>
2075 <entry>-</entry>
2076 <entry>-</entry>
2077 <entry>-</entry>
2078 <entry>-</entry>
2079 <entry>-</entry>
2080 <entry>-</entry>
2081 <entry>-</entry>
2082 <entry>v<subscript>9</subscript></entry>
2083 <entry>v<subscript>8</subscript></entry>
2084 <entry>v<subscript>7</subscript></entry>
2085 <entry>v<subscript>6</subscript></entry>
2086 <entry>v<subscript>5</subscript></entry>
2087 <entry>v<subscript>4</subscript></entry>
2088 <entry>v<subscript>3</subscript></entry>
2089 <entry>v<subscript>2</subscript></entry>
2090 <entry>v<subscript>1</subscript></entry>
2091 <entry>v<subscript>0</subscript></entry>
2092 </row>
2093 <row id="V4L2-MBUS-FMT-YVYU10-2X10">
2094 <entry>V4L2_MBUS_FMT_YVYU10_2X10</entry>
2095 <entry>0x200c</entry>
2096 <entry></entry>
2097 <entry>-</entry>
2098 <entry>-</entry>
2099 <entry>-</entry>
2100 <entry>-</entry>
2101 <entry>-</entry>
2102 <entry>-</entry>
2103 <entry>-</entry>
2104 <entry>-</entry>
2105 <entry>-</entry>
2106 <entry>-</entry>
2107 <entry>y<subscript>9</subscript></entry>
2108 <entry>y<subscript>8</subscript></entry>
2109 <entry>y<subscript>7</subscript></entry>
2110 <entry>y<subscript>6</subscript></entry>
2111 <entry>y<subscript>5</subscript></entry>
2112 <entry>y<subscript>4</subscript></entry>
2113 <entry>y<subscript>3</subscript></entry>
2114 <entry>y<subscript>2</subscript></entry>
2115 <entry>y<subscript>1</subscript></entry>
2116 <entry>y<subscript>0</subscript></entry>
2117 </row>
2118 <row>
2119 <entry></entry>
2120 <entry></entry>
2121 <entry></entry>
2122 <entry>-</entry>
2123 <entry>-</entry>
2124 <entry>-</entry>
2125 <entry>-</entry>
2126 <entry>-</entry>
2127 <entry>-</entry>
2128 <entry>-</entry>
2129 <entry>-</entry>
2130 <entry>-</entry>
2131 <entry>-</entry>
2132 <entry>v<subscript>9</subscript></entry>
2133 <entry>v<subscript>8</subscript></entry>
2134 <entry>v<subscript>7</subscript></entry>
2135 <entry>v<subscript>6</subscript></entry>
2136 <entry>v<subscript>5</subscript></entry>
2137 <entry>v<subscript>4</subscript></entry>
2138 <entry>v<subscript>3</subscript></entry>
2139 <entry>v<subscript>2</subscript></entry>
2140 <entry>v<subscript>1</subscript></entry>
2141 <entry>v<subscript>0</subscript></entry>
2142 </row>
2143 <row>
2144 <entry></entry>
2145 <entry></entry>
2146 <entry></entry>
2147 <entry>-</entry>
2148 <entry>-</entry>
2149 <entry>-</entry>
2150 <entry>-</entry>
2151 <entry>-</entry>
2152 <entry>-</entry>
2153 <entry>-</entry>
2154 <entry>-</entry>
2155 <entry>-</entry>
2156 <entry>-</entry>
2157 <entry>y<subscript>9</subscript></entry>
2158 <entry>y<subscript>8</subscript></entry>
2159 <entry>y<subscript>7</subscript></entry>
2160 <entry>y<subscript>6</subscript></entry>
2161 <entry>y<subscript>5</subscript></entry>
2162 <entry>y<subscript>4</subscript></entry>
2163 <entry>y<subscript>3</subscript></entry>
2164 <entry>y<subscript>2</subscript></entry>
2165 <entry>y<subscript>1</subscript></entry>
2166 <entry>y<subscript>0</subscript></entry>
2167 </row>
2168 <row>
2169 <entry></entry>
2170 <entry></entry>
2171 <entry></entry>
2172 <entry>-</entry>
2173 <entry>-</entry>
2174 <entry>-</entry>
2175 <entry>-</entry>
2176 <entry>-</entry>
2177 <entry>-</entry>
2178 <entry>-</entry>
2179 <entry>-</entry>
2180 <entry>-</entry>
2181 <entry>-</entry>
2182 <entry>u<subscript>9</subscript></entry>
2183 <entry>u<subscript>8</subscript></entry>
2184 <entry>u<subscript>7</subscript></entry>
2185 <entry>u<subscript>6</subscript></entry>
2186 <entry>u<subscript>5</subscript></entry>
2187 <entry>u<subscript>4</subscript></entry>
2188 <entry>u<subscript>3</subscript></entry>
2189 <entry>u<subscript>2</subscript></entry>
2190 <entry>u<subscript>1</subscript></entry>
2191 <entry>u<subscript>0</subscript></entry>
2192 </row>
2193 <row id="V4L2-MBUS-FMT-Y12-1X12">
2194 <entry>V4L2_MBUS_FMT_Y12_1X12</entry>
2195 <entry>0x2013</entry>
2196 <entry></entry>
2197 <entry>-</entry>
2198 <entry>-</entry>
2199 <entry>-</entry>
2200 <entry>-</entry>
2201 <entry>-</entry>
2202 <entry>-</entry>
2203 <entry>-</entry>
2204 <entry>-</entry>
2205 <entry>y<subscript>11</subscript></entry>
2206 <entry>y<subscript>10</subscript></entry>
2207 <entry>y<subscript>9</subscript></entry>
2208 <entry>y<subscript>8</subscript></entry>
2209 <entry>y<subscript>7</subscript></entry>
2210 <entry>y<subscript>6</subscript></entry>
2211 <entry>y<subscript>5</subscript></entry>
2212 <entry>y<subscript>4</subscript></entry>
2213 <entry>y<subscript>3</subscript></entry>
2214 <entry>y<subscript>2</subscript></entry>
2215 <entry>y<subscript>1</subscript></entry>
2216 <entry>y<subscript>0</subscript></entry>
2217 </row>
2218 <row id="V4L2-MBUS-FMT-UYVY8-1X16">
2219 <entry>V4L2_MBUS_FMT_UYVY8_1X16</entry>
2220 <entry>0x200f</entry>
2221 <entry></entry>
2222 <entry>-</entry>
2223 <entry>-</entry>
2224 <entry>-</entry>
2225 <entry>-</entry>
2226 <entry>u<subscript>7</subscript></entry>
2227 <entry>u<subscript>6</subscript></entry>
2228 <entry>u<subscript>5</subscript></entry>
2229 <entry>u<subscript>4</subscript></entry>
2230 <entry>u<subscript>3</subscript></entry>
2231 <entry>u<subscript>2</subscript></entry>
2232 <entry>u<subscript>1</subscript></entry>
2233 <entry>u<subscript>0</subscript></entry>
2234 <entry>y<subscript>7</subscript></entry>
2235 <entry>y<subscript>6</subscript></entry>
2236 <entry>y<subscript>5</subscript></entry>
2237 <entry>y<subscript>4</subscript></entry>
2238 <entry>y<subscript>3</subscript></entry>
2239 <entry>y<subscript>2</subscript></entry>
2240 <entry>y<subscript>1</subscript></entry>
2241 <entry>y<subscript>0</subscript></entry>
2242 </row>
2243 <row>
2244 <entry></entry>
2245 <entry></entry>
2246 <entry></entry>
2247 <entry>-</entry>
2248 <entry>-</entry>
2249 <entry>-</entry>
2250 <entry>-</entry>
2251 <entry>v<subscript>7</subscript></entry>
2252 <entry>v<subscript>6</subscript></entry>
2253 <entry>v<subscript>5</subscript></entry>
2254 <entry>v<subscript>4</subscript></entry>
2255 <entry>v<subscript>3</subscript></entry>
2256 <entry>v<subscript>2</subscript></entry>
2257 <entry>v<subscript>1</subscript></entry>
2258 <entry>v<subscript>0</subscript></entry>
2259 <entry>y<subscript>7</subscript></entry>
2260 <entry>y<subscript>6</subscript></entry>
2261 <entry>y<subscript>5</subscript></entry>
2262 <entry>y<subscript>4</subscript></entry>
2263 <entry>y<subscript>3</subscript></entry>
2264 <entry>y<subscript>2</subscript></entry>
2265 <entry>y<subscript>1</subscript></entry>
2266 <entry>y<subscript>0</subscript></entry>
2267 </row>
2268 <row id="V4L2-MBUS-FMT-VYUY8-1X16">
2269 <entry>V4L2_MBUS_FMT_VYUY8_1X16</entry>
2270 <entry>0x2010</entry>
2271 <entry></entry>
2272 <entry>-</entry>
2273 <entry>-</entry>
2274 <entry>-</entry>
2275 <entry>-</entry>
2276 <entry>v<subscript>7</subscript></entry>
2277 <entry>v<subscript>6</subscript></entry>
2278 <entry>v<subscript>5</subscript></entry>
2279 <entry>v<subscript>4</subscript></entry>
2280 <entry>v<subscript>3</subscript></entry>
2281 <entry>v<subscript>2</subscript></entry>
2282 <entry>v<subscript>1</subscript></entry>
2283 <entry>v<subscript>0</subscript></entry>
2284 <entry>y<subscript>7</subscript></entry>
2285 <entry>y<subscript>6</subscript></entry>
2286 <entry>y<subscript>5</subscript></entry>
2287 <entry>y<subscript>4</subscript></entry>
2288 <entry>y<subscript>3</subscript></entry>
2289 <entry>y<subscript>2</subscript></entry>
2290 <entry>y<subscript>1</subscript></entry>
2291 <entry>y<subscript>0</subscript></entry>
2292 </row>
2293 <row>
2294 <entry></entry>
2295 <entry></entry>
2296 <entry></entry>
2297 <entry>-</entry>
2298 <entry>-</entry>
2299 <entry>-</entry>
2300 <entry>-</entry>
2301 <entry>u<subscript>7</subscript></entry>
2302 <entry>u<subscript>6</subscript></entry>
2303 <entry>u<subscript>5</subscript></entry>
2304 <entry>u<subscript>4</subscript></entry>
2305 <entry>u<subscript>3</subscript></entry>
2306 <entry>u<subscript>2</subscript></entry>
2307 <entry>u<subscript>1</subscript></entry>
2308 <entry>u<subscript>0</subscript></entry>
2309 <entry>y<subscript>7</subscript></entry>
2310 <entry>y<subscript>6</subscript></entry>
2311 <entry>y<subscript>5</subscript></entry>
2312 <entry>y<subscript>4</subscript></entry>
2313 <entry>y<subscript>3</subscript></entry>
2314 <entry>y<subscript>2</subscript></entry>
2315 <entry>y<subscript>1</subscript></entry>
2316 <entry>y<subscript>0</subscript></entry>
2317 </row>
2318 <row id="V4L2-MBUS-FMT-YUYV8-1X16">
2319 <entry>V4L2_MBUS_FMT_YUYV8_1X16</entry>
2320 <entry>0x2011</entry>
2321 <entry></entry>
2322 <entry>-</entry>
2323 <entry>-</entry>
2324 <entry>-</entry>
2325 <entry>-</entry>
2326 <entry>y<subscript>7</subscript></entry>
2327 <entry>y<subscript>6</subscript></entry>
2328 <entry>y<subscript>5</subscript></entry>
2329 <entry>y<subscript>4</subscript></entry>
2330 <entry>y<subscript>3</subscript></entry>
2331 <entry>y<subscript>2</subscript></entry>
2332 <entry>y<subscript>1</subscript></entry>
2333 <entry>y<subscript>0</subscript></entry>
2334 <entry>u<subscript>7</subscript></entry>
2335 <entry>u<subscript>6</subscript></entry>
2336 <entry>u<subscript>5</subscript></entry>
2337 <entry>u<subscript>4</subscript></entry>
2338 <entry>u<subscript>3</subscript></entry>
2339 <entry>u<subscript>2</subscript></entry>
2340 <entry>u<subscript>1</subscript></entry>
2341 <entry>u<subscript>0</subscript></entry>
2342 </row>
2343 <row>
2344 <entry></entry>
2345 <entry></entry>
2346 <entry></entry>
2347 <entry>-</entry>
2348 <entry>-</entry>
2349 <entry>-</entry>
2350 <entry>-</entry>
2351 <entry>y<subscript>7</subscript></entry>
2352 <entry>y<subscript>6</subscript></entry>
2353 <entry>y<subscript>5</subscript></entry>
2354 <entry>y<subscript>4</subscript></entry>
2355 <entry>y<subscript>3</subscript></entry>
2356 <entry>y<subscript>2</subscript></entry>
2357 <entry>y<subscript>1</subscript></entry>
2358 <entry>y<subscript>0</subscript></entry>
2359 <entry>v<subscript>7</subscript></entry>
2360 <entry>v<subscript>6</subscript></entry>
2361 <entry>v<subscript>5</subscript></entry>
2362 <entry>v<subscript>4</subscript></entry>
2363 <entry>v<subscript>3</subscript></entry>
2364 <entry>v<subscript>2</subscript></entry>
2365 <entry>v<subscript>1</subscript></entry>
2366 <entry>v<subscript>0</subscript></entry>
2367 </row>
2368 <row id="V4L2-MBUS-FMT-YVYU8-1X16">
2369 <entry>V4L2_MBUS_FMT_YVYU8_1X16</entry>
2370 <entry>0x2012</entry>
2371 <entry></entry>
2372 <entry>-</entry>
2373 <entry>-</entry>
2374 <entry>-</entry>
2375 <entry>-</entry>
2376 <entry>y<subscript>7</subscript></entry>
2377 <entry>y<subscript>6</subscript></entry>
2378 <entry>y<subscript>5</subscript></entry>
2379 <entry>y<subscript>4</subscript></entry>
2380 <entry>y<subscript>3</subscript></entry>
2381 <entry>y<subscript>2</subscript></entry>
2382 <entry>y<subscript>1</subscript></entry>
2383 <entry>y<subscript>0</subscript></entry>
2384 <entry>v<subscript>7</subscript></entry>
2385 <entry>v<subscript>6</subscript></entry>
2386 <entry>v<subscript>5</subscript></entry>
2387 <entry>v<subscript>4</subscript></entry>
2388 <entry>v<subscript>3</subscript></entry>
2389 <entry>v<subscript>2</subscript></entry>
2390 <entry>v<subscript>1</subscript></entry>
2391 <entry>v<subscript>0</subscript></entry>
2392 </row>
2393 <row>
2394 <entry></entry>
2395 <entry></entry>
2396 <entry></entry>
2397 <entry>-</entry>
2398 <entry>-</entry>
2399 <entry>-</entry>
2400 <entry>-</entry>
2401 <entry>y<subscript>7</subscript></entry>
2402 <entry>y<subscript>6</subscript></entry>
2403 <entry>y<subscript>5</subscript></entry>
2404 <entry>y<subscript>4</subscript></entry>
2405 <entry>y<subscript>3</subscript></entry>
2406 <entry>y<subscript>2</subscript></entry>
2407 <entry>y<subscript>1</subscript></entry>
2408 <entry>y<subscript>0</subscript></entry>
2409 <entry>u<subscript>7</subscript></entry>
2410 <entry>u<subscript>6</subscript></entry>
2411 <entry>u<subscript>5</subscript></entry>
2412 <entry>u<subscript>4</subscript></entry>
2413 <entry>u<subscript>3</subscript></entry>
2414 <entry>u<subscript>2</subscript></entry>
2415 <entry>u<subscript>1</subscript></entry>
2416 <entry>u<subscript>0</subscript></entry>
2417 </row>
2418 <row id="V4L2-MBUS-FMT-YUYV10-1X20">
2419 <entry>V4L2_MBUS_FMT_YUYV10_1X20</entry>
2420 <entry>0x200d</entry>
2421 <entry></entry>
2422 <entry>y<subscript>9</subscript></entry>
2423 <entry>y<subscript>8</subscript></entry>
2424 <entry>y<subscript>7</subscript></entry>
2425 <entry>y<subscript>6</subscript></entry>
2426 <entry>y<subscript>5</subscript></entry>
2427 <entry>y<subscript>4</subscript></entry>
2428 <entry>y<subscript>3</subscript></entry>
2429 <entry>y<subscript>2</subscript></entry>
2430 <entry>y<subscript>1</subscript></entry>
2431 <entry>y<subscript>0</subscript></entry>
2432 <entry>u<subscript>9</subscript></entry>
2433 <entry>u<subscript>8</subscript></entry>
2434 <entry>u<subscript>7</subscript></entry>
2435 <entry>u<subscript>6</subscript></entry>
2436 <entry>u<subscript>5</subscript></entry>
2437 <entry>u<subscript>4</subscript></entry>
2438 <entry>u<subscript>3</subscript></entry>
2439 <entry>u<subscript>2</subscript></entry>
2440 <entry>u<subscript>1</subscript></entry>
2441 <entry>u<subscript>0</subscript></entry>
2442 </row>
2443 <row>
2444 <entry></entry>
2445 <entry></entry>
2446 <entry></entry>
2447 <entry>y<subscript>9</subscript></entry>
2448 <entry>y<subscript>8</subscript></entry>
2449 <entry>y<subscript>7</subscript></entry>
2450 <entry>y<subscript>6</subscript></entry>
2451 <entry>y<subscript>5</subscript></entry>
2452 <entry>y<subscript>4</subscript></entry>
2453 <entry>y<subscript>3</subscript></entry>
2454 <entry>y<subscript>2</subscript></entry>
2455 <entry>y<subscript>1</subscript></entry>
2456 <entry>y<subscript>0</subscript></entry>
2457 <entry>v<subscript>9</subscript></entry>
2458 <entry>v<subscript>8</subscript></entry>
2459 <entry>v<subscript>7</subscript></entry>
2460 <entry>v<subscript>6</subscript></entry>
2461 <entry>v<subscript>5</subscript></entry>
2462 <entry>v<subscript>4</subscript></entry>
2463 <entry>v<subscript>3</subscript></entry>
2464 <entry>v<subscript>2</subscript></entry>
2465 <entry>v<subscript>1</subscript></entry>
2466 <entry>v<subscript>0</subscript></entry>
2467 </row>
2468 <row id="V4L2-MBUS-FMT-YVYU10-1X20">
2469 <entry>V4L2_MBUS_FMT_YVYU10_1X20</entry>
2470 <entry>0x200e</entry>
2471 <entry></entry>
2472 <entry>y<subscript>9</subscript></entry>
2473 <entry>y<subscript>8</subscript></entry>
2474 <entry>y<subscript>7</subscript></entry>
2475 <entry>y<subscript>6</subscript></entry>
2476 <entry>y<subscript>5</subscript></entry>
2477 <entry>y<subscript>4</subscript></entry>
2478 <entry>y<subscript>3</subscript></entry>
2479 <entry>y<subscript>2</subscript></entry>
2480 <entry>y<subscript>1</subscript></entry>
2481 <entry>y<subscript>0</subscript></entry>
2482 <entry>v<subscript>9</subscript></entry>
2483 <entry>v<subscript>8</subscript></entry>
2484 <entry>v<subscript>7</subscript></entry>
2485 <entry>v<subscript>6</subscript></entry>
2486 <entry>v<subscript>5</subscript></entry>
2487 <entry>v<subscript>4</subscript></entry>
2488 <entry>v<subscript>3</subscript></entry>
2489 <entry>v<subscript>2</subscript></entry>
2490 <entry>v<subscript>1</subscript></entry>
2491 <entry>v<subscript>0</subscript></entry>
2492 </row>
2493 <row>
2494 <entry></entry>
2495 <entry></entry>
2496 <entry></entry>
2497 <entry>y<subscript>9</subscript></entry>
2498 <entry>y<subscript>8</subscript></entry>
2499 <entry>y<subscript>7</subscript></entry>
2500 <entry>y<subscript>6</subscript></entry>
2501 <entry>y<subscript>5</subscript></entry>
2502 <entry>y<subscript>4</subscript></entry>
2503 <entry>y<subscript>3</subscript></entry>
2504 <entry>y<subscript>2</subscript></entry>
2505 <entry>y<subscript>1</subscript></entry>
2506 <entry>y<subscript>0</subscript></entry>
2507 <entry>u<subscript>9</subscript></entry>
2508 <entry>u<subscript>8</subscript></entry>
2509 <entry>u<subscript>7</subscript></entry>
2510 <entry>u<subscript>6</subscript></entry>
2511 <entry>u<subscript>5</subscript></entry>
2512 <entry>u<subscript>4</subscript></entry>
2513 <entry>u<subscript>3</subscript></entry>
2514 <entry>u<subscript>2</subscript></entry>
2515 <entry>u<subscript>1</subscript></entry>
2516 <entry>u<subscript>0</subscript></entry>
2517 </row>
2518 </tbody>
2519 </tgroup>
2520 </table>
2521 </section>
2522
2523 <section>
2524 <title>JPEG Compressed Formats</title>
2525
2526 <para>Those data formats consist of an ordered sequence of 8-bit bytes
2527 obtained from JPEG compression process. Additionally to the
2528 <constant>_JPEG</constant> postfix the format code is made of
2529 the following information.
2530 <itemizedlist>
2531 <listitem><para>The number of bus samples per entropy encoded byte.</para></listitem>
2532 <listitem><para>The bus width.</para></listitem>
2533 </itemizedlist>
2534 </para>
2535
2536 <para>For instance, for a JPEG baseline process and an 8-bit bus width
2537 the format will be named <constant>V4L2_MBUS_FMT_JPEG_1X8</constant>.
2538 </para>
2539
2540 <para>The following table lists existing JPEG compressed formats.</para>
2541
2542 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-jpeg">
2543 <title>JPEG Formats</title>
2544 <tgroup cols="3">
2545 <colspec colname="id" align="left" />
2546 <colspec colname="code" align="left"/>
2547 <colspec colname="remarks" align="left"/>
2548 <thead>
2549 <row>
2550 <entry>Identifier</entry>
2551 <entry>Code</entry>
2552 <entry>Remarks</entry>
2553 </row>
2554 </thead>
2555 <tbody valign="top">
2556 <row id="V4L2-MBUS-FMT-JPEG-1X8">
2557 <entry>V4L2_MBUS_FMT_JPEG_1X8</entry>
2558 <entry>0x4001</entry>
2559 <entry>Besides of its usage for the parallel bus this format is
2560 recommended for transmission of JPEG data over MIPI CSI bus
2561 using the User Defined 8-bit Data types.
2562 </entry>
2563 </row>
2564 </tbody>
2565 </tgroup>
2566 </table>
2567 </section>
2568
2569 <section id="v4l2-mbus-vendor-spec-fmts">
2570 <title>Vendor and Device Specific Formats</title>
2571
2572 <note>
2573 <title>Experimental</title>
2574 <para>This is an <link linkend="experimental">experimental</link>
2575interface and may change in the future.</para>
2576 </note>
2577
2578 <para>This section lists complex data formats that are either vendor or
2579 device specific.
2580 </para>
2581
2582 <para>The following table lists the existing vendor and device specific
2583 formats.</para>
2584
2585 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-vendor-specific">
2586 <title>Vendor and device specific formats</title>
2587 <tgroup cols="3">
2588 <colspec colname="id" align="left" />
2589 <colspec colname="code" align="left"/>
2590 <colspec colname="remarks" align="left"/>
2591 <thead>
2592 <row>
2593 <entry>Identifier</entry>
2594 <entry>Code</entry>
2595 <entry>Comments</entry>
2596 </row>
2597 </thead>
2598 <tbody valign="top">
2599 <row id="V4L2-MBUS-FMT-S5C-UYVY-JPEG-1X8">
2600 <entry>V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8</entry>
2601 <entry>0x5001</entry>
2602 <entry>
2603 Interleaved raw UYVY and JPEG image format with embedded
2604 meta-data used by Samsung S3C73MX camera sensors.
2605 </entry>
2606 </row>
2607 </tbody>
2608 </tgroup>
2609 </table>
2610 </section>
2611
2612 </section>
2613</section>
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
new file mode 100644
index 00000000000..4d110b1ad3e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -0,0 +1,626 @@
1 <partinfo>
2 <authorgroup>
3 <author>
4 <firstname>Michael</firstname>
5 <surname>Schimek</surname>
6 <othername role="mi">H</othername>
7 <affiliation>
8 <address>
9 <email>mschimek@gmx.at</email>
10 </address>
11 </affiliation>
12 </author>
13
14 <author>
15 <firstname>Bill</firstname>
16 <surname>Dirks</surname>
17 <!-- Commented until Bill opts in to be spammed.
18 <affiliation>
19 <address>
20 <email>bill@thedirks.org</email>
21 </address>
22 </affiliation> -->
23 <contrib>Original author of the V4L2 API and
24documentation.</contrib>
25 </author>
26
27 <author>
28 <firstname>Hans</firstname>
29 <surname>Verkuil</surname>
30 <contrib>Designed and documented the VIDIOC_LOG_STATUS ioctl,
31the extended control ioctls, major parts of the sliced VBI API, the
32MPEG encoder and decoder APIs and the DV Timings API.</contrib>
33 <affiliation>
34 <address>
35 <email>hverkuil@xs4all.nl</email>
36 </address>
37 </affiliation>
38 </author>
39
40 <author>
41 <firstname>Martin</firstname>
42 <surname>Rubli</surname>
43 <!--
44 <affiliation>
45 <address>
46 <email>martin_rubli@logitech.com</email>
47 </address>
48 </affiliation> -->
49 <contrib>Designed and documented the VIDIOC_ENUM_FRAMESIZES
50and VIDIOC_ENUM_FRAMEINTERVALS ioctls.</contrib>
51 </author>
52
53 <author>
54 <firstname>Andy</firstname>
55 <surname>Walls</surname>
56 <contrib>Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV
57MPEG stream embedded, sliced VBI data format in this specification.
58</contrib>
59 <affiliation>
60 <address>
61 <email>awalls@md.metrocast.net</email>
62 </address>
63 </affiliation>
64 </author>
65
66 <author>
67 <firstname>Mauro</firstname>
68 <surname>Carvalho Chehab</surname>
69 <contrib>Documented libv4l, designed and added v4l2grab example,
70Remote Controller chapter.</contrib>
71 <affiliation>
72 <address>
73 <email>mchehab@redhat.com</email>
74 </address>
75 </affiliation>
76 </author>
77
78 <author>
79 <firstname>Muralidharan</firstname>
80 <surname>Karicheri</surname>
81 <contrib>Documented the Digital Video timings API.</contrib>
82 <affiliation>
83 <address>
84 <email>m-karicheri2@ti.com</email>
85 </address>
86 </affiliation>
87 </author>
88
89 <author>
90 <firstname>Pawel</firstname>
91 <surname>Osciak</surname>
92 <contrib>Designed and documented the multi-planar API.</contrib>
93 <affiliation>
94 <address>
95 <email>pawel AT osciak.com</email>
96 </address>
97 </affiliation>
98 </author>
99
100 <author>
101 <firstname>Sakari</firstname>
102 <surname>Ailus</surname>
103 <contrib>Subdev selections API.</contrib>
104 <affiliation>
105 <address>
106 <email>sakari.ailus@iki.fi</email>
107 </address>
108 </affiliation>
109 </author>
110 </authorgroup>
111
112 <copyright>
113 <year>1999</year>
114 <year>2000</year>
115 <year>2001</year>
116 <year>2002</year>
117 <year>2003</year>
118 <year>2004</year>
119 <year>2005</year>
120 <year>2006</year>
121 <year>2007</year>
122 <year>2008</year>
123 <year>2009</year>
124 <year>2010</year>
125 <year>2011</year>
126 <year>2012</year>
127 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
128Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab,
129 Pawel Osciak</holder>
130 </copyright>
131 <legalnotice>
132 <para>Except when explicitly stated as GPL, programming examples within
133 this part can be used and distributed without restrictions.</para>
134 </legalnotice>
135 <revhistory>
136 <!-- Put document revisions here, newest first. -->
137 <!-- API revisions (changes and additions of defines, enums,
138structs, ioctls) must be noted in more detail in the history chapter
139(compat.xml), along with the possible impact on existing drivers and
140applications. -->
141
142 <revision>
143 <revnumber>3.6</revnumber>
144 <date>2012-07-02</date>
145 <authorinitials>hv</authorinitials>
146 <revremark>Added VIDIOC_ENUM_FREQ_BANDS.
147 </revremark>
148 </revision>
149
150 <revision>
151 <revnumber>3.5</revnumber>
152 <date>2012-05-07</date>
153 <authorinitials>sa, sn, hv</authorinitials>
154 <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev
155 selections API. Improved the description of V4L2_CID_COLORFX
156 control, added V4L2_CID_COLORFX_CBCR control.
157 Added camera controls V4L2_CID_AUTO_EXPOSURE_BIAS,
158 V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, V4L2_CID_IMAGE_STABILIZATION,
159 V4L2_CID_ISO_SENSITIVITY, V4L2_CID_ISO_SENSITIVITY_AUTO,
160 V4L2_CID_EXPOSURE_METERING, V4L2_CID_SCENE_MODE,
161 V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START,
162 V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS
163 and V4L2_CID_AUTO_FOCUS_RANGE.
164 Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and
165 VIDIOC_DV_TIMINGS_CAP.
166 </revremark>
167 </revision>
168
169 <revision>
170 <revnumber>3.4</revnumber>
171 <date>2012-01-25</date>
172 <authorinitials>sn</authorinitials>
173 <revremark>Added <link linkend="jpeg-controls">JPEG compression
174 control class.</link>
175 </revremark>
176 </revision>
177
178 <revision>
179 <revnumber>3.3</revnumber>
180 <date>2012-01-11</date>
181 <authorinitials>hv</authorinitials>
182 <revremark>Added device_caps field to struct v4l2_capabilities.</revremark>
183 </revision>
184
185 <revision>
186 <revnumber>3.2</revnumber>
187 <date>2011-08-26</date>
188 <authorinitials>hv</authorinitials>
189 <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark>
190 </revision>
191
192 <revision>
193 <revnumber>3.1</revnumber>
194 <date>2011-06-27</date>
195 <authorinitials>mcc, po, hv</authorinitials>
196 <revremark>Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.
197 Standardize an error code for invalid ioctl.
198 Added V4L2_CTRL_TYPE_BITMASK.</revremark>
199 </revision>
200
201 <revision>
202 <revnumber>2.6.39</revnumber>
203 <date>2011-03-01</date>
204 <authorinitials>mcc, po</authorinitials>
205 <revremark>Removed VIDIOC_*_OLD from videodev2.h header and update it to reflect latest changes. Added the <link linkend="planar-apis">multi-planar API</link>.</revremark>
206 </revision>
207
208 <revision>
209 <revnumber>2.6.37</revnumber>
210 <date>2010-08-06</date>
211 <authorinitials>hv</authorinitials>
212 <revremark>Removed obsolete vtx (videotext) API.</revremark>
213 </revision>
214
215 <revision>
216 <revnumber>2.6.33</revnumber>
217 <date>2009-12-03</date>
218 <authorinitials>mk</authorinitials>
219 <revremark>Added documentation for the Digital Video timings API.</revremark>
220 </revision>
221
222 <revision>
223 <revnumber>2.6.32</revnumber>
224 <date>2009-08-31</date>
225 <authorinitials>mcc</authorinitials>
226 <revremark>Now, revisions will match the kernel version where
227the V4L2 API changes will be used by the Linux Kernel.
228Also added Remote Controller chapter.</revremark>
229 </revision>
230
231 <revision>
232 <revnumber>0.29</revnumber>
233 <date>2009-08-26</date>
234 <authorinitials>ev</authorinitials>
235 <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
236 </revision>
237
238 <revision>
239 <revnumber>0.28</revnumber>
240 <date>2009-08-26</date>
241 <authorinitials>gl</authorinitials>
242 <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
243 </revision>
244
245 <revision>
246 <revnumber>0.27</revnumber>
247 <date>2009-08-15</date>
248 <authorinitials>mcc</authorinitials>
249 <revremark>Added libv4l and Remote Controller documentation;
250added v4l2grab and keytable application examples.</revremark>
251 </revision>
252
253 <revision>
254 <revnumber>0.26</revnumber>
255 <date>2009-07-23</date>
256 <authorinitials>hv</authorinitials>
257 <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
258capabilities. Added support for string controls.</revremark>
259 </revision>
260
261 <revision>
262 <revnumber>0.25</revnumber>
263 <date>2009-01-18</date>
264 <authorinitials>hv</authorinitials>
265 <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
266the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
267Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
268V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
269 </revision>
270
271 <revision>
272 <revnumber>0.24</revnumber>
273 <date>2008-03-04</date>
274 <authorinitials>mhs</authorinitials>
275 <revremark>Added pixel formats Y16 and SBGGR16, new controls
276and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
277 </revision>
278
279 <revision>
280 <revnumber>0.23</revnumber>
281 <date>2007-08-30</date>
282 <authorinitials>mhs</authorinitials>
283 <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
284Clarified the byte order of packed pixel formats.</revremark>
285 </revision>
286
287 <revision>
288 <revnumber>0.22</revnumber>
289 <date>2007-08-29</date>
290 <authorinitials>mhs</authorinitials>
291 <revremark>Added the Video Output Overlay interface, new MPEG
292controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
293VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
294VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
295Clarifications in the cropping chapter, about RGB pixel formats, the
296mmap(), poll(), select(), read() and write() functions. Typographical
297fixes.</revremark>
298 </revision>
299
300 <revision>
301 <revnumber>0.21</revnumber>
302 <date>2006-12-19</date>
303 <authorinitials>mhs</authorinitials>
304 <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
305 </revision>
306
307 <revision>
308 <revnumber>0.20</revnumber>
309 <date>2006-11-24</date>
310 <authorinitials>mhs</authorinitials>
311 <revremark>Clarified the purpose of the audioset field in
312struct v4l2_input and v4l2_output.</revremark>
313 </revision>
314
315 <revision>
316 <revnumber>0.19</revnumber>
317 <date>2006-10-19</date>
318 <authorinitials>mhs</authorinitials>
319 <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
320 </revision>
321
322 <revision>
323 <revnumber>0.18</revnumber>
324 <date>2006-10-18</date>
325 <authorinitials>mhs</authorinitials>
326 <revremark>Added the description of extended controls by Hans
327Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
328 </revision>
329
330 <revision>
331 <revnumber>0.17</revnumber>
332 <date>2006-10-12</date>
333 <authorinitials>mhs</authorinitials>
334 <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
335 </revision>
336
337 <revision>
338 <revnumber>0.16</revnumber>
339 <date>2006-10-08</date>
340 <authorinitials>mhs</authorinitials>
341 <revremark>VIDIOC_ENUM_FRAMESIZES and
342VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
343 </revision>
344
345 <revision>
346 <revnumber>0.15</revnumber>
347 <date>2006-09-23</date>
348 <authorinitials>mhs</authorinitials>
349 <revremark>Cleaned up the bibliography, added BT.653 and
350BT.1119. capture.c/start_capturing() for user pointer I/O did not
351initialize the buffer index. Documented the V4L MPEG and MJPEG
352VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
353formats. See the history chapter for API changes.</revremark>
354 </revision>
355
356 <revision>
357 <revnumber>0.14</revnumber>
358 <date>2006-09-14</date>
359 <authorinitials>mr</authorinitials>
360 <revremark>Added VIDIOC_ENUM_FRAMESIZES and
361VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
362digital devices.</revremark>
363 </revision>
364
365 <revision>
366 <revnumber>0.13</revnumber>
367 <date>2006-04-07</date>
368 <authorinitials>mhs</authorinitials>
369 <revremark>Corrected the description of struct v4l2_window
370clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
371defines.</revremark>
372 </revision>
373
374 <revision>
375 <revnumber>0.12</revnumber>
376 <date>2006-02-03</date>
377 <authorinitials>mhs</authorinitials>
378 <revremark>Corrected the description of struct
379v4l2_captureparm and v4l2_outputparm.</revremark>
380 </revision>
381
382 <revision>
383 <revnumber>0.11</revnumber>
384 <date>2006-01-27</date>
385 <authorinitials>mhs</authorinitials>
386 <revremark>Improved the description of struct
387v4l2_tuner.</revremark>
388 </revision>
389
390 <revision>
391 <revnumber>0.10</revnumber>
392 <date>2006-01-10</date>
393 <authorinitials>mhs</authorinitials>
394 <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
395clarifications.</revremark>
396 </revision>
397
398 <revision>
399 <revnumber>0.9</revnumber>
400 <date>2005-11-27</date>
401 <authorinitials>mhs</authorinitials>
402 <revremark>Improved the 525 line numbering diagram. Hans
403Verkuil and I rewrote the sliced VBI section. He also contributed a
404VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
405selection example. Various updates.</revremark>
406 </revision>
407
408 <revision>
409 <revnumber>0.8</revnumber>
410 <date>2004-10-04</date>
411 <authorinitials>mhs</authorinitials>
412 <revremark>Somehow a piece of junk slipped into the capture
413example, removed.</revremark>
414 </revision>
415
416 <revision>
417 <revnumber>0.7</revnumber>
418 <date>2004-09-19</date>
419 <authorinitials>mhs</authorinitials>
420 <revremark>Fixed video standard selection, control
421enumeration, downscaling and aspect example. Added read and user
422pointer i/o to video capture example.</revremark>
423 </revision>
424
425 <revision>
426 <revnumber>0.6</revnumber>
427 <date>2004-08-01</date>
428 <authorinitials>mhs</authorinitials>
429 <revremark>v4l2_buffer changes, added video capture example,
430various corrections.</revremark>
431 </revision>
432
433 <revision>
434 <revnumber>0.5</revnumber>
435 <date>2003-11-05</date>
436 <authorinitials>mhs</authorinitials>
437 <revremark>Pixel format erratum.</revremark>
438 </revision>
439
440 <revision>
441 <revnumber>0.4</revnumber>
442 <date>2003-09-17</date>
443 <authorinitials>mhs</authorinitials>
444 <revremark>Corrected source and Makefile to generate a PDF.
445SGML fixes. Added latest API changes. Closed gaps in the history
446chapter.</revremark>
447 </revision>
448
449 <revision>
450 <revnumber>0.3</revnumber>
451 <date>2003-02-05</date>
452 <authorinitials>mhs</authorinitials>
453 <revremark>Another draft, more corrections.</revremark>
454 </revision>
455
456 <revision>
457 <revnumber>0.2</revnumber>
458 <date>2003-01-15</date>
459 <authorinitials>mhs</authorinitials>
460 <revremark>Second draft, with corrections pointed out by Gerd
461Knorr.</revremark>
462 </revision>
463
464 <revision>
465 <revnumber>0.1</revnumber>
466 <date>2002-12-01</date>
467 <authorinitials>mhs</authorinitials>
468 <revremark>First draft, based on documentation by Bill Dirks
469and discussions on the V4L mailing list.</revremark>
470 </revision>
471 </revhistory>
472</partinfo>
473
474<title>Video for Linux Two API Specification</title>
475 <subtitle>Revision 3.6</subtitle>
476
477 <chapter id="common">
478 &sub-common;
479 </chapter>
480
481 <chapter id="pixfmt">
482 &sub-pixfmt;
483 </chapter>
484
485 <chapter id="io">
486 &sub-io;
487 </chapter>
488
489 <chapter id="devices">
490 <title>Interfaces</title>
491
492 <section id="capture"> &sub-dev-capture; </section>
493 <section id="overlay"> &sub-dev-overlay; </section>
494 <section id="output"> &sub-dev-output; </section>
495 <section id="osd"> &sub-dev-osd; </section>
496 <section id="codec"> &sub-dev-codec; </section>
497 <section id="effect"> &sub-dev-effect; </section>
498 <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
499 <section id="sliced"> &sub-dev-sliced-vbi; </section>
500 <section id="ttx"> &sub-dev-teletext; </section>
501 <section id="radio"> &sub-dev-radio; </section>
502 <section id="rds"> &sub-dev-rds; </section>
503 <section id="event"> &sub-dev-event; </section>
504 <section id="subdev"> &sub-dev-subdev; </section>
505 </chapter>
506
507 <chapter id="driver">
508 &sub-driver;
509 </chapter>
510
511 <chapter id="libv4l">
512 &sub-libv4l;
513 </chapter>
514
515 <chapter id="compat">
516 &sub-compat;
517 </chapter>
518
519 <appendix id="user-func">
520 <title>Function Reference</title>
521
522 <!-- Keep this alphabetically sorted. -->
523
524 &sub-close;
525 &sub-ioctl;
526 <!-- All ioctls go here. -->
527 &sub-create-bufs;
528 &sub-cropcap;
529 &sub-dbg-g-chip-ident;
530 &sub-dbg-g-register;
531 &sub-decoder-cmd;
532 &sub-dqevent;
533 &sub-dv-timings-cap;
534 &sub-encoder-cmd;
535 &sub-enumaudio;
536 &sub-enumaudioout;
537 &sub-enum-dv-presets;
538 &sub-enum-dv-timings;
539 &sub-enum-fmt;
540 &sub-enum-framesizes;
541 &sub-enum-frameintervals;
542 &sub-enum-freq-bands;
543 &sub-enuminput;
544 &sub-enumoutput;
545 &sub-enumstd;
546 &sub-expbuf;
547 &sub-g-audio;
548 &sub-g-audioout;
549 &sub-g-crop;
550 &sub-g-ctrl;
551 &sub-g-dv-preset;
552 &sub-g-dv-timings;
553 &sub-g-enc-index;
554 &sub-g-ext-ctrls;
555 &sub-g-fbuf;
556 &sub-g-fmt;
557 &sub-g-frequency;
558 &sub-g-input;
559 &sub-g-jpegcomp;
560 &sub-g-modulator;
561 &sub-g-output;
562 &sub-g-parm;
563 &sub-g-priority;
564 &sub-g-selection;
565 &sub-g-sliced-vbi-cap;
566 &sub-g-std;
567 &sub-g-tuner;
568 &sub-log-status;
569 &sub-overlay;
570 &sub-prepare-buf;
571 &sub-qbuf;
572 &sub-querybuf;
573 &sub-querycap;
574 &sub-queryctrl;
575 &sub-query-dv-preset;
576 &sub-query-dv-timings;
577 &sub-querystd;
578 &sub-reqbufs;
579 &sub-s-hw-freq-seek;
580 &sub-streamon;
581 &sub-subdev-enum-frame-interval;
582 &sub-subdev-enum-frame-size;
583 &sub-subdev-enum-mbus-code;
584 &sub-subdev-g-crop;
585 &sub-subdev-g-edid;
586 &sub-subdev-g-fmt;
587 &sub-subdev-g-frame-interval;
588 &sub-subdev-g-selection;
589 &sub-subscribe-event;
590 <!-- End of ioctls. -->
591 &sub-mmap;
592 &sub-munmap;
593 &sub-open;
594 &sub-poll;
595 &sub-read;
596 &sub-select;
597 &sub-write;
598 </appendix>
599
600 <appendix>
601 <title>Common definitions for V4L2 and V4L2 subdev interfaces</title>
602 &sub-selections-common;
603 </appendix>
604
605 <appendix id="videodev">
606 <title>Video For Linux Two Header File</title>
607 &sub-videodev2-h;
608 </appendix>
609
610 <appendix id="capture-example">
611 <title>Video Capture Example</title>
612 &sub-capture-c;
613 </appendix>
614
615 <appendix id="v4l2grab-example">
616 <title>Video Grabber example using libv4l</title>
617 <para>This program demonstrates how to grab V4L2 images in ppm format by
618using libv4l handlers. The advantage is that this grabber can potentially work
619with any V4L2 driver.</para>
620 &sub-v4l2grab-c;
621 </appendix>
622
623 &sub-media-indices;
624
625 &sub-biblio;
626
diff --git a/Documentation/DocBook/media/v4l/v4l2grab.c.xml b/Documentation/DocBook/media/v4l/v4l2grab.c.xml
new file mode 100644
index 00000000000..bed12e40be2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/v4l2grab.c.xml
@@ -0,0 +1,164 @@
1<programlisting>
2/* V4L2 video picture grabber
3 Copyright (C) 2009 Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 */
14
15#include &lt;stdio.h&gt;
16#include &lt;stdlib.h&gt;
17#include &lt;string.h&gt;
18#include &lt;fcntl.h&gt;
19#include &lt;errno.h&gt;
20#include &lt;sys/ioctl.h&gt;
21#include &lt;sys/types.h&gt;
22#include &lt;sys/time.h&gt;
23#include &lt;sys/mman.h&gt;
24#include &lt;linux/videodev2.h&gt;
25#include "../libv4l/include/libv4l2.h"
26
27#define CLEAR(x) memset(&amp;(x), 0, sizeof(x))
28
29struct buffer {
30 void *start;
31 size_t length;
32};
33
34static void xioctl(int fh, int request, void *arg)
35{
36 int r;
37
38 do {
39 r = v4l2_ioctl(fh, request, arg);
40 } while (r == -1 &amp;&amp; ((errno == EINTR) || (errno == EAGAIN)));
41
42 if (r == -1) {
43 fprintf(stderr, "error %d, %s\n", errno, strerror(errno));
44 exit(EXIT_FAILURE);
45 }
46}
47
48int main(int argc, char **argv)
49{
50 struct <link linkend="v4l2-format">v4l2_format</link> fmt;
51 struct <link linkend="v4l2-buffer">v4l2_buffer</link> buf;
52 struct <link linkend="v4l2-requestbuffers">v4l2_requestbuffers</link> req;
53 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type;
54 fd_set fds;
55 struct timeval tv;
56 int r, fd = -1;
57 unsigned int i, n_buffers;
58 char *dev_name = "/dev/video0";
59 char out_name[256];
60 FILE *fout;
61 struct buffer *buffers;
62
63 fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0);
64 if (fd &lt; 0) {
65 perror("Cannot open device");
66 exit(EXIT_FAILURE);
67 }
68
69 CLEAR(fmt);
70 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
71 fmt.fmt.pix.width = 640;
72 fmt.fmt.pix.height = 480;
73 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
74 fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
75 xioctl(fd, VIDIOC_S_FMT, &amp;fmt);
76 if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) {
77 printf("Libv4l didn't accept RGB24 format. Can't proceed.\n");
78 exit(EXIT_FAILURE);
79 }
80 if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480))
81 printf("Warning: driver is sending image at %dx%d\n",
82 fmt.fmt.pix.width, fmt.fmt.pix.height);
83
84 CLEAR(req);
85 req.count = 2;
86 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
87 req.memory = V4L2_MEMORY_MMAP;
88 xioctl(fd, VIDIOC_REQBUFS, &amp;req);
89
90 buffers = calloc(req.count, sizeof(*buffers));
91 for (n_buffers = 0; n_buffers &lt; req.count; ++n_buffers) {
92 CLEAR(buf);
93
94 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
95 buf.memory = V4L2_MEMORY_MMAP;
96 buf.index = n_buffers;
97
98 xioctl(fd, VIDIOC_QUERYBUF, &amp;buf);
99
100 buffers[n_buffers].length = buf.length;
101 buffers[n_buffers].start = v4l2_mmap(NULL, buf.length,
102 PROT_READ | PROT_WRITE, MAP_SHARED,
103 fd, buf.m.offset);
104
105 if (MAP_FAILED == buffers[n_buffers].start) {
106 perror("mmap");
107 exit(EXIT_FAILURE);
108 }
109 }
110
111 for (i = 0; i &lt; n_buffers; ++i) {
112 CLEAR(buf);
113 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
114 buf.memory = V4L2_MEMORY_MMAP;
115 buf.index = i;
116 xioctl(fd, VIDIOC_QBUF, &amp;buf);
117 }
118 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
119
120 xioctl(fd, VIDIOC_STREAMON, &amp;type);
121 for (i = 0; i &lt; 20; i++) {
122 do {
123 FD_ZERO(&amp;fds);
124 FD_SET(fd, &amp;fds);
125
126 /* Timeout. */
127 tv.tv_sec = 2;
128 tv.tv_usec = 0;
129
130 r = select(fd + 1, &amp;fds, NULL, NULL, &amp;tv);
131 } while ((r == -1 &amp;&amp; (errno = EINTR)));
132 if (r == -1) {
133 perror("select");
134 return errno;
135 }
136
137 CLEAR(buf);
138 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
139 buf.memory = V4L2_MEMORY_MMAP;
140 xioctl(fd, VIDIOC_DQBUF, &amp;buf);
141
142 sprintf(out_name, "out%03d.ppm", i);
143 fout = fopen(out_name, "w");
144 if (!fout) {
145 perror("Cannot open image");
146 exit(EXIT_FAILURE);
147 }
148 fprintf(fout, "P6\n%d %d 255\n",
149 fmt.fmt.pix.width, fmt.fmt.pix.height);
150 fwrite(buffers[buf.index].start, buf.bytesused, 1, fout);
151 fclose(fout);
152
153 xioctl(fd, VIDIOC_QBUF, &amp;buf);
154 }
155
156 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
157 xioctl(fd, VIDIOC_STREAMOFF, &amp;type);
158 for (i = 0; i &lt; n_buffers; ++i)
159 v4l2_munmap(buffers[i].start, buffers[i].length);
160 v4l2_close(fd);
161
162 return 0;
163}
164</programlisting>
diff --git a/Documentation/DocBook/media/v4l/vbi_525.pdf b/Documentation/DocBook/media/v4l/vbi_525.pdf
new file mode 100644
index 00000000000..9e72c25b208
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vbi_525.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/vbi_625.pdf b/Documentation/DocBook/media/v4l/vbi_625.pdf
new file mode 100644
index 00000000000..765235e33a4
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vbi_625.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/vbi_hsync.pdf b/Documentation/DocBook/media/v4l/vbi_hsync.pdf
new file mode 100644
index 00000000000..200b668189b
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vbi_hsync.pdf
Binary files differ
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
new file mode 100644
index 00000000000..cd994367243
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
@@ -0,0 +1,154 @@
1<refentry id="vidioc-create-bufs">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_CREATE_BUFS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_CREATE_BUFS</refname>
9 <refpurpose>Create buffers for Memory Mapped or User Pointer or DMA Buffer
10 I/O</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_create_buffers *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_CREATE_BUFS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental"> experimental </link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>This ioctl is used to create buffers for <link linkend="mmap">memory
59mapped</link> or <link linkend="userp">user pointer</link> or <link
60linkend="dmabuf">DMA buffer</link> I/O. It can be used as an alternative or in
61addition to the <constant>VIDIOC_REQBUFS</constant> ioctl, when a tighter
62control over buffers is required. This ioctl can be called multiple times to
63create buffers of different sizes.</para>
64
65 <para>To allocate device buffers applications initialize relevant fields of
66the <structname>v4l2_create_buffers</structname> structure. They set the
67<structfield>type</structfield> field in the
68&v4l2-format; structure, embedded in this
69structure, to the respective stream or buffer type.
70<structfield>count</structfield> must be set to the number of required buffers.
71<structfield>memory</structfield> specifies the required I/O method. The
72<structfield>format</structfield> field shall typically be filled in using
73either the <constant>VIDIOC_TRY_FMT</constant> or
74<constant>VIDIOC_G_FMT</constant> ioctl(). Additionally, applications can adjust
75<structfield>sizeimage</structfield> fields to fit their specific needs. The
76<structfield>reserved</structfield> array must be zeroed.</para>
77
78 <para>When the ioctl is called with a pointer to this structure the driver
79will attempt to allocate up to the requested number of buffers and store the
80actual number allocated and the starting index in the
81<structfield>count</structfield> and the <structfield>index</structfield> fields
82respectively. On return <structfield>count</structfield> can be smaller than
83the number requested. The driver may also increase buffer sizes if required,
84however, it will not update <structfield>sizeimage</structfield> field values.
85The user has to use <constant>VIDIOC_QUERYBUF</constant> to retrieve that
86information.</para>
87
88 <table pgwide="1" frame="none" id="v4l2-create-buffers">
89 <title>struct <structname>v4l2_create_buffers</structname></title>
90 <tgroup cols="3">
91 &cs-str;
92 <tbody valign="top">
93 <row>
94 <entry>__u32</entry>
95 <entry><structfield>index</structfield></entry>
96 <entry>The starting buffer index, returned by the driver.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>count</structfield></entry>
101 <entry>The number of buffers requested or granted. If count == 0, then
102 <constant>VIDIOC_CREATE_BUFS</constant> will set <structfield>index</structfield>
103 to the current number of created buffers, and it will check the validity of
104 <structfield>memory</structfield> and <structfield>format.type</structfield>.
105 If those are invalid -1 is returned and errno is set to &EINVAL;,
106 otherwise <constant>VIDIOC_CREATE_BUFS</constant> returns 0. It will
107 never set errno to &EBUSY; in this particular case.</entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>memory</structfield></entry>
112 <entry>Applications set this field to
113<constant>V4L2_MEMORY_MMAP</constant>,
114<constant>V4L2_MEMORY_DMABUF</constant> or
115<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
116/></entry>
117 </row>
118 <row>
119 <entry>&v4l2-format;</entry>
120 <entry><structfield>format</structfield></entry>
121 <entry>Filled in by the application, preserved by the driver.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>reserved</structfield>[8]</entry>
126 <entry>A place holder for future extensions.</entry>
127 </row>
128 </tbody>
129 </tgroup>
130 </table>
131 </refsect1>
132
133 <refsect1>
134 &return-value;
135
136 <variablelist>
137 <varlistentry>
138 <term><errorcode>ENOMEM</errorcode></term>
139 <listitem>
140 <para>No memory to allocate buffers for <link linkend="mmap">memory
141mapped</link> I/O.</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term><errorcode>EINVAL</errorcode></term>
146 <listitem>
147 <para>The buffer type (<structfield>type</structfield> field) or the
148requested I/O method (<structfield>memory</structfield>) is not
149supported.</para>
150 </listitem>
151 </varlistentry>
152 </variablelist>
153 </refsect1>
154</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
new file mode 100644
index 00000000000..bf7cc979fdf
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
@@ -0,0 +1,167 @@
1<refentry id="vidioc-cropcap">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_CROPCAP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_CROPCAP</refname>
9 <refpurpose>Information about the video cropping and scaling abilities</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_cropcap
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_CROPCAP</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>Applications use this function to query the cropping
53limits, the pixel aspect of images and to calculate scale factors.
54They set the <structfield>type</structfield> field of a v4l2_cropcap
55structure to the respective buffer (stream) type and call the
56<constant>VIDIOC_CROPCAP</constant> ioctl with a pointer to this
57structure. Drivers fill the rest of the structure. The results are
58constant except when switching the video standard. Remember this
59switch can occur implicit when switching the video input or
60output.</para>
61
62 <para>This ioctl must be implemented for video capture or output devices that
63support cropping and/or scaling and/or have non-square pixels, and for overlay devices.</para>
64
65 <table pgwide="1" frame="none" id="v4l2-cropcap">
66 <title>struct <structname>v4l2_cropcap</structname></title>
67 <tgroup cols="3">
68 &cs-str;
69 <tbody valign="top">
70 <row>
71 <entry>__u32</entry>
72 <entry><structfield>type</structfield></entry>
73 <entry>Type of the data stream, set by the application.
74Only these types are valid here:
75<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
76<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>,
77<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
78<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and
79<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
80 </row>
81 <row>
82 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry>
83 <entry><structfield>bounds</structfield></entry>
84 <entry>Defines the window within capturing or output is
85possible, this may exclude for example the horizontal and vertical
86blanking areas. The cropping rectangle cannot exceed these limits.
87Width and height are defined in pixels, the driver writer is free to
88choose origin and units of the coordinate system in the analog
89domain.</entry>
90 </row>
91 <row>
92 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry>
93 <entry><structfield>defrect</structfield></entry>
94 <entry>Default cropping rectangle, it shall cover the
95"whole picture". Assuming pixel aspect 1/1 this could be for example a
96640&nbsp;&times;&nbsp;480 rectangle for NTSC, a
97768&nbsp;&times;&nbsp;576 rectangle for PAL and SECAM centered over
98the active picture area. The same co-ordinate system as for
99 <structfield>bounds</structfield> is used.</entry>
100 </row>
101 <row>
102 <entry>&v4l2-fract;</entry>
103 <entry><structfield>pixelaspect</structfield></entry>
104 <entry><para>This is the pixel aspect (y / x) when no
105scaling is applied, the ratio of the actual sampling
106frequency and the frequency required to get square
107pixels.</para><para>When cropping coordinates refer to square pixels,
108the driver sets <structfield>pixelaspect</structfield> to 1/1. Other
109common values are 54/59 for PAL and SECAM, 11/10 for NTSC sampled
110according to [<xref linkend="itu601" />].</para></entry>
111 </row>
112 </tbody>
113 </tgroup>
114 </table>
115
116 <!-- NB this table is duplicated in the overlay chapter. -->
117
118 <table pgwide="1" frame="none" id="v4l2-rect-crop">
119 <title>struct <structname>v4l2_rect</structname></title>
120 <tgroup cols="3">
121 &cs-str;
122 <tbody valign="top">
123 <row>
124 <entry>__s32</entry>
125 <entry><structfield>left</structfield></entry>
126 <entry>Horizontal offset of the top, left corner of the
127rectangle, in pixels.</entry>
128 </row>
129 <row>
130 <entry>__s32</entry>
131 <entry><structfield>top</structfield></entry>
132 <entry>Vertical offset of the top, left corner of the
133rectangle, in pixels.</entry>
134 </row>
135 <row>
136 <entry>__s32</entry>
137 <entry><structfield>width</structfield></entry>
138 <entry>Width of the rectangle, in pixels.</entry>
139 </row>
140 <row>
141 <entry>__s32</entry>
142 <entry><structfield>height</structfield></entry>
143 <entry>Height of the rectangle, in pixels. Width
144and height cannot be negative, the fields are signed for
145hysterical reasons. <!-- video4linux-list@redhat.com
146on 22 Oct 2002 subject "Re:[V4L][patches!] Re:v4l2/kernel-2.5" -->
147</entry>
148 </row>
149 </tbody>
150 </tgroup>
151 </table>
152 </refsect1>
153
154 <refsect1>
155 &return-value;
156
157 <variablelist>
158 <varlistentry>
159 <term><errorcode>EINVAL</errorcode></term>
160 <listitem>
161 <para>The &v4l2-cropcap; <structfield>type</structfield> is
162invalid.</para>
163 </listitem>
164 </varlistentry>
165 </variablelist>
166 </refsect1>
167</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
new file mode 100644
index 00000000000..4ecd966808d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
@@ -0,0 +1,266 @@
1<refentry id="vidioc-dbg-g-chip-ident">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_IDENT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_DBG_G_CHIP_IDENT</refname>
9 <refpurpose>Identify the chips on a TV card</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_dbg_chip_ident
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_DBG_G_CHIP_IDENT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54
55 <para>This is an <link
56linkend="experimental">experimental</link> interface and may change in
57the future.</para>
58 </note>
59
60 <para>For driver debugging purposes this ioctl allows test
61applications to query the driver about the chips present on the TV
62card. Regular applications must not use it. When you found a chip
63specific bug, please contact the linux-media mailing list (&v4l-ml;)
64so it can be fixed.</para>
65
66 <para>To query the driver applications must initialize the
67<structfield>match.type</structfield> and
68<structfield>match.addr</structfield> or <structfield>match.name</structfield>
69fields of a &v4l2-dbg-chip-ident;
70and call <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> with a pointer to
71this structure. On success the driver stores information about the
72selected chip in the <structfield>ident</structfield> and
73<structfield>revision</structfield> fields. On failure the structure
74remains unchanged.</para>
75
76 <para>When <structfield>match.type</structfield> is
77<constant>V4L2_CHIP_MATCH_HOST</constant>,
78<structfield>match.addr</structfield> selects the nth non-&i2c; chip
79on the TV card. You can enumerate all chips by starting at zero and
80incrementing <structfield>match.addr</structfield> by one until
81<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;.
82The number zero always selects the host chip, &eg; the chip connected
83to the PCI or USB bus.</para>
84
85 <para>When <structfield>match.type</structfield> is
86<constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>,
87<structfield>match.name</structfield> contains the I2C driver name.
88For instance
89<constant>"saa7127"</constant> will match any chip
90supported by the saa7127 driver, regardless of its &i2c; bus address.
91When multiple chips supported by the same driver are present, the
92ioctl will return <constant>V4L2_IDENT_AMBIGUOUS</constant> in the
93<structfield>ident</structfield> field.</para>
94
95 <para>When <structfield>match.type</structfield> is
96<constant>V4L2_CHIP_MATCH_I2C_ADDR</constant>,
97<structfield>match.addr</structfield> selects a chip by its 7 bit
98&i2c; bus address.</para>
99
100 <para>When <structfield>match.type</structfield> is
101<constant>V4L2_CHIP_MATCH_AC97</constant>,
102<structfield>match.addr</structfield> selects the nth AC97 chip
103on the TV card. You can enumerate all chips by starting at zero and
104incrementing <structfield>match.addr</structfield> by one until
105<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;.</para>
106
107 <para>On success, the <structfield>ident</structfield> field will
108contain a chip ID from the Linux
109<filename>media/v4l2-chip-ident.h</filename> header file, and the
110<structfield>revision</structfield> field will contain a driver
111specific value, or zero if no particular revision is associated with
112this chip.</para>
113
114 <para>When the driver could not identify the selected chip,
115<structfield>ident</structfield> will contain
116<constant>V4L2_IDENT_UNKNOWN</constant>. When no chip matched
117the ioctl will succeed but the
118<structfield>ident</structfield> field will contain
119<constant>V4L2_IDENT_NONE</constant>. If multiple chips matched,
120<structfield>ident</structfield> will contain
121<constant>V4L2_IDENT_AMBIGUOUS</constant>. In all these cases the
122<structfield>revision</structfield> field remains unchanged.</para>
123
124 <para>This ioctl is optional, not all drivers may support it. It
125was introduced in Linux 2.6.21, but the API was changed to the
126one described here in 2.6.29.</para>
127
128 <para>We recommended the <application>v4l2-dbg</application>
129utility over calling this ioctl directly. It is available from the
130LinuxTV v4l-dvb repository; see <ulink
131url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
132access instructions.</para>
133
134 <!-- Note for convenience vidioc-dbg-g-register.sgml
135 contains a duplicate of this table. -->
136 <table pgwide="1" frame="none" id="ident-v4l2-dbg-match">
137 <title>struct <structname>v4l2_dbg_match</structname></title>
138 <tgroup cols="4">
139 &cs-ustr;
140 <tbody valign="top">
141 <row>
142 <entry>__u32</entry>
143 <entry><structfield>type</structfield></entry>
144 <entry>See <xref linkend="ident-chip-match-types" /> for a list of
145possible types.</entry>
146 </row>
147 <row>
148 <entry>union</entry>
149 <entry>(anonymous)</entry>
150 </row>
151 <row>
152 <entry></entry>
153 <entry>__u32</entry>
154 <entry><structfield>addr</structfield></entry>
155 <entry>Match a chip by this number, interpreted according
156to the <structfield>type</structfield> field.</entry>
157 </row>
158 <row>
159 <entry></entry>
160 <entry>char</entry>
161 <entry><structfield>name[32]</structfield></entry>
162 <entry>Match a chip by this name, interpreted according
163to the <structfield>type</structfield> field.</entry>
164 </row>
165 </tbody>
166 </tgroup>
167 </table>
168
169 <table pgwide="1" frame="none" id="v4l2-dbg-chip-ident">
170 <title>struct <structname>v4l2_dbg_chip_ident</structname></title>
171 <tgroup cols="3">
172 &cs-str;
173 <tbody valign="top">
174 <row>
175 <entry>struct v4l2_dbg_match</entry>
176 <entry><structfield>match</structfield></entry>
177 <entry>How to match the chip, see <xref linkend="ident-v4l2-dbg-match" />.</entry>
178 </row>
179 <row>
180 <entry>__u32</entry>
181 <entry><structfield>ident</structfield></entry>
182 <entry>A chip identifier as defined in the Linux
183<filename>media/v4l2-chip-ident.h</filename> header file, or one of
184the values from <xref linkend="chip-ids" />.</entry>
185 </row>
186 <row>
187 <entry>__u32</entry>
188 <entry><structfield>revision</structfield></entry>
189 <entry>A chip revision, chip and driver specific.</entry>
190 </row>
191 </tbody>
192 </tgroup>
193 </table>
194
195 <!-- Note for convenience vidioc-dbg-g-register.sgml
196 contains a duplicate of this table. -->
197 <table pgwide="1" frame="none" id="ident-chip-match-types">
198 <title>Chip Match Types</title>
199 <tgroup cols="3">
200 &cs-def;
201 <tbody valign="top">
202 <row>
203 <entry><constant>V4L2_CHIP_MATCH_HOST</constant></entry>
204 <entry>0</entry>
205 <entry>Match the nth chip on the card, zero for the
206 host chip. Does not match &i2c; chips.</entry>
207 </row>
208 <row>
209 <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
210 <entry>1</entry>
211 <entry>Match an &i2c; chip by its driver name.</entry>
212 </row>
213 <row>
214 <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
215 <entry>2</entry>
216 <entry>Match a chip by its 7 bit &i2c; bus address.</entry>
217 </row>
218 <row>
219 <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
220 <entry>3</entry>
221 <entry>Match the nth anciliary AC97 chip.</entry>
222 </row>
223 </tbody>
224 </tgroup>
225 </table>
226
227 <!-- This is an anonymous enum in media/v4l2-chip-ident.h. -->
228 <table pgwide="1" frame="none" id="chip-ids">
229 <title>Chip Identifiers</title>
230 <tgroup cols="3">
231 &cs-def;
232 <tbody valign="top">
233 <row>
234 <entry><constant>V4L2_IDENT_NONE</constant></entry>
235 <entry>0</entry>
236 <entry>No chip matched.</entry>
237 </row>
238 <row>
239 <entry><constant>V4L2_IDENT_AMBIGUOUS</constant></entry>
240 <entry>1</entry>
241 <entry>Multiple chips matched.</entry>
242 </row>
243 <row>
244 <entry><constant>V4L2_IDENT_UNKNOWN</constant></entry>
245 <entry>2</entry>
246 <entry>A chip is present at this address, but the driver
247could not identify it.</entry>
248 </row>
249 </tbody>
250 </tgroup>
251 </table>
252 </refsect1>
253
254 <refsect1>
255 &return-value;
256
257 <variablelist>
258 <varlistentry>
259 <term><errorcode>EINVAL</errorcode></term>
260 <listitem>
261 <para>The <structfield>match_type</structfield> is invalid.</para>
262 </listitem>
263 </varlistentry>
264 </variablelist>
265 </refsect1>
266</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml
new file mode 100644
index 00000000000..a44aebc7997
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml
@@ -0,0 +1,258 @@
1<refentry id="vidioc-dbg-g-register">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_DBG_G_REGISTER</refname>
9 <refname>VIDIOC_DBG_S_REGISTER</refname>
10 <refpurpose>Read or write hardware registers</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_dbg_register *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_dbg_register
28*<parameter>argp</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Arguments</title>
35
36 <variablelist>
37 <varlistentry>
38 <term><parameter>fd</parameter></term>
39 <listitem>
40 <para>&fd;</para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>request</parameter></term>
45 <listitem>
46 <para>VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term><parameter>argp</parameter></term>
51 <listitem>
52 <para></para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57
58 <refsect1>
59 <title>Description</title>
60
61 <note>
62 <title>Experimental</title>
63
64 <para>This is an <link linkend="experimental">experimental</link>
65interface and may change in the future.</para>
66 </note>
67
68 <para>For driver debugging purposes these ioctls allow test
69applications to access hardware registers directly. Regular
70applications must not use them.</para>
71
72 <para>Since writing or even reading registers can jeopardize the
73system security, its stability and damage the hardware, both ioctls
74require superuser privileges. Additionally the Linux kernel must be
75compiled with the <constant>CONFIG_VIDEO_ADV_DEBUG</constant> option
76to enable these ioctls.</para>
77
78 <para>To write a register applications must initialize all fields
79of a &v4l2-dbg-register; and call
80<constant>VIDIOC_DBG_S_REGISTER</constant> with a pointer to this
81structure. The <structfield>match.type</structfield> and
82<structfield>match.addr</structfield> or <structfield>match.name</structfield>
83fields select a chip on the TV
84card, the <structfield>reg</structfield> field specifies a register
85number and the <structfield>val</structfield> field the value to be
86written into the register.</para>
87
88 <para>To read a register applications must initialize the
89<structfield>match.type</structfield>,
90<structfield>match.chip</structfield> or <structfield>match.name</structfield> and
91<structfield>reg</structfield> fields, and call
92<constant>VIDIOC_DBG_G_REGISTER</constant> with a pointer to this
93structure. On success the driver stores the register value in the
94<structfield>val</structfield> field. On failure the structure remains
95unchanged.</para>
96
97 <para>When <structfield>match.type</structfield> is
98<constant>V4L2_CHIP_MATCH_HOST</constant>,
99<structfield>match.addr</structfield> selects the nth non-&i2c; chip
100on the TV card. The number zero always selects the host chip, &eg; the
101chip connected to the PCI or USB bus. You can find out which chips are
102present with the &VIDIOC-DBG-G-CHIP-IDENT; ioctl.</para>
103
104 <para>When <structfield>match.type</structfield> is
105<constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>,
106<structfield>match.name</structfield> contains the I2C driver name.
107For instance
108<constant>"saa7127"</constant> will match any chip
109supported by the saa7127 driver, regardless of its &i2c; bus address.
110When multiple chips supported by the same driver are present, the
111effect of these ioctls is undefined. Again with the
112&VIDIOC-DBG-G-CHIP-IDENT; ioctl you can find out which &i2c; chips are
113present.</para>
114
115 <para>When <structfield>match.type</structfield> is
116<constant>V4L2_CHIP_MATCH_I2C_ADDR</constant>,
117<structfield>match.addr</structfield> selects a chip by its 7 bit &i2c;
118bus address.</para>
119
120 <para>When <structfield>match.type</structfield> is
121<constant>V4L2_CHIP_MATCH_AC97</constant>,
122<structfield>match.addr</structfield> selects the nth AC97 chip
123on the TV card.</para>
124
125 <note>
126 <title>Success not guaranteed</title>
127
128 <para>Due to a flaw in the Linux &i2c; bus driver these ioctls may
129return successfully without actually reading or writing a register. To
130catch the most likely failure we recommend a &VIDIOC-DBG-G-CHIP-IDENT;
131call confirming the presence of the selected &i2c; chip.</para>
132 </note>
133
134 <para>These ioctls are optional, not all drivers may support them.
135However when a driver supports these ioctls it must also support
136&VIDIOC-DBG-G-CHIP-IDENT;. Conversely it may support
137<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> but not these ioctls.</para>
138
139 <para><constant>VIDIOC_DBG_G_REGISTER</constant> and
140<constant>VIDIOC_DBG_S_REGISTER</constant> were introduced in Linux
1412.6.21, but their API was changed to the one described here in kernel 2.6.29.</para>
142
143 <para>We recommended the <application>v4l2-dbg</application>
144utility over calling these ioctls directly. It is available from the
145LinuxTV v4l-dvb repository; see <ulink
146url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
147access instructions.</para>
148
149 <!-- Note for convenience vidioc-dbg-g-chip-ident.sgml
150 contains a duplicate of this table. -->
151 <table pgwide="1" frame="none" id="v4l2-dbg-match">
152 <title>struct <structname>v4l2_dbg_match</structname></title>
153 <tgroup cols="4">
154 &cs-ustr;
155 <tbody valign="top">
156 <row>
157 <entry>__u32</entry>
158 <entry><structfield>type</structfield></entry>
159 <entry>See <xref linkend="ident-chip-match-types" /> for a list of
160possible types.</entry>
161 </row>
162 <row>
163 <entry>union</entry>
164 <entry>(anonymous)</entry>
165 </row>
166 <row>
167 <entry></entry>
168 <entry>__u32</entry>
169 <entry><structfield>addr</structfield></entry>
170 <entry>Match a chip by this number, interpreted according
171to the <structfield>type</structfield> field.</entry>
172 </row>
173 <row>
174 <entry></entry>
175 <entry>char</entry>
176 <entry><structfield>name[32]</structfield></entry>
177 <entry>Match a chip by this name, interpreted according
178to the <structfield>type</structfield> field.</entry>
179 </row>
180 </tbody>
181 </tgroup>
182 </table>
183
184
185 <table pgwide="1" frame="none" id="v4l2-dbg-register">
186 <title>struct <structname>v4l2_dbg_register</structname></title>
187 <tgroup cols="4">
188 <colspec colname="c1" />
189 <colspec colname="c2" />
190 <colspec colname="c4" />
191 <tbody valign="top">
192 <row>
193 <entry>struct v4l2_dbg_match</entry>
194 <entry><structfield>match</structfield></entry>
195 <entry>How to match the chip, see <xref linkend="v4l2-dbg-match" />.</entry>
196 </row>
197 <row>
198 <entry>__u64</entry>
199 <entry><structfield>reg</structfield></entry>
200 <entry>A register number.</entry>
201 </row>
202 <row>
203 <entry>__u64</entry>
204 <entry><structfield>val</structfield></entry>
205 <entry>The value read from, or to be written into the
206register.</entry>
207 </row>
208 </tbody>
209 </tgroup>
210 </table>
211
212 <!-- Note for convenience vidioc-dbg-g-chip-ident.sgml
213 contains a duplicate of this table. -->
214 <table pgwide="1" frame="none" id="chip-match-types">
215 <title>Chip Match Types</title>
216 <tgroup cols="3">
217 &cs-def;
218 <tbody valign="top">
219 <row>
220 <entry><constant>V4L2_CHIP_MATCH_HOST</constant></entry>
221 <entry>0</entry>
222 <entry>Match the nth chip on the card, zero for the
223 host chip. Does not match &i2c; chips.</entry>
224 </row>
225 <row>
226 <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
227 <entry>1</entry>
228 <entry>Match an &i2c; chip by its driver name.</entry>
229 </row>
230 <row>
231 <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
232 <entry>2</entry>
233 <entry>Match a chip by its 7 bit &i2c; bus address.</entry>
234 </row>
235 <row>
236 <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
237 <entry>3</entry>
238 <entry>Match the nth anciliary AC97 chip.</entry>
239 </row>
240 </tbody>
241 </tgroup>
242 </table>
243 </refsect1>
244
245 <refsect1>
246 &return-value;
247
248 <variablelist>
249 <varlistentry>
250 <term><errorcode>EPERM</errorcode></term>
251 <listitem>
252 <para>Insufficient permissions. Root privileges are required
253to execute these ioctls.</para>
254 </listitem>
255 </varlistentry>
256 </variablelist>
257 </refsect1>
258</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
new file mode 100644
index 00000000000..9215627b04c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
@@ -0,0 +1,249 @@
1<refentry id="vidioc-decoder-cmd">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_DECODER_CMD</refname>
9 <refname>VIDIOC_TRY_DECODER_CMD</refname>
10 <refpurpose>Execute an decoder command</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_decoder_cmd *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>These ioctls control an audio/video (usually MPEG-) decoder.
53<constant>VIDIOC_DECODER_CMD</constant> sends a command to the
54decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to
55try a command without actually executing it. To send a command applications
56must initialize all fields of a &v4l2-decoder-cmd; and call
57<constant>VIDIOC_DECODER_CMD</constant> or <constant>VIDIOC_TRY_DECODER_CMD</constant>
58with a pointer to this structure.</para>
59
60 <para>The <structfield>cmd</structfield> field must contain the
61command code. Some commands use the <structfield>flags</structfield> field for
62additional information.
63</para>
64
65 <para>A <function>write</function>() or &VIDIOC-STREAMON; call sends an implicit
66START command to the decoder if it has not been started yet.
67</para>
68
69 <para>A <function>close</function>() or &VIDIOC-STREAMOFF; call of a streaming
70file descriptor sends an implicit immediate STOP command to the decoder, and all
71buffered data is discarded.</para>
72
73 <para>These ioctls are optional, not all drivers may support
74them. They were introduced in Linux 3.3.</para>
75
76 <table pgwide="1" frame="none" id="v4l2-decoder-cmd">
77 <title>struct <structname>v4l2_decoder_cmd</structname></title>
78 <tgroup cols="5">
79 &cs-str;
80 <tbody valign="top">
81 <row>
82 <entry>__u32</entry>
83 <entry><structfield>cmd</structfield></entry>
84 <entry></entry>
85 <entry></entry>
86 <entry>The decoder command, see <xref linkend="decoder-cmds" />.</entry>
87 </row>
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>flags</structfield></entry>
91 <entry></entry>
92 <entry></entry>
93 <entry>Flags to go with the command. If no flags are defined for
94this command, drivers and applications must set this field to zero.</entry>
95 </row>
96 <row>
97 <entry>union</entry>
98 <entry>(anonymous)</entry>
99 <entry></entry>
100 <entry></entry>
101 <entry></entry>
102 </row>
103 <row>
104 <entry></entry>
105 <entry>struct</entry>
106 <entry><structfield>start</structfield></entry>
107 <entry></entry>
108 <entry>Structure containing additional data for the
109<constant>V4L2_DEC_CMD_START</constant> command.</entry>
110 </row>
111 <row>
112 <entry></entry>
113 <entry></entry>
114 <entry>__s32</entry>
115 <entry><structfield>speed</structfield></entry>
116 <entry>Playback speed and direction. The playback speed is defined as
117<structfield>speed</structfield>/1000 of the normal speed. So 1000 is normal playback.
118Negative numbers denote reverse playback, so -1000 does reverse playback at normal
119speed. Speeds -1, 0 and 1 have special meanings: speed 0 is shorthand for 1000
120(normal playback). A speed of 1 steps just one frame forward, a speed of -1 steps
121just one frame back.
122 </entry>
123 </row>
124 <row>
125 <entry></entry>
126 <entry></entry>
127 <entry>__u32</entry>
128 <entry><structfield>format</structfield></entry>
129 <entry>Format restrictions. This field is set by the driver, not the
130application. Possible values are <constant>V4L2_DEC_START_FMT_NONE</constant> if
131there are no format restrictions or <constant>V4L2_DEC_START_FMT_GOP</constant>
132if the decoder operates on full GOPs (<wordasword>Group Of Pictures</wordasword>).
133This is usually the case for reverse playback: the decoder needs full GOPs, which
134it can then play in reverse order. So to implement reverse playback the application
135must feed the decoder the last GOP in the video file, then the GOP before that, etc. etc.
136 </entry>
137 </row>
138 <row>
139 <entry></entry>
140 <entry>struct</entry>
141 <entry><structfield>stop</structfield></entry>
142 <entry></entry>
143 <entry>Structure containing additional data for the
144<constant>V4L2_DEC_CMD_STOP</constant> command.</entry>
145 </row>
146 <row>
147 <entry></entry>
148 <entry></entry>
149 <entry>__u64</entry>
150 <entry><structfield>pts</structfield></entry>
151 <entry>Stop playback at this <structfield>pts</structfield> or immediately
152if the playback is already past that timestamp. Leave to 0 if you want to stop after the
153last frame was decoded.
154 </entry>
155 </row>
156 <row>
157 <entry></entry>
158 <entry>struct</entry>
159 <entry><structfield>raw</structfield></entry>
160 <entry></entry>
161 <entry></entry>
162 </row>
163 <row>
164 <entry></entry>
165 <entry></entry>
166 <entry>__u32</entry>
167 <entry><structfield>data</structfield>[16]</entry>
168 <entry>Reserved for future extensions. Drivers and
169applications must set the array to zero.</entry>
170 </row>
171 </tbody>
172 </tgroup>
173 </table>
174
175 <table pgwide="1" frame="none" id="decoder-cmds">
176 <title>Decoder Commands</title>
177 <tgroup cols="3">
178 &cs-def;
179 <tbody valign="top">
180 <row>
181 <entry><constant>V4L2_DEC_CMD_START</constant></entry>
182 <entry>0</entry>
183 <entry>Start the decoder. When the decoder is already
184running or paused, this command will just change the playback speed.
185That means that calling <constant>V4L2_DEC_CMD_START</constant> when
186the decoder was paused will <emphasis>not</emphasis> resume the decoder.
187You have to explicitly call <constant>V4L2_DEC_CMD_RESUME</constant> for that.
188This command has one flag:
189<constant>V4L2_DEC_CMD_START_MUTE_AUDIO</constant>. If set, then audio will
190be muted when playing back at a non-standard speed.
191 </entry>
192 </row>
193 <row>
194 <entry><constant>V4L2_DEC_CMD_STOP</constant></entry>
195 <entry>1</entry>
196 <entry>Stop the decoder. When the decoder is already stopped,
197this command does nothing. This command has two flags:
198if <constant>V4L2_DEC_CMD_STOP_TO_BLACK</constant> is set, then the decoder will
199set the picture to black after it stopped decoding. Otherwise the last image will
200repeat. If <constant>V4L2_DEC_CMD_STOP_IMMEDIATELY</constant> is set, then the decoder
201stops immediately (ignoring the <structfield>pts</structfield> value), otherwise it
202will keep decoding until timestamp >= pts or until the last of the pending data from
203its internal buffers was decoded.
204</entry>
205 </row>
206 <row>
207 <entry><constant>V4L2_DEC_CMD_PAUSE</constant></entry>
208 <entry>2</entry>
209 <entry>Pause the decoder. When the decoder has not been
210started yet, the driver will return an &EPERM;. When the decoder is
211already paused, this command does nothing. This command has one flag:
212if <constant>V4L2_DEC_CMD_PAUSE_TO_BLACK</constant> is set, then set the
213decoder output to black when paused.
214</entry>
215 </row>
216 <row>
217 <entry><constant>V4L2_DEC_CMD_RESUME</constant></entry>
218 <entry>3</entry>
219 <entry>Resume decoding after a PAUSE command. When the
220decoder has not been started yet, the driver will return an &EPERM;.
221When the decoder is already running, this command does nothing. No
222flags are defined for this command.</entry>
223 </row>
224 </tbody>
225 </tgroup>
226 </table>
227
228 </refsect1>
229
230 <refsect1>
231 &return-value;
232
233 <variablelist>
234 <varlistentry>
235 <term><errorcode>EINVAL</errorcode></term>
236 <listitem>
237 <para>The <structfield>cmd</structfield> field is invalid.</para>
238 </listitem>
239 </varlistentry>
240 <varlistentry>
241 <term><errorcode>EPERM</errorcode></term>
242 <listitem>
243 <para>The application sent a PAUSE or RESUME command when
244the decoder was not running.</para>
245 </listitem>
246 </varlistentry>
247 </variablelist>
248 </refsect1>
249</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
new file mode 100644
index 00000000000..98a856f9ec3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
@@ -0,0 +1,271 @@
1<refentry id="vidioc-dqevent">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_DQEVENT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_DQEVENT</refname>
9 <refpurpose>Dequeue event</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_event
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_DQEVENT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>Dequeue an event from a video device. No input is required
53 for this ioctl. All the fields of the &v4l2-event; structure are
54 filled by the driver. The file handle will also receive exceptions
55 which the application may get by e.g. using the select system
56 call.</para>
57
58 <table frame="none" pgwide="1" id="v4l2-event">
59 <title>struct <structname>v4l2_event</structname></title>
60 <tgroup cols="4">
61 &cs-str;
62 <tbody valign="top">
63 <row>
64 <entry>__u32</entry>
65 <entry><structfield>type</structfield></entry>
66 <entry></entry>
67 <entry>Type of the event.</entry>
68 </row>
69 <row>
70 <entry>union</entry>
71 <entry><structfield>u</structfield></entry>
72 <entry></entry>
73 <entry></entry>
74 </row>
75 <row>
76 <entry></entry>
77 <entry>&v4l2-event-vsync;</entry>
78 <entry><structfield>vsync</structfield></entry>
79 <entry>Event data for event V4L2_EVENT_VSYNC.
80 </entry>
81 </row>
82 <row>
83 <entry></entry>
84 <entry>&v4l2-event-ctrl;</entry>
85 <entry><structfield>ctrl</structfield></entry>
86 <entry>Event data for event V4L2_EVENT_CTRL.
87 </entry>
88 </row>
89 <row>
90 <entry></entry>
91 <entry>&v4l2-event-frame-sync;</entry>
92 <entry><structfield>frame_sync</structfield></entry>
93 <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry>
94 </row>
95 <row>
96 <entry></entry>
97 <entry>__u8</entry>
98 <entry><structfield>data</structfield>[64]</entry>
99 <entry>Event data. Defined by the event type. The union
100 should be used to define easily accessible type for
101 events.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>pending</structfield></entry>
106 <entry></entry>
107 <entry>Number of pending events excluding this one.</entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>sequence</structfield></entry>
112 <entry></entry>
113 <entry>Event sequence number. The sequence number is
114 incremented for every subscribed event that takes place.
115 If sequence numbers are not contiguous it means that
116 events have been lost.
117 </entry>
118 </row>
119 <row>
120 <entry>struct timespec</entry>
121 <entry><structfield>timestamp</structfield></entry>
122 <entry></entry>
123 <entry>Event timestamp.</entry>
124 </row>
125 <row>
126 <entry>u32</entry>
127 <entry><structfield>id</structfield></entry>
128 <entry></entry>
129 <entry>The ID associated with the event source. If the event does not
130 have an associated ID (this depends on the event type), then this
131 is 0.</entry>
132 </row>
133 <row>
134 <entry>__u32</entry>
135 <entry><structfield>reserved</structfield>[8]</entry>
136 <entry></entry>
137 <entry>Reserved for future extensions. Drivers must set
138 the array to zero.</entry>
139 </row>
140 </tbody>
141 </tgroup>
142 </table>
143
144 <table frame="none" pgwide="1" id="v4l2-event-vsync">
145 <title>struct <structname>v4l2_event_vsync</structname></title>
146 <tgroup cols="3">
147 &cs-str;
148 <tbody valign="top">
149 <row>
150 <entry>__u8</entry>
151 <entry><structfield>field</structfield></entry>
152 <entry>The upcoming field. See &v4l2-field;.</entry>
153 </row>
154 </tbody>
155 </tgroup>
156 </table>
157
158 <table frame="none" pgwide="1" id="v4l2-event-ctrl">
159 <title>struct <structname>v4l2_event_ctrl</structname></title>
160 <tgroup cols="4">
161 &cs-str;
162 <tbody valign="top">
163 <row>
164 <entry>__u32</entry>
165 <entry><structfield>changes</structfield></entry>
166 <entry></entry>
167 <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
168 </row>
169 <row>
170 <entry>__u32</entry>
171 <entry><structfield>type</structfield></entry>
172 <entry></entry>
173 <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
174 </row>
175 <row>
176 <entry>union (anonymous)</entry>
177 <entry></entry>
178 <entry></entry>
179 <entry></entry>
180 </row>
181 <row>
182 <entry></entry>
183 <entry>__s32</entry>
184 <entry><structfield>value</structfield></entry>
185 <entry>The 32-bit value of the control for 32-bit control types.
186 This is 0 for string controls since the value of a string
187 cannot be passed using &VIDIOC-DQEVENT;.</entry>
188 </row>
189 <row>
190 <entry></entry>
191 <entry>__s64</entry>
192 <entry><structfield>value64</structfield></entry>
193 <entry>The 64-bit value of the control for 64-bit control types.</entry>
194 </row>
195 <row>
196 <entry>__u32</entry>
197 <entry><structfield>flags</structfield></entry>
198 <entry></entry>
199 <entry>The control flags. See <xref linkend="control-flags" />.</entry>
200 </row>
201 <row>
202 <entry>__s32</entry>
203 <entry><structfield>minimum</structfield></entry>
204 <entry></entry>
205 <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
206 </row>
207 <row>
208 <entry>__s32</entry>
209 <entry><structfield>maximum</structfield></entry>
210 <entry></entry>
211 <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
212 </row>
213 <row>
214 <entry>__s32</entry>
215 <entry><structfield>step</structfield></entry>
216 <entry></entry>
217 <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
218 </row>
219 <row>
220 <entry>__s32</entry>
221 <entry><structfield>default_value</structfield></entry>
222 <entry></entry>
223 <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
224 </row>
225 </tbody>
226 </tgroup>
227 </table>
228
229 <table frame="none" pgwide="1" id="v4l2-event-frame-sync">
230 <title>struct <structname>v4l2_event_frame_sync</structname></title>
231 <tgroup cols="3">
232 &cs-str;
233 <tbody valign="top">
234 <row>
235 <entry>__u32</entry>
236 <entry><structfield>frame_sequence</structfield></entry>
237 <entry>
238 The sequence number of the frame being received.
239 </entry>
240 </row>
241 </tbody>
242 </tgroup>
243 </table>
244
245 <table pgwide="1" frame="none" id="changes-flags">
246 <title>Changes</title>
247 <tgroup cols="3">
248 &cs-def;
249 <tbody valign="top">
250 <row>
251 <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
252 <entry>0x0001</entry>
253 <entry>This control event was triggered because the value of the control
254 changed. Special case: if a button control is pressed, then this
255 event is sent as well, even though there is not explicit value
256 associated with a button control.</entry>
257 </row>
258 <row>
259 <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
260 <entry>0x0002</entry>
261 <entry>This control event was triggered because the control flags
262 changed.</entry>
263 </row>
264 </tbody>
265 </tgroup>
266 </table>
267 </refsect1>
268 <refsect1>
269 &return-value;
270 </refsect1>
271</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-dv-timings-cap.xml b/Documentation/DocBook/media/v4l/vidioc-dv-timings-cap.xml
new file mode 100644
index 00000000000..cd7720d404e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-dv-timings-cap.xml
@@ -0,0 +1,205 @@
1<refentry id="vidioc-dv-timings-cap">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_DV_TIMINGS_CAP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_DV_TIMINGS_CAP</refname>
9 <refpurpose>The capabilities of the Digital Video receiver/transmitter</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_dv_timings_cap *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_DV_TIMINGS_CAP</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <note>
52 <title>Experimental</title>
53 <para>This is an <link linkend="experimental"> experimental </link>
54 interface and may change in the future.</para>
55 </note>
56
57 <para>To query the capabilities of the DV receiver/transmitter applications can call
58this ioctl and the driver will fill in the structure. Note that drivers may return
59different values after switching the video input or output.</para>
60
61 <table pgwide="1" frame="none" id="v4l2-bt-timings-cap">
62 <title>struct <structname>v4l2_bt_timings_cap</structname></title>
63 <tgroup cols="3">
64 &cs-str;
65 <tbody valign="top">
66 <row>
67 <entry>__u32</entry>
68 <entry><structfield>min_width</structfield></entry>
69 <entry>Minimum width of the active video in pixels.</entry>
70 </row>
71 <row>
72 <entry>__u32</entry>
73 <entry><structfield>max_width</structfield></entry>
74 <entry>Maximum width of the active video in pixels.</entry>
75 </row>
76 <row>
77 <entry>__u32</entry>
78 <entry><structfield>min_height</structfield></entry>
79 <entry>Minimum height of the active video in lines.</entry>
80 </row>
81 <row>
82 <entry>__u32</entry>
83 <entry><structfield>max_height</structfield></entry>
84 <entry>Maximum height of the active video in lines.</entry>
85 </row>
86 <row>
87 <entry>__u64</entry>
88 <entry><structfield>min_pixelclock</structfield></entry>
89 <entry>Minimum pixelclock frequency in Hz.</entry>
90 </row>
91 <row>
92 <entry>__u64</entry>
93 <entry><structfield>max_pixelclock</structfield></entry>
94 <entry>Maximum pixelclock frequency in Hz.</entry>
95 </row>
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>standards</structfield></entry>
99 <entry>The video standard(s) supported by the hardware.
100 See <xref linkend="dv-bt-standards"/> for a list of standards.</entry>
101 </row>
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>capabilities</structfield></entry>
105 <entry>Several flags giving more information about the capabilities.
106 See <xref linkend="dv-bt-cap-capabilities"/> for a description of the flags.
107 </entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>reserved</structfield>[16]</entry>
112 <entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
113 </row>
114 </tbody>
115 </tgroup>
116 </table>
117
118 <table pgwide="1" frame="none" id="v4l2-dv-timings-cap">
119 <title>struct <structname>v4l2_dv_timings_cap</structname></title>
120 <tgroup cols="4">
121 &cs-str;
122 <tbody valign="top">
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>type</structfield></entry>
126 <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
127 </row>
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>reserved</structfield>[3]</entry>
131 <entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
132 </row>
133 <row>
134 <entry>union</entry>
135 <entry><structfield></structfield></entry>
136 <entry></entry>
137 </row>
138 <row>
139 <entry></entry>
140 <entry>&v4l2-bt-timings-cap;</entry>
141 <entry><structfield>bt</structfield></entry>
142 <entry>BT.656/1120 timings capabilities of the hardware.</entry>
143 </row>
144 <row>
145 <entry></entry>
146 <entry>__u32</entry>
147 <entry><structfield>raw_data</structfield>[32]</entry>
148 <entry></entry>
149 </row>
150 </tbody>
151 </tgroup>
152 </table>
153
154 <table pgwide="1" frame="none" id="dv-bt-cap-capabilities">
155 <title>DV BT Timing capabilities</title>
156 <tgroup cols="2">
157 &cs-str;
158 <tbody valign="top">
159 <row>
160 <entry>Flag</entry>
161 <entry>Description</entry>
162 </row>
163 <row>
164 <entry></entry>
165 <entry></entry>
166 </row>
167 <row>
168 <entry>V4L2_DV_BT_CAP_INTERLACED</entry>
169 <entry>Interlaced formats are supported.
170 </entry>
171 </row>
172 <row>
173 <entry>V4L2_DV_BT_CAP_PROGRESSIVE</entry>
174 <entry>Progressive formats are supported.
175 </entry>
176 </row>
177 <row>
178 <entry>V4L2_DV_BT_CAP_REDUCED_BLANKING</entry>
179 <entry>CVT/GTF specific: the timings can make use of reduced blanking (CVT)
180or the 'Secondary GTF' curve (GTF).
181 </entry>
182 </row>
183 <row>
184 <entry>V4L2_DV_BT_CAP_CUSTOM</entry>
185 <entry>Can support non-standard timings, i.e. timings not belonging to the
186standards set in the <structfield>standards</structfield> field.
187 </entry>
188 </row>
189 </tbody>
190 </tgroup>
191 </table>
192 </refsect1>
193
194 <refsect1>
195 &return-value;
196 </refsect1>
197</refentry>
198
199<!--
200Local Variables:
201mode: sgml
202sgml-parent-document: "v4l2.sgml"
203indent-tabs-mode: nil
204End:
205-->
diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
new file mode 100644
index 00000000000..0619ca5d2d3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
@@ -0,0 +1,189 @@
1<refentry id="vidioc-encoder-cmd">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENCODER_CMD</refname>
9 <refname>VIDIOC_TRY_ENCODER_CMD</refname>
10 <refpurpose>Execute an encoder command</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_encoder_cmd *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>These ioctls control an audio/video (usually MPEG-) encoder.
53<constant>VIDIOC_ENCODER_CMD</constant> sends a command to the
54encoder, <constant>VIDIOC_TRY_ENCODER_CMD</constant> can be used to
55try a command without actually executing it.</para>
56
57 <para>To send a command applications must initialize all fields of a
58 &v4l2-encoder-cmd; and call
59 <constant>VIDIOC_ENCODER_CMD</constant> or
60 <constant>VIDIOC_TRY_ENCODER_CMD</constant> with a pointer to this
61 structure.</para>
62
63 <para>The <structfield>cmd</structfield> field must contain the
64command code. The <structfield>flags</structfield> field is currently
65only used by the STOP command and contains one bit: If the
66<constant>V4L2_ENC_CMD_STOP_AT_GOP_END</constant> flag is set,
67encoding will continue until the end of the current <wordasword>Group
68Of Pictures</wordasword>, otherwise it will stop immediately.</para>
69
70 <para>A <function>read</function>() or &VIDIOC-STREAMON; call sends an implicit
71START command to the encoder if it has not been started yet. After a STOP command,
72<function>read</function>() calls will read the remaining data
73buffered by the driver. When the buffer is empty,
74<function>read</function>() will return zero and the next
75<function>read</function>() call will restart the encoder.</para>
76
77 <para>A <function>close</function>() or &VIDIOC-STREAMOFF; call of a streaming
78file descriptor sends an implicit immediate STOP to the encoder, and all buffered
79data is discarded.</para>
80
81 <para>These ioctls are optional, not all drivers may support
82them. They were introduced in Linux 2.6.21.</para>
83
84 <table pgwide="1" frame="none" id="v4l2-encoder-cmd">
85 <title>struct <structname>v4l2_encoder_cmd</structname></title>
86 <tgroup cols="3">
87 &cs-str;
88 <tbody valign="top">
89 <row>
90 <entry>__u32</entry>
91 <entry><structfield>cmd</structfield></entry>
92 <entry>The encoder command, see <xref linkend="encoder-cmds" />.</entry>
93 </row>
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>flags</structfield></entry>
97 <entry>Flags to go with the command, see <xref
98 linkend="encoder-flags" />. If no flags are defined for
99this command, drivers and applications must set this field to
100zero.</entry>
101 </row>
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>data</structfield>[8]</entry>
105 <entry>Reserved for future extensions. Drivers and
106applications must set the array to zero.</entry>
107 </row>
108 </tbody>
109 </tgroup>
110 </table>
111
112 <table pgwide="1" frame="none" id="encoder-cmds">
113 <title>Encoder Commands</title>
114 <tgroup cols="3">
115 &cs-def;
116 <tbody valign="top">
117 <row>
118 <entry><constant>V4L2_ENC_CMD_START</constant></entry>
119 <entry>0</entry>
120 <entry>Start the encoder. When the encoder is already
121running or paused, this command does nothing. No flags are defined for
122this command.</entry>
123 </row>
124 <row>
125 <entry><constant>V4L2_ENC_CMD_STOP</constant></entry>
126 <entry>1</entry>
127 <entry>Stop the encoder. When the
128<constant>V4L2_ENC_CMD_STOP_AT_GOP_END</constant> flag is set,
129encoding will continue until the end of the current <wordasword>Group
130Of Pictures</wordasword>, otherwise encoding will stop immediately.
131When the encoder is already stopped, this command does
132nothing.</entry>
133 </row>
134 <row>
135 <entry><constant>V4L2_ENC_CMD_PAUSE</constant></entry>
136 <entry>2</entry>
137 <entry>Pause the encoder. When the encoder has not been
138started yet, the driver will return an &EPERM;. When the encoder is
139already paused, this command does nothing. No flags are defined for
140this command.</entry>
141 </row>
142 <row>
143 <entry><constant>V4L2_ENC_CMD_RESUME</constant></entry>
144 <entry>3</entry>
145 <entry>Resume encoding after a PAUSE command. When the
146encoder has not been started yet, the driver will return an &EPERM;.
147When the encoder is already running, this command does nothing. No
148flags are defined for this command.</entry>
149 </row>
150 </tbody>
151 </tgroup>
152 </table>
153
154 <table pgwide="1" frame="none" id="encoder-flags">
155 <title>Encoder Command Flags</title>
156 <tgroup cols="3">
157 &cs-def;
158 <tbody valign="top">
159 <row>
160 <entry><constant>V4L2_ENC_CMD_STOP_AT_GOP_END</constant></entry>
161 <entry>0x0001</entry>
162 <entry>Stop encoding at the end of the current <wordasword>Group Of
163Pictures</wordasword>, rather than immediately.</entry>
164 </row>
165 </tbody>
166 </tgroup>
167 </table>
168 </refsect1>
169
170 <refsect1>
171 &return-value;
172
173 <variablelist>
174 <varlistentry>
175 <term><errorcode>EINVAL</errorcode></term>
176 <listitem>
177 <para>The <structfield>cmd</structfield> field is invalid.</para>
178 </listitem>
179 </varlistentry>
180 <varlistentry>
181 <term><errorcode>EPERM</errorcode></term>
182 <listitem>
183 <para>The application sent a PAUSE or RESUME command when
184the encoder was not running.</para>
185 </listitem>
186 </varlistentry>
187 </variablelist>
188 </refsect1>
189</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
new file mode 100644
index 00000000000..fced5fb0dbf
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
@@ -0,0 +1,240 @@
1<refentry id="vidioc-enum-dv-presets">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUM_DV_PRESETS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUM_DV_PRESETS</refname>
9 <refpurpose>Enumerate supported Digital Video presets</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_dv_enum_preset *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUM_DV_PRESETS</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>This ioctl is <emphasis role="bold">deprecated</emphasis>.
52 New drivers and applications should use &VIDIOC-ENUM-DV-TIMINGS; instead.
53 </para>
54
55 <para>To query the attributes of a DV preset, applications initialize the
56<structfield>index</structfield> field and zero the reserved array of &v4l2-dv-enum-preset;
57and call the <constant>VIDIOC_ENUM_DV_PRESETS</constant> ioctl with a pointer to this
58structure. Drivers fill the rest of the structure or return an
59&EINVAL; when the index is out of bounds. To enumerate all DV Presets supported,
60applications shall begin at index zero, incrementing by one until the
61driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a
62different set of DV presets after switching the video input or
63output.</para>
64
65 <table pgwide="1" frame="none" id="v4l2-dv-enum-preset">
66 <title>struct <structname>v4l2_dv_enum_presets</structname></title>
67 <tgroup cols="3">
68 &cs-str;
69 <tbody valign="top">
70 <row>
71 <entry>__u32</entry>
72 <entry><structfield>index</structfield></entry>
73 <entry>Number of the DV preset, set by the
74application.</entry>
75 </row>
76 <row>
77 <entry>__u32</entry>
78 <entry><structfield>preset</structfield></entry>
79 <entry>This field identifies one of the DV preset values listed in <xref linkend="v4l2-dv-presets-vals"/>.</entry>
80 </row>
81 <row>
82 <entry>__u8</entry>
83 <entry><structfield>name</structfield>[24]</entry>
84 <entry>Name of the preset, a NUL-terminated ASCII string, for example: "720P-60", "1080I-60". This information is
85intended for the user.</entry>
86 </row>
87 <row>
88 <entry>__u32</entry>
89 <entry><structfield>width</structfield></entry>
90 <entry>Width of the active video in pixels for the DV preset.</entry>
91 </row>
92 <row>
93 <entry>__u32</entry>
94 <entry><structfield>height</structfield></entry>
95 <entry>Height of the active video in lines for the DV preset.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>reserved</structfield>[4]</entry>
100 <entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
101 </row>
102 </tbody>
103 </tgroup>
104 </table>
105
106 <table pgwide="1" frame="none" id="v4l2-dv-presets-vals">
107 <title>struct <structname>DV Presets</structname></title>
108 <tgroup cols="3">
109 &cs-str;
110 <tbody valign="top">
111 <row>
112 <entry>Preset</entry>
113 <entry>Preset value</entry>
114 <entry>Description</entry>
115 </row>
116 <row>
117 <entry></entry>
118 <entry></entry>
119 <entry></entry>
120 </row>
121 <row>
122 <entry>V4L2_DV_INVALID</entry>
123 <entry>0</entry>
124 <entry>Invalid preset value.</entry>
125 </row>
126 <row>
127 <entry>V4L2_DV_480P59_94</entry>
128 <entry>1</entry>
129 <entry>720x480 progressive video at 59.94 fps as per BT.1362.</entry>
130 </row>
131 <row>
132 <entry>V4L2_DV_576P50</entry>
133 <entry>2</entry>
134 <entry>720x576 progressive video at 50 fps as per BT.1362.</entry>
135 </row>
136 <row>
137 <entry>V4L2_DV_720P24</entry>
138 <entry>3</entry>
139 <entry>1280x720 progressive video at 24 fps as per SMPTE 296M.</entry>
140 </row>
141 <row>
142 <entry>V4L2_DV_720P25</entry>
143 <entry>4</entry>
144 <entry>1280x720 progressive video at 25 fps as per SMPTE 296M.</entry>
145 </row>
146 <row>
147 <entry>V4L2_DV_720P30</entry>
148 <entry>5</entry>
149 <entry>1280x720 progressive video at 30 fps as per SMPTE 296M.</entry>
150 </row>
151 <row>
152 <entry>V4L2_DV_720P50</entry>
153 <entry>6</entry>
154 <entry>1280x720 progressive video at 50 fps as per SMPTE 296M.</entry>
155 </row>
156 <row>
157 <entry>V4L2_DV_720P59_94</entry>
158 <entry>7</entry>
159 <entry>1280x720 progressive video at 59.94 fps as per SMPTE 274M.</entry>
160 </row>
161 <row>
162 <entry>V4L2_DV_720P60</entry>
163 <entry>8</entry>
164 <entry>1280x720 progressive video at 60 fps as per SMPTE 274M/296M.</entry>
165 </row>
166 <row>
167 <entry>V4L2_DV_1080I29_97</entry>
168 <entry>9</entry>
169 <entry>1920x1080 interlaced video at 29.97 fps as per BT.1120/SMPTE 274M.</entry>
170 </row>
171 <row>
172 <entry>V4L2_DV_1080I30</entry>
173 <entry>10</entry>
174 <entry>1920x1080 interlaced video at 30 fps as per BT.1120/SMPTE 274M.</entry>
175 </row>
176 <row>
177 <entry>V4L2_DV_1080I25</entry>
178 <entry>11</entry>
179 <entry>1920x1080 interlaced video at 25 fps as per BT.1120.</entry>
180 </row>
181 <row>
182 <entry>V4L2_DV_1080I50</entry>
183 <entry>12</entry>
184 <entry>1920x1080 interlaced video at 50 fps as per SMPTE 296M.</entry>
185 </row>
186 <row>
187 <entry>V4L2_DV_1080I60</entry>
188 <entry>13</entry>
189 <entry>1920x1080 interlaced video at 60 fps as per SMPTE 296M.</entry>
190 </row>
191 <row>
192 <entry>V4L2_DV_1080P24</entry>
193 <entry>14</entry>
194 <entry>1920x1080 progressive video at 24 fps as per SMPTE 296M.</entry>
195 </row>
196 <row>
197 <entry>V4L2_DV_1080P25</entry>
198 <entry>15</entry>
199 <entry>1920x1080 progressive video at 25 fps as per SMPTE 296M.</entry>
200 </row>
201 <row>
202 <entry>V4L2_DV_1080P30</entry>
203 <entry>16</entry>
204 <entry>1920x1080 progressive video at 30 fps as per SMPTE 296M.</entry>
205 </row>
206 <row>
207 <entry>V4L2_DV_1080P50</entry>
208 <entry>17</entry>
209 <entry>1920x1080 progressive video at 50 fps as per BT.1120.</entry>
210 </row>
211 <row>
212 <entry>V4L2_DV_1080P60</entry>
213 <entry>18</entry>
214 <entry>1920x1080 progressive video at 60 fps as per BT.1120.</entry>
215 </row>
216 </tbody>
217 </tgroup>
218 </table>
219 </refsect1>
220
221 <refsect1>
222 &return-value;
223
224 <variablelist>
225 <varlistentry>
226 <term><errorcode>EINVAL</errorcode></term>
227 <listitem>
228 <para>The &v4l2-dv-enum-preset; <structfield>index</structfield>
229is out of bounds.</para>
230 </listitem>
231 </varlistentry>
232 <varlistentry>
233 <term><errorcode>ENODATA</errorcode></term>
234 <listitem>
235 <para>Digital video presets are not supported for this input or output.</para>
236 </listitem>
237 </varlistentry>
238 </variablelist>
239 </refsect1>
240</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml
new file mode 100644
index 00000000000..b3e17c1dfaf
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml
@@ -0,0 +1,125 @@
1<refentry id="vidioc-enum-dv-timings">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUM_DV_TIMINGS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUM_DV_TIMINGS</refname>
9 <refpurpose>Enumerate supported Digital Video timings</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_enum_dv_timings *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUM_DV_TIMINGS</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <note>
52 <title>Experimental</title>
53 <para>This is an <link linkend="experimental"> experimental </link>
54 interface and may change in the future.</para>
55 </note>
56
57 <para>While some DV receivers or transmitters support a wide range of timings, others
58support only a limited number of timings. With this ioctl applications can enumerate a list
59of known supported timings. Call &VIDIOC-DV-TIMINGS-CAP; to check if it also supports other
60standards or even custom timings that are not in this list.</para>
61
62 <para>To query the available timings, applications initialize the
63<structfield>index</structfield> field and zero the reserved array of &v4l2-enum-dv-timings;
64and call the <constant>VIDIOC_ENUM_DV_TIMINGS</constant> ioctl with a pointer to this
65structure. Drivers fill the rest of the structure or return an
66&EINVAL; when the index is out of bounds. To enumerate all supported DV timings,
67applications shall begin at index zero, incrementing by one until the
68driver returns <errorcode>EINVAL</errorcode>. Note that drivers may enumerate a
69different set of DV timings after switching the video input or
70output.</para>
71
72 <table pgwide="1" frame="none" id="v4l2-enum-dv-timings">
73 <title>struct <structname>v4l2_enum_dv_timings</structname></title>
74 <tgroup cols="3">
75 &cs-str;
76 <tbody valign="top">
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>index</structfield></entry>
80 <entry>Number of the DV timings, set by the
81application.</entry>
82 </row>
83 <row>
84 <entry>__u32</entry>
85 <entry><structfield>reserved</structfield>[3]</entry>
86 <entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
87 </row>
88 <row>
89 <entry>&v4l2-dv-timings;</entry>
90 <entry><structfield>timings</structfield></entry>
91 <entry>The timings.</entry>
92 </row>
93 </tbody>
94 </tgroup>
95 </table>
96 </refsect1>
97
98 <refsect1>
99 &return-value;
100
101 <variablelist>
102 <varlistentry>
103 <term><errorcode>EINVAL</errorcode></term>
104 <listitem>
105 <para>The &v4l2-enum-dv-timings; <structfield>index</structfield>
106is out of bounds.</para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><errorcode>ENODATA</errorcode></term>
111 <listitem>
112 <para>Digital video presets are not supported for this input or output.</para>
113 </listitem>
114 </varlistentry>
115 </variablelist>
116 </refsect1>
117</refentry>
118
119<!--
120Local Variables:
121mode: sgml
122sgml-parent-document: "v4l2.sgml"
123indent-tabs-mode: nil
124End:
125-->
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
new file mode 100644
index 00000000000..f8dfeed34fc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
@@ -0,0 +1,159 @@
1<refentry id="vidioc-enum-fmt">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUM_FMT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUM_FMT</refname>
9 <refpurpose>Enumerate image formats</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_fmtdesc
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENUM_FMT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To enumerate image formats applications initialize the
53<structfield>type</structfield> and <structfield>index</structfield>
54field of &v4l2-fmtdesc; and call the
55<constant>VIDIOC_ENUM_FMT</constant> ioctl with a pointer to this
56structure. Drivers fill the rest of the structure or return an
57&EINVAL;. All formats are enumerable by beginning at index zero and
58incrementing by one until <errorcode>EINVAL</errorcode> is
59returned.</para>
60
61 <para>Note that after switching input or output the list of enumerated image
62formats may be different.</para>
63
64 <table pgwide="1" frame="none" id="v4l2-fmtdesc">
65 <title>struct <structname>v4l2_fmtdesc</structname></title>
66 <tgroup cols="3">
67 &cs-str;
68 <tbody valign="top">
69 <row>
70 <entry>__u32</entry>
71 <entry><structfield>index</structfield></entry>
72 <entry>Number of the format in the enumeration, set by
73the application. This is in no way related to the <structfield>
74pixelformat</structfield> field.</entry>
75 </row>
76 <row>
77 <entry>__u32</entry>
78 <entry><structfield>type</structfield></entry>
79 <entry>Type of the data stream, set by the application.
80Only these types are valid here:
81<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
82<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>,
83<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
84<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and
85<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
86 </row>
87 <row>
88 <entry>__u32</entry>
89 <entry><structfield>flags</structfield></entry>
90 <entry>See <xref linkend="fmtdesc-flags" /></entry>
91 </row>
92 <row>
93 <entry>__u8</entry>
94 <entry><structfield>description</structfield>[32]</entry>
95 <entry>Description of the format, a NUL-terminated ASCII
96string. This information is intended for the user, for example: "YUV
974:2:2".</entry>
98 </row>
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>pixelformat</structfield></entry>
102 <entry>The image format identifier. This is a
103four character code as computed by the v4l2_fourcc()
104macro:</entry>
105 </row>
106 <row>
107 <entry spanname="hspan"><para><programlisting id="v4l2-fourcc">
108#define v4l2_fourcc(a,b,c,d) (((__u32)(a)&lt;&lt;0)|((__u32)(b)&lt;&lt;8)|((__u32)(c)&lt;&lt;16)|((__u32)(d)&lt;&lt;24))
109</programlisting></para><para>Several image formats are already
110defined by this specification in <xref linkend="pixfmt" />. Note these
111codes are not the same as those used in the Windows world.</para></entry>
112 </row>
113 <row>
114 <entry>__u32</entry>
115 <entry><structfield>reserved</structfield>[4]</entry>
116 <entry>Reserved for future extensions. Drivers must set
117the array to zero.</entry>
118 </row>
119 </tbody>
120 </tgroup>
121 </table>
122
123 <table pgwide="1" frame="none" id="fmtdesc-flags">
124 <title>Image Format Description Flags</title>
125 <tgroup cols="3">
126 &cs-def;
127 <tbody valign="top">
128 <row>
129 <entry><constant>V4L2_FMT_FLAG_COMPRESSED</constant></entry>
130 <entry>0x0001</entry>
131 <entry>This is a compressed format.</entry>
132 </row>
133 <row>
134 <entry><constant>V4L2_FMT_FLAG_EMULATED</constant></entry>
135 <entry>0x0002</entry>
136 <entry>This format is not native to the device but emulated
137through software (usually libv4l2), where possible try to use a native format
138instead for better performance.</entry>
139 </row>
140 </tbody>
141 </tgroup>
142 </table>
143 </refsect1>
144
145 <refsect1>
146 &return-value;
147
148 <variablelist>
149 <varlistentry>
150 <term><errorcode>EINVAL</errorcode></term>
151 <listitem>
152 <para>The &v4l2-fmtdesc; <structfield>type</structfield>
153is not supported or the <structfield>index</structfield> is out of
154bounds.</para>
155 </listitem>
156 </varlistentry>
157 </variablelist>
158 </refsect1>
159</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml b/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml
new file mode 100644
index 00000000000..5fd72c4c33e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml
@@ -0,0 +1,259 @@
1<refentry id="vidioc-enum-frameintervals">
2
3 <refmeta>
4 <refentrytitle>ioctl VIDIOC_ENUM_FRAMEINTERVALS</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_ENUM_FRAMEINTERVALS</refname>
10 <refpurpose>Enumerate frame intervals</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_frmivalenum *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENUM_FRAMEINTERVALS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para>Pointer to a &v4l2-frmivalenum; structure that
44contains a pixel format and size and receives a frame interval.</para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <para>This ioctl allows applications to enumerate all frame
54intervals that the device supports for the given pixel format and
55frame size.</para>
56 <para>The supported pixel formats and frame sizes can be obtained
57by using the &VIDIOC-ENUM-FMT; and &VIDIOC-ENUM-FRAMESIZES;
58functions.</para>
59 <para>The return value and the content of the
60<structfield>v4l2_frmivalenum.type</structfield> field depend on the
61type of frame intervals the device supports. Here are the semantics of
62the function for the different cases:</para>
63 <itemizedlist>
64 <listitem>
65 <para><emphasis role="bold">Discrete:</emphasis> The function
66returns success if the given index value (zero-based) is valid. The
67application should increase the index by one for each call until
68<constant>EINVAL</constant> is returned. The `v4l2_frmivalenum.type`
69field is set to `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the
70union only the `discrete` member is valid.</para>
71 </listitem>
72 <listitem>
73 <para><emphasis role="bold">Step-wise:</emphasis> The function
74returns success if the given index value is zero and
75<constant>EINVAL</constant> for any other index value. The
76<structfield>v4l2_frmivalenum.type</structfield> field is set to
77<constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant> by the driver. Of the
78union only the <structfield>stepwise</structfield> member is
79valid.</para>
80 </listitem>
81 <listitem>
82 <para><emphasis role="bold">Continuous:</emphasis> This is a
83special case of the step-wise type above. The function returns success
84if the given index value is zero and <constant>EINVAL</constant> for
85any other index value. The
86<structfield>v4l2_frmivalenum.type</structfield> field is set to
87<constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant> by the driver. Of
88the union only the <structfield>stepwise</structfield> member is valid
89and the <structfield>step</structfield> value is set to 1.</para>
90 </listitem>
91 </itemizedlist>
92
93 <para>When the application calls the function with index zero, it
94must check the <structfield>type</structfield> field to determine the
95type of frame interval enumeration the device supports. Only for the
96<constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant> type does it make
97sense to increase the index value to receive more frame
98intervals.</para>
99 <para>Note that the order in which the frame intervals are
100returned has no special meaning. In particular does it not say
101anything about potential default frame intervals.</para>
102 <para>Applications can assume that the enumeration data does not
103change without any interaction from the application itself. This means
104that the enumeration data is consistent if the application does not
105perform any other ioctl calls while it runs the frame interval
106enumeration.</para>
107 </refsect1>
108
109 <refsect1>
110 <title>Notes</title>
111
112 <itemizedlist>
113 <listitem>
114 <para><emphasis role="bold">Frame intervals and frame
115rates:</emphasis> The V4L2 API uses frame intervals instead of frame
116rates. Given the frame interval the frame rate can be computed as
117follows:<screen>frame_rate = 1 / frame_interval</screen></para>
118 </listitem>
119 </itemizedlist>
120
121 </refsect1>
122
123 <refsect1>
124 <title>Structs</title>
125
126 <para>In the structs below, <emphasis>IN</emphasis> denotes a
127value that has to be filled in by the application,
128<emphasis>OUT</emphasis> denotes values that the driver fills in. The
129application should zero out all members except for the
130<emphasis>IN</emphasis> fields.</para>
131
132 <table pgwide="1" frame="none" id="v4l2-frmival-stepwise">
133 <title>struct <structname>v4l2_frmival_stepwise</structname></title>
134 <tgroup cols="3">
135 &cs-str;
136 <tbody valign="top">
137 <row>
138 <entry>&v4l2-fract;</entry>
139 <entry><structfield>min</structfield></entry>
140 <entry>Minimum frame interval [s].</entry>
141 </row>
142 <row>
143 <entry>&v4l2-fract;</entry>
144 <entry><structfield>max</structfield></entry>
145 <entry>Maximum frame interval [s].</entry>
146 </row>
147 <row>
148 <entry>&v4l2-fract;</entry>
149 <entry><structfield>step</structfield></entry>
150 <entry>Frame interval step size [s].</entry>
151 </row>
152 </tbody>
153 </tgroup>
154 </table>
155
156 <table pgwide="1" frame="none" id="v4l2-frmivalenum">
157 <title>struct <structname>v4l2_frmivalenum</structname></title>
158 <tgroup cols="4">
159 <colspec colname="c1" />
160 <colspec colname="c2" />
161 <colspec colname="c3" />
162 <colspec colname="c4" />
163 <tbody valign="top">
164 <row>
165 <entry>__u32</entry>
166 <entry><structfield>index</structfield></entry>
167 <entry></entry>
168 <entry>IN: Index of the given frame interval in the
169enumeration.</entry>
170 </row>
171 <row>
172 <entry>__u32</entry>
173 <entry><structfield>pixel_format</structfield></entry>
174 <entry></entry>
175 <entry>IN: Pixel format for which the frame intervals are
176enumerated.</entry>
177 </row>
178 <row>
179 <entry>__u32</entry>
180 <entry><structfield>width</structfield></entry>
181 <entry></entry>
182 <entry>IN: Frame width for which the frame intervals are
183enumerated.</entry>
184 </row>
185 <row>
186 <entry>__u32</entry>
187 <entry><structfield>height</structfield></entry>
188 <entry></entry>
189 <entry>IN: Frame height for which the frame intervals are
190enumerated.</entry>
191 </row>
192 <row>
193 <entry>__u32</entry>
194 <entry><structfield>type</structfield></entry>
195 <entry></entry>
196 <entry>OUT: Frame interval type the device supports.</entry>
197 </row>
198 <row>
199 <entry>union</entry>
200 <entry></entry>
201 <entry></entry>
202 <entry>OUT: Frame interval with the given index.</entry>
203 </row>
204 <row>
205 <entry></entry>
206 <entry>&v4l2-fract;</entry>
207 <entry><structfield>discrete</structfield></entry>
208 <entry>Frame interval [s].</entry>
209 </row>
210 <row>
211 <entry></entry>
212 <entry>&v4l2-frmival-stepwise;</entry>
213 <entry><structfield>stepwise</structfield></entry>
214 <entry></entry>
215 </row>
216 <row>
217 <entry>__u32</entry>
218 <entry><structfield>reserved[2]</structfield></entry>
219 <entry></entry>
220 <entry>Reserved space for future use.</entry>
221 </row>
222 </tbody>
223 </tgroup>
224 </table>
225 </refsect1>
226
227 <refsect1>
228 <title>Enums</title>
229
230 <table pgwide="1" frame="none" id="v4l2-frmivaltypes">
231 <title>enum <structname>v4l2_frmivaltypes</structname></title>
232 <tgroup cols="3">
233 &cs-def;
234 <tbody valign="top">
235 <row>
236 <entry><constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant></entry>
237 <entry>1</entry>
238 <entry>Discrete frame interval.</entry>
239 </row>
240 <row>
241 <entry><constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant></entry>
242 <entry>2</entry>
243 <entry>Continuous frame interval.</entry>
244 </row>
245 <row>
246 <entry><constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant></entry>
247 <entry>3</entry>
248 <entry>Step-wise defined frame interval.</entry>
249 </row>
250 </tbody>
251 </tgroup>
252 </table>
253 </refsect1>
254
255 <refsect1>
256 &return-value;
257 </refsect1>
258
259</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
new file mode 100644
index 00000000000..a78454b5abc
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
@@ -0,0 +1,264 @@
1<refentry id="vidioc-enum-framesizes">
2
3 <refmeta>
4 <refentrytitle>ioctl VIDIOC_ENUM_FRAMESIZES</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_ENUM_FRAMESIZES</refname>
10 <refpurpose>Enumerate frame sizes</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_frmsizeenum *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENUM_FRAMESIZES</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para>Pointer to a &v4l2-frmsizeenum; that contains an index
44and pixel format and receives a frame width and height.</para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <para>This ioctl allows applications to enumerate all frame sizes
54(&ie; width and height in pixels) that the device supports for the
55given pixel format.</para>
56 <para>The supported pixel formats can be obtained by using the
57&VIDIOC-ENUM-FMT; function.</para>
58 <para>The return value and the content of the
59<structfield>v4l2_frmsizeenum.type</structfield> field depend on the
60type of frame sizes the device supports. Here are the semantics of the
61function for the different cases:</para>
62
63 <itemizedlist>
64 <listitem>
65 <para><emphasis role="bold">Discrete:</emphasis> The function
66returns success if the given index value (zero-based) is valid. The
67application should increase the index by one for each call until
68<constant>EINVAL</constant> is returned. The
69<structfield>v4l2_frmsizeenum.type</structfield> field is set to
70<constant>V4L2_FRMSIZE_TYPE_DISCRETE</constant> by the driver. Of the
71union only the <structfield>discrete</structfield> member is
72valid.</para>
73 </listitem>
74 <listitem>
75 <para><emphasis role="bold">Step-wise:</emphasis> The function
76returns success if the given index value is zero and
77<constant>EINVAL</constant> for any other index value. The
78<structfield>v4l2_frmsizeenum.type</structfield> field is set to
79<constant>V4L2_FRMSIZE_TYPE_STEPWISE</constant> by the driver. Of the
80union only the <structfield>stepwise</structfield> member is
81valid.</para>
82 </listitem>
83 <listitem>
84 <para><emphasis role="bold">Continuous:</emphasis> This is a
85special case of the step-wise type above. The function returns success
86if the given index value is zero and <constant>EINVAL</constant> for
87any other index value. The
88<structfield>v4l2_frmsizeenum.type</structfield> field is set to
89<constant>V4L2_FRMSIZE_TYPE_CONTINUOUS</constant> by the driver. Of
90the union only the <structfield>stepwise</structfield> member is valid
91and the <structfield>step_width</structfield> and
92<structfield>step_height</structfield> values are set to 1.</para>
93 </listitem>
94 </itemizedlist>
95
96 <para>When the application calls the function with index zero, it
97must check the <structfield>type</structfield> field to determine the
98type of frame size enumeration the device supports. Only for the
99<constant>V4L2_FRMSIZE_TYPE_DISCRETE</constant> type does it make
100sense to increase the index value to receive more frame sizes.</para>
101 <para>Note that the order in which the frame sizes are returned
102has no special meaning. In particular does it not say anything about
103potential default format sizes.</para>
104 <para>Applications can assume that the enumeration data does not
105change without any interaction from the application itself. This means
106that the enumeration data is consistent if the application does not
107perform any other ioctl calls while it runs the frame size
108enumeration.</para>
109 </refsect1>
110
111 <refsect1>
112 <title>Structs</title>
113
114 <para>In the structs below, <emphasis>IN</emphasis> denotes a
115value that has to be filled in by the application,
116<emphasis>OUT</emphasis> denotes values that the driver fills in. The
117application should zero out all members except for the
118<emphasis>IN</emphasis> fields.</para>
119
120 <table pgwide="1" frame="none" id="v4l2-frmsize-discrete">
121 <title>struct <structname>v4l2_frmsize_discrete</structname></title>
122 <tgroup cols="3">
123 &cs-str;
124 <tbody valign="top">
125 <row>
126 <entry>__u32</entry>
127 <entry><structfield>width</structfield></entry>
128 <entry>Width of the frame [pixel].</entry>
129 </row>
130 <row>
131 <entry>__u32</entry>
132 <entry><structfield>height</structfield></entry>
133 <entry>Height of the frame [pixel].</entry>
134 </row>
135 </tbody>
136 </tgroup>
137 </table>
138
139 <table pgwide="1" frame="none" id="v4l2-frmsize-stepwise">
140 <title>struct <structname>v4l2_frmsize_stepwise</structname></title>
141 <tgroup cols="3">
142 &cs-str;
143 <tbody valign="top">
144 <row>
145 <entry>__u32</entry>
146 <entry><structfield>min_width</structfield></entry>
147 <entry>Minimum frame width [pixel].</entry>
148 </row>
149 <row>
150 <entry>__u32</entry>
151 <entry><structfield>max_width</structfield></entry>
152 <entry>Maximum frame width [pixel].</entry>
153 </row>
154 <row>
155 <entry>__u32</entry>
156 <entry><structfield>step_width</structfield></entry>
157 <entry>Frame width step size [pixel].</entry>
158 </row>
159 <row>
160 <entry>__u32</entry>
161 <entry><structfield>min_height</structfield></entry>
162 <entry>Minimum frame height [pixel].</entry>
163 </row>
164 <row>
165 <entry>__u32</entry>
166 <entry><structfield>max_height</structfield></entry>
167 <entry>Maximum frame height [pixel].</entry>
168 </row>
169 <row>
170 <entry>__u32</entry>
171 <entry><structfield>step_height</structfield></entry>
172 <entry>Frame height step size [pixel].</entry>
173 </row>
174 </tbody>
175 </tgroup>
176 </table>
177
178 <table pgwide="1" frame="none" id="v4l2-frmsizeenum">
179 <title>struct <structname>v4l2_frmsizeenum</structname></title>
180 <tgroup cols="4">
181 <colspec colname="c1" />
182 <colspec colname="c2" />
183 <colspec colname="c3" />
184 <colspec colname="c4" />
185 <tbody valign="top">
186 <row>
187 <entry>__u32</entry>
188 <entry><structfield>index</structfield></entry>
189 <entry></entry>
190 <entry>IN: Index of the given frame size in the enumeration.</entry>
191 </row>
192 <row>
193 <entry>__u32</entry>
194 <entry><structfield>pixel_format</structfield></entry>
195 <entry></entry>
196 <entry>IN: Pixel format for which the frame sizes are enumerated.</entry>
197 </row>
198 <row>
199 <entry>__u32</entry>
200 <entry><structfield>type</structfield></entry>
201 <entry></entry>
202 <entry>OUT: Frame size type the device supports.</entry>
203 </row>
204 <row>
205 <entry>union</entry>
206 <entry></entry>
207 <entry></entry>
208 <entry>OUT: Frame size with the given index.</entry>
209 </row>
210 <row>
211 <entry></entry>
212 <entry>&v4l2-frmsize-discrete;</entry>
213 <entry><structfield>discrete</structfield></entry>
214 <entry></entry>
215 </row>
216 <row>
217 <entry></entry>
218 <entry>&v4l2-frmsize-stepwise;</entry>
219 <entry><structfield>stepwise</structfield></entry>
220 <entry></entry>
221 </row>
222 <row>
223 <entry>__u32</entry>
224 <entry><structfield>reserved[2]</structfield></entry>
225 <entry></entry>
226 <entry>Reserved space for future use.</entry>
227 </row>
228 </tbody>
229 </tgroup>
230 </table>
231 </refsect1>
232
233 <refsect1>
234 <title>Enums</title>
235
236 <table pgwide="1" frame="none" id="v4l2-frmsizetypes">
237 <title>enum <structname>v4l2_frmsizetypes</structname></title>
238 <tgroup cols="3">
239 &cs-def;
240 <tbody valign="top">
241 <row>
242 <entry><constant>V4L2_FRMSIZE_TYPE_DISCRETE</constant></entry>
243 <entry>1</entry>
244 <entry>Discrete frame size.</entry>
245 </row>
246 <row>
247 <entry><constant>V4L2_FRMSIZE_TYPE_CONTINUOUS</constant></entry>
248 <entry>2</entry>
249 <entry>Continuous frame size.</entry>
250 </row>
251 <row>
252 <entry><constant>V4L2_FRMSIZE_TYPE_STEPWISE</constant></entry>
253 <entry>3</entry>
254 <entry>Step-wise defined frame size.</entry>
255 </row>
256 </tbody>
257 </tgroup>
258 </table>
259 </refsect1>
260
261 <refsect1>
262 &return-value;
263 </refsect1>
264</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml b/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml
new file mode 100644
index 00000000000..6541ba0175e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml
@@ -0,0 +1,179 @@
1<refentry id="vidioc-enum-freq-bands">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUM_FREQ_BANDS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUM_FREQ_BANDS</refname>
9 <refpurpose>Enumerate supported frequency bands</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_frequency_band
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENUM_FREQ_BANDS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental"> experimental </link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>Enumerates the frequency bands that a tuner or modulator supports.
59To do this applications initialize the <structfield>tuner</structfield>,
60<structfield>type</structfield> and <structfield>index</structfield> fields,
61and zero out the <structfield>reserved</structfield> array of a &v4l2-frequency-band; and
62call the <constant>VIDIOC_ENUM_FREQ_BANDS</constant> ioctl with a pointer
63to this structure.</para>
64
65 <para>This ioctl is supported if the <constant>V4L2_TUNER_CAP_FREQ_BANDS</constant> capability
66 of the corresponding tuner/modulator is set.</para>
67
68 <table pgwide="1" frame="none" id="v4l2-frequency-band">
69 <title>struct <structname>v4l2_frequency_band</structname></title>
70 <tgroup cols="3">
71 &cs-str;
72 <tbody valign="top">
73 <row>
74 <entry>__u32</entry>
75 <entry><structfield>tuner</structfield></entry>
76 <entry>The tuner or modulator index number. This is the
77same value as in the &v4l2-input; <structfield>tuner</structfield>
78field and the &v4l2-tuner; <structfield>index</structfield> field, or
79the &v4l2-output; <structfield>modulator</structfield> field and the
80&v4l2-modulator; <structfield>index</structfield> field.</entry>
81 </row>
82 <row>
83 <entry>__u32</entry>
84 <entry><structfield>type</structfield></entry>
85 <entry>The tuner type. This is the same value as in the
86&v4l2-tuner; <structfield>type</structfield> field. The type must be set
87to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename>
88device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant>
89for all others. Set this field to <constant>V4L2_TUNER_RADIO</constant> for
90modulators (currently only radio modulators are supported).
91See <xref linkend="v4l2-tuner-type" /></entry>
92 </row>
93 <row>
94 <entry>__u32</entry>
95 <entry><structfield>index</structfield></entry>
96 <entry>Identifies the frequency band, set by the application.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>capability</structfield></entry>
101 <entry spanname="hspan">The tuner/modulator capability flags for
102this frequency band, see <xref linkend="tuner-capability" />. The <constant>V4L2_TUNER_CAP_LOW</constant>
103capability must be the same for all frequency bands of the selected tuner/modulator.
104So either all bands have that capability set, or none of them have that capability.</entry>
105 </row>
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>rangelow</structfield></entry>
109 <entry spanname="hspan">The lowest tunable frequency in
110units of 62.5 kHz, or if the <structfield>capability</structfield>
111flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
112Hz, for this frequency band.</entry>
113 </row>
114 <row>
115 <entry>__u32</entry>
116 <entry><structfield>rangehigh</structfield></entry>
117 <entry spanname="hspan">The highest tunable frequency in
118units of 62.5 kHz, or if the <structfield>capability</structfield>
119flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
120Hz, for this frequency band.</entry>
121 </row>
122 <row>
123 <entry>__u32</entry>
124 <entry><structfield>modulation</structfield></entry>
125 <entry spanname="hspan">The supported modulation systems of this frequency band.
126 See <xref linkend="band-modulation" />. Note that currently only one
127 modulation system per frequency band is supported. More work will need to
128 be done if multiple modulation systems are possible. Contact the
129 linux-media mailing list (&v4l-ml;) if you need that functionality.</entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>reserved</structfield>[9]</entry>
134 <entry>Reserved for future extensions. Applications and drivers
135 must set the array to zero.</entry>
136 </row>
137 </tbody>
138 </tgroup>
139 </table>
140
141 <table pgwide="1" frame="none" id="band-modulation">
142 <title>Band Modulation Systems</title>
143 <tgroup cols="3">
144 &cs-def;
145 <tbody valign="top">
146 <row>
147 <entry><constant>V4L2_BAND_MODULATION_VSB</constant></entry>
148 <entry>0x02</entry>
149 <entry>Vestigial Sideband modulation, used for analog TV.</entry>
150 </row>
151 <row>
152 <entry><constant>V4L2_BAND_MODULATION_FM</constant></entry>
153 <entry>0x04</entry>
154 <entry>Frequency Modulation, commonly used for analog radio.</entry>
155 </row>
156 <row>
157 <entry><constant>V4L2_BAND_MODULATION_AM</constant></entry>
158 <entry>0x08</entry>
159 <entry>Amplitude Modulation, commonly used for analog radio.</entry>
160 </row>
161 </tbody>
162 </tgroup>
163 </table>
164 </refsect1>
165
166 <refsect1>
167 &return-value;
168
169 <variablelist>
170 <varlistentry>
171 <term><errorcode>EINVAL</errorcode></term>
172 <listitem>
173 <para>The <structfield>tuner</structfield> or <structfield>index</structfield>
174is out of bounds or the <structfield>type</structfield> field is wrong.</para>
175 </listitem>
176 </varlistentry>
177 </variablelist>
178 </refsect1>
179</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml b/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml
new file mode 100644
index 00000000000..ea816ab2e49
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml
@@ -0,0 +1,76 @@
1<refentry id="vidioc-enumaudio">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUMAUDIO</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUMAUDIO</refname>
9 <refpurpose>Enumerate audio inputs</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_audio *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUMAUDIO</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To query the attributes of an audio input applications
52initialize the <structfield>index</structfield> field and zero out the
53<structfield>reserved</structfield> array of a &v4l2-audio;
54and call the <constant>VIDIOC_ENUMAUDIO</constant> ioctl with a pointer
55to this structure. Drivers fill the rest of the structure or return an
56&EINVAL; when the index is out of bounds. To enumerate all audio
57inputs applications shall begin at index zero, incrementing by one
58until the driver returns <errorcode>EINVAL</errorcode>.</para>
59
60 <para>See <xref linkend="vidioc-g-audio" /> for a description of
61&v4l2-audio;.</para>
62 </refsect1>
63
64 <refsect1>
65 &return-value;
66
67 <variablelist>
68 <varlistentry>
69 <term><errorcode>EINVAL</errorcode></term>
70 <listitem>
71 <para>The number of the audio input is out of bounds.</para>
72 </listitem>
73 </varlistentry>
74 </variablelist>
75 </refsect1>
76</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml b/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml
new file mode 100644
index 00000000000..2e87cedb0d3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml
@@ -0,0 +1,79 @@
1<refentry id="vidioc-enumaudioout">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUMAUDOUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUMAUDOUT</refname>
9 <refpurpose>Enumerate audio outputs</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_audioout *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUMAUDOUT</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To query the attributes of an audio output applications
52initialize the <structfield>index</structfield> field and zero out the
53<structfield>reserved</structfield> array of a &v4l2-audioout; and
54call the <constant>VIDIOC_G_AUDOUT</constant> ioctl with a pointer
55to this structure. Drivers fill the rest of the structure or return an
56&EINVAL; when the index is out of bounds. To enumerate all audio
57outputs applications shall begin at index zero, incrementing by one
58until the driver returns <errorcode>EINVAL</errorcode>.</para>
59
60 <para>Note connectors on a TV card to loop back the received audio
61signal to a sound card are not audio outputs in this sense.</para>
62
63 <para>See <xref linkend="vidioc-g-audioout" /> for a description of
64&v4l2-audioout;.</para>
65 </refsect1>
66
67 <refsect1>
68 &return-value;
69
70 <variablelist>
71 <varlistentry>
72 <term><errorcode>EINVAL</errorcode></term>
73 <listitem>
74 <para>The number of the audio output is out of bounds.</para>
75 </listitem>
76 </varlistentry>
77 </variablelist>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
new file mode 100644
index 00000000000..3c9a81305ad
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
@@ -0,0 +1,313 @@
1<refentry id="vidioc-enuminput">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUMINPUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUMINPUT</refname>
9 <refpurpose>Enumerate video inputs</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_input
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_ENUMINPUT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To query the attributes of a video input applications
53initialize the <structfield>index</structfield> field of &v4l2-input;
54and call the <constant>VIDIOC_ENUMINPUT</constant> ioctl with a
55pointer to this structure. Drivers fill the rest of the structure or
56return an &EINVAL; when the index is out of bounds. To enumerate all
57inputs applications shall begin at index zero, incrementing by one
58until the driver returns <errorcode>EINVAL</errorcode>.</para>
59
60 <table frame="none" pgwide="1" id="v4l2-input">
61 <title>struct <structname>v4l2_input</structname></title>
62 <tgroup cols="3">
63 &cs-str;
64 <tbody valign="top">
65 <row>
66 <entry>__u32</entry>
67 <entry><structfield>index</structfield></entry>
68 <entry>Identifies the input, set by the
69application.</entry>
70 </row>
71 <row>
72 <entry>__u8</entry>
73 <entry><structfield>name</structfield>[32]</entry>
74 <entry>Name of the video input, a NUL-terminated ASCII
75string, for example: "Vin (Composite 2)". This information is intended
76for the user, preferably the connector label on the device itself.</entry>
77 </row>
78 <row>
79 <entry>__u32</entry>
80 <entry><structfield>type</structfield></entry>
81 <entry>Type of the input, see <xref
82 linkend="input-type" />.</entry>
83 </row>
84 <row>
85 <entry>__u32</entry>
86 <entry><structfield>audioset</structfield></entry>
87 <entry><para>Drivers can enumerate up to 32 video and
88audio inputs. This field shows which audio inputs were selectable as
89audio source if this was the currently selected video input. It is a
90bit mask. The LSB corresponds to audio input 0, the MSB to input 31.
91Any number of bits can be set, or none.</para><para>When the driver
92does not enumerate audio inputs no bits must be set. Applications
93shall not interpret this as lack of audio support. Some drivers
94automatically select audio sources and do not enumerate them since
95there is no choice anyway.</para><para>For details on audio inputs and
96how to select the current input see <xref
97 linkend="audio" />.</para></entry>
98 </row>
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>tuner</structfield></entry>
102 <entry>Capture devices can have zero or more tuners (RF
103demodulators). When the <structfield>type</structfield> is set to
104<constant>V4L2_INPUT_TYPE_TUNER</constant> this is an RF connector and
105this field identifies the tuner. It corresponds to
106&v4l2-tuner; field <structfield>index</structfield>. For details on
107tuners see <xref linkend="tuner" />.</entry>
108 </row>
109 <row>
110 <entry>&v4l2-std-id;</entry>
111 <entry><structfield>std</structfield></entry>
112 <entry>Every video input supports one or more different
113video standards. This field is a set of all supported standards. For
114details on video standards and how to switch see <xref
115linkend="standard" />.</entry>
116 </row>
117 <row>
118 <entry>__u32</entry>
119 <entry><structfield>status</structfield></entry>
120 <entry>This field provides status information about the
121input. See <xref linkend="input-status" /> for flags.
122With the exception of the sensor orientation bits <structfield>status</structfield> is only valid when this is the
123current input.</entry>
124 </row>
125 <row>
126 <entry>__u32</entry>
127 <entry><structfield>capabilities</structfield></entry>
128 <entry>This field provides capabilities for the
129input. See <xref linkend="input-capabilities" /> for flags.</entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>reserved</structfield>[3]</entry>
134 <entry>Reserved for future extensions. Drivers must set
135the array to zero.</entry>
136 </row>
137 </tbody>
138 </tgroup>
139 </table>
140
141 <table frame="none" pgwide="1" id="input-type">
142 <title>Input Types</title>
143 <tgroup cols="3">
144 &cs-def;
145 <tbody valign="top">
146 <row>
147 <entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
148 <entry>1</entry>
149 <entry>This input uses a tuner (RF demodulator).</entry>
150 </row>
151 <row>
152 <entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
153 <entry>2</entry>
154 <entry>Analog baseband input, for example CVBS /
155Composite Video, S-Video, RGB.</entry>
156 </row>
157 </tbody>
158 </tgroup>
159 </table>
160
161 <!-- Status flags based on proposal by Mark McClelland,
162video4linux-list@redhat.com on 18 Oct 2002, subject "Re: [V4L] Re:
163v4l2 api". "Why are some of them inverted? So that the driver doesn't
164have to lie about the status in cases where it can't tell one way or
165the other. Plus, a status of zero would generally mean that everything
166is OK." -->
167
168 <table frame="none" pgwide="1" id="input-status">
169 <title>Input Status Flags</title>
170 <tgroup cols="3">
171 <colspec colname="c1" />
172 <colspec colname="c2" align="center" />
173 <colspec colname="c3" />
174 <spanspec namest="c1" nameend="c3" spanname="hspan"
175 align="left" />
176 <tbody valign="top">
177 <row>
178 <entry spanname="hspan">General</entry>
179 </row>
180 <row>
181 <entry><constant>V4L2_IN_ST_NO_POWER</constant></entry>
182 <entry>0x00000001</entry>
183 <entry>Attached device is off.</entry>
184 </row>
185 <row>
186 <entry><constant>V4L2_IN_ST_NO_SIGNAL</constant></entry>
187 <entry>0x00000002</entry>
188 <entry></entry>
189 </row>
190 <row>
191 <entry><constant>V4L2_IN_ST_NO_COLOR</constant></entry>
192 <entry>0x00000004</entry>
193 <entry>The hardware supports color decoding, but does not
194detect color modulation in the signal.</entry>
195 </row>
196 <row>
197 <entry spanname="hspan">Sensor Orientation</entry>
198 </row>
199 <row>
200 <entry><constant>V4L2_IN_ST_HFLIP</constant></entry>
201 <entry>0x00000010</entry>
202 <entry>The input is connected to a device that produces a signal
203that is flipped horizontally and does not correct this before passing the
204signal to userspace.</entry>
205 </row>
206 <row>
207 <entry><constant>V4L2_IN_ST_VFLIP</constant></entry>
208 <entry>0x00000020</entry>
209 <entry>The input is connected to a device that produces a signal
210that is flipped vertically and does not correct this before passing the
211signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry>
212 </row>
213 <row>
214 <entry spanname="hspan">Analog Video</entry>
215 </row>
216 <row>
217 <entry><constant>V4L2_IN_ST_NO_H_LOCK</constant></entry>
218 <entry>0x00000100</entry>
219 <entry>No horizontal sync lock.</entry>
220 </row>
221 <row>
222 <entry><constant>V4L2_IN_ST_COLOR_KILL</constant></entry>
223 <entry>0x00000200</entry>
224 <entry>A color killer circuit automatically disables color
225decoding when it detects no color modulation. When this flag is set
226the color killer is enabled <emphasis>and</emphasis> has shut off
227color decoding.</entry>
228 </row>
229 <row>
230 <entry spanname="hspan">Digital Video</entry>
231 </row>
232 <row>
233 <entry><constant>V4L2_IN_ST_NO_SYNC</constant></entry>
234 <entry>0x00010000</entry>
235 <entry>No synchronization lock.</entry>
236 </row>
237 <row>
238 <entry><constant>V4L2_IN_ST_NO_EQU</constant></entry>
239 <entry>0x00020000</entry>
240 <entry>No equalizer lock.</entry>
241 </row>
242 <row>
243 <entry><constant>V4L2_IN_ST_NO_CARRIER</constant></entry>
244 <entry>0x00040000</entry>
245 <entry>Carrier recovery failed.</entry>
246 </row>
247 <row>
248 <entry spanname="hspan">VCR and Set-Top Box</entry>
249 </row>
250 <row>
251 <entry><constant>V4L2_IN_ST_MACROVISION</constant></entry>
252 <entry>0x01000000</entry>
253 <entry>Macrovision is an analog copy prevention system
254mangling the video signal to confuse video recorders. When this
255flag is set Macrovision has been detected.</entry>
256 </row>
257 <row>
258 <entry><constant>V4L2_IN_ST_NO_ACCESS</constant></entry>
259 <entry>0x02000000</entry>
260 <entry>Conditional access denied.</entry>
261 </row>
262 <row>
263 <entry><constant>V4L2_IN_ST_VTR</constant></entry>
264 <entry>0x04000000</entry>
265 <entry>VTR time constant. [?]</entry>
266 </row>
267 </tbody>
268 </tgroup>
269 </table>
270
271 <!-- Capability flags based on video timings RFC by Muralidharan
272Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
273input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
274 -->
275 <table frame="none" pgwide="1" id="input-capabilities">
276 <title>Input capabilities</title>
277 <tgroup cols="3">
278 &cs-def;
279 <tbody valign="top">
280 <row>
281 <entry><constant>V4L2_IN_CAP_PRESETS</constant></entry>
282 <entry>0x00000001</entry>
283 <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
284 </row>
285 <row>
286 <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry>
287 <entry>0x00000002</entry>
288 <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry>
289 </row>
290 <row>
291 <entry><constant>V4L2_IN_CAP_STD</constant></entry>
292 <entry>0x00000004</entry>
293 <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
294 </row>
295 </tbody>
296 </tgroup>
297 </table>
298 </refsect1>
299
300 <refsect1>
301 &return-value;
302
303 <variablelist>
304 <varlistentry>
305 <term><errorcode>EINVAL</errorcode></term>
306 <listitem>
307 <para>The &v4l2-input; <structfield>index</structfield> is
308out of bounds.</para>
309 </listitem>
310 </varlistentry>
311 </variablelist>
312 </refsect1>
313</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
new file mode 100644
index 00000000000..f4ab0798545
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
@@ -0,0 +1,198 @@
1<refentry id="vidioc-enumoutput">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUMOUTPUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUMOUTPUT</refname>
9 <refpurpose>Enumerate video outputs</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_output *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUMOUTPUT</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To query the attributes of a video outputs applications
52initialize the <structfield>index</structfield> field of &v4l2-output;
53and call the <constant>VIDIOC_ENUMOUTPUT</constant> ioctl with a
54pointer to this structure. Drivers fill the rest of the structure or
55return an &EINVAL; when the index is out of bounds. To enumerate all
56outputs applications shall begin at index zero, incrementing by one
57until the driver returns <errorcode>EINVAL</errorcode>.</para>
58
59 <table frame="none" pgwide="1" id="v4l2-output">
60 <title>struct <structname>v4l2_output</structname></title>
61 <tgroup cols="3">
62 &cs-str;
63 <tbody valign="top">
64 <row>
65 <entry>__u32</entry>
66 <entry><structfield>index</structfield></entry>
67 <entry>Identifies the output, set by the
68application.</entry>
69 </row>
70 <row>
71 <entry>__u8</entry>
72 <entry><structfield>name</structfield>[32]</entry>
73 <entry>Name of the video output, a NUL-terminated ASCII
74string, for example: "Vout". This information is intended for the
75user, preferably the connector label on the device itself.</entry>
76 </row>
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>type</structfield></entry>
80 <entry>Type of the output, see <xref
81 linkend="output-type" />.</entry>
82 </row>
83 <row>
84 <entry>__u32</entry>
85 <entry><structfield>audioset</structfield></entry>
86 <entry><para>Drivers can enumerate up to 32 video and
87audio outputs. This field shows which audio outputs were
88selectable as the current output if this was the currently selected
89video output. It is a bit mask. The LSB corresponds to audio output 0,
90the MSB to output 31. Any number of bits can be set, or
91none.</para><para>When the driver does not enumerate audio outputs no
92bits must be set. Applications shall not interpret this as lack of
93audio support. Drivers may automatically select audio outputs without
94enumerating them.</para><para>For details on audio outputs and how to
95select the current output see <xref linkend="audio" />.</para></entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>modulator</structfield></entry>
100 <entry>Output devices can have zero or more RF modulators.
101When the <structfield>type</structfield> is
102<constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> this is an RF
103connector and this field identifies the modulator. It corresponds to
104&v4l2-modulator; field <structfield>index</structfield>. For details
105on modulators see <xref linkend="tuner" />.</entry>
106 </row>
107 <row>
108 <entry>&v4l2-std-id;</entry>
109 <entry><structfield>std</structfield></entry>
110 <entry>Every video output supports one or more different
111video standards. This field is a set of all supported standards. For
112details on video standards and how to switch see <xref
113 linkend="standard" />.</entry>
114 </row>
115 <row>
116 <entry>__u32</entry>
117 <entry><structfield>capabilities</structfield></entry>
118 <entry>This field provides capabilities for the
119output. See <xref linkend="output-capabilities" /> for flags.</entry>
120 </row>
121 <row>
122 <entry>__u32</entry>
123 <entry><structfield>reserved</structfield>[3]</entry>
124 <entry>Reserved for future extensions. Drivers must set
125the array to zero.</entry>
126 </row>
127 </tbody>
128 </tgroup>
129 </table>
130
131 <table frame="none" pgwide="1" id="output-type">
132 <title>Output Type</title>
133 <tgroup cols="3">
134 &cs-def;
135 <tbody valign="top">
136 <row>
137 <entry><constant>V4L2_OUTPUT_TYPE_MODULATOR</constant></entry>
138 <entry>1</entry>
139 <entry>This output is an analog TV modulator.</entry>
140 </row>
141 <row>
142 <entry><constant>V4L2_OUTPUT_TYPE_ANALOG</constant></entry>
143 <entry>2</entry>
144 <entry>Analog baseband output, for example Composite /
145CVBS, S-Video, RGB.</entry>
146 </row>
147 <row>
148 <entry><constant>V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY</constant></entry>
149 <entry>3</entry>
150 <entry>[?]</entry>
151 </row>
152 </tbody>
153 </tgroup>
154 </table>
155
156 <!-- Capabilities flags based on video timings RFC by Muralidharan
157Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
158input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
159 -->
160 <table frame="none" pgwide="1" id="output-capabilities">
161 <title>Output capabilities</title>
162 <tgroup cols="3">
163 &cs-def;
164 <tbody valign="top">
165 <row>
166 <entry><constant>V4L2_OUT_CAP_PRESETS</constant></entry>
167 <entry>0x00000001</entry>
168 <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
169 </row>
170 <row>
171 <entry><constant>V4L2_OUT_CAP_DV_TIMINGS</constant></entry>
172 <entry>0x00000002</entry>
173 <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry>
174 </row>
175 <row>
176 <entry><constant>V4L2_OUT_CAP_STD</constant></entry>
177 <entry>0x00000004</entry>
178 <entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry>
179 </row>
180 </tbody>
181 </tgroup>
182 </table>
183
184 </refsect1>
185 <refsect1>
186 &return-value;
187
188 <variablelist>
189 <varlistentry>
190 <term><errorcode>EINVAL</errorcode></term>
191 <listitem>
192 <para>The &v4l2-output; <structfield>index</structfield>
193is out of bounds.</para>
194 </listitem>
195 </varlistentry>
196 </variablelist>
197 </refsect1>
198</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml
new file mode 100644
index 00000000000..8065099401d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml
@@ -0,0 +1,389 @@
1<refentry id="vidioc-enumstd">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUMSTD</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUMSTD</refname>
9 <refpurpose>Enumerate supported video standards</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_standard *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUMSTD</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To query the attributes of a video standard,
52especially a custom (driver defined) one, applications initialize the
53<structfield>index</structfield> field of &v4l2-standard; and call the
54<constant>VIDIOC_ENUMSTD</constant> ioctl with a pointer to this
55structure. Drivers fill the rest of the structure or return an
56&EINVAL; when the index is out of bounds. To enumerate all standards
57applications shall begin at index zero, incrementing by one until the
58driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a
59different set of standards after switching the video input or
60output.<footnote>
61 <para>The supported standards may overlap and we need an
62unambiguous set to find the current standard returned by
63<constant>VIDIOC_G_STD</constant>.</para>
64 </footnote></para>
65
66 <table pgwide="1" frame="none" id="v4l2-standard">
67 <title>struct <structname>v4l2_standard</structname></title>
68 <tgroup cols="3">
69 &cs-str;
70 <tbody valign="top">
71 <row>
72 <entry>__u32</entry>
73 <entry><structfield>index</structfield></entry>
74 <entry>Number of the video standard, set by the
75application.</entry>
76 </row>
77 <row>
78 <entry>&v4l2-std-id;</entry>
79 <entry><structfield>id</structfield></entry>
80 <entry>The bits in this field identify the standard as
81one of the common standards listed in <xref linkend="v4l2-std-id" />,
82or if bits 32 to 63 are set as custom standards. Multiple bits can be
83set if the hardware does not distinguish between these standards,
84however separate indices do not indicate the opposite. The
85<structfield>id</structfield> must be unique. No other enumerated
86<structname>v4l2_standard</structname> structure, for this input or
87output anyway, can contain the same set of bits.</entry>
88 </row>
89 <row>
90 <entry>__u8</entry>
91 <entry><structfield>name</structfield>[24]</entry>
92 <entry>Name of the standard, a NUL-terminated ASCII
93string, for example: "PAL-B/G", "NTSC Japan". This information is
94intended for the user.</entry>
95 </row>
96 <row>
97 <entry>&v4l2-fract;</entry>
98 <entry><structfield>frameperiod</structfield></entry>
99 <entry>The frame period (not field period) is numerator
100/ denominator. For example M/NTSC has a frame period of 1001 /
10130000 seconds.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>framelines</structfield></entry>
106 <entry>Total lines per frame including blanking,
107e.&nbsp;g. 625 for B/PAL.</entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>reserved</structfield>[4]</entry>
112 <entry>Reserved for future extensions. Drivers must set
113the array to zero.</entry>
114 </row>
115 </tbody>
116 </tgroup>
117 </table>
118
119 <table pgwide="1" frame="none" id="v4l2-fract">
120 <title>struct <structname>v4l2_fract</structname></title>
121 <tgroup cols="3">
122 &cs-str;
123 <tbody valign="top">
124 <row>
125 <entry>__u32</entry>
126 <entry><structfield>numerator</structfield></entry>
127 <entry></entry>
128 </row>
129 <row>
130 <entry>__u32</entry>
131 <entry><structfield>denominator</structfield></entry>
132 <entry></entry>
133 </row>
134 </tbody>
135 </tgroup>
136 </table>
137
138 <table pgwide="1" frame="none" id="v4l2-std-id">
139 <title>typedef <structname>v4l2_std_id</structname></title>
140 <tgroup cols="3">
141 &cs-str;
142 <tbody valign="top">
143 <row>
144 <entry>__u64</entry>
145 <entry><structfield>v4l2_std_id</structfield></entry>
146 <entry>This type is a set, each bit representing another
147video standard as listed below and in <xref
148linkend="video-standards" />. The 32 most significant bits are reserved
149for custom (driver defined) video standards.</entry>
150 </row>
151 </tbody>
152 </tgroup>
153 </table>
154
155 <para><programlisting>
156#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
157#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
158#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
159#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
160#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
161#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
162#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
163#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
164
165#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
166#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
167#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
168#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
169</programlisting></para><para><constant>V4L2_STD_PAL_60</constant> is
170a hybrid standard with 525 lines, 60 Hz refresh rate, and PAL color
171modulation with a 4.43 MHz color subcarrier. Some PAL video recorders
172can play back NTSC tapes in this mode for display on a 50/60 Hz agnostic
173PAL TV.</para><para><programlisting>
174#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
175#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
176#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
177</programlisting></para><para><constant>V4L2_STD_NTSC_443</constant>
178is a hybrid standard with 525 lines, 60 Hz refresh rate, and NTSC
179color modulation with a 4.43 MHz color
180subcarrier.</para><para><programlisting>
181#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
182
183#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
184#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
185#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
186#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
187#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
188#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
189#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
190#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
191
192/* ATSC/HDTV */
193#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
194#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
195</programlisting></para><para><!-- ATSC proposal by Mark McClelland,
196video4linux-list@redhat.com on 17 Oct 2002
197--><constant>V4L2_STD_ATSC_8_VSB</constant> and
198<constant>V4L2_STD_ATSC_16_VSB</constant> are U.S. terrestrial digital
199TV standards. Presently the V4L2 API does not support digital TV. See
200also the Linux DVB API at <ulink
201url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
202<para><programlisting>
203#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
204 V4L2_STD_PAL_B1 |\
205 V4L2_STD_PAL_G)
206#define V4L2_STD_B (V4L2_STD_PAL_B |\
207 V4L2_STD_PAL_B1 |\
208 V4L2_STD_SECAM_B)
209#define V4L2_STD_GH (V4L2_STD_PAL_G |\
210 V4L2_STD_PAL_H |\
211 V4L2_STD_SECAM_G |\
212 V4L2_STD_SECAM_H)
213#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
214 V4L2_STD_PAL_D1 |\
215 V4L2_STD_PAL_K)
216#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
217 V4L2_STD_PAL_DK |\
218 V4L2_STD_PAL_H |\
219 V4L2_STD_PAL_I)
220#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
221 V4L2_STD_NTSC_M_JP |\
222 V4L2_STD_NTSC_M_KR)
223#define V4L2_STD_MN (V4L2_STD_PAL_M |\
224 V4L2_STD_PAL_N |\
225 V4L2_STD_PAL_Nc |\
226 V4L2_STD_NTSC)
227#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
228 V4L2_STD_SECAM_K |\
229 V4L2_STD_SECAM_K1)
230#define V4L2_STD_DK (V4L2_STD_PAL_DK |\
231 V4L2_STD_SECAM_DK)
232
233#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
234 V4L2_STD_SECAM_G |\
235 V4L2_STD_SECAM_H |\
236 V4L2_STD_SECAM_DK |\
237 V4L2_STD_SECAM_L |\
238 V4L2_STD_SECAM_LC)
239
240#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
241 V4L2_STD_PAL_60 |\
242 V4L2_STD_NTSC |\
243 V4L2_STD_NTSC_443)
244#define V4L2_STD_625_50 (V4L2_STD_PAL |\
245 V4L2_STD_PAL_N |\
246 V4L2_STD_PAL_Nc |\
247 V4L2_STD_SECAM)
248
249#define V4L2_STD_UNKNOWN 0
250#define V4L2_STD_ALL (V4L2_STD_525_60 |\
251 V4L2_STD_625_50)
252</programlisting></para>
253
254 <table pgwide="1" id="video-standards" orient="land">
255 <title>Video Standards (based on [<xref linkend="itu470" />])</title>
256 <tgroup cols="12" colsep="1" rowsep="1" align="center">
257 <colspec colname="c1" align="left" />
258 <colspec colname="c2" />
259 <colspec colname="c3" />
260 <colspec colname="c4" />
261 <colspec colname="c5" />
262 <colspec colnum="7" colname="c7" />
263 <colspec colnum="9" colname="c9" />
264 <colspec colnum="12" colname="c12" />
265 <spanspec namest="c2" nameend="c3" spanname="m" align="center" />
266 <spanspec namest="c4" nameend="c12" spanname="x" align="center" />
267 <spanspec namest="c5" nameend="c7" spanname="b" align="center" />
268 <spanspec namest="c9" nameend="c12" spanname="s" align="center" />
269 <thead>
270 <row>
271 <entry>Characteristics</entry>
272 <entry><para>M/NTSC<footnote><para>Japan uses a standard
273similar to M/NTSC
274(V4L2_STD_NTSC_M_JP).</para></footnote></para></entry>
275 <entry>M/PAL</entry>
276 <entry><para>N/PAL<footnote><para> The values in
277brackets apply to the combination N/PAL a.k.a.
278N<subscript>C</subscript> used in Argentina
279(V4L2_STD_PAL_Nc).</para></footnote></para></entry>
280 <entry align="center">B, B1, G/PAL</entry>
281 <entry align="center">D, D1, K/PAL</entry>
282 <entry align="center">H/PAL</entry>
283 <entry align="center">I/PAL</entry>
284 <entry align="center">B, G/SECAM</entry>
285 <entry align="center">D, K/SECAM</entry>
286 <entry align="center">K1/SECAM</entry>
287 <entry align="center">L/SECAM</entry>
288 </row>
289 </thead>
290 <tbody valign="top">
291 <row>
292 <entry>Frame lines</entry>
293 <entry spanname="m">525</entry>
294 <entry spanname="x">625</entry>
295 </row>
296 <row>
297 <entry>Frame period (s)</entry>
298 <entry spanname="m">1001/30000</entry>
299 <entry spanname="x">1/25</entry>
300 </row>
301 <row>
302 <entry>Chrominance sub-carrier frequency (Hz)</entry>
303 <entry>3579545 &plusmn;&nbsp;10</entry>
304 <entry>3579611.49 &plusmn;&nbsp;10</entry>
305 <entry>4433618.75 &plusmn;&nbsp;5 (3582056.25
306&plusmn;&nbsp;5)</entry>
307 <entry spanname="b">4433618.75 &plusmn;&nbsp;5</entry>
308 <entry>4433618.75 &plusmn;&nbsp;1</entry>
309 <entry spanname="s">f<subscript>OR</subscript>&nbsp;=
3104406250 &plusmn;&nbsp;2000, f<subscript>OB</subscript>&nbsp;= 4250000
311&plusmn;&nbsp;2000</entry>
312 </row>
313 <row>
314 <entry>Nominal radio-frequency channel bandwidth
315(MHz)</entry>
316 <entry>6</entry>
317 <entry>6</entry>
318 <entry>6</entry>
319 <entry>B: 7; B1, G: 8</entry>
320 <entry>8</entry>
321 <entry>8</entry>
322 <entry>8</entry>
323 <entry>8</entry>
324 <entry>8</entry>
325 <entry>8</entry>
326 <entry>8</entry>
327 </row>
328 <row>
329 <entry>Sound carrier relative to vision carrier
330(MHz)</entry>
331 <entry>+&nbsp;4.5</entry>
332 <entry>+&nbsp;4.5</entry>
333 <entry>+&nbsp;4.5</entry>
334 <entry><para>+&nbsp;5.5 &plusmn;&nbsp;0.001
335<footnote><para>In the Federal Republic of Germany, Austria, Italy,
336the Netherlands, Slovakia and Switzerland a system of two sound
337carriers is used, the frequency of the second carrier being
338242.1875&nbsp;kHz above the frequency of the first sound carrier. For
339stereophonic sound transmissions a similar system is used in
340Australia.</para></footnote> <footnote><para>New Zealand uses a sound
341carrier displaced 5.4996 &plusmn;&nbsp;0.0005 MHz from the vision
342carrier.</para></footnote> <footnote><para>In Denmark, Finland, New
343Zealand, Sweden and Spain a system of two sound carriers is used. In
344Iceland, Norway and Poland the same system is being introduced. The
345second carrier is 5.85&nbsp;MHz above the vision carrier and is DQPSK
346modulated with 728&nbsp;kbit/s sound and data multiplex. (NICAM
347system)</para></footnote> <footnote><para>In the United Kingdom, a
348system of two sound carriers is used. The second sound carrier is
3496.552&nbsp;MHz above the vision carrier and is DQPSK modulated with a
350728&nbsp;kbit/s sound and data multiplex able to carry two sound
351channels. (NICAM system)</para></footnote></para></entry>
352 <entry>+&nbsp;6.5 &plusmn;&nbsp;0.001</entry>
353 <entry>+&nbsp;5.5</entry>
354 <entry>+&nbsp;5.9996 &plusmn;&nbsp;0.0005</entry>
355 <entry>+&nbsp;5.5 &plusmn;&nbsp;0.001</entry>
356 <entry>+&nbsp;6.5 &plusmn;&nbsp;0.001</entry>
357 <entry>+&nbsp;6.5</entry>
358 <entry><para>+&nbsp;6.5 <footnote><para>In France, a
359digital carrier 5.85 MHz away from the vision carrier may be used in
360addition to the main sound carrier. It is modulated in differentially
361encoded QPSK with a 728 kbit/s sound and data multiplexer capable of
362carrying two sound channels. (NICAM
363system)</para></footnote></para></entry>
364 </row>
365 </tbody>
366 </tgroup>
367 </table>
368 </refsect1>
369
370 <refsect1>
371 &return-value;
372
373 <variablelist>
374 <varlistentry>
375 <term><errorcode>EINVAL</errorcode></term>
376 <listitem>
377 <para>The &v4l2-standard; <structfield>index</structfield>
378is out of bounds.</para>
379 </listitem>
380 </varlistentry>
381 <varlistentry>
382 <term><errorcode>ENODATA</errorcode></term>
383 <listitem>
384 <para>Standard video timings are not supported for this input or output.</para>
385 </listitem>
386 </varlistentry>
387 </variablelist>
388 </refsect1>
389</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-expbuf.xml b/Documentation/DocBook/media/v4l/vidioc-expbuf.xml
new file mode 100644
index 00000000000..72dfbd20a80
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-expbuf.xml
@@ -0,0 +1,212 @@
1<refentry id="vidioc-expbuf">
2
3 <refmeta>
4 <refentrytitle>ioctl VIDIOC_EXPBUF</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_EXPBUF</refname>
10 <refpurpose>Export a buffer as a DMABUF file descriptor.</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_exportbuffer *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_EXPBUF</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental"> experimental </link>
55 interface and may change in the future.</para>
56 </note>
57
58<para>This ioctl is an extension to the <link linkend="mmap">memory
59mapping</link> I/O method, therefore it is available only for
60<constant>V4L2_MEMORY_MMAP</constant> buffers. It can be used to export a
61buffer as a DMABUF file at any time after buffers have been allocated with the
62&VIDIOC-REQBUFS; ioctl.</para>
63
64<para> To export a buffer, applications fill &v4l2-exportbuffer;. The
65<structfield> type </structfield> field is set to the same buffer type as was
66previously used with &v4l2-requestbuffers;<structfield> type </structfield>.
67Applications must also set the <structfield> index </structfield> field. Valid
68index numbers range from zero to the number of buffers allocated with
69&VIDIOC-REQBUFS; (&v4l2-requestbuffers;<structfield> count </structfield>)
70minus one. For the multi-planar API, applications set the <structfield> plane
71</structfield> field to the index of the plane to be exported. Valid planes
72range from zero to the maximal number of valid planes for the currently active
73format. For the single-planar API, applications must set <structfield> plane
74</structfield> to zero. Additional flags may be posted in the <structfield>
75flags </structfield> field. Refer to a manual for open() for details.
76Currently only O_CLOEXEC is supported. All other fields must be set to zero.
77In the case of multi-planar API, every plane is exported separately using
78multiple <constant> VIDIOC_EXPBUF </constant> calls. </para>
79
80<para> After calling <constant>VIDIOC_EXPBUF</constant> the <structfield> fd
81</structfield> field will be set by a driver. This is a DMABUF file
82descriptor. The application may pass it to other DMABUF-aware devices. Refer to
83<link linkend="dmabuf">DMABUF importing</link> for details about importing
84DMABUF files into V4L2 nodes. It is recommended to close a DMABUF file when it
85is no longer used to allow the associated memory to be reclaimed. </para>
86
87 </refsect1>
88 <refsect1>
89 <section>
90 <title>Examples</title>
91
92 <example>
93 <title>Exporting a buffer.</title>
94 <programlisting>
95int buffer_export(int v4lfd, &v4l2-buf-type; bt, int index, int *dmafd)
96{
97 &v4l2-exportbuffer; expbuf;
98
99 memset(&amp;expbuf, 0, sizeof(expbuf));
100 expbuf.type = bt;
101 expbuf.index = index;
102 if (ioctl(v4lfd, &VIDIOC-EXPBUF;, &amp;expbuf) == -1) {
103 perror("VIDIOC_EXPBUF");
104 return -1;
105 }
106
107 *dmafd = expbuf.fd;
108
109 return 0;
110}
111 </programlisting>
112 </example>
113
114 <example>
115 <title>Exporting a buffer using the multi-planar API.</title>
116 <programlisting>
117int buffer_export_mp(int v4lfd, &v4l2-buf-type; bt, int index,
118 int dmafd[], int n_planes)
119{
120 int i;
121
122 for (i = 0; i &lt; n_planes; ++i) {
123 &v4l2-exportbuffer; expbuf;
124
125 memset(&amp;expbuf, 0, sizeof(expbuf));
126 expbuf.type = bt;
127 expbuf.index = index;
128 expbuf.plane = i;
129 if (ioctl(v4lfd, &VIDIOC-EXPBUF;, &amp;expbuf) == -1) {
130 perror("VIDIOC_EXPBUF");
131 while (i)
132 close(dmafd[--i]);
133 return -1;
134 }
135 dmafd[i] = expbuf.fd;
136 }
137
138 return 0;
139}
140 </programlisting>
141 </example>
142 </section>
143 </refsect1>
144
145 <refsect1>
146 <table pgwide="1" frame="none" id="v4l2-exportbuffer">
147 <title>struct <structname>v4l2_exportbuffer</structname></title>
148 <tgroup cols="3">
149 &cs-str;
150 <tbody valign="top">
151 <row>
152 <entry>__u32</entry>
153 <entry><structfield>type</structfield></entry>
154 <entry>Type of the buffer, same as &v4l2-format;
155<structfield>type</structfield> or &v4l2-requestbuffers;
156<structfield>type</structfield>, set by the application. See <xref
157linkend="v4l2-buf-type" /></entry>
158 </row>
159 <row>
160 <entry>__u32</entry>
161 <entry><structfield>index</structfield></entry>
162 <entry>Number of the buffer, set by the application. This field is
163only used for <link linkend="mmap">memory mapping</link> I/O and can range from
164zero to the number of buffers allocated with the &VIDIOC-REQBUFS; and/or
165&VIDIOC-CREATE-BUFS; ioctls. </entry>
166 </row>
167 <row>
168 <entry>__u32</entry>
169 <entry><structfield>plane</structfield></entry>
170 <entry>Index of the plane to be exported when using the
171multi-planar API. Otherwise this value must be set to zero. </entry>
172 </row>
173 <row>
174 <entry>__u32</entry>
175 <entry><structfield>flags</structfield></entry>
176 <entry>Flags for the newly created file, currently only <constant>
177O_CLOEXEC </constant> is supported, refer to the manual of open() for more
178details.</entry>
179 </row>
180 <row>
181 <entry>__s32</entry>
182 <entry><structfield>fd</structfield></entry>
183 <entry>The DMABUF file descriptor associated with a buffer. Set by
184 the driver.</entry>
185 </row>
186 <row>
187 <entry>__u32</entry>
188 <entry><structfield>reserved[11]</structfield></entry>
189 <entry>Reserved field for future use. Must be set to zero.</entry>
190 </row>
191 </tbody>
192 </tgroup>
193 </table>
194
195 </refsect1>
196
197 <refsect1>
198 &return-value;
199 <variablelist>
200 <varlistentry>
201 <term><errorcode>EINVAL</errorcode></term>
202 <listitem>
203 <para>A queue is not in MMAP mode or DMABUF exporting is not
204supported or <structfield> flags </structfield> or <structfield> type
205</structfield> or <structfield> index </structfield> or <structfield> plane
206</structfield> fields are invalid.</para>
207 </listitem>
208 </varlistentry>
209 </variablelist>
210 </refsect1>
211
212</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-audio.xml b/Documentation/DocBook/media/v4l/vidioc-g-audio.xml
new file mode 100644
index 00000000000..d7bb9b3738f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-audio.xml
@@ -0,0 +1,172 @@
1<refentry id="vidioc-g-audio">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_AUDIO</refname>
9 <refname>VIDIOC_S_AUDIO</refname>
10 <refpurpose>Query or select the current audio input and its
11attributes</refpurpose>
12 </refnamediv>
13
14 <refsynopsisdiv>
15 <funcsynopsis>
16 <funcprototype>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>struct v4l2_audio *<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 <funcsynopsis>
24 <funcprototype>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const struct v4l2_audio *<parameter>argp</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Arguments</title>
35
36 <variablelist>
37 <varlistentry>
38 <term><parameter>fd</parameter></term>
39 <listitem>
40 <para>&fd;</para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>request</parameter></term>
45 <listitem>
46 <para>VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term><parameter>argp</parameter></term>
51 <listitem>
52 <para></para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para>To query the current audio input applications zero out the
62<structfield>reserved</structfield> array of a &v4l2-audio;
63and call the <constant>VIDIOC_G_AUDIO</constant> ioctl with a pointer
64to this structure. Drivers fill the rest of the structure or return an
65&EINVAL; when the device has no audio inputs, or none which combine
66with the current video input.</para>
67
68 <para>Audio inputs have one writable property, the audio mode. To
69select the current audio input <emphasis>and</emphasis> change the
70audio mode, applications initialize the
71<structfield>index</structfield> and <structfield>mode</structfield>
72fields, and the
73<structfield>reserved</structfield> array of a
74<structname>v4l2_audio</structname> structure and call the
75<constant>VIDIOC_S_AUDIO</constant> ioctl. Drivers may switch to a
76different audio mode if the request cannot be satisfied. However, this
77is a write-only ioctl, it does not return the actual new audio
78mode.</para>
79
80 <table pgwide="1" frame="none" id="v4l2-audio">
81 <title>struct <structname>v4l2_audio</structname></title>
82 <tgroup cols="3">
83 &cs-str;
84 <tbody valign="top">
85 <row>
86 <entry>__u32</entry>
87 <entry><structfield>index</structfield></entry>
88 <entry>Identifies the audio input, set by the
89driver or application.</entry>
90 </row>
91 <row>
92 <entry>__u8</entry>
93 <entry><structfield>name</structfield>[32]</entry>
94 <entry>Name of the audio input, a NUL-terminated ASCII
95string, for example: "Line In". This information is intended for the
96user, preferably the connector label on the device itself.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>capability</structfield></entry>
101 <entry>Audio capability flags, see <xref
102 linkend="audio-capability" />.</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>mode</structfield></entry>
107 <entry>Audio mode flags set by drivers and applications (on
108 <constant>VIDIOC_S_AUDIO</constant> ioctl), see <xref linkend="audio-mode" />.</entry>
109 </row>
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>reserved</structfield>[2]</entry>
113 <entry>Reserved for future extensions. Drivers and
114applications must set the array to zero.</entry>
115 </row>
116 </tbody>
117 </tgroup>
118 </table>
119
120 <table pgwide="1" frame="none" id="audio-capability">
121 <title>Audio Capability Flags</title>
122 <tgroup cols="3">
123 &cs-def;
124 <tbody valign="top">
125 <row>
126 <entry><constant>V4L2_AUDCAP_STEREO</constant></entry>
127 <entry>0x00001</entry>
128 <entry>This is a stereo input. The flag is intended to
129automatically disable stereo recording etc. when the signal is always
130monaural. The API provides no means to detect if stereo is
131<emphasis>received</emphasis>, unless the audio input belongs to a
132tuner.</entry>
133 </row>
134 <row>
135 <entry><constant>V4L2_AUDCAP_AVL</constant></entry>
136 <entry>0x00002</entry>
137 <entry>Automatic Volume Level mode is supported.</entry>
138 </row>
139 </tbody>
140 </tgroup>
141 </table>
142
143 <table pgwide="1" frame="none" id="audio-mode">
144 <title>Audio Mode Flags</title>
145 <tgroup cols="3">
146 &cs-def;
147 <tbody valign="top">
148 <row>
149 <entry><constant>V4L2_AUDMODE_AVL</constant></entry>
150 <entry>0x00001</entry>
151 <entry>AVL mode is on.</entry>
152 </row>
153 </tbody>
154 </tgroup>
155 </table>
156 </refsect1>
157
158 <refsect1>
159 &return-value;
160
161 <variablelist>
162 <varlistentry>
163 <term><errorcode>EINVAL</errorcode></term>
164 <listitem>
165 <para>No audio inputs combine with the current video input,
166or the number of the selected audio input is out of bounds or it does
167not combine.</para>
168 </listitem>
169 </varlistentry>
170 </variablelist>
171 </refsect1>
172</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml b/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml
new file mode 100644
index 00000000000..200a2704a97
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml
@@ -0,0 +1,138 @@
1<refentry id="vidioc-g-audioout">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_AUDOUT</refname>
9 <refname>VIDIOC_S_AUDOUT</refname>
10 <refpurpose>Query or select the current audio output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_audioout *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_audioout *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>To query the current audio output applications zero out the
61<structfield>reserved</structfield> array of a &v4l2-audioout; and
62call the <constant>VIDIOC_G_AUDOUT</constant> ioctl with a pointer
63to this structure. Drivers fill the rest of the structure or return an
64&EINVAL; when the device has no audio inputs, or none which combine
65with the current video output.</para>
66
67 <para>Audio outputs have no writable properties. Nevertheless, to
68select the current audio output applications can initialize the
69<structfield>index</structfield> field and
70<structfield>reserved</structfield> array (which in the future may
71contain writable properties) of a
72<structname>v4l2_audioout</structname> structure and call the
73<constant>VIDIOC_S_AUDOUT</constant> ioctl. Drivers switch to the
74requested output or return the &EINVAL; when the index is out of
75bounds. This is a write-only ioctl, it does not return the current
76audio output attributes as <constant>VIDIOC_G_AUDOUT</constant>
77does.</para>
78
79 <para>Note connectors on a TV card to loop back the received audio
80signal to a sound card are not audio outputs in this sense.</para>
81
82 <table pgwide="1" frame="none" id="v4l2-audioout">
83 <title>struct <structname>v4l2_audioout</structname></title>
84 <tgroup cols="3">
85 &cs-str;
86 <tbody valign="top">
87 <row>
88 <entry>__u32</entry>
89 <entry><structfield>index</structfield></entry>
90 <entry>Identifies the audio output, set by the
91driver or application.</entry>
92 </row>
93 <row>
94 <entry>__u8</entry>
95 <entry><structfield>name</structfield>[32]</entry>
96 <entry>Name of the audio output, a NUL-terminated ASCII
97string, for example: "Line Out". This information is intended for the
98user, preferably the connector label on the device itself.</entry>
99 </row>
100 <row>
101 <entry>__u32</entry>
102 <entry><structfield>capability</structfield></entry>
103 <entry>Audio capability flags, none defined yet. Drivers
104must set this field to zero.</entry>
105 </row>
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>mode</structfield></entry>
109 <entry>Audio mode, none defined yet. Drivers and
110applications (on <constant>VIDIOC_S_AUDOUT</constant>) must set this
111field to zero.</entry>
112 </row>
113 <row>
114 <entry>__u32</entry>
115 <entry><structfield>reserved</structfield>[2]</entry>
116 <entry>Reserved for future extensions. Drivers and
117applications must set the array to zero.</entry>
118 </row>
119 </tbody>
120 </tgroup>
121 </table>
122 </refsect1>
123
124 <refsect1>
125 &return-value;
126
127 <variablelist>
128 <varlistentry>
129 <term><errorcode>EINVAL</errorcode></term>
130 <listitem>
131 <para>No audio outputs combine with the current video
132output, or the number of the selected audio output is out of bounds or
133it does not combine.</para>
134 </listitem>
135 </varlistentry>
136 </variablelist>
137 </refsect1>
138</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
new file mode 100644
index 00000000000..75c6a93de3c
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
@@ -0,0 +1,124 @@
1<refentry id="vidioc-g-crop">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_CROP</refname>
9 <refname>VIDIOC_S_CROP</refname>
10 <refpurpose>Get or set the current cropping rectangle</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_crop *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_crop *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_G_CROP, VIDIOC_S_CROP</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>To query the cropping rectangle size and position
61applications set the <structfield>type</structfield> field of a
62<structname>v4l2_crop</structname> structure to the respective buffer
63(stream) type and call the <constant>VIDIOC_G_CROP</constant> ioctl
64with a pointer to this structure. The driver fills the rest of the
65structure or returns the &EINVAL; if cropping is not supported.</para>
66
67 <para>To change the cropping rectangle applications initialize the
68<structfield>type</structfield> and &v4l2-rect; substructure named
69<structfield>c</structfield> of a v4l2_crop structure and call the
70<constant>VIDIOC_S_CROP</constant> ioctl with a pointer to this
71structure.</para>
72
73 <para>The driver first adjusts the requested dimensions against
74hardware limits, &ie; the bounds given by the capture/output window,
75and it rounds to the closest possible values of horizontal and
76vertical offset, width and height. In particular the driver must round
77the vertical offset of the cropping rectangle to frame lines modulo
78two, such that the field order cannot be confused.</para>
79
80 <para>Second the driver adjusts the image size (the opposite
81rectangle of the scaling process, source or target depending on the
82data direction) to the closest size possible while maintaining the
83current horizontal and vertical scaling factor.</para>
84
85 <para>Finally the driver programs the hardware with the actual
86cropping and image parameters. <constant>VIDIOC_S_CROP</constant> is a
87write-only ioctl, it does not return the actual parameters. To query
88them applications must call <constant>VIDIOC_G_CROP</constant> and
89&VIDIOC-G-FMT;. When the parameters are unsuitable the application may
90modify the cropping or image parameters and repeat the cycle until
91satisfactory parameters have been negotiated.</para>
92
93 <para>When cropping is not supported then no parameters are
94changed and <constant>VIDIOC_S_CROP</constant> returns the
95&EINVAL;.</para>
96
97 <table pgwide="1" frame="none" id="v4l2-crop">
98 <title>struct <structname>v4l2_crop</structname></title>
99 <tgroup cols="3">
100 &cs-str;
101 <tbody valign="top">
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>type</structfield></entry>
105 <entry>Type of the data stream, set by the application.
106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> and
108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
109 </row>
110 <row>
111 <entry>&v4l2-rect;</entry>
112 <entry><structfield>c</structfield></entry>
113 <entry>Cropping rectangle. The same co-ordinate system as
114for &v4l2-cropcap; <structfield>bounds</structfield> is used.</entry>
115 </row>
116 </tbody>
117 </tgroup>
118 </table>
119 </refsect1>
120
121 <refsect1>
122 &return-value;
123 </refsect1>
124</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml b/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml
new file mode 100644
index 00000000000..12b1d0503e2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml
@@ -0,0 +1,129 @@
1<refentry id="vidioc-g-ctrl">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_CTRL</refname>
9 <refname>VIDIOC_S_CTRL</refname>
10 <refpurpose>Get or set the value of a control</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_control
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_G_CTRL, VIDIOC_S_CTRL</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <para>To get the current value of a control applications
54initialize the <structfield>id</structfield> field of a struct
55<structname>v4l2_control</structname> and call the
56<constant>VIDIOC_G_CTRL</constant> ioctl with a pointer to this
57structure. To change the value of a control applications initialize
58the <structfield>id</structfield> and <structfield>value</structfield>
59fields of a struct <structname>v4l2_control</structname> and call the
60<constant>VIDIOC_S_CTRL</constant> ioctl.</para>
61
62 <para>When the <structfield>id</structfield> is invalid drivers
63return an &EINVAL;. When the <structfield>value</structfield> is out
64of bounds drivers can choose to take the closest valid value or return
65an &ERANGE;, whatever seems more appropriate. However,
66<constant>VIDIOC_S_CTRL</constant> is a write-only ioctl, it does not
67return the actual new value.</para>
68
69 <para>These ioctls work only with user controls. For other
70control classes the &VIDIOC-G-EXT-CTRLS;, &VIDIOC-S-EXT-CTRLS; or
71&VIDIOC-TRY-EXT-CTRLS; must be used.</para>
72
73 <table pgwide="1" frame="none" id="v4l2-control">
74 <title>struct <structname>v4l2_control</structname></title>
75 <tgroup cols="3">
76 &cs-str;
77 <tbody valign="top">
78 <row>
79 <entry>__u32</entry>
80 <entry><structfield>id</structfield></entry>
81 <entry>Identifies the control, set by the
82application.</entry>
83 </row>
84 <row>
85 <entry>__s32</entry>
86 <entry><structfield>value</structfield></entry>
87 <entry>New value or current value.</entry>
88 </row>
89 </tbody>
90 </tgroup>
91 </table>
92 </refsect1>
93
94 <refsect1>
95 &return-value;
96
97 <variablelist>
98 <varlistentry>
99 <term><errorcode>EINVAL</errorcode></term>
100 <listitem>
101 <para>The &v4l2-control; <structfield>id</structfield> is
102invalid.</para>
103 </listitem>
104 </varlistentry>
105 <varlistentry>
106 <term><errorcode>ERANGE</errorcode></term>
107 <listitem>
108 <para>The &v4l2-control; <structfield>value</structfield>
109is out of bounds.</para>
110 </listitem>
111 </varlistentry>
112 <varlistentry>
113 <term><errorcode>EBUSY</errorcode></term>
114 <listitem>
115 <para>The control is temporarily not changeable, possibly
116because another applications took over control of the device function
117this control belongs to.</para>
118 </listitem>
119 </varlistentry>
120 <varlistentry>
121 <term><errorcode>EACCES</errorcode></term>
122 <listitem>
123 <para>Attempt to set a read-only control or to get a
124 write-only control.</para>
125 </listitem>
126 </varlistentry>
127 </variablelist>
128 </refsect1>
129</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
new file mode 100644
index 00000000000..b9ea37634f6
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
@@ -0,0 +1,113 @@
1<refentry id="vidioc-g-dv-preset">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_DV_PRESET</refname>
9 <refname>VIDIOC_S_DV_PRESET</refname>
10 <refpurpose>Query or select the DV preset of the current input or output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>These ioctls are <emphasis role="bold">deprecated</emphasis>.
53 New drivers and applications should use &VIDIOC-G-DV-TIMINGS; and &VIDIOC-S-DV-TIMINGS;
54 instead.
55 </para>
56
57 <para>To query and select the current DV preset, applications
58use the <constant>VIDIOC_G_DV_PRESET</constant> and <constant>VIDIOC_S_DV_PRESET</constant>
59ioctls which take a pointer to a &v4l2-dv-preset; type as argument.
60Applications must zero the reserved array in &v4l2-dv-preset;.
61<constant>VIDIOC_G_DV_PRESET</constant> returns a dv preset in the field
62<structfield>preset</structfield> of &v4l2-dv-preset;.</para>
63
64 <para><constant>VIDIOC_S_DV_PRESET</constant> accepts a pointer to a &v4l2-dv-preset;
65that has the preset value to be set. Applications must zero the reserved array in &v4l2-dv-preset;.
66If the preset is not supported, it returns an &EINVAL; </para>
67 </refsect1>
68
69 <refsect1>
70 &return-value;
71
72 <variablelist>
73 <varlistentry>
74 <term><errorcode>EINVAL</errorcode></term>
75 <listitem>
76 <para>This ioctl is not supported, or the
77<constant>VIDIOC_S_DV_PRESET</constant>,<constant>VIDIOC_S_DV_PRESET</constant> parameter was unsuitable.</para>
78 </listitem>
79 </varlistentry>
80 <varlistentry>
81 <term><errorcode>ENODATA</errorcode></term>
82 <listitem>
83 <para>Digital video presets are not supported for this input or output.</para>
84 </listitem>
85 </varlistentry>
86 <varlistentry>
87 <term><errorcode>EBUSY</errorcode></term>
88 <listitem>
89 <para>The device is busy and therefore can not change the preset.</para>
90 </listitem>
91 </varlistentry>
92 </variablelist>
93
94 <table pgwide="1" frame="none" id="v4l2-dv-preset">
95 <title>struct <structname>v4l2_dv_preset</structname></title>
96 <tgroup cols="3">
97 &cs-str;
98 <tbody valign="top">
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>preset</structfield></entry>
102 <entry>Preset value to represent the digital video timings</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>reserved[4]</structfield></entry>
107 <entry>Reserved fields for future use</entry>
108 </row>
109 </tbody>
110 </tgroup>
111 </table>
112 </refsect1>
113</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
new file mode 100644
index 00000000000..72369707bd7
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
@@ -0,0 +1,331 @@
1<refentry id="vidioc-g-dv-timings">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_DV_TIMINGS</refname>
9 <refname>VIDIOC_S_DV_TIMINGS</refname>
10 <refpurpose>Get or set DV timings for input or output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51 <para>To set DV timings for the input or output, applications use the
52<constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current timings,
53applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
54information is filled in using the structure &v4l2-dv-timings;. These ioctls take
55a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
56or the timing values are not correct, the driver returns &EINVAL;.</para>
57<para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the
58timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" />
59standards. If the current input or output does not support DV timings (e.g. if
60&VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_DV_TIMINGS</constant> flag), then
61&ENODATA; is returned.</para>
62 </refsect1>
63
64 <refsect1>
65 &return-value;
66
67 <variablelist>
68 <varlistentry>
69 <term><errorcode>EINVAL</errorcode></term>
70 <listitem>
71 <para>This ioctl is not supported, or the
72<constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><errorcode>ENODATA</errorcode></term>
77 <listitem>
78 <para>Digital video timings are not supported for this input or output.</para>
79 </listitem>
80 </varlistentry>
81 <varlistentry>
82 <term><errorcode>EBUSY</errorcode></term>
83 <listitem>
84 <para>The device is busy and therefore can not change the timings.</para>
85 </listitem>
86 </varlistentry>
87 </variablelist>
88
89 <table pgwide="1" frame="none" id="v4l2-bt-timings">
90 <title>struct <structname>v4l2_bt_timings</structname></title>
91 <tgroup cols="3">
92 &cs-str;
93 <tbody valign="top">
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>width</structfield></entry>
97 <entry>Width of the active video in pixels.</entry>
98 </row>
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>height</structfield></entry>
102 <entry>Height of the active video frame in lines. So for interlaced formats the
103 height of the active video in each field is <structfield>height</structfield>/2.</entry>
104 </row>
105 <row>
106 <entry>__u32</entry>
107 <entry><structfield>interlaced</structfield></entry>
108 <entry>Progressive (0) or interlaced (1)</entry>
109 </row>
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>polarities</structfield></entry>
113 <entry>This is a bit mask that defines polarities of sync signals.
114bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set
115(1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
116 </row>
117 <row>
118 <entry>__u64</entry>
119 <entry><structfield>pixelclock</structfield></entry>
120 <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
121 </row>
122 <row>
123 <entry>__u32</entry>
124 <entry><structfield>hfrontporch</structfield></entry>
125 <entry>Horizontal front porch in pixels</entry>
126 </row>
127 <row>
128 <entry>__u32</entry>
129 <entry><structfield>hsync</structfield></entry>
130 <entry>Horizontal sync length in pixels</entry>
131 </row>
132 <row>
133 <entry>__u32</entry>
134 <entry><structfield>hbackporch</structfield></entry>
135 <entry>Horizontal back porch in pixels</entry>
136 </row>
137 <row>
138 <entry>__u32</entry>
139 <entry><structfield>vfrontporch</structfield></entry>
140 <entry>Vertical front porch in lines. For interlaced formats this refers to the
141 odd field (aka field 1).</entry>
142 </row>
143 <row>
144 <entry>__u32</entry>
145 <entry><structfield>vsync</structfield></entry>
146 <entry>Vertical sync length in lines. For interlaced formats this refers to the
147 odd field (aka field 1).</entry>
148 </row>
149 <row>
150 <entry>__u32</entry>
151 <entry><structfield>vbackporch</structfield></entry>
152 <entry>Vertical back porch in lines. For interlaced formats this refers to the
153 odd field (aka field 1).</entry>
154 </row>
155 <row>
156 <entry>__u32</entry>
157 <entry><structfield>il_vfrontporch</structfield></entry>
158 <entry>Vertical front porch in lines for the even field (aka field 2) of
159 interlaced field formats.</entry>
160 </row>
161 <row>
162 <entry>__u32</entry>
163 <entry><structfield>il_vsync</structfield></entry>
164 <entry>Vertical sync length in lines for the even field (aka field 2) of
165 interlaced field formats.</entry>
166 </row>
167 <row>
168 <entry>__u32</entry>
169 <entry><structfield>il_vbackporch</structfield></entry>
170 <entry>Vertical back porch in lines for the even field (aka field 2) of
171 interlaced field formats.</entry>
172 </row>
173 <row>
174 <entry>__u32</entry>
175 <entry><structfield>standards</structfield></entry>
176 <entry>The video standard(s) this format belongs to. This will be filled in by
177 the driver. Applications must set this to 0. See <xref linkend="dv-bt-standards"/>
178 for a list of standards.</entry>
179 </row>
180 <row>
181 <entry>__u32</entry>
182 <entry><structfield>flags</structfield></entry>
183 <entry>Several flags giving more information about the format.
184 See <xref linkend="dv-bt-flags"/> for a description of the flags.
185 </entry>
186 </row>
187 </tbody>
188 </tgroup>
189 </table>
190
191 <table pgwide="1" frame="none" id="v4l2-dv-timings">
192 <title>struct <structname>v4l2_dv_timings</structname></title>
193 <tgroup cols="4">
194 &cs-str;
195 <tbody valign="top">
196 <row>
197 <entry>__u32</entry>
198 <entry><structfield>type</structfield></entry>
199 <entry></entry>
200 <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
201 </row>
202 <row>
203 <entry>union</entry>
204 <entry><structfield></structfield></entry>
205 <entry></entry>
206 </row>
207 <row>
208 <entry></entry>
209 <entry>&v4l2-bt-timings;</entry>
210 <entry><structfield>bt</structfield></entry>
211 <entry>Timings defined by BT.656/1120 specifications</entry>
212 </row>
213 <row>
214 <entry></entry>
215 <entry>__u32</entry>
216 <entry><structfield>reserved</structfield>[32]</entry>
217 <entry></entry>
218 </row>
219 </tbody>
220 </tgroup>
221 </table>
222
223 <table pgwide="1" frame="none" id="dv-timing-types">
224 <title>DV Timing types</title>
225 <tgroup cols="3">
226 &cs-str;
227 <tbody valign="top">
228 <row>
229 <entry>Timing type</entry>
230 <entry>value</entry>
231 <entry>Description</entry>
232 </row>
233 <row>
234 <entry></entry>
235 <entry></entry>
236 <entry></entry>
237 </row>
238 <row>
239 <entry>V4L2_DV_BT_656_1120</entry>
240 <entry>0</entry>
241 <entry>BT.656/1120 timings</entry>
242 </row>
243 </tbody>
244 </tgroup>
245 </table>
246 <table pgwide="1" frame="none" id="dv-bt-standards">
247 <title>DV BT Timing standards</title>
248 <tgroup cols="2">
249 &cs-str;
250 <tbody valign="top">
251 <row>
252 <entry>Timing standard</entry>
253 <entry>Description</entry>
254 </row>
255 <row>
256 <entry></entry>
257 <entry></entry>
258 </row>
259 <row>
260 <entry>V4L2_DV_BT_STD_CEA861</entry>
261 <entry>The timings follow the CEA-861 Digital TV Profile standard</entry>
262 </row>
263 <row>
264 <entry>V4L2_DV_BT_STD_DMT</entry>
265 <entry>The timings follow the VESA Discrete Monitor Timings standard</entry>
266 </row>
267 <row>
268 <entry>V4L2_DV_BT_STD_CVT</entry>
269 <entry>The timings follow the VESA Coordinated Video Timings standard</entry>
270 </row>
271 <row>
272 <entry>V4L2_DV_BT_STD_GTF</entry>
273 <entry>The timings follow the VESA Generalized Timings Formula standard</entry>
274 </row>
275 </tbody>
276 </tgroup>
277 </table>
278 <table pgwide="1" frame="none" id="dv-bt-flags">
279 <title>DV BT Timing flags</title>
280 <tgroup cols="2">
281 &cs-str;
282 <tbody valign="top">
283 <row>
284 <entry>Flag</entry>
285 <entry>Description</entry>
286 </row>
287 <row>
288 <entry></entry>
289 <entry></entry>
290 </row>
291 <row>
292 <entry>V4L2_DV_FL_REDUCED_BLANKING</entry>
293 <entry>CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary
294GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
295intervals are reduced, allowing a higher resolution over the same
296bandwidth. This is a read-only flag, applications must not set this.
297 </entry>
298 </row>
299 <row>
300 <entry>V4L2_DV_FL_CAN_REDUCE_FPS</entry>
301 <entry>CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple
302of six. These formats can be optionally played at 1 / 1.001 speed to
303be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
30429.97 frames per second. If the transmitter can't generate such frequencies, then the
305flag will also be cleared. This is a read-only flag, applications must not set this.
306 </entry>
307 </row>
308 <row>
309 <entry>V4L2_DV_FL_REDUCED_FPS</entry>
310 <entry>CEA-861 specific: only valid for video transmitters, the flag is cleared
311by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag
312set, for other formats the flag will be cleared by the driver.
313
314If the application sets this flag, then the pixelclock used to set up the transmitter is
315divided by 1.001 to make it compatible with NTSC framerates. If the transmitter
316can't generate such frequencies, then the flag will also be cleared.
317 </entry>
318 </row>
319 <row>
320 <entry>V4L2_DV_FL_HALF_LINE</entry>
321 <entry>Specific to interlaced formats: if set, then field 1 (aka the odd field)
322is really one half-line longer and field 2 (aka the even field) is really one half-line
323shorter, so each field has exactly the same number of half-lines. Whether half-lines can be
324detected or used depends on the hardware.
325 </entry>
326 </row>
327 </tbody>
328 </tgroup>
329 </table>
330 </refsect1>
331</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
new file mode 100644
index 00000000000..be25029a16f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
@@ -0,0 +1,189 @@
1<refentry id="vidioc-g-enc-index">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_ENC_INDEX</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_ENC_INDEX</refname>
9 <refpurpose>Get meta data about a compressed video stream</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_enc_idx *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_G_ENC_INDEX</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides
52meta data about a compressed video stream the same or another
53application currently reads from the driver, which is useful for
54random access into the stream without decoding it.</para>
55
56 <para>To read the data applications must call
57<constant>VIDIOC_G_ENC_INDEX</constant> with a pointer to a
58&v4l2-enc-idx;. On success the driver fills the
59<structfield>entry</structfield> array, stores the number of elements
60written in the <structfield>entries</structfield> field, and
61initializes the <structfield>entries_cap</structfield> field.</para>
62
63 <para>Each element of the <structfield>entry</structfield> array
64contains meta data about one picture. A
65<constant>VIDIOC_G_ENC_INDEX</constant> call reads up to
66<constant>V4L2_ENC_IDX_ENTRIES</constant> entries from a driver
67buffer, which can hold up to <structfield>entries_cap</structfield>
68entries. This number can be lower or higher than
69<constant>V4L2_ENC_IDX_ENTRIES</constant>, but not zero. When the
70application fails to read the meta data in time the oldest entries
71will be lost. When the buffer is empty or no capturing/encoding is in
72progress, <structfield>entries</structfield> will be zero.</para>
73
74 <para>Currently this ioctl is only defined for MPEG-2 program
75streams and video elementary streams.</para>
76
77 <table pgwide="1" frame="none" id="v4l2-enc-idx">
78 <title>struct <structname>v4l2_enc_idx</structname></title>
79 <tgroup cols="3">
80 &cs-str;
81 <tbody valign="top">
82 <row>
83 <entry>__u32</entry>
84 <entry><structfield>entries</structfield></entry>
85 <entry>The number of entries the driver stored in the
86<structfield>entry</structfield> array.</entry>
87 </row>
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>entries_cap</structfield></entry>
91 <entry>The number of entries the driver can
92buffer. Must be greater than zero.</entry>
93 </row>
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>reserved</structfield>[4]</entry>
97 <entry spanname="hspan">Reserved for future extensions.
98Drivers must set the array to zero.</entry>
99 </row>
100 <row>
101 <entry>&v4l2-enc-idx-entry;</entry>
102 <entry><structfield>entry</structfield>[<constant>V4L2_ENC_IDX_ENTRIES</constant>]</entry>
103 <entry>Meta data about a compressed video stream. Each
104element of the array corresponds to one picture, sorted in ascending
105order by their <structfield>offset</structfield>.</entry>
106 </row>
107 </tbody>
108 </tgroup>
109 </table>
110
111 <table pgwide="1" frame="none" id="v4l2-enc-idx-entry">
112 <title>struct <structname>v4l2_enc_idx_entry</structname></title>
113 <tgroup cols="3">
114 &cs-str;
115 <tbody valign="top">
116 <row>
117 <entry>__u64</entry>
118 <entry><structfield>offset</structfield></entry>
119 <entry>The offset in bytes from the beginning of the
120compressed video stream to the beginning of this picture, that is a
121<wordasword>PES packet header</wordasword> as defined in <xref
122 linkend="mpeg2part1" /> or a <wordasword>picture
123header</wordasword> as defined in <xref linkend="mpeg2part2" />. When
124the encoder is stopped, the driver resets the offset to zero.</entry>
125 </row>
126 <row>
127 <entry>__u64</entry>
128 <entry><structfield>pts</structfield></entry>
129 <entry>The 33 bit <wordasword>Presentation Time
130Stamp</wordasword> of this picture as defined in <xref
131 linkend="mpeg2part1" />.</entry>
132 </row>
133 <row>
134 <entry>__u32</entry>
135 <entry><structfield>length</structfield></entry>
136 <entry>The length of this picture in bytes.</entry>
137 </row>
138 <row>
139 <entry>__u32</entry>
140 <entry><structfield>flags</structfield></entry>
141 <entry>Flags containing the coding type of this picture, see <xref
142 linkend="enc-idx-flags" />.</entry>
143 </row>
144 <row>
145 <entry>__u32</entry>
146 <entry><structfield>reserved</structfield>[2]</entry>
147 <entry>Reserved for future extensions.
148Drivers must set the array to zero.</entry>
149 </row>
150 </tbody>
151 </tgroup>
152 </table>
153
154 <table pgwide="1" frame="none" id="enc-idx-flags">
155 <title>Index Entry Flags</title>
156 <tgroup cols="3">
157 &cs-def;
158 <tbody valign="top">
159 <row>
160 <entry><constant>V4L2_ENC_IDX_FRAME_I</constant></entry>
161 <entry>0x00</entry>
162 <entry>This is an Intra-coded picture.</entry>
163 </row>
164 <row>
165 <entry><constant>V4L2_ENC_IDX_FRAME_P</constant></entry>
166 <entry>0x01</entry>
167 <entry>This is a Predictive-coded picture.</entry>
168 </row>
169 <row>
170 <entry><constant>V4L2_ENC_IDX_FRAME_B</constant></entry>
171 <entry>0x02</entry>
172 <entry>This is a Bidirectionally predictive-coded
173picture.</entry>
174 </row>
175 <row>
176 <entry><constant>V4L2_ENC_IDX_FRAME_MASK</constant></entry>
177 <entry>0x0F</entry>
178 <entry><wordasword>AND</wordasword> the flags field with
179this mask to obtain the picture coding type.</entry>
180 </row>
181 </tbody>
182 </tgroup>
183 </table>
184 </refsect1>
185
186 <refsect1>
187 &return-value;
188 </refsect1>
189</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
new file mode 100644
index 00000000000..0a4b90fcf2d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
@@ -0,0 +1,341 @@
1<refentry id="vidioc-g-ext-ctrls">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
4VIDIOC_TRY_EXT_CTRLS</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_G_EXT_CTRLS</refname>
10 <refname>VIDIOC_S_EXT_CTRLS</refname>
11 <refname>VIDIOC_TRY_EXT_CTRLS</refname>
12 <refpurpose>Get or set the value of several controls, try control
13values</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17 <funcsynopsis>
18 <funcprototype>
19 <funcdef>int <function>ioctl</function></funcdef>
20 <paramdef>int <parameter>fd</parameter></paramdef>
21 <paramdef>int <parameter>request</parameter></paramdef>
22 <paramdef>struct v4l2_ext_controls
23*<parameter>argp</parameter></paramdef>
24 </funcprototype>
25 </funcsynopsis>
26 </refsynopsisdiv>
27
28 <refsect1>
29 <title>Arguments</title>
30
31 <variablelist>
32 <varlistentry>
33 <term><parameter>fd</parameter></term>
34 <listitem>
35 <para>&fd;</para>
36 </listitem>
37 </varlistentry>
38 <varlistentry>
39 <term><parameter>request</parameter></term>
40 <listitem>
41 <para>VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
42VIDIOC_TRY_EXT_CTRLS</para>
43 </listitem>
44 </varlistentry>
45 <varlistentry>
46 <term><parameter>argp</parameter></term>
47 <listitem>
48 <para></para>
49 </listitem>
50 </varlistentry>
51 </variablelist>
52 </refsect1>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>These ioctls allow the caller to get or set multiple
58controls atomically. Control IDs are grouped into control classes (see
59<xref linkend="ctrl-class" />) and all controls in the control array
60must belong to the same control class.</para>
61
62 <para>Applications must always fill in the
63<structfield>count</structfield>,
64<structfield>ctrl_class</structfield>,
65<structfield>controls</structfield> and
66<structfield>reserved</structfield> fields of &v4l2-ext-controls;, and
67initialize the &v4l2-ext-control; array pointed to by the
68<structfield>controls</structfield> fields.</para>
69
70 <para>To get the current value of a set of controls applications
71initialize the <structfield>id</structfield>,
72<structfield>size</structfield> and <structfield>reserved2</structfield> fields
73of each &v4l2-ext-control; and call the
74<constant>VIDIOC_G_EXT_CTRLS</constant> ioctl. String controls controls
75must also set the <structfield>string</structfield> field.</para>
76
77 <para>If the <structfield>size</structfield> is too small to
78receive the control result (only relevant for pointer-type controls
79like strings), then the driver will set <structfield>size</structfield>
80to a valid value and return an &ENOSPC;. You should re-allocate the
81string memory to this new size and try again. It is possible that the
82same issue occurs again if the string has grown in the meantime. It is
83recommended to call &VIDIOC-QUERYCTRL; first and use
84<structfield>maximum</structfield>+1 as the new <structfield>size</structfield>
85value. It is guaranteed that that is sufficient memory.
86</para>
87
88 <para>To change the value of a set of controls applications
89initialize the <structfield>id</structfield>, <structfield>size</structfield>,
90<structfield>reserved2</structfield> and
91<structfield>value/string</structfield> fields of each &v4l2-ext-control; and
92call the <constant>VIDIOC_S_EXT_CTRLS</constant> ioctl. The controls
93will only be set if <emphasis>all</emphasis> control values are
94valid.</para>
95
96 <para>To check if a set of controls have correct values applications
97initialize the <structfield>id</structfield>, <structfield>size</structfield>,
98<structfield>reserved2</structfield> and
99<structfield>value/string</structfield> fields of each &v4l2-ext-control; and
100call the <constant>VIDIOC_TRY_EXT_CTRLS</constant> ioctl. It is up to
101the driver whether wrong values are automatically adjusted to a valid
102value or if an error is returned.</para>
103
104 <para>When the <structfield>id</structfield> or
105<structfield>ctrl_class</structfield> is invalid drivers return an
106&EINVAL;. When the value is out of bounds drivers can choose to take
107the closest valid value or return an &ERANGE;, whatever seems more
108appropriate. In the first case the new value is set in
109&v4l2-ext-control;.</para>
110
111 <para>The driver will only set/get these controls if all control
112values are correct. This prevents the situation where only some of the
113controls were set/get. Only low-level errors (&eg; a failed i2c
114command) can still cause this situation.</para>
115
116 <table pgwide="1" frame="none" id="v4l2-ext-control">
117 <title>struct <structname>v4l2_ext_control</structname></title>
118 <tgroup cols="4">
119 &cs-ustr;
120 <tbody valign="top">
121 <row>
122 <entry>__u32</entry>
123 <entry><structfield>id</structfield></entry>
124 <entry></entry>
125 <entry>Identifies the control, set by the
126application.</entry>
127 </row>
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>size</structfield></entry>
131 <entry></entry>
132 <entry>The total size in bytes of the payload of this
133control. This is normally 0, but for pointer controls this should be
134set to the size of the memory containing the payload, or that will
135receive the payload. If <constant>VIDIOC_G_EXT_CTRLS</constant> finds
136that this value is less than is required to store
137the payload result, then it is set to a value large enough to store the
138payload result and ENOSPC is returned. Note that for string controls
139this <structfield>size</structfield> field should not be confused with the length of the string.
140This field refers to the size of the memory that contains the string.
141The actual <emphasis>length</emphasis> of the string may well be much smaller.
142</entry>
143 </row>
144 <row>
145 <entry>__u32</entry>
146 <entry><structfield>reserved2</structfield>[1]</entry>
147 <entry></entry>
148 <entry>Reserved for future extensions. Drivers and
149applications must set the array to zero.</entry>
150 </row>
151 <row>
152 <entry>union</entry>
153 <entry>(anonymous)</entry>
154 </row>
155 <row>
156 <entry></entry>
157 <entry>__s32</entry>
158 <entry><structfield>value</structfield></entry>
159 <entry>New value or current value.</entry>
160 </row>
161 <row>
162 <entry></entry>
163 <entry>__s64</entry>
164 <entry><structfield>value64</structfield></entry>
165 <entry>New value or current value.</entry>
166 </row>
167 <row>
168 <entry></entry>
169 <entry>char *</entry>
170 <entry><structfield>string</structfield></entry>
171 <entry>A pointer to a string.</entry>
172 </row>
173 </tbody>
174 </tgroup>
175 </table>
176
177 <table pgwide="1" frame="none" id="v4l2-ext-controls">
178 <title>struct <structname>v4l2_ext_controls</structname></title>
179 <tgroup cols="3">
180 &cs-str;
181 <tbody valign="top">
182 <row>
183 <entry>__u32</entry>
184 <entry><structfield>ctrl_class</structfield></entry>
185 <entry>The control class to which all controls belong, see
186<xref linkend="ctrl-class" />. Drivers that use a kernel framework for handling
187controls will also accept a value of 0 here, meaning that the controls can
188belong to any control class. Whether drivers support this can be tested by setting
189<structfield>ctrl_class</structfield> to 0 and calling <constant>VIDIOC_TRY_EXT_CTRLS</constant>
190with a <structfield>count</structfield> of 0. If that succeeds, then the driver
191supports this feature.</entry>
192 </row>
193 <row>
194 <entry>__u32</entry>
195 <entry><structfield>count</structfield></entry>
196 <entry>The number of controls in the controls array. May
197also be zero.</entry>
198 </row>
199 <row>
200 <entry>__u32</entry>
201 <entry><structfield>error_idx</structfield></entry>
202 <entry>Set by the driver in case of an error. If it is equal
203to <structfield>count</structfield>, then no actual changes were made to
204controls. In other words, the error was not associated with setting a particular
205control. If it is another value, then only the controls up to <structfield>error_idx-1</structfield>
206were modified and control <structfield>error_idx</structfield> is the one that
207caused the error. The <structfield>error_idx</structfield> value is undefined
208if the ioctl returned 0 (success).</entry>
209 </row>
210 <row>
211 <entry>__u32</entry>
212 <entry><structfield>reserved</structfield>[2]</entry>
213 <entry>Reserved for future extensions. Drivers and
214applications must set the array to zero.</entry>
215 </row>
216 <row>
217 <entry>&v4l2-ext-control; *</entry>
218 <entry><structfield>controls</structfield></entry>
219 <entry>Pointer to an array of
220<structfield>count</structfield> v4l2_ext_control structures. Ignored
221if <structfield>count</structfield> equals zero.</entry>
222 </row>
223 </tbody>
224 </tgroup>
225 </table>
226
227 <table pgwide="1" frame="none" id="ctrl-class">
228 <title>Control classes</title>
229 <tgroup cols="3">
230 &cs-def;
231 <tbody valign="top">
232 <row>
233 <entry><constant>V4L2_CTRL_CLASS_USER</constant></entry>
234 <entry>0x980000</entry>
235 <entry>The class containing user controls. These controls
236are described in <xref linkend="control" />. All controls that can be set
237using the &VIDIOC-S-CTRL; and &VIDIOC-G-CTRL; ioctl belong to this
238class.</entry>
239 </row>
240 <row>
241 <entry><constant>V4L2_CTRL_CLASS_MPEG</constant></entry>
242 <entry>0x990000</entry>
243 <entry>The class containing MPEG compression controls.
244These controls are described in <xref
245 linkend="mpeg-controls" />.</entry>
246 </row>
247 <row>
248 <entry><constant>V4L2_CTRL_CLASS_CAMERA</constant></entry>
249 <entry>0x9a0000</entry>
250 <entry>The class containing camera controls.
251These controls are described in <xref
252 linkend="camera-controls" />.</entry>
253 </row>
254 <row>
255 <entry><constant>V4L2_CTRL_CLASS_FM_TX</constant></entry>
256 <entry>0x9b0000</entry>
257 <entry>The class containing FM Transmitter (FM TX) controls.
258These controls are described in <xref
259 linkend="fm-tx-controls" />.</entry>
260 </row>
261 <row>
262 <entry><constant>V4L2_CTRL_CLASS_FLASH</constant></entry>
263 <entry>0x9c0000</entry>
264 <entry>The class containing flash device controls.
265These controls are described in <xref
266 linkend="flash-controls" />.</entry>
267 </row>
268 <row>
269 <entry><constant>V4L2_CTRL_CLASS_JPEG</constant></entry>
270 <entry>0x9d0000</entry>
271 <entry>The class containing JPEG compression controls.
272These controls are described in <xref
273 linkend="jpeg-controls" />.</entry>
274 </row>
275 <row>
276 <entry><constant>V4L2_CTRL_CLASS_IMAGE_SOURCE</constant></entry>
277 <entry>0x9e0000</entry> <entry>The class containing image
278 source controls. These controls are described in <xref
279 linkend="image-source-controls" />.</entry>
280 </row>
281 <row>
282 <entry><constant>V4L2_CTRL_CLASS_IMAGE_PROC</constant></entry>
283 <entry>0x9f0000</entry> <entry>The class containing image
284 processing controls. These controls are described in <xref
285 linkend="image-process-controls" />.</entry>
286 </row>
287 </tbody>
288 </tgroup>
289 </table>
290
291 </refsect1>
292
293 <refsect1>
294 &return-value;
295
296 <variablelist>
297 <varlistentry>
298 <term><errorcode>EINVAL</errorcode></term>
299 <listitem>
300 <para>The &v4l2-ext-control; <structfield>id</structfield>
301is invalid or the &v4l2-ext-controls;
302<structfield>ctrl_class</structfield> is invalid. This error code is
303also returned by the <constant>VIDIOC_S_EXT_CTRLS</constant> and
304<constant>VIDIOC_TRY_EXT_CTRLS</constant> ioctls if two or more
305control values are in conflict.</para>
306 </listitem>
307 </varlistentry>
308 <varlistentry>
309 <term><errorcode>ERANGE</errorcode></term>
310 <listitem>
311 <para>The &v4l2-ext-control; <structfield>value</structfield>
312is out of bounds.</para>
313 </listitem>
314 </varlistentry>
315 <varlistentry>
316 <term><errorcode>EBUSY</errorcode></term>
317 <listitem>
318 <para>The control is temporarily not changeable, possibly
319because another applications took over control of the device function
320this control belongs to.</para>
321 </listitem>
322 </varlistentry>
323 <varlistentry>
324 <term><errorcode>ENOSPC</errorcode></term>
325 <listitem>
326 <para>The space reserved for the control's payload is insufficient.
327The field <structfield>size</structfield> is set to a value that is enough
328to store the payload and this error code is returned.</para>
329 </listitem>
330 </varlistentry>
331 <varlistentry>
332 <term><errorcode>EACCES</errorcode></term>
333 <listitem>
334 <para>Attempt to try or set a read-only control or to get a
335 write-only control.</para>
336 </listitem>
337 </varlistentry>
338 </variablelist>
339 </refsect1>
340</refentry>
341
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
new file mode 100644
index 00000000000..7c63815e7af
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
@@ -0,0 +1,463 @@
1<refentry id="vidioc-g-fbuf">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_FBUF</refname>
9 <refname>VIDIOC_S_FBUF</refname>
10 <refpurpose>Get or set frame buffer overlay parameters</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_framebuffer *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_framebuffer *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_G_FBUF, VIDIOC_S_FBUF</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>Applications can use the <constant>VIDIOC_G_FBUF</constant> and
61<constant>VIDIOC_S_FBUF</constant> ioctl to get and set the
62framebuffer parameters for a <link linkend="overlay">Video
63Overlay</link> or <link linkend="osd">Video Output Overlay</link>
64(OSD). The type of overlay is implied by the device type (capture or
65output device) and can be determined with the &VIDIOC-QUERYCAP; ioctl.
66One <filename>/dev/videoN</filename> device must not support both
67kinds of overlay.</para>
68
69 <para>The V4L2 API distinguishes destructive and non-destructive
70overlays. A destructive overlay copies captured video images into the
71video memory of a graphics card. A non-destructive overlay blends
72video images into a VGA signal or graphics into a video signal.
73<wordasword>Video Output Overlays</wordasword> are always
74non-destructive.</para>
75
76 <para>To get the current parameters applications call the
77<constant>VIDIOC_G_FBUF</constant> ioctl with a pointer to a
78<structname>v4l2_framebuffer</structname> structure. The driver fills
79all fields of the structure or returns an &EINVAL; when overlays are
80not supported.</para>
81
82 <para>To set the parameters for a <wordasword>Video Output
83Overlay</wordasword>, applications must initialize the
84<structfield>flags</structfield> field of a struct
85<structname>v4l2_framebuffer</structname>. Since the framebuffer is
86implemented on the TV card all other parameters are determined by the
87driver. When an application calls <constant>VIDIOC_S_FBUF</constant>
88with a pointer to this structure, the driver prepares for the overlay
89and returns the framebuffer parameters as
90<constant>VIDIOC_G_FBUF</constant> does, or it returns an error
91code.</para>
92
93 <para>To set the parameters for a <wordasword>non-destructive
94Video Overlay</wordasword>, applications must initialize the
95<structfield>flags</structfield> field, the
96<structfield>fmt</structfield> substructure, and call
97<constant>VIDIOC_S_FBUF</constant>. Again the driver prepares for the
98overlay and returns the framebuffer parameters as
99<constant>VIDIOC_G_FBUF</constant> does, or it returns an error
100code.</para>
101
102 <para>For a <wordasword>destructive Video Overlay</wordasword>
103applications must additionally provide a
104<structfield>base</structfield> address. Setting up a DMA to a
105random memory location can jeopardize the system security, its
106stability or even damage the hardware, therefore only the superuser
107can set the parameters for a destructive video overlay.</para>
108
109 <!-- NB v4l2_pix_format is also specified in pixfmt.sgml.-->
110
111 <table pgwide="1" frame="none" id="v4l2-framebuffer">
112 <title>struct <structname>v4l2_framebuffer</structname></title>
113 <tgroup cols="4">
114 &cs-ustr;
115 <tbody valign="top">
116 <row>
117 <entry>__u32</entry>
118 <entry><structfield>capability</structfield></entry>
119 <entry></entry>
120 <entry>Overlay capability flags set by the driver, see
121<xref linkend="framebuffer-cap" />.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>flags</structfield></entry>
126 <entry></entry>
127 <entry>Overlay control flags set by application and
128driver, see <xref linkend="framebuffer-flags" /></entry>
129 </row>
130 <row>
131 <entry>void *</entry>
132 <entry><structfield>base</structfield></entry>
133 <entry></entry>
134 <entry>Physical base address of the framebuffer,
135that is the address of the pixel in the top left corner of the
136framebuffer.<footnote><para>A physical base address may not suit all
137platforms. GK notes in theory we should pass something like PCI device
138+ memory region + offset instead. If you encounter problems please
139discuss on the linux-media mailing list: &v4l-ml;.</para></footnote></entry>
140 </row>
141 <row>
142 <entry></entry>
143 <entry></entry>
144 <entry></entry>
145 <entry>This field is irrelevant to
146<wordasword>non-destructive Video Overlays</wordasword>. For
147<wordasword>destructive Video Overlays</wordasword> applications must
148provide a base address. The driver may accept only base addresses
149which are a multiple of two, four or eight bytes. For
150<wordasword>Video Output Overlays</wordasword> the driver must return
151a valid base address, so applications can find the corresponding Linux
152framebuffer device (see <xref linkend="osd" />).</entry>
153 </row>
154 <row>
155 <entry>&v4l2-pix-format;</entry>
156 <entry><structfield>fmt</structfield></entry>
157 <entry></entry>
158 <entry>Layout of the frame buffer. The
159<structname>v4l2_pix_format</structname> structure is defined in <xref
160linkend="pixfmt" />, for clarification the fields and acceptable values
161 are listed below:</entry>
162 </row>
163 <row>
164 <entry></entry>
165 <entry>__u32</entry>
166 <entry><structfield>width</structfield></entry>
167 <entry>Width of the frame buffer in pixels.</entry>
168 </row>
169 <row>
170 <entry></entry>
171 <entry>__u32</entry>
172 <entry><structfield>height</structfield></entry>
173 <entry>Height of the frame buffer in pixels.</entry>
174 </row>
175 <row>
176 <entry></entry>
177 <entry>__u32</entry>
178 <entry><structfield>pixelformat</structfield></entry>
179 <entry>The pixel format of the
180framebuffer.</entry>
181 </row>
182 <row>
183 <entry></entry>
184 <entry></entry>
185 <entry></entry>
186 <entry>For <wordasword>non-destructive Video
187Overlays</wordasword> this field only defines a format for the
188&v4l2-window; <structfield>chromakey</structfield> field.</entry>
189 </row>
190 <row>
191 <entry></entry>
192 <entry></entry>
193 <entry></entry>
194 <entry>For <wordasword>destructive Video
195Overlays</wordasword> applications must initialize this field. For
196<wordasword>Video Output Overlays</wordasword> the driver must return
197a valid format.</entry>
198 </row>
199 <row>
200 <entry></entry>
201 <entry></entry>
202 <entry></entry>
203 <entry>Usually this is an RGB format (for example
204<link linkend="V4L2-PIX-FMT-RGB565"><constant>V4L2_PIX_FMT_RGB565</constant></link>)
205but YUV formats (only packed YUV formats when chroma keying is used,
206not including <constant>V4L2_PIX_FMT_YUYV</constant> and
207<constant>V4L2_PIX_FMT_UYVY</constant>) and the
208<constant>V4L2_PIX_FMT_PAL8</constant> format are also permitted. The
209behavior of the driver when an application requests a compressed
210format is undefined. See <xref linkend="pixfmt" /> for information on
211pixel formats.</entry>
212 </row>
213 <row>
214 <entry></entry>
215 <entry>&v4l2-field;</entry>
216 <entry><structfield>field</structfield></entry>
217 <entry>Drivers and applications shall ignore this field.
218If applicable, the field order is selected with the &VIDIOC-S-FMT;
219ioctl, using the <structfield>field</structfield> field of
220&v4l2-window;.</entry>
221 </row>
222 <row>
223 <entry></entry>
224 <entry>__u32</entry>
225 <entry><structfield>bytesperline</structfield></entry>
226 <entry>Distance in bytes between the leftmost pixels in
227two adjacent lines.</entry>
228 </row>
229 <row>
230 <entry spanname="hspan"><para>This field is irrelevant to
231<wordasword>non-destructive Video
232Overlays</wordasword>.</para><para>For <wordasword>destructive Video
233Overlays</wordasword> both applications and drivers can set this field
234to request padding bytes at the end of each line. Drivers however may
235ignore the requested value, returning <structfield>width</structfield>
236times bytes-per-pixel or a larger value required by the hardware. That
237implies applications can just set this field to zero to get a
238reasonable default.</para><para>For <wordasword>Video Output
239Overlays</wordasword> the driver must return a valid
240value.</para><para>Video hardware may access padding bytes, therefore
241they must reside in accessible memory. Consider for example the case
242where padding bytes after the last line of an image cross a system
243page boundary. Capture devices may write padding bytes, the value is
244undefined. Output devices ignore the contents of padding
245bytes.</para><para>When the image format is planar the
246<structfield>bytesperline</structfield> value applies to the largest
247plane and is divided by the same factor as the
248<structfield>width</structfield> field for any smaller planes. For
249example the Cb and Cr planes of a YUV 4:2:0 image have half as many
250padding bytes following each line as the Y plane. To avoid ambiguities
251drivers must return a <structfield>bytesperline</structfield> value
252rounded up to a multiple of the scale factor.</para></entry>
253 </row>
254 <row>
255 <entry></entry>
256 <entry>__u32</entry>
257 <entry><structfield>sizeimage</structfield></entry>
258 <entry><para>This field is irrelevant to
259<wordasword>non-destructive Video Overlays</wordasword>. For
260<wordasword>destructive Video Overlays</wordasword> applications must
261initialize this field. For <wordasword>Video Output
262Overlays</wordasword> the driver must return a valid
263format.</para><para>Together with <structfield>base</structfield> it
264defines the framebuffer memory accessible by the
265driver.</para></entry>
266 </row>
267 <row>
268 <entry></entry>
269 <entry>&v4l2-colorspace;</entry>
270 <entry><structfield>colorspace</structfield></entry>
271 <entry>This information supplements the
272<structfield>pixelformat</structfield> and must be set by the driver,
273see <xref linkend="colorspaces" />.</entry>
274 </row>
275 <row>
276 <entry></entry>
277 <entry>__u32</entry>
278 <entry><structfield>priv</structfield></entry>
279 <entry>Reserved for additional information about custom
280(driver defined) formats. When not used drivers and applications must
281set this field to zero.</entry>
282 </row>
283 </tbody>
284 </tgroup>
285 </table>
286
287 <table pgwide="1" frame="none" id="framebuffer-cap">
288 <title>Frame Buffer Capability Flags</title>
289 <tgroup cols="3">
290 &cs-def;
291 <tbody valign="top">
292 <row>
293 <entry><constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant></entry>
294 <entry>0x0001</entry>
295 <entry>The device is capable of non-destructive overlays.
296When the driver clears this flag, only destructive overlays are
297supported. There are no drivers yet which support both destructive and
298non-destructive overlays. Video Output Overlays are in practice always
299non-destructive.</entry>
300 </row>
301 <row>
302 <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry>
303 <entry>0x0002</entry>
304 <entry>The device supports clipping by chroma-keying the
305images. That is, image pixels replace pixels in the VGA or video
306signal only where the latter assume a certain color. Chroma-keying
307makes no sense for destructive overlays.</entry>
308 </row>
309 <row>
310 <entry><constant>V4L2_FBUF_CAP_LIST_CLIPPING</constant></entry>
311 <entry>0x0004</entry>
312 <entry>The device supports clipping using a list of clip
313rectangles.</entry>
314 </row>
315 <row>
316 <entry><constant>V4L2_FBUF_CAP_BITMAP_CLIPPING</constant></entry>
317 <entry>0x0008</entry>
318 <entry>The device supports clipping using a bit mask.</entry>
319 </row>
320 <row>
321 <entry><constant>V4L2_FBUF_CAP_LOCAL_ALPHA</constant></entry>
322 <entry>0x0010</entry>
323 <entry>The device supports clipping/blending using the
324alpha channel of the framebuffer or VGA signal. Alpha blending makes
325no sense for destructive overlays.</entry>
326 </row>
327 <row>
328 <entry><constant>V4L2_FBUF_CAP_GLOBAL_ALPHA</constant></entry>
329 <entry>0x0020</entry>
330 <entry>The device supports alpha blending using a global
331alpha value. Alpha blending makes no sense for destructive overlays.</entry>
332 </row>
333 <row>
334 <entry><constant>V4L2_FBUF_CAP_LOCAL_INV_ALPHA</constant></entry>
335 <entry>0x0040</entry>
336 <entry>The device supports clipping/blending using the
337inverted alpha channel of the framebuffer or VGA signal. Alpha
338blending makes no sense for destructive overlays.</entry>
339 </row>
340 <row>
341 <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry>
342 <entry>0x0080</entry>
343 <entry>The device supports Source Chroma-keying. Video pixels
344with the chroma-key colors are replaced by framebuffer pixels, which is exactly opposite of
345<constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry>
346 </row>
347 </tbody>
348 </tgroup>
349 </table>
350
351 <table pgwide="1" frame="none" id="framebuffer-flags">
352 <title>Frame Buffer Flags</title>
353 <tgroup cols="3">
354 &cs-def;
355 <tbody valign="top">
356 <row>
357 <entry><constant>V4L2_FBUF_FLAG_PRIMARY</constant></entry>
358 <entry>0x0001</entry>
359 <entry>The framebuffer is the primary graphics surface.
360In other words, the overlay is destructive. This flag is typically set by any
361driver that doesn't have the <constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant>
362capability and it is cleared otherwise.</entry>
363 </row>
364 <row>
365 <entry><constant>V4L2_FBUF_FLAG_OVERLAY</constant></entry>
366 <entry>0x0002</entry>
367 <entry>If this flag is set for a video capture device, then the
368driver will set the initial overlay size to cover the full framebuffer size,
369otherwise the existing overlay size (as set by &VIDIOC-S-FMT;) will be used.
370
371Only one video capture driver (bttv) supports this flag. The use of this flag
372for capture devices is deprecated. There is no way to detect which drivers
373support this flag, so the only reliable method of setting the overlay size is
374through &VIDIOC-S-FMT;.
375
376If this flag is set for a video output device, then the video output overlay
377window is relative to the top-left corner of the framebuffer and restricted
378to the size of the framebuffer. If it is cleared, then the video output
379overlay window is relative to the video output display.
380 </entry>
381 </row>
382 <row>
383 <entry><constant>V4L2_FBUF_FLAG_CHROMAKEY</constant></entry>
384 <entry>0x0004</entry>
385 <entry>Use chroma-keying. The chroma-key color is
386determined by the <structfield>chromakey</structfield> field of
387&v4l2-window; and negotiated with the &VIDIOC-S-FMT; ioctl, see <xref
388 linkend="overlay" />
389and
390 <xref linkend="osd" />.</entry>
391 </row>
392 <row>
393 <entry spanname="hspan">There are no flags to enable
394clipping using a list of clip rectangles or a bitmap. These methods
395are negotiated with the &VIDIOC-S-FMT; ioctl, see <xref
396 linkend="overlay" /> and <xref linkend="osd" />.</entry>
397 </row>
398 <row>
399 <entry><constant>V4L2_FBUF_FLAG_LOCAL_ALPHA</constant></entry>
400 <entry>0x0008</entry>
401 <entry>Use the alpha channel of the framebuffer to clip or
402blend framebuffer pixels with video images. The blend
403function is: output = framebuffer pixel * alpha + video pixel * (1 -
404alpha). The actual alpha depth depends on the framebuffer pixel
405format.</entry>
406 </row>
407 <row>
408 <entry><constant>V4L2_FBUF_FLAG_GLOBAL_ALPHA</constant></entry>
409 <entry>0x0010</entry>
410 <entry>Use a global alpha value to blend the framebuffer
411with video images. The blend function is: output = (framebuffer pixel
412* alpha + video pixel * (255 - alpha)) / 255. The alpha value is
413determined by the <structfield>global_alpha</structfield> field of
414&v4l2-window; and negotiated with the &VIDIOC-S-FMT; ioctl, see <xref
415 linkend="overlay" />
416and <xref linkend="osd" />.</entry>
417 </row>
418 <row>
419 <entry><constant>V4L2_FBUF_FLAG_LOCAL_INV_ALPHA</constant></entry>
420 <entry>0x0020</entry>
421 <entry>Like
422<constant>V4L2_FBUF_FLAG_LOCAL_ALPHA</constant>, use the alpha channel
423of the framebuffer to clip or blend framebuffer pixels with video
424images, but with an inverted alpha value. The blend function is:
425output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The
426actual alpha depth depends on the framebuffer pixel format.</entry>
427 </row>
428 <row>
429 <entry><constant>V4L2_FBUF_FLAG_SRC_CHROMAKEY</constant></entry>
430 <entry>0x0040</entry>
431 <entry>Use source chroma-keying. The source chroma-key color is
432determined by the <structfield>chromakey</structfield> field of
433&v4l2-window; and negotiated with the &VIDIOC-S-FMT; ioctl, see <xref
434linkend="overlay" /> and <xref linkend="osd" />.
435Both chroma-keying are mutual exclusive to each other, so same
436<structfield>chromakey</structfield> field of &v4l2-window; is being used.</entry>
437 </row>
438 </tbody>
439 </tgroup>
440 </table>
441 </refsect1>
442
443 <refsect1>
444 &return-value;
445
446 <variablelist>
447 <varlistentry>
448 <term><errorcode>EPERM</errorcode></term>
449 <listitem>
450 <para><constant>VIDIOC_S_FBUF</constant> can only be called
451by a privileged user to negotiate the parameters for a destructive
452overlay.</para>
453 </listitem>
454 </varlistentry>
455 <varlistentry>
456 <term><errorcode>EINVAL</errorcode></term>
457 <listitem>
458 <para>The <constant>VIDIOC_S_FBUF</constant> parameters are unsuitable.</para>
459 </listitem>
460 </varlistentry>
461 </variablelist>
462 </refsect1>
463</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
new file mode 100644
index 00000000000..ee8f56e1bac
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -0,0 +1,197 @@
1<refentry id="vidioc-g-fmt">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
4VIDIOC_TRY_FMT</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_G_FMT</refname>
10 <refname>VIDIOC_S_FMT</refname>
11 <refname>VIDIOC_TRY_FMT</refname>
12 <refpurpose>Get or set the data format, try a format</refpurpose>
13 </refnamediv>
14
15 <refsynopsisdiv>
16 <funcsynopsis>
17 <funcprototype>
18 <funcdef>int <function>ioctl</function></funcdef>
19 <paramdef>int <parameter>fd</parameter></paramdef>
20 <paramdef>int <parameter>request</parameter></paramdef>
21 <paramdef>struct v4l2_format
22*<parameter>argp</parameter></paramdef>
23 </funcprototype>
24 </funcsynopsis>
25 </refsynopsisdiv>
26
27 <refsect1>
28 <title>Arguments</title>
29
30 <variablelist>
31 <varlistentry>
32 <term><parameter>fd</parameter></term>
33 <listitem>
34 <para>&fd;</para>
35 </listitem>
36 </varlistentry>
37 <varlistentry>
38 <term><parameter>request</parameter></term>
39 <listitem>
40 <para>VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT</para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>argp</parameter></term>
45 <listitem>
46 <para></para>
47 </listitem>
48 </varlistentry>
49 </variablelist>
50 </refsect1>
51
52 <refsect1>
53 <title>Description</title>
54
55 <para>These ioctls are used to negotiate the format of data
56(typically image format) exchanged between driver and
57application.</para>
58
59 <para>To query the current parameters applications set the
60<structfield>type</structfield> field of a struct
61<structname>v4l2_format</structname> to the respective buffer (stream)
62type. For example video capture devices use
63<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> or
64<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>. When the application
65calls the <constant>VIDIOC_G_FMT</constant> ioctl with a pointer to
66this structure the driver fills the respective member of the
67<structfield>fmt</structfield> union. In case of video capture devices
68that is either the &v4l2-pix-format; <structfield>pix</structfield> or
69the &v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member.
70When the requested buffer type is not supported drivers return an
71&EINVAL;.</para>
72
73 <para>To change the current format parameters applications
74initialize the <structfield>type</structfield> field and all
75fields of the respective <structfield>fmt</structfield>
76union member. For details see the documentation of the various devices
77types in <xref linkend="devices" />. Good practice is to query the
78current parameters first, and to
79modify only those parameters not suitable for the application. When
80the application calls the <constant>VIDIOC_S_FMT</constant> ioctl
81with a pointer to a <structname>v4l2_format</structname> structure
82the driver checks
83and adjusts the parameters against hardware abilities. Drivers
84should not return an error code unless the <structfield>type</structfield> field is invalid, this is
85a mechanism to fathom device capabilities and to approach parameters
86acceptable for both the application and driver. On success the driver
87may program the hardware, allocate resources and generally prepare for
88data exchange.
89Finally the <constant>VIDIOC_S_FMT</constant> ioctl returns the
90current format parameters as <constant>VIDIOC_G_FMT</constant> does.
91Very simple, inflexible devices may even ignore all input and always
92return the default parameters. However all V4L2 devices exchanging
93data with the application must implement the
94<constant>VIDIOC_G_FMT</constant> and
95<constant>VIDIOC_S_FMT</constant> ioctl. When the requested buffer
96type is not supported drivers return an &EINVAL; on a
97<constant>VIDIOC_S_FMT</constant> attempt. When I/O is already in
98progress or the resource is not available for other reasons drivers
99return the &EBUSY;.</para>
100
101 <para>The <constant>VIDIOC_TRY_FMT</constant> ioctl is equivalent
102to <constant>VIDIOC_S_FMT</constant> with one exception: it does not
103change driver state. It can also be called at any time, never
104returning <errorcode>EBUSY</errorcode>. This function is provided to
105negotiate parameters, to learn about hardware limitations, without
106disabling I/O or possibly time consuming hardware preparations.
107Although strongly recommended drivers are not required to implement
108this ioctl.</para>
109
110 <para>The format as returned by <constant>VIDIOC_TRY_FMT</constant>
111must be identical to what <constant>VIDIOC_S_FMT</constant> returns for
112the same input or output.</para>
113
114 <table pgwide="1" frame="none" id="v4l2-format">
115 <title>struct <structname>v4l2_format</structname></title>
116 <tgroup cols="4">
117 <colspec colname="c1" />
118 <colspec colname="c2" />
119 <colspec colname="c3" />
120 <colspec colname="c4" />
121 <tbody valign="top">
122 <row>
123 <entry>__u32</entry>
124 <entry><structfield>type</structfield></entry>
125 <entry></entry>
126 <entry>Type of the data stream, see <xref
127 linkend="v4l2-buf-type" />.</entry>
128 </row>
129 <row>
130 <entry>union</entry>
131 <entry><structfield>fmt</structfield></entry>
132 </row>
133 <row>
134 <entry></entry>
135 <entry>&v4l2-pix-format;</entry>
136 <entry><structfield>pix</structfield></entry>
137 <entry>Definition of an image format, see <xref
138 linkend="pixfmt" />, used by video capture and output
139devices.</entry>
140 </row>
141 <row>
142 <entry></entry>
143 <entry>&v4l2-pix-format-mplane;</entry>
144 <entry><structfield>pix_mp</structfield></entry>
145 <entry>Definition of an image format, see <xref
146 linkend="pixfmt" />, used by video capture and output
147devices that support the <link linkend="planar-apis">multi-planar
148version of the API</link>.</entry>
149 </row>
150 <row>
151 <entry></entry>
152 <entry>&v4l2-window;</entry>
153 <entry><structfield>win</structfield></entry>
154 <entry>Definition of an overlaid image, see <xref
155 linkend="overlay" />, used by video overlay devices.</entry>
156 </row>
157 <row>
158 <entry></entry>
159 <entry>&v4l2-vbi-format;</entry>
160 <entry><structfield>vbi</structfield></entry>
161 <entry>Raw VBI capture or output parameters. This is
162discussed in more detail in <xref linkend="raw-vbi" />. Used by raw VBI
163capture and output devices.</entry>
164 </row>
165 <row>
166 <entry></entry>
167 <entry>&v4l2-sliced-vbi-format;</entry>
168 <entry><structfield>sliced</structfield></entry>
169 <entry>Sliced VBI capture or output parameters. See
170<xref linkend="sliced" /> for details. Used by sliced VBI
171capture and output devices.</entry>
172 </row>
173 <row>
174 <entry></entry>
175 <entry>__u8</entry>
176 <entry><structfield>raw_data</structfield>[200]</entry>
177 <entry>Place holder for future extensions.</entry>
178 </row>
179 </tbody>
180 </tgroup>
181 </table>
182 </refsect1>
183
184 <refsect1>
185 &return-value;
186
187 <variablelist>
188 <varlistentry>
189 <term><errorcode>EINVAL</errorcode></term>
190 <listitem>
191 <para>The &v4l2-format; <structfield>type</structfield>
192field is invalid or the requested buffer type not supported.</para>
193 </listitem>
194 </varlistentry>
195 </variablelist>
196 </refsect1>
197</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
new file mode 100644
index 00000000000..c7a1c462e72
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
@@ -0,0 +1,147 @@
1<refentry id="vidioc-g-frequency">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_FREQUENCY</refname>
9 <refname>VIDIOC_S_FREQUENCY</refname>
10 <refpurpose>Get or set tuner or modulator radio
11frequency</refpurpose>
12 </refnamediv>
13
14 <refsynopsisdiv>
15 <funcsynopsis>
16 <funcprototype>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>struct v4l2_frequency
21*<parameter>argp</parameter></paramdef>
22 </funcprototype>
23 </funcsynopsis>
24 <funcsynopsis>
25 <funcprototype>
26 <funcdef>int <function>ioctl</function></funcdef>
27 <paramdef>int <parameter>fd</parameter></paramdef>
28 <paramdef>int <parameter>request</parameter></paramdef>
29 <paramdef>const struct v4l2_frequency
30*<parameter>argp</parameter></paramdef>
31 </funcprototype>
32 </funcsynopsis>
33 </refsynopsisdiv>
34
35 <refsect1>
36 <title>Arguments</title>
37
38 <variablelist>
39 <varlistentry>
40 <term><parameter>fd</parameter></term>
41 <listitem>
42 <para>&fd;</para>
43 </listitem>
44 </varlistentry>
45 <varlistentry>
46 <term><parameter>request</parameter></term>
47 <listitem>
48 <para>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</para>
49 </listitem>
50 </varlistentry>
51 <varlistentry>
52 <term><parameter>argp</parameter></term>
53 <listitem>
54 <para></para>
55 </listitem>
56 </varlistentry>
57 </variablelist>
58 </refsect1>
59
60 <refsect1>
61 <title>Description</title>
62
63 <para>To get the current tuner or modulator radio frequency
64applications set the <structfield>tuner</structfield> field of a
65&v4l2-frequency; to the respective tuner or modulator number (only
66input devices have tuners, only output devices have modulators), zero
67out the <structfield>reserved</structfield> array and
68call the <constant>VIDIOC_G_FREQUENCY</constant> ioctl with a pointer
69to this structure. The driver stores the current frequency in the
70<structfield>frequency</structfield> field.</para>
71
72 <para>To change the current tuner or modulator radio frequency
73applications initialize the <structfield>tuner</structfield>,
74<structfield>type</structfield> and
75<structfield>frequency</structfield> fields, and the
76<structfield>reserved</structfield> array of a &v4l2-frequency; and
77call the <constant>VIDIOC_S_FREQUENCY</constant> ioctl with a pointer
78to this structure. When the requested frequency is not possible the
79driver assumes the closest possible value. However
80<constant>VIDIOC_S_FREQUENCY</constant> is a write-only ioctl, it does
81not return the actual new frequency.</para>
82
83 <table pgwide="1" frame="none" id="v4l2-frequency">
84 <title>struct <structname>v4l2_frequency</structname></title>
85 <tgroup cols="3">
86 &cs-str;
87 <tbody valign="top">
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>tuner</structfield></entry>
91 <entry>The tuner or modulator index number. This is the
92same value as in the &v4l2-input; <structfield>tuner</structfield>
93field and the &v4l2-tuner; <structfield>index</structfield> field, or
94the &v4l2-output; <structfield>modulator</structfield> field and the
95&v4l2-modulator; <structfield>index</structfield> field.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>type</structfield></entry>
100 <entry>The tuner type. This is the same value as in the
101&v4l2-tuner; <structfield>type</structfield> field. The type must be set
102to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename>
103device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant>
104for all others. Set this field to <constant>V4L2_TUNER_RADIO</constant> for
105modulators (currently only radio modulators are supported).
106See <xref linkend="v4l2-tuner-type" /></entry>
107 </row>
108 <row>
109 <entry>__u32</entry>
110 <entry><structfield>frequency</structfield></entry>
111 <entry>Tuning frequency in units of 62.5 kHz, or if the
112&v4l2-tuner; or &v4l2-modulator; <structfield>capabilities</structfield> flag
113<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
114Hz.</entry>
115 </row>
116 <row>
117 <entry>__u32</entry>
118 <entry><structfield>reserved</structfield>[8]</entry>
119 <entry>Reserved for future extensions. Drivers and
120 applications must set the array to zero.</entry>
121 </row>
122 </tbody>
123 </tgroup>
124 </table>
125 </refsect1>
126
127 <refsect1>
128 &return-value;
129
130 <variablelist>
131 <varlistentry>
132 <term><errorcode>EINVAL</errorcode></term>
133 <listitem>
134 <para>The <structfield>tuner</structfield> index is out of
135bounds or the value in the <structfield>type</structfield> field is
136wrong.</para>
137 </listitem>
138 </varlistentry>
139 <varlistentry>
140 <term><errorcode>EBUSY</errorcode></term>
141 <listitem>
142 <para>A hardware seek is in progress.</para>
143 </listitem>
144 </varlistentry>
145 </variablelist>
146 </refsect1>
147</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-input.xml b/Documentation/DocBook/media/v4l/vidioc-g-input.xml
new file mode 100644
index 00000000000..1d43065090d
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-input.xml
@@ -0,0 +1,83 @@
1<refentry id="vidioc-g-input">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_INPUT</refname>
9 <refname>VIDIOC_S_INPUT</refname>
10 <refpurpose>Query or select the current video input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>int *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_INPUT, VIDIOC_S_INPUT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To query the current video input applications call the
53<constant>VIDIOC_G_INPUT</constant> ioctl with a pointer to an integer
54where the driver stores the number of the input, as in the
55&v4l2-input; <structfield>index</structfield> field. This ioctl will
56fail only when there are no video inputs, returning
57<errorcode>EINVAL</errorcode>.</para>
58
59 <para>To select a video input applications store the number of the
60desired input in an integer and call the
61<constant>VIDIOC_S_INPUT</constant> ioctl with a pointer to this
62integer. Side effects are possible. For example inputs may support
63different video standards, so the driver may implicitly switch the
64current standard. Because of these possible side effects applications
65must select an input before querying or negotiating any other parameters.</para>
66
67 <para>Information about video inputs is available using the
68&VIDIOC-ENUMINPUT; ioctl.</para>
69 </refsect1>
70
71 <refsect1>
72 &return-value;
73
74 <variablelist>
75 <varlistentry>
76 <term><errorcode>EINVAL</errorcode></term>
77 <listitem>
78 <para>The number of the video input is out of bounds.</para>
79 </listitem>
80 </varlistentry>
81 </variablelist>
82 </refsect1>
83</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml b/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml
new file mode 100644
index 00000000000..48748499c09
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml
@@ -0,0 +1,175 @@
1<refentry id="vidioc-g-jpegcomp">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_JPEGCOMP</refname>
9 <refname>VIDIOC_S_JPEGCOMP</refname>
10 <refpurpose></refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>v4l2_jpegcompression *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const v4l2_jpegcompression *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>These ioctls are <emphasis role="bold">deprecated</emphasis>.
61 New drivers and applications should use <link linkend="jpeg-controls">
62 JPEG class controls</link> for image quality and JPEG markers control.
63 </para>
64
65 <para>[to do]</para>
66
67 <para>Ronald Bultje elaborates:</para>
68
69 <!-- See video4linux-list@redhat.com on 16 Oct 2002, subject
70"Re: [V4L] Re: v4l2 api / Zoran v4l2_jpegcompression" -->
71
72 <para>APP is some application-specific information. The
73application can set it itself, and it'll be stored in the JPEG-encoded
74fields (eg; interlacing information for in an AVI or so). COM is the
75same, but it's comments, like 'encoded by me' or so.</para>
76
77 <para>jpeg_markers describes whether the huffman tables,
78quantization tables and the restart interval information (all
79JPEG-specific stuff) should be stored in the JPEG-encoded fields.
80These define how the JPEG field is encoded. If you omit them,
81applications assume you've used standard encoding. You usually do want
82to add them.</para>
83
84 <!-- NB VIDIOC_S_JPEGCOMP is w/o. -->
85
86 <table pgwide="1" frame="none" id="v4l2-jpegcompression">
87 <title>struct <structname>v4l2_jpegcompression</structname></title>
88 <tgroup cols="3">
89 &cs-str;
90 <tbody valign="top">
91 <row>
92 <entry>int</entry>
93 <entry><structfield>quality</structfield></entry>
94 <entry>Deprecated. If <link linkend="jpeg-quality-control"><constant>
95 V4L2_CID_JPEG_IMAGE_QUALITY</constant></link> control is exposed by
96 a driver applications should use it instead and ignore this field.
97 </entry>
98 </row>
99 <row>
100 <entry>int</entry>
101 <entry><structfield>APPn</structfield></entry>
102 <entry></entry>
103 </row>
104 <row>
105 <entry>int</entry>
106 <entry><structfield>APP_len</structfield></entry>
107 <entry></entry>
108 </row>
109 <row>
110 <entry>char</entry>
111 <entry><structfield>APP_data</structfield>[60]</entry>
112 <entry></entry>
113 </row>
114 <row>
115 <entry>int</entry>
116 <entry><structfield>COM_len</structfield></entry>
117 <entry></entry>
118 </row>
119 <row>
120 <entry>char</entry>
121 <entry><structfield>COM_data</structfield>[60]</entry>
122 <entry></entry>
123 </row>
124 <row>
125 <entry>__u32</entry>
126 <entry><structfield>jpeg_markers</structfield></entry>
127 <entry>See <xref linkend="jpeg-markers"/>. Deprecated.
128 If <link linkend="jpeg-active-marker-control"><constant>
129 V4L2_CID_JPEG_ACTIVE_MARKER</constant></link> control
130 is exposed by a driver applications should use it instead
131 and ignore this field.</entry>
132 </row>
133 </tbody>
134 </tgroup>
135 </table>
136
137 <table pgwide="1" frame="none" id="jpeg-markers">
138 <title>JPEG Markers Flags</title>
139 <tgroup cols="3">
140 &cs-def;
141 <tbody valign="top">
142 <row>
143 <entry><constant>V4L2_JPEG_MARKER_DHT</constant></entry>
144 <entry>(1&lt;&lt;3)</entry>
145 <entry>Define Huffman Tables</entry>
146 </row>
147 <row>
148 <entry><constant>V4L2_JPEG_MARKER_DQT</constant></entry>
149 <entry>(1&lt;&lt;4)</entry>
150 <entry>Define Quantization Tables</entry>
151 </row>
152 <row>
153 <entry><constant>V4L2_JPEG_MARKER_DRI</constant></entry>
154 <entry>(1&lt;&lt;5)</entry>
155 <entry>Define Restart Interval</entry>
156 </row>
157 <row>
158 <entry><constant>V4L2_JPEG_MARKER_COM</constant></entry>
159 <entry>(1&lt;&lt;6)</entry>
160 <entry>Comment segment</entry>
161 </row>
162 <row>
163 <entry><constant>V4L2_JPEG_MARKER_APP</constant></entry>
164 <entry>(1&lt;&lt;7)</entry>
165 <entry>App segment, driver will always use APP0</entry>
166 </row>
167 </tbody>
168 </tgroup>
169 </table>
170 </refsect1>
171
172 <refsect1>
173 &return-value;
174 </refsect1>
175</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
new file mode 100644
index 00000000000..7f4ac7e41fa
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
@@ -0,0 +1,238 @@
1<refentry id="vidioc-g-modulator">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_MODULATOR</refname>
9 <refname>VIDIOC_S_MODULATOR</refname>
10 <refpurpose>Get or set modulator attributes</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_modulator
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 <funcsynopsis>
24 <funcprototype>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const struct v4l2_modulator
29*<parameter>argp</parameter></paramdef>
30 </funcprototype>
31 </funcsynopsis>
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Arguments</title>
36
37 <variablelist>
38 <varlistentry>
39 <term><parameter>fd</parameter></term>
40 <listitem>
41 <para>&fd;</para>
42 </listitem>
43 </varlistentry>
44 <varlistentry>
45 <term><parameter>request</parameter></term>
46 <listitem>
47 <para>VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</para>
48 </listitem>
49 </varlistentry>
50 <varlistentry>
51 <term><parameter>argp</parameter></term>
52 <listitem>
53 <para></para>
54 </listitem>
55 </varlistentry>
56 </variablelist>
57 </refsect1>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para>To query the attributes of a modulator applications initialize
63the <structfield>index</structfield> field and zero out the
64<structfield>reserved</structfield> array of a &v4l2-modulator; and
65call the <constant>VIDIOC_G_MODULATOR</constant> ioctl with a pointer
66to this structure. Drivers fill the rest of the structure or return an
67&EINVAL; when the index is out of bounds. To enumerate all modulators
68applications shall begin at index zero, incrementing by one until the
69driver returns <errorcode>EINVAL</errorcode>.</para>
70
71 <para>Modulators have two writable properties, an audio
72modulation set and the radio frequency. To change the modulated audio
73subprograms, applications initialize the <structfield>index
74</structfield> and <structfield>txsubchans</structfield> fields and the
75<structfield>reserved</structfield> array and call the
76<constant>VIDIOC_S_MODULATOR</constant> ioctl. Drivers may choose a
77different audio modulation if the request cannot be satisfied. However
78this is a write-only ioctl, it does not return the actual audio
79modulation selected.</para>
80
81 <para>To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl
82is available.</para>
83
84 <table pgwide="1" frame="none" id="v4l2-modulator">
85 <title>struct <structname>v4l2_modulator</structname></title>
86 <tgroup cols="3">
87 &cs-str;
88 <tbody valign="top">
89 <row>
90 <entry>__u32</entry>
91 <entry><structfield>index</structfield></entry>
92 <entry>Identifies the modulator, set by the
93application.</entry>
94 </row>
95 <row>
96 <entry>__u8</entry>
97 <entry><structfield>name</structfield>[32]</entry>
98 <entry>Name of the modulator, a NUL-terminated ASCII
99string. This information is intended for the user.</entry>
100 </row>
101 <row>
102 <entry>__u32</entry>
103 <entry><structfield>capability</structfield></entry>
104 <entry>Modulator capability flags. No flags are defined
105for this field, the tuner flags in &v4l2-tuner;
106are used accordingly. The audio flags indicate the ability
107to encode audio subprograms. They will <emphasis>not</emphasis>
108change for example with the current video standard.</entry>
109 </row>
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>rangelow</structfield></entry>
113 <entry>The lowest tunable frequency in units of 62.5
114KHz, or if the <structfield>capability</structfield> flag
115<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
116Hz.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>rangehigh</structfield></entry>
121 <entry>The highest tunable frequency in units of 62.5
122KHz, or if the <structfield>capability</structfield> flag
123<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
124Hz.</entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>txsubchans</structfield></entry>
129 <entry>With this field applications can determine how
130audio sub-carriers shall be modulated. It contains a set of flags as
131defined in <xref linkend="modulator-txsubchans" />. Note the tuner
132<structfield>rxsubchans</structfield> flags are reused, but the
133semantics are different. Video output devices are assumed to have an
134analog or PCM audio input with 1-3 channels. The
135<structfield>txsubchans</structfield> flags select one or more
136channels for modulation, together with some audio subprogram
137indicator, for example a stereo pilot tone.</entry>
138 </row>
139 <row>
140 <entry>__u32</entry>
141 <entry><structfield>reserved</structfield>[4]</entry>
142 <entry>Reserved for future extensions. Drivers and
143applications must set the array to zero.</entry>
144 </row>
145 </tbody>
146 </tgroup>
147 </table>
148
149 <table pgwide="1" frame="none" id="modulator-txsubchans">
150 <title>Modulator Audio Transmission Flags</title>
151 <tgroup cols="3">
152 &cs-def;
153 <tbody valign="top">
154 <row>
155 <entry><constant>V4L2_TUNER_SUB_MONO</constant></entry>
156 <entry>0x0001</entry>
157 <entry>Modulate channel 1 as mono audio, when the input
158has more channels, a down-mix of channel 1 and 2. This flag does not
159combine with <constant>V4L2_TUNER_SUB_STEREO</constant> or
160<constant>V4L2_TUNER_SUB_LANG1</constant>.</entry>
161 </row>
162 <row>
163 <entry><constant>V4L2_TUNER_SUB_STEREO</constant></entry>
164 <entry>0x0002</entry>
165 <entry>Modulate channel 1 and 2 as left and right
166channel of a stereo audio signal. When the input has only one channel
167or two channels and <constant>V4L2_TUNER_SUB_SAP</constant> is also
168set, channel 1 is encoded as left and right channel. This flag does
169not combine with <constant>V4L2_TUNER_SUB_MONO</constant> or
170<constant>V4L2_TUNER_SUB_LANG1</constant>. When the driver does not
171support stereo audio it shall fall back to mono.</entry>
172 </row>
173 <row>
174 <entry><constant>V4L2_TUNER_SUB_LANG1</constant></entry>
175 <entry>0x0008</entry>
176 <entry>Modulate channel 1 and 2 as primary and secondary
177language of a bilingual audio signal. When the input has only one
178channel it is used for both languages. It is not possible to encode
179the primary or secondary language only. This flag does not combine
180with <constant>V4L2_TUNER_SUB_MONO</constant>,
181<constant>V4L2_TUNER_SUB_STEREO</constant> or
182<constant>V4L2_TUNER_SUB_SAP</constant>. If the hardware does not
183support the respective audio matrix, or the current video standard
184does not permit bilingual audio the
185<constant>VIDIOC_S_MODULATOR</constant> ioctl shall return an &EINVAL;
186and the driver shall fall back to mono or stereo mode.</entry>
187 </row>
188 <row>
189 <entry><constant>V4L2_TUNER_SUB_LANG2</constant></entry>
190 <entry>0x0004</entry>
191 <entry>Same effect as
192<constant>V4L2_TUNER_SUB_SAP</constant>.</entry>
193 </row>
194 <row>
195 <entry><constant>V4L2_TUNER_SUB_SAP</constant></entry>
196 <entry>0x0004</entry>
197 <entry>When combined with <constant>V4L2_TUNER_SUB_MONO
198</constant> the first channel is encoded as mono audio, the last
199channel as Second Audio Program. When the input has only one channel
200it is used for both audio tracks. When the input has three channels
201the mono track is a down-mix of channel 1 and 2. When combined with
202<constant>V4L2_TUNER_SUB_STEREO</constant> channel 1 and 2 are
203encoded as left and right stereo audio, channel 3 as Second Audio
204Program. When the input has only two channels, the first is encoded as
205left and right channel and the second as SAP. When the input has only
206one channel it is used for all audio tracks. It is not possible to
207encode a Second Audio Program only. This flag must combine with
208<constant>V4L2_TUNER_SUB_MONO</constant> or
209<constant>V4L2_TUNER_SUB_STEREO</constant>. If the hardware does not
210support the respective audio matrix, or the current video standard
211does not permit SAP the <constant>VIDIOC_S_MODULATOR</constant> ioctl
212shall return an &EINVAL; and driver shall fall back to mono or stereo
213mode.</entry>
214 </row>
215 <row>
216 <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry>
217 <entry>0x0010</entry>
218 <entry>Enable the RDS encoder for a radio FM transmitter.</entry>
219 </row>
220 </tbody>
221 </tgroup>
222 </table>
223 </refsect1>
224
225 <refsect1>
226 &return-value;
227
228 <variablelist>
229 <varlistentry>
230 <term><errorcode>EINVAL</errorcode></term>
231 <listitem>
232 <para>The &v4l2-modulator;
233<structfield>index</structfield> is out of bounds.</para>
234 </listitem>
235 </varlistentry>
236 </variablelist>
237 </refsect1>
238</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-output.xml b/Documentation/DocBook/media/v4l/vidioc-g-output.xml
new file mode 100644
index 00000000000..4533068ecb8
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-output.xml
@@ -0,0 +1,85 @@
1<refentry id="vidioc-g-output">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_OUTPUT</refname>
9 <refname>VIDIOC_S_OUTPUT</refname>
10 <refpurpose>Query or select the current video output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>int *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To query the current video output applications call the
53<constant>VIDIOC_G_OUTPUT</constant> ioctl with a pointer to an integer
54where the driver stores the number of the output, as in the
55&v4l2-output; <structfield>index</structfield> field. This ioctl
56will fail only when there are no video outputs, returning the
57&EINVAL;.</para>
58
59 <para>To select a video output applications store the number of the
60desired output in an integer and call the
61<constant>VIDIOC_S_OUTPUT</constant> ioctl with a pointer to this integer.
62Side effects are possible. For example outputs may support different
63video standards, so the driver may implicitly switch the current
64standard.
65standard. Because of these possible side effects applications
66must select an output before querying or negotiating any other parameters.</para>
67
68 <para>Information about video outputs is available using the
69&VIDIOC-ENUMOUTPUT; ioctl.</para>
70 </refsect1>
71
72 <refsect1>
73 &return-value;
74
75 <variablelist>
76 <varlistentry>
77 <term><errorcode>EINVAL</errorcode></term>
78 <listitem>
79 <para>The number of the video output is out of bounds, or
80there are no video outputs at all.</para>
81 </listitem>
82 </varlistentry>
83 </variablelist>
84 </refsect1>
85</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
new file mode 100644
index 00000000000..9058224d1bb
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
@@ -0,0 +1,314 @@
1<refentry id="vidioc-g-parm">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_PARM</refname>
9 <refname>VIDIOC_S_PARM</refname>
10 <refpurpose>Get or set streaming parameters</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>v4l2_streamparm *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_PARM, VIDIOC_S_PARM</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>The current video standard determines a nominal number of
53frames per second. If less than this number of frames is to be
54captured or output, applications can request frame skipping or
55duplicating on the driver side. This is especially useful when using
56the <function>read()</function> or <function>write()</function>, which
57are not augmented by timestamps or sequence counters, and to avoid
58unnecessary data copying.</para>
59
60 <para>Further these ioctls can be used to determine the number of
61buffers used internally by a driver in read/write mode. For
62implications see the section discussing the &func-read;
63function.</para>
64
65 <para>To get and set the streaming parameters applications call
66the <constant>VIDIOC_G_PARM</constant> and
67<constant>VIDIOC_S_PARM</constant> ioctl, respectively. They take a
68pointer to a struct <structname>v4l2_streamparm</structname> which
69contains a union holding separate parameters for input and output
70devices.</para>
71
72 <table pgwide="1" frame="none" id="v4l2-streamparm">
73 <title>struct <structname>v4l2_streamparm</structname></title>
74 <tgroup cols="4">
75 &cs-ustr;
76 <tbody valign="top">
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>type</structfield></entry>
80 <entry></entry>
81 <entry>The buffer (stream) type, same as &v4l2-format;
82<structfield>type</structfield>, set by the application. See <xref
83 linkend="v4l2-buf-type" /></entry>
84 </row>
85 <row>
86 <entry>union</entry>
87 <entry><structfield>parm</structfield></entry>
88 <entry></entry>
89 <entry></entry>
90 </row>
91 <row>
92 <entry></entry>
93 <entry>&v4l2-captureparm;</entry>
94 <entry><structfield>capture</structfield></entry>
95 <entry>Parameters for capture devices, used when
96<structfield>type</structfield> is
97<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>.</entry>
98 </row>
99 <row>
100 <entry></entry>
101 <entry>&v4l2-outputparm;</entry>
102 <entry><structfield>output</structfield></entry>
103 <entry>Parameters for output devices, used when
104<structfield>type</structfield> is
105<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>.</entry>
106 </row>
107 <row>
108 <entry></entry>
109 <entry>__u8</entry>
110 <entry><structfield>raw_data</structfield>[200]</entry>
111 <entry>A place holder for future extensions.</entry>
112 </row>
113 </tbody>
114 </tgroup>
115 </table>
116
117 <table pgwide="1" frame="none" id="v4l2-captureparm">
118 <title>struct <structname>v4l2_captureparm</structname></title>
119 <tgroup cols="3">
120 &cs-str;
121 <tbody valign="top">
122 <row>
123 <entry>__u32</entry>
124 <entry><structfield>capability</structfield></entry>
125 <entry>See <xref linkend="parm-caps" />.</entry>
126 </row>
127 <row>
128 <entry>__u32</entry>
129 <entry><structfield>capturemode</structfield></entry>
130 <entry>Set by drivers and applications, see <xref linkend="parm-flags" />.</entry>
131 </row>
132 <row>
133 <entry>&v4l2-fract;</entry>
134 <entry><structfield>timeperframe</structfield></entry>
135 <entry><para>This is is the desired period between
136successive frames captured by the driver, in seconds. The
137field is intended to skip frames on the driver side, saving I/O
138bandwidth.</para><para>Applications store here the desired frame
139period, drivers return the actual frame period, which must be greater
140or equal to the nominal frame period determined by the current video
141standard (&v4l2-standard; <structfield>frameperiod</structfield>
142field). Changing the video standard (also implicitly by switching the
143video input) may reset this parameter to the nominal frame period. To
144reset manually applications can just set this field to
145zero.</para><para>Drivers support this function only when they set the
146<constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
147<structfield>capability</structfield> field.</para></entry>
148 </row>
149 <row>
150 <entry>__u32</entry>
151 <entry><structfield>extendedmode</structfield></entry>
152 <entry>Custom (driver specific) streaming parameters. When
153unused, applications and drivers must set this field to zero.
154Applications using this field should check the driver name and
155version, see <xref linkend="querycap" />.</entry>
156 </row>
157 <row>
158 <entry>__u32</entry>
159 <entry><structfield>readbuffers</structfield></entry>
160 <entry>Applications set this field to the desired number
161of buffers used internally by the driver in &func-read; mode. Drivers
162return the actual number of buffers. When an application requests zero
163buffers, drivers should just return the current setting rather than
164the minimum or an error code. For details see <xref
165 linkend="rw" />.</entry>
166 </row>
167 <row>
168 <entry>__u32</entry>
169 <entry><structfield>reserved</structfield>[4]</entry>
170 <entry>Reserved for future extensions. Drivers and
171applications must set the array to zero.</entry>
172 </row>
173 </tbody>
174 </tgroup>
175 </table>
176
177 <table pgwide="1" frame="none" id="v4l2-outputparm">
178 <title>struct <structname>v4l2_outputparm</structname></title>
179 <tgroup cols="3">
180 &cs-str;
181 <tbody valign="top">
182 <row>
183 <entry>__u32</entry>
184 <entry><structfield>capability</structfield></entry>
185 <entry>See <xref linkend="parm-caps" />.</entry>
186 </row>
187 <row>
188 <entry>__u32</entry>
189 <entry><structfield>outputmode</structfield></entry>
190 <entry>Set by drivers and applications, see <xref
191 linkend="parm-flags" />.</entry>
192 </row>
193 <row>
194 <entry>&v4l2-fract;</entry>
195 <entry><structfield>timeperframe</structfield></entry>
196 <entry>This is is the desired period between
197successive frames output by the driver, in seconds.</entry>
198 </row>
199 <row>
200 <entry spanname="hspan"><para>The field is intended to
201repeat frames on the driver side in &func-write; mode (in streaming
202mode timestamps can be used to throttle the output), saving I/O
203bandwidth.</para><para>Applications store here the desired frame
204period, drivers return the actual frame period, which must be greater
205or equal to the nominal frame period determined by the current video
206standard (&v4l2-standard; <structfield>frameperiod</structfield>
207field). Changing the video standard (also implicitly by switching the
208video output) may reset this parameter to the nominal frame period. To
209reset manually applications can just set this field to
210zero.</para><para>Drivers support this function only when they set the
211<constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
212<structfield>capability</structfield> field.</para></entry>
213 </row>
214 <row>
215 <entry>__u32</entry>
216 <entry><structfield>extendedmode</structfield></entry>
217 <entry>Custom (driver specific) streaming parameters. When
218unused, applications and drivers must set this field to zero.
219Applications using this field should check the driver name and
220version, see <xref linkend="querycap" />.</entry>
221 </row>
222 <row>
223 <entry>__u32</entry>
224 <entry><structfield>writebuffers</structfield></entry>
225 <entry>Applications set this field to the desired number
226of buffers used internally by the driver in
227<function>write()</function> mode. Drivers return the actual number of
228buffers. When an application requests zero buffers, drivers should
229just return the current setting rather than the minimum or an error
230code. For details see <xref linkend="rw" />.</entry>
231 </row>
232 <row>
233 <entry>__u32</entry>
234 <entry><structfield>reserved</structfield>[4]</entry>
235 <entry>Reserved for future extensions. Drivers and
236applications must set the array to zero.</entry>
237 </row>
238 </tbody>
239 </tgroup>
240 </table>
241
242 <table pgwide="1" frame="none" id="parm-caps">
243 <title>Streaming Parameters Capabilites</title>
244 <tgroup cols="3">
245 &cs-def;
246 <tbody valign="top">
247 <row>
248 <entry><constant>V4L2_CAP_TIMEPERFRAME</constant></entry>
249 <entry>0x1000</entry>
250 <entry>The frame skipping/repeating controlled by the
251<structfield>timeperframe</structfield> field is supported.</entry>
252 </row>
253 </tbody>
254 </tgroup>
255 </table>
256
257 <table pgwide="1" frame="none" id="parm-flags">
258 <title>Capture Parameters Flags</title>
259 <tgroup cols="3">
260 &cs-def;
261 <tbody valign="top">
262 <row>
263 <entry><constant>V4L2_MODE_HIGHQUALITY</constant></entry>
264 <entry>0x0001</entry>
265 <entry><para>High quality imaging mode. High quality mode
266is intended for still imaging applications. The idea is to get the
267best possible image quality that the hardware can deliver. It is not
268defined how the driver writer may achieve that; it will depend on the
269hardware and the ingenuity of the driver writer. High quality mode is
270a different mode from the the regular motion video capture modes. In
271high quality mode:<itemizedlist>
272 <listitem>
273 <para>The driver may be able to capture higher
274resolutions than for motion capture.</para>
275 </listitem>
276 <listitem>
277 <para>The driver may support fewer pixel formats
278than motion capture (eg; true color).</para>
279 </listitem>
280 <listitem>
281 <para>The driver may capture and arithmetically
282combine multiple successive fields or frames to remove color edge
283artifacts and reduce the noise in the video data.
284</para>
285 </listitem>
286 <listitem>
287 <para>The driver may capture images in slices like
288a scanner in order to handle larger format images than would otherwise
289be possible. </para>
290 </listitem>
291 <listitem>
292 <para>An image capture operation may be
293significantly slower than motion capture. </para>
294 </listitem>
295 <listitem>
296 <para>Moving objects in the image might have
297excessive motion blur. </para>
298 </listitem>
299 <listitem>
300 <para>Capture might only work through the
301<function>read()</function> call.</para>
302 </listitem>
303 </itemizedlist></para></entry>
304 </row>
305 </tbody>
306 </tgroup>
307 </table>
308
309 </refsect1>
310
311 <refsect1>
312 &return-value;
313 </refsect1>
314</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-priority.xml b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml
new file mode 100644
index 00000000000..6a81b4fe953
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml
@@ -0,0 +1,135 @@
1<refentry id="vidioc-g-priority">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_PRIORITY</refname>
9 <refname>VIDIOC_S_PRIORITY</refname>
10 <refpurpose>Query or request the access priority associated with a
11file descriptor</refpurpose>
12 </refnamediv>
13
14 <refsynopsisdiv>
15 <funcsynopsis>
16 <funcprototype>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>enum v4l2_priority *<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 <funcsynopsis>
24 <funcprototype>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const enum v4l2_priority *<parameter>argp</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Arguments</title>
35
36 <variablelist>
37 <varlistentry>
38 <term><parameter>fd</parameter></term>
39 <listitem>
40 <para>&fd;</para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>request</parameter></term>
45 <listitem>
46 <para>VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term><parameter>argp</parameter></term>
51 <listitem>
52 <para>Pointer to an enum v4l2_priority type.</para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para>To query the current access priority
62applications call the <constant>VIDIOC_G_PRIORITY</constant> ioctl
63with a pointer to an enum v4l2_priority variable where the driver stores
64the current priority.</para>
65
66 <para>To request an access priority applications store the
67desired priority in an enum v4l2_priority variable and call
68<constant>VIDIOC_S_PRIORITY</constant> ioctl with a pointer to this
69variable.</para>
70
71 <table frame="none" pgwide="1" id="v4l2-priority">
72 <title>enum v4l2_priority</title>
73 <tgroup cols="3">
74 &cs-def;
75 <tbody valign="top">
76 <row>
77 <entry><constant>V4L2_PRIORITY_UNSET</constant></entry>
78 <entry>0</entry>
79 <entry></entry>
80 </row>
81 <row>
82 <entry><constant>V4L2_PRIORITY_BACKGROUND</constant></entry>
83 <entry>1</entry>
84 <entry>Lowest priority, usually applications running in
85background, for example monitoring VBI transmissions. A proxy
86application running in user space will be necessary if multiple
87applications want to read from a device at this priority.</entry>
88 </row>
89 <row>
90 <entry><constant>V4L2_PRIORITY_INTERACTIVE</constant></entry>
91 <entry>2</entry>
92 <entry></entry>
93 </row>
94 <row>
95 <entry><constant>V4L2_PRIORITY_DEFAULT</constant></entry>
96 <entry>2</entry>
97 <entry>Medium priority, usually applications started and
98interactively controlled by the user. For example TV viewers, Teletext
99browsers, or just "panel" applications to change the channel or video
100controls. This is the default priority unless an application requests
101another.</entry>
102 </row>
103 <row>
104 <entry><constant>V4L2_PRIORITY_RECORD</constant></entry>
105 <entry>3</entry>
106 <entry>Highest priority. Only one file descriptor can have
107this priority, it blocks any other fd from changing device properties.
108Usually applications which must not be interrupted, like video
109recording.</entry>
110 </row>
111 </tbody>
112 </tgroup>
113 </table>
114 </refsect1>
115
116 <refsect1>
117 &return-value;
118
119 <variablelist>
120 <varlistentry>
121 <term><errorcode>EINVAL</errorcode></term>
122 <listitem>
123 <para>The requested priority value is invalid.</para>
124 </listitem>
125 </varlistentry>
126 <varlistentry>
127 <term><errorcode>EBUSY</errorcode></term>
128 <listitem>
129 <para>Another application already requested higher
130priority.</para>
131 </listitem>
132 </varlistentry>
133 </variablelist>
134 </refsect1>
135</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
new file mode 100644
index 00000000000..b11ec75e21a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
@@ -0,0 +1,241 @@
1<refentry id="vidioc-g-selection">
2
3 <refmeta>
4 <refentrytitle>ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</refentrytitle>
5 &manvol;
6 </refmeta>
7
8 <refnamediv>
9 <refname>VIDIOC_G_SELECTION</refname>
10 <refname>VIDIOC_S_SELECTION</refname>
11 <refpurpose>Get or set one of the selection rectangles</refpurpose>
12 </refnamediv>
13
14 <refsynopsisdiv>
15 <funcsynopsis>
16 <funcprototype>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>struct v4l2_selection *<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <note>
54 <title>Experimental</title>
55 <para>This is an <link linkend="experimental"> experimental </link>
56 interface and may change in the future.</para>
57 </note>
58
59 <para>The ioctls are used to query and configure selection rectangles.</para>
60
61<para> To query the cropping (composing) rectangle set &v4l2-selection;
62<structfield> type </structfield> field to the respective buffer type.
63Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
64</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
65</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
66<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
67setting the value of &v4l2-selection; <structfield>target</structfield> field
68to <constant> V4L2_SEL_TGT_CROP </constant> (<constant>
69V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
70linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
71targets. The <structfield>flags</structfield> and <structfield>reserved
72</structfield> fields of &v4l2-selection; are ignored and they must be filled
73with zeros. The driver fills the rest of the structure or
74returns &EINVAL; if incorrect buffer type or target was used. If cropping
75(composing) is not supported then the active rectangle is not mutable and it is
76always equal to the bounds rectangle. Finally, the &v4l2-rect;
77<structfield>r</structfield> rectangle is filled with the current cropping
78(composing) coordinates. The coordinates are expressed in driver-dependent
79units. The only exception are rectangles for images in raw formats, whose
80coordinates are always expressed in pixels. </para>
81
82<para> To change the cropping (composing) rectangle set the &v4l2-selection;
83<structfield>type</structfield> field to the respective buffer type. Do not
84use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
85</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
86</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
87<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
88setting the value of &v4l2-selection; <structfield>target</structfield> to
89<constant>V4L2_SEL_TGT_CROP</constant> (<constant>
90V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
91linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
92targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be
93set to the desired active area. Field &v4l2-selection; <structfield> reserved
94</structfield> is ignored and must be filled with zeros. The driver may adjust
95coordinates of the requested rectangle. An application may
96introduce constraints to control rounding behaviour. The &v4l2-selection;
97<structfield>flags</structfield> field must be set to one of the following:
98
99<itemizedlist>
100 <listitem>
101<para><constant>0</constant> - The driver can adjust the rectangle size freely
102and shall choose a crop/compose rectangle as close as possible to the requested
103one.</para>
104 </listitem>
105 <listitem>
106<para><constant>V4L2_SEL_FLAG_GE</constant> - The driver is not allowed to
107shrink the rectangle. The original rectangle must lay inside the adjusted
108one.</para>
109 </listitem>
110 <listitem>
111<para><constant>V4L2_SEL_FLAG_LE</constant> - The driver is not allowed to
112enlarge the rectangle. The adjusted rectangle must lay inside the original
113one.</para>
114 </listitem>
115 <listitem>
116<para><constant>V4L2_SEL_FLAG_GE | V4L2_SEL_FLAG_LE</constant> - The driver
117must choose the size exactly the same as in the requested rectangle.</para>
118 </listitem>
119</itemizedlist>
120
121Please refer to <xref linkend="sel-const-adjust" />.
122
123</para>
124
125<para> The driver may have to adjusts the requested dimensions against hardware
126limits and other parts as the pipeline, i.e. the bounds given by the
127capture/output window or TV display. The closest possible values of horizontal
128and vertical offset and sizes are chosen according to following priority:
129
130<orderedlist>
131 <listitem>
132 <para>Satisfy constraints from &v4l2-selection; <structfield>flags</structfield>.</para>
133 </listitem>
134 <listitem>
135 <para>Adjust width, height, left, and top to hardware limits and alignments.</para>
136 </listitem>
137 <listitem>
138 <para>Keep center of adjusted rectangle as close as possible to the original one.</para>
139 </listitem>
140 <listitem>
141 <para>Keep width and height as close as possible to original ones.</para>
142 </listitem>
143 <listitem>
144 <para>Keep horizontal and vertical offset as close as possible to original ones.</para>
145 </listitem>
146</orderedlist>
147
148On success the &v4l2-rect; <structfield>r</structfield> field contains
149the adjusted rectangle. When the parameters are unsuitable the application may
150modify the cropping (composing) or image parameters and repeat the cycle until
151satisfactory parameters have been negotiated. If constraints flags have to be
152violated at then ERANGE is returned. The error indicates that <emphasis> there
153exist no rectangle </emphasis> that satisfies the constraints.</para>
154
155 <para>Selection targets and flags are documented in <xref
156 linkend="v4l2-selections-common"/>.</para>
157
158 <para>
159 <figure id="sel-const-adjust">
160 <title>Size adjustments with constraint flags.</title>
161 <mediaobject>
162 <imageobject>
163 <imagedata fileref="constraints.png" format="PNG" />
164 </imageobject>
165 <textobject>
166 <phrase>Behaviour of rectangle adjustment for different constraint
167 flags.</phrase>
168 </textobject>
169 </mediaobject>
170 </figure>
171 </para>
172
173 <para>
174 <table pgwide="1" frame="none" id="v4l2-selection">
175 <title>struct <structname>v4l2_selection</structname></title>
176 <tgroup cols="3">
177 &cs-str;
178 <tbody valign="top">
179 <row>
180 <entry>__u32</entry>
181 <entry><structfield>type</structfield></entry>
182 <entry>Type of the buffer (from &v4l2-buf-type;).</entry>
183 </row>
184 <row>
185 <entry>__u32</entry>
186 <entry><structfield>target</structfield></entry>
187 <entry>Used to select between <link linkend="v4l2-selections-common"> cropping
188 and composing rectangles</link>.</entry>
189 </row>
190 <row>
191 <entry>__u32</entry>
192 <entry><structfield>flags</structfield></entry>
193 <entry>Flags controlling the selection rectangle adjustments, refer to
194 <link linkend="v4l2-selection-flags">selection flags</link>.</entry>
195 </row>
196 <row>
197 <entry>&v4l2-rect;</entry>
198 <entry><structfield>r</structfield></entry>
199 <entry>The selection rectangle.</entry>
200 </row>
201 <row>
202 <entry>__u32</entry>
203 <entry><structfield>reserved[9]</structfield></entry>
204 <entry>Reserved fields for future use.</entry>
205 </row>
206 </tbody>
207 </tgroup>
208 </table>
209 </para>
210 </refsect1>
211
212 <refsect1>
213 &return-value;
214 <variablelist>
215 <varlistentry>
216 <term><errorcode>EINVAL</errorcode></term>
217 <listitem>
218 <para>Given buffer type <structfield>type</structfield> or
219the selection target <structfield>target</structfield> is not supported,
220or the <structfield>flags</structfield> argument is not valid.</para>
221 </listitem>
222 </varlistentry>
223 <varlistentry>
224 <term><errorcode>ERANGE</errorcode></term>
225 <listitem>
226 <para>It is not possible to adjust &v4l2-rect; <structfield>
227r</structfield> rectangle to satisfy all contraints given in the
228<structfield>flags</structfield> argument.</para>
229 </listitem>
230 </varlistentry>
231 <varlistentry>
232 <term><errorcode>EBUSY</errorcode></term>
233 <listitem>
234 <para>It is not possible to apply change of the selection rectangle
235at the moment. Usually because streaming is in progress.</para>
236 </listitem>
237 </varlistentry>
238 </variablelist>
239 </refsect1>
240
241</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
new file mode 100644
index 00000000000..bd015d1563f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
@@ -0,0 +1,255 @@
1<refentry id="vidioc-g-sliced-vbi-cap">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_SLICED_VBI_CAP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_SLICED_VBI_CAP</refname>
9 <refpurpose>Query sliced VBI capabilities</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_sliced_vbi_cap *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_G_SLICED_VBI_CAP</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To find out which data services are supported by a sliced
52VBI capture or output device, applications initialize the
53<structfield>type</structfield> field of a &v4l2-sliced-vbi-cap;,
54clear the <structfield>reserved</structfield> array and
55call the <constant>VIDIOC_G_SLICED_VBI_CAP</constant> ioctl. The
56driver fills in the remaining fields or returns an &EINVAL; if the
57sliced VBI API is unsupported or <structfield>type</structfield>
58is invalid.</para>
59
60 <para>Note the <structfield>type</structfield> field was added,
61and the ioctl changed from read-only to write-read, in Linux 2.6.19.</para>
62
63 <table pgwide="1" frame="none" id="v4l2-sliced-vbi-cap">
64 <title>struct <structname>v4l2_sliced_vbi_cap</structname></title>
65 <tgroup cols="5">
66 <colspec colname="c1" colwidth="3*" />
67 <colspec colname="c2" colwidth="3*" />
68 <colspec colname="c3" colwidth="2*" />
69 <colspec colname="c4" colwidth="2*" />
70 <colspec colname="c5" colwidth="2*" />
71 <spanspec spanname="hspan" namest="c3" nameend="c5" />
72 <tbody valign="top">
73 <row>
74 <entry>__u16</entry>
75 <entry><structfield>service_set</structfield></entry>
76 <entry spanname="hspan">A set of all data services
77supported by the driver. Equal to the union of all elements of the
78<structfield>service_lines </structfield> array.</entry>
79 </row>
80 <row>
81 <entry>__u16</entry>
82 <entry><structfield>service_lines</structfield>[2][24]</entry>
83 <entry spanname="hspan">Each element of this array
84contains a set of data services the hardware can look for or insert
85into a particular scan line. Data services are defined in <xref
86 linkend="vbi-services" />. Array indices map to ITU-R
87line numbers (see also <xref
88 linkend="vbi-525" /> and <xref
89linkend="vbi-625" />) as follows:</entry>
90 </row>
91 <row>
92 <entry></entry>
93 <entry></entry>
94 <entry>Element</entry>
95 <entry>525 line systems</entry>
96 <entry>625 line systems</entry>
97 </row>
98 <row>
99 <entry></entry>
100 <entry></entry>
101 <entry><structfield>service_lines</structfield>[0][1]</entry>
102 <entry align="center">1</entry>
103 <entry align="center">1</entry>
104 </row>
105 <row>
106 <entry></entry>
107 <entry></entry>
108 <entry><structfield>service_lines</structfield>[0][23]</entry>
109 <entry align="center">23</entry>
110 <entry align="center">23</entry>
111 </row>
112 <row>
113 <entry></entry>
114 <entry></entry>
115 <entry><structfield>service_lines</structfield>[1][1]</entry>
116 <entry align="center">264</entry>
117 <entry align="center">314</entry>
118 </row>
119 <row>
120 <entry></entry>
121 <entry></entry>
122 <entry><structfield>service_lines</structfield>[1][23]</entry>
123 <entry align="center">286</entry>
124 <entry align="center">336</entry>
125 </row>
126 <row>
127 <entry></entry>
128 </row>
129 <row>
130 <entry></entry>
131 <entry></entry>
132 <entry spanname="hspan">The number of VBI lines the
133hardware can capture or output per frame, or the number of services it
134can identify on a given line may be limited. For example on PAL line
13516 the hardware may be able to look for a VPS or Teletext signal, but
136not both at the same time. Applications can learn about these limits
137using the &VIDIOC-S-FMT; ioctl as described in <xref
138 linkend="sliced" />.</entry>
139 </row>
140 <row>
141 <entry></entry>
142 </row>
143 <row>
144 <entry></entry>
145 <entry></entry>
146 <entry spanname="hspan">Drivers must set
147<structfield>service_lines</structfield>[0][0] and
148<structfield>service_lines</structfield>[1][0] to zero.</entry>
149 </row>
150 <row>
151 <entry>__u32</entry>
152 <entry><structfield>type</structfield></entry>
153 <entry>Type of the data stream, see <xref
154 linkend="v4l2-buf-type" />. Should be
155<constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant> or
156<constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant>.</entry>
157 </row>
158 <row>
159 <entry>__u32</entry>
160 <entry><structfield>reserved</structfield>[3]</entry>
161 <entry spanname="hspan">This array is reserved for future
162extensions. Applications and drivers must set it to zero.</entry>
163 </row>
164 </tbody>
165 </tgroup>
166 </table>
167
168 <!-- See also dev-sliced-vbi.sgml -->
169 <table pgwide="1" frame="none" id="vbi-services">
170 <title>Sliced VBI services</title>
171 <tgroup cols="5">
172 <colspec colname="c1" colwidth="2*" />
173 <colspec colname="c2" colwidth="1*" />
174 <colspec colname="c3" colwidth="1*" />
175 <colspec colname="c4" colwidth="2*" />
176 <colspec colname="c5" colwidth="2*" />
177 <spanspec spanname='rlp' namest='c3' nameend='c5' />
178 <thead>
179 <row>
180 <entry>Symbol</entry>
181 <entry>Value</entry>
182 <entry>Reference</entry>
183 <entry>Lines, usually</entry>
184 <entry>Payload</entry>
185 </row>
186 </thead>
187 <tbody valign="top">
188 <row>
189 <entry><constant>V4L2_SLICED_TELETEXT_B</constant> (Teletext
190System B)</entry>
191 <entry>0x0001</entry>
192 <entry><xref linkend="ets300706" />, <xref linkend="itu653" /></entry>
193 <entry>PAL/SECAM line 7-22, 320-335 (second field 7-22)</entry>
194 <entry>Last 42 of the 45 byte Teletext packet, that is
195without clock run-in and framing code, lsb first transmitted.</entry>
196 </row>
197 <row>
198 <entry><constant>V4L2_SLICED_VPS</constant></entry>
199 <entry>0x0400</entry>
200 <entry><xref linkend="ets300231" /></entry>
201 <entry>PAL line 16</entry>
202 <entry>Byte number 3 to 15 according to Figure 9 of
203ETS&nbsp;300&nbsp;231, lsb first transmitted.</entry>
204 </row>
205 <row>
206 <entry><constant>V4L2_SLICED_CAPTION_525</constant></entry>
207 <entry>0x1000</entry>
208 <entry><xref linkend="eia608" /></entry>
209 <entry>NTSC line 21, 284 (second field 21)</entry>
210 <entry>Two bytes in transmission order, including parity
211bit, lsb first transmitted.</entry>
212 </row>
213 <row>
214 <entry><constant>V4L2_SLICED_WSS_625</constant></entry>
215 <entry>0x4000</entry>
216 <entry><xref linkend="en300294" />, <xref linkend="itu1119" /></entry>
217 <entry>PAL/SECAM line 23</entry>
218 <entry><screen>
219Byte 0 1
220 msb lsb msb lsb
221Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
222</screen></entry>
223 </row>
224 <row>
225 <entry><constant>V4L2_SLICED_VBI_525</constant></entry>
226 <entry>0x1000</entry>
227 <entry spanname="rlp">Set of services applicable to 525
228line systems.</entry>
229 </row>
230 <row>
231 <entry><constant>V4L2_SLICED_VBI_625</constant></entry>
232 <entry>0x4401</entry>
233 <entry spanname="rlp">Set of services applicable to 625
234line systems.</entry>
235 </row>
236 </tbody>
237 </tgroup>
238 </table>
239
240 </refsect1>
241
242 <refsect1>
243 &return-value;
244
245 <variablelist>
246 <varlistentry>
247 <term><errorcode>EINVAL</errorcode></term>
248 <listitem>
249 <para>The value in the <structfield>type</structfield> field is
250wrong.</para>
251 </listitem>
252 </varlistentry>
253 </variablelist>
254 </refsect1>
255</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-std.xml b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
new file mode 100644
index 00000000000..4a898417de2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
@@ -0,0 +1,98 @@
1<refentry id="vidioc-g-std">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_STD, VIDIOC_S_STD</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_STD</refname>
9 <refname>VIDIOC_S_STD</refname>
10 <refpurpose>Query or select the video standard of the current input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>v4l2_std_id
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 <funcsynopsis>
24 <funcprototype>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const v4l2_std_id
29*<parameter>argp</parameter></paramdef>
30 </funcprototype>
31 </funcsynopsis>
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Arguments</title>
36
37 <variablelist>
38 <varlistentry>
39 <term><parameter>fd</parameter></term>
40 <listitem>
41 <para>&fd;</para>
42 </listitem>
43 </varlistentry>
44 <varlistentry>
45 <term><parameter>request</parameter></term>
46 <listitem>
47 <para>VIDIOC_G_STD, VIDIOC_S_STD</para>
48 </listitem>
49 </varlistentry>
50 <varlistentry>
51 <term><parameter>argp</parameter></term>
52 <listitem>
53 <para></para>
54 </listitem>
55 </varlistentry>
56 </variablelist>
57 </refsect1>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para>To query and select the current video standard applications
63use the <constant>VIDIOC_G_STD</constant> and <constant>VIDIOC_S_STD</constant> ioctls which take a pointer to a
64&v4l2-std-id; type as argument. <constant>VIDIOC_G_STD</constant> can
65return a single flag or a set of flags as in &v4l2-standard; field
66<structfield>id</structfield>. The flags must be unambiguous such
67that they appear in only one enumerated <structname>v4l2_standard</structname> structure.</para>
68
69 <para><constant>VIDIOC_S_STD</constant> accepts one or more
70flags, being a write-only ioctl it does not return the actual new standard as
71<constant>VIDIOC_G_STD</constant> does. When no flags are given or
72the current input does not support the requested standard the driver
73returns an &EINVAL;. When the standard set is ambiguous drivers may
74return <errorcode>EINVAL</errorcode> or choose any of the requested
75standards. If the current input or output does not support standard video timings (e.g. if
76&VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_STD</constant> flag), then
77&ENODATA; is returned.</para>
78 </refsect1>
79
80 <refsect1>
81 &return-value;
82
83 <variablelist>
84 <varlistentry>
85 <term><errorcode>EINVAL</errorcode></term>
86 <listitem>
87 <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term><errorcode>ENODATA</errorcode></term>
92 <listitem>
93 <para>Standard video timings are not supported for this input or output.</para>
94 </listitem>
95 </varlistentry>
96 </variablelist>
97 </refsect1>
98</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
new file mode 100644
index 00000000000..6cc82010c73
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -0,0 +1,569 @@
1<refentry id="vidioc-g-tuner">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_TUNER</refname>
9 <refname>VIDIOC_S_TUNER</refname>
10 <refpurpose>Get or set tuner attributes</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_tuner
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 <funcsynopsis>
24 <funcprototype>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const struct v4l2_tuner
29*<parameter>argp</parameter></paramdef>
30 </funcprototype>
31 </funcsynopsis>
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Arguments</title>
36
37 <variablelist>
38 <varlistentry>
39 <term><parameter>fd</parameter></term>
40 <listitem>
41 <para>&fd;</para>
42 </listitem>
43 </varlistentry>
44 <varlistentry>
45 <term><parameter>request</parameter></term>
46 <listitem>
47 <para>VIDIOC_G_TUNER, VIDIOC_S_TUNER</para>
48 </listitem>
49 </varlistentry>
50 <varlistentry>
51 <term><parameter>argp</parameter></term>
52 <listitem>
53 <para></para>
54 </listitem>
55 </varlistentry>
56 </variablelist>
57 </refsect1>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para>To query the attributes of a tuner applications initialize the
63<structfield>index</structfield> field and zero out the
64<structfield>reserved</structfield> array of a &v4l2-tuner; and call the
65<constant>VIDIOC_G_TUNER</constant> ioctl with a pointer to this
66structure. Drivers fill the rest of the structure or return an
67&EINVAL; when the index is out of bounds. To enumerate all tuners
68applications shall begin at index zero, incrementing by one until the
69driver returns <errorcode>EINVAL</errorcode>.</para>
70
71 <para>Tuners have two writable properties, the audio mode and
72the radio frequency. To change the audio mode, applications initialize
73the <structfield>index</structfield>,
74<structfield>audmode</structfield> and
75<structfield>reserved</structfield> fields and call the
76<constant>VIDIOC_S_TUNER</constant> ioctl. This will
77<emphasis>not</emphasis> change the current tuner, which is determined
78by the current video input. Drivers may choose a different audio mode
79if the requested mode is invalid or unsupported. Since this is a
80<!-- FIXME -->write-only ioctl, it does not return the actually
81selected audio mode.</para>
82
83 <para>To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl
84is available.</para>
85
86 <table pgwide="1" frame="none" id="v4l2-tuner">
87 <title>struct <structname>v4l2_tuner</structname></title>
88 <tgroup cols="3">
89 <colspec colname="c1" colwidth="1*" />
90 <colspec colname="c2" colwidth="1*" />
91 <colspec colname="c3" colwidth="1*" />
92 <colspec colname="c4" colwidth="1*" />
93 <spanspec spanname="hspan" namest="c3" nameend="c4" />
94 <tbody valign="top">
95 <row>
96 <entry>__u32</entry>
97 <entry><structfield>index</structfield></entry>
98 <entry spanname="hspan">Identifies the tuner, set by the
99application.</entry>
100 </row>
101 <row>
102 <entry>__u8</entry>
103 <entry><structfield>name</structfield>[32]</entry>
104 <entry spanname="hspan"><para>Name of the tuner, a
105NUL-terminated ASCII string. This information is intended for the
106user.<!-- FIXME Video inputs already have a name, the purpose of this
107field is not quite clear.--></para></entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>type</structfield></entry>
112 <entry spanname="hspan">Type of the tuner, see <xref
113 linkend="v4l2-tuner-type" />.</entry>
114 </row>
115 <row>
116 <entry>__u32</entry>
117 <entry><structfield>capability</structfield></entry>
118 <entry spanname="hspan"><para>Tuner capability flags, see
119<xref linkend="tuner-capability" />. Audio flags indicate the ability
120to decode audio subprograms. They will <emphasis>not</emphasis>
121change, for example with the current video standard.</para><para>When
122the structure refers to a radio tuner the
123<constant>V4L2_TUNER_CAP_LANG1</constant>,
124<constant>V4L2_TUNER_CAP_LANG2</constant> and
125<constant>V4L2_TUNER_CAP_NORM</constant> flags can't be used.</para>
126<para>If multiple frequency bands are supported, then
127<structfield>capability</structfield> is the union of all
128<structfield>capability</structfield> fields of each &v4l2-frequency-band;.
129</para></entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>rangelow</structfield></entry>
134 <entry spanname="hspan">The lowest tunable frequency in
135units of 62.5 kHz, or if the <structfield>capability</structfield>
136flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
137Hz. If multiple frequency bands are supported, then
138<structfield>rangelow</structfield> is the lowest frequency
139of all the frequency bands.</entry>
140 </row>
141 <row>
142 <entry>__u32</entry>
143 <entry><structfield>rangehigh</structfield></entry>
144 <entry spanname="hspan">The highest tunable frequency in
145units of 62.5 kHz, or if the <structfield>capability</structfield>
146flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
147Hz. If multiple frequency bands are supported, then
148<structfield>rangehigh</structfield> is the highest frequency
149of all the frequency bands.</entry>
150 </row>
151 <row>
152 <entry>__u32</entry>
153 <entry><structfield>rxsubchans</structfield></entry>
154 <entry spanname="hspan"><para>Some tuners or audio
155decoders can determine the received audio subprograms by analyzing
156audio carriers, pilot tones or other indicators. To pass this
157information drivers set flags defined in <xref
158 linkend="tuner-rxsubchans" /> in this field. For
159example:</para></entry>
160 </row>
161 <row>
162 <entry></entry>
163 <entry></entry>
164 <entry><constant>V4L2_TUNER_SUB_MONO</constant></entry>
165 <entry>receiving mono audio</entry>
166 </row>
167 <row>
168 <entry></entry>
169 <entry></entry>
170 <entry><constant>STEREO | SAP</constant></entry>
171 <entry>receiving stereo audio and a secondary audio
172program</entry>
173 </row>
174 <row>
175 <entry></entry>
176 <entry></entry>
177 <entry><constant>MONO | STEREO</constant></entry>
178 <entry>receiving mono or stereo audio, the hardware cannot
179distinguish</entry>
180 </row>
181 <row>
182 <entry></entry>
183 <entry></entry>
184 <entry><constant>LANG1 | LANG2</constant></entry>
185 <entry>receiving bilingual audio</entry>
186 </row>
187 <row>
188 <entry></entry>
189 <entry></entry>
190 <entry><constant>MONO | STEREO | LANG1 | LANG2</constant></entry>
191 <entry>receiving mono, stereo or bilingual
192audio</entry>
193 </row>
194 <row>
195 <entry></entry>
196 <entry></entry>
197 <entry spanname="hspan"><para>When the
198<constant>V4L2_TUNER_CAP_STEREO</constant>,
199<constant>_LANG1</constant>, <constant>_LANG2</constant> or
200<constant>_SAP</constant> flag is cleared in the
201<structfield>capability</structfield> field, the corresponding
202<constant>V4L2_TUNER_SUB_</constant> flag must not be set
203here.</para><para>This field is valid only if this is the tuner of the
204current video input, or when the structure refers to a radio
205tuner.</para></entry>
206 </row>
207 <row>
208 <entry>__u32</entry>
209 <entry><structfield>audmode</structfield></entry>
210 <entry spanname="hspan"><para>The selected audio mode, see
211<xref linkend="tuner-audmode" /> for valid values. The audio mode does
212not affect audio subprogram detection, and like a <link
213linkend="control">control</link> it does not automatically change
214unless the requested mode is invalid or unsupported. See <xref
215 linkend="tuner-matrix" /> for possible results when
216the selected and received audio programs do not
217match.</para><para>Currently this is the only field of struct
218<structname>v4l2_tuner</structname> applications can
219change.</para></entry>
220 </row>
221 <row>
222 <entry>__u32</entry>
223 <entry><structfield>signal</structfield></entry>
224 <entry spanname="hspan">The signal strength if known, ranging
225from 0 to 65535. Higher values indicate a better signal.</entry>
226 </row>
227 <row>
228 <entry>__s32</entry>
229 <entry><structfield>afc</structfield></entry>
230 <entry spanname="hspan">Automatic frequency control: When the
231<structfield>afc</structfield> value is negative, the frequency is too
232low, when positive too high.<!-- FIXME need example what to do when it never
233settles at zero, &ie; range is what? --></entry>
234 </row>
235 <row>
236 <entry>__u32</entry>
237 <entry><structfield>reserved</structfield>[4]</entry>
238 <entry spanname="hspan">Reserved for future extensions. Drivers and
239applications must set the array to zero.</entry>
240 </row>
241 </tbody>
242 </tgroup>
243 </table>
244
245 <table pgwide="1" frame="none" id="v4l2-tuner-type">
246 <title>enum v4l2_tuner_type</title>
247 <tgroup cols="3">
248 &cs-def;
249 <tbody valign="top">
250 <row>
251 <entry><constant>V4L2_TUNER_RADIO</constant></entry>
252 <entry>1</entry>
253 <entry></entry>
254 </row>
255 <row>
256 <entry><constant>V4L2_TUNER_ANALOG_TV</constant></entry>
257 <entry>2</entry>
258 <entry></entry>
259 </row>
260 </tbody>
261 </tgroup>
262 </table>
263
264 <table pgwide="1" frame="none" id="tuner-capability">
265 <title>Tuner and Modulator Capability Flags</title>
266 <tgroup cols="3">
267 &cs-def;
268 <tbody valign="top">
269 <row>
270 <entry><constant>V4L2_TUNER_CAP_LOW</constant></entry>
271 <entry>0x0001</entry>
272 <entry>When set, tuning frequencies are expressed in units of
27362.5&nbsp;Hz, otherwise in units of 62.5&nbsp;kHz.</entry>
274 </row>
275 <row>
276 <entry><constant>V4L2_TUNER_CAP_NORM</constant></entry>
277 <entry>0x0002</entry>
278 <entry>This is a multi-standard tuner; the video standard
279can or must be switched. (B/G PAL tuners for example are typically not
280 considered multi-standard because the video standard is automatically
281 determined from the frequency band.) The set of supported video
282 standards is available from the &v4l2-input; pointing to this tuner,
283 see the description of ioctl &VIDIOC-ENUMINPUT; for details. Only
284 <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry>
285 </row>
286 <row>
287 <entry><constant>V4L2_TUNER_CAP_HWSEEK_BOUNDED</constant></entry>
288 <entry>0x0004</entry>
289 <entry>If set, then this tuner supports the hardware seek functionality
290 where the seek stops when it reaches the end of the frequency range.</entry>
291 </row>
292 <row>
293 <entry><constant>V4L2_TUNER_CAP_HWSEEK_WRAP</constant></entry>
294 <entry>0x0008</entry>
295 <entry>If set, then this tuner supports the hardware seek functionality
296 where the seek wraps around when it reaches the end of the frequency range.</entry>
297 </row>
298 <row>
299 <entry><constant>V4L2_TUNER_CAP_STEREO</constant></entry>
300 <entry>0x0010</entry>
301 <entry>Stereo audio reception is supported.</entry>
302 </row>
303 <row>
304 <entry><constant>V4L2_TUNER_CAP_LANG1</constant></entry>
305 <entry>0x0040</entry>
306 <entry>Reception of the primary language of a bilingual
307audio program is supported. Bilingual audio is a feature of
308two-channel systems, transmitting the primary language monaural on the
309main audio carrier and a secondary language monaural on a second
310carrier. Only
311 <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry>
312 </row>
313 <row>
314 <entry><constant>V4L2_TUNER_CAP_LANG2</constant></entry>
315 <entry>0x0020</entry>
316 <entry>Reception of the secondary language of a bilingual
317audio program is supported. Only
318 <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry>
319 </row>
320 <row>
321 <entry><constant>V4L2_TUNER_CAP_SAP</constant></entry>
322 <entry>0x0020</entry>
323 <entry><para>Reception of a secondary audio program is
324supported. This is a feature of the BTSC system which accompanies the
325NTSC video standard. Two audio carriers are available for mono or
326stereo transmissions of a primary language, and an independent third
327carrier for a monaural secondary language. Only
328 <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</para><para>Note the
329<constant>V4L2_TUNER_CAP_LANG2</constant> and
330<constant>V4L2_TUNER_CAP_SAP</constant> flags are synonyms.
331<constant>V4L2_TUNER_CAP_SAP</constant> applies when the tuner
332supports the <constant>V4L2_STD_NTSC_M</constant> video
333standard.</para><!-- FIXME what if PAL+NTSC and Bi but not SAP? --></entry>
334 </row>
335 <row>
336 <entry><constant>V4L2_TUNER_CAP_RDS</constant></entry>
337 <entry>0x0080</entry>
338 <entry>RDS capture is supported. This capability is only valid for
339radio tuners.</entry>
340 </row>
341 <row>
342 <entry><constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant></entry>
343 <entry>0x0100</entry>
344 <entry>The RDS data is passed as unparsed RDS blocks.</entry>
345 </row>
346 <row>
347 <entry><constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant></entry>
348 <entry>0x0200</entry>
349 <entry>The RDS data is parsed by the hardware and set via controls.</entry>
350 </row>
351 <row>
352 <entry><constant>V4L2_TUNER_CAP_FREQ_BANDS</constant></entry>
353 <entry>0x0400</entry>
354 <entry>The &VIDIOC-ENUM-FREQ-BANDS; ioctl can be used to enumerate
355 the available frequency bands.</entry>
356 </row>
357 <row>
358 <entry><constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant></entry>
359 <entry>0x0800</entry>
360 <entry>The range to search when using the hardware seek functionality
361 is programmable, see &VIDIOC-S-HW-FREQ-SEEK; for details.</entry>
362 </row>
363 </tbody>
364 </tgroup>
365 </table>
366
367 <table pgwide="1" frame="none" id="tuner-rxsubchans">
368 <title>Tuner Audio Reception Flags</title>
369 <tgroup cols="3">
370 &cs-def;
371 <tbody valign="top">
372 <row>
373 <entry><constant>V4L2_TUNER_SUB_MONO</constant></entry>
374 <entry>0x0001</entry>
375 <entry>The tuner receives a mono audio signal.</entry>
376 </row>
377 <row>
378 <entry><constant>V4L2_TUNER_SUB_STEREO</constant></entry>
379 <entry>0x0002</entry>
380 <entry>The tuner receives a stereo audio signal.</entry>
381 </row>
382 <row>
383 <entry><constant>V4L2_TUNER_SUB_LANG1</constant></entry>
384 <entry>0x0008</entry>
385 <entry>The tuner receives the primary language of a
386bilingual audio signal. Drivers must clear this flag when the current
387video standard is <constant>V4L2_STD_NTSC_M</constant>.</entry>
388 </row>
389 <row>
390 <entry><constant>V4L2_TUNER_SUB_LANG2</constant></entry>
391 <entry>0x0004</entry>
392 <entry>The tuner receives the secondary language of a
393bilingual audio signal (or a second audio program).</entry>
394 </row>
395 <row>
396 <entry><constant>V4L2_TUNER_SUB_SAP</constant></entry>
397 <entry>0x0004</entry>
398 <entry>The tuner receives a Second Audio Program. Note the
399<constant>V4L2_TUNER_SUB_LANG2</constant> and
400<constant>V4L2_TUNER_SUB_SAP</constant> flags are synonyms. The
401<constant>V4L2_TUNER_SUB_SAP</constant> flag applies when the
402current video standard is <constant>V4L2_STD_NTSC_M</constant>.</entry>
403 </row>
404 <row>
405 <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry>
406 <entry>0x0010</entry>
407 <entry>The tuner receives an RDS channel.</entry>
408 </row>
409 </tbody>
410 </tgroup>
411 </table>
412
413 <table pgwide="1" frame="none" id="tuner-audmode">
414 <title>Tuner Audio Modes</title>
415 <tgroup cols="3">
416 &cs-def;
417 <tbody valign="top">
418 <row>
419 <entry><constant>V4L2_TUNER_MODE_MONO</constant></entry>
420 <entry>0</entry>
421 <entry>Play mono audio. When the tuner receives a stereo
422signal this a down-mix of the left and right channel. When the tuner
423receives a bilingual or SAP signal this mode selects the primary
424language.</entry>
425 </row>
426 <row>
427 <entry><constant>V4L2_TUNER_MODE_STEREO</constant></entry>
428 <entry>1</entry>
429 <entry><para>Play stereo audio. When the tuner receives
430bilingual audio it may play different languages on the left and right
431channel or the primary language is played on both channels.</para><para>Playing
432different languages in this mode is
433deprecated. New drivers should do this only in
434<constant>MODE_LANG1_LANG2</constant>.</para><para>When the tuner
435receives no stereo signal or does not support stereo reception the
436driver shall fall back to <constant>MODE_MONO</constant>.</para></entry>
437 </row>
438 <row>
439 <entry><constant>V4L2_TUNER_MODE_LANG1</constant></entry>
440 <entry>3</entry>
441 <entry>Play the primary language, mono or stereo. Only
442<constant>V4L2_TUNER_ANALOG_TV</constant> tuners support this
443mode.</entry>
444 </row>
445 <row>
446 <entry><constant>V4L2_TUNER_MODE_LANG2</constant></entry>
447 <entry>2</entry>
448 <entry>Play the secondary language, mono. When the tuner
449receives no bilingual audio or SAP, or their reception is not
450supported the driver shall fall back to mono or stereo mode. Only
451<constant>V4L2_TUNER_ANALOG_TV</constant> tuners support this
452mode.</entry>
453 </row>
454 <row>
455 <entry><constant>V4L2_TUNER_MODE_SAP</constant></entry>
456 <entry>2</entry>
457 <entry>Play the Second Audio Program. When the tuner
458receives no bilingual audio or SAP, or their reception is not
459supported the driver shall fall back to mono or stereo mode. Only
460<constant>V4L2_TUNER_ANALOG_TV</constant> tuners support this mode.
461Note the <constant>V4L2_TUNER_MODE_LANG2</constant> and
462<constant>V4L2_TUNER_MODE_SAP</constant> are synonyms.</entry>
463 </row>
464 <row>
465 <entry><constant>V4L2_TUNER_MODE_LANG1_LANG2</constant></entry>
466 <entry>4</entry>
467 <entry>Play the primary language on the left channel, the
468secondary language on the right channel. When the tuner receives no
469bilingual audio or SAP, it shall fall back to
470<constant>MODE_LANG1</constant> or <constant>MODE_MONO</constant>.
471Only <constant>V4L2_TUNER_ANALOG_TV</constant> tuners support this
472mode.</entry>
473 </row>
474 </tbody>
475 </tgroup>
476 </table>
477
478 <table pgwide="1" frame="all" id="tuner-matrix">
479 <title>Tuner Audio Matrix</title>
480 <tgroup cols="6" align="center">
481 <colspec align="left" />
482 <colspec colname="c2" colwidth="1*" />
483 <colspec colwidth="1*" />
484 <colspec colwidth="1*" />
485 <colspec colnum="6" colname="c6" colwidth="1*" />
486 <spanspec namest="c2" nameend="c6" spanname="hspan" align="center" />
487 <thead>
488 <row>
489 <entry></entry>
490 <entry spanname="hspan">Selected
491<constant>V4L2_TUNER_MODE_</constant></entry>
492 </row>
493 <row>
494 <entry>Received <constant>V4L2_TUNER_SUB_</constant></entry>
495 <entry><constant>MONO</constant></entry>
496 <entry><constant>STEREO</constant></entry>
497 <entry><constant>LANG1</constant></entry>
498 <entry><constant>LANG2 = SAP</constant></entry>
499 <entry><constant>LANG1_LANG2</constant><footnote><para>This
500mode has been added in Linux 2.6.17 and may not be supported by older
501drivers.</para></footnote></entry>
502 </row>
503 </thead>
504 <tbody valign="top">
505 <row>
506 <entry><constant>MONO</constant></entry>
507 <entry>Mono</entry>
508 <entry>Mono/Mono</entry>
509 <entry>Mono</entry>
510 <entry>Mono</entry>
511 <entry>Mono/Mono</entry>
512 </row>
513 <row>
514 <entry><constant>MONO | SAP</constant></entry>
515 <entry>Mono</entry>
516 <entry>Mono/Mono</entry>
517 <entry>Mono</entry>
518 <entry>SAP</entry>
519 <entry>Mono/SAP (preferred) or Mono/Mono</entry>
520 </row>
521 <row>
522 <entry><constant>STEREO</constant></entry>
523 <entry>L+R</entry>
524 <entry>L/R</entry>
525 <entry>Stereo L/R (preferred) or Mono L+R</entry>
526 <entry>Stereo L/R (preferred) or Mono L+R</entry>
527 <entry>L/R (preferred) or L+R/L+R</entry>
528 </row>
529 <row>
530 <entry><constant>STEREO | SAP</constant></entry>
531 <entry>L+R</entry>
532 <entry>L/R</entry>
533 <entry>Stereo L/R (preferred) or Mono L+R</entry>
534 <entry>SAP</entry>
535 <entry>L+R/SAP (preferred) or L/R or L+R/L+R</entry>
536 </row>
537 <row>
538 <entry><constant>LANG1 | LANG2</constant></entry>
539 <entry>Language&nbsp;1</entry>
540 <entry>Lang1/Lang2 (deprecated<footnote><para>Playback of
541both languages in <constant>MODE_STEREO</constant> is deprecated. In
542the future drivers should produce only the primary language in this
543mode. Applications should request
544<constant>MODE_LANG1_LANG2</constant> to record both languages or a
545stereo signal.</para></footnote>) or
546Lang1/Lang1</entry>
547 <entry>Language&nbsp;1</entry>
548 <entry>Language&nbsp;2</entry>
549 <entry>Lang1/Lang2 (preferred) or Lang1/Lang1</entry>
550 </row>
551 </tbody>
552 </tgroup>
553 </table>
554 </refsect1>
555
556 <refsect1>
557 &return-value;
558
559 <variablelist>
560 <varlistentry>
561 <term><errorcode>EINVAL</errorcode></term>
562 <listitem>
563 <para>The &v4l2-tuner; <structfield>index</structfield> is
564out of bounds.</para>
565 </listitem>
566 </varlistentry>
567 </variablelist>
568 </refsect1>
569</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-log-status.xml b/Documentation/DocBook/media/v4l/vidioc-log-status.xml
new file mode 100644
index 00000000000..5ded7d35e27
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-log-status.xml
@@ -0,0 +1,41 @@
1<refentry id="vidioc-log-status">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_LOG_STATUS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_LOG_STATUS</refname>
9 <refpurpose>Log driver status information</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 </funcprototype>
19 </funcsynopsis>
20 </refsynopsisdiv>
21
22 <refsect1>
23 <title>Description</title>
24
25 <para>As the video/audio devices become more complicated it
26becomes harder to debug problems. When this ioctl is called the driver
27will output the current device status to the kernel log. This is
28particular useful when dealing with problems like no sound, no video
29and incorrectly tuned channels. Also many modern devices autodetect
30video and audio standards and this ioctl will report what the device
31thinks what the standard is. Mismatches may give an indication where
32the problem is.</para>
33
34 <para>This ioctl is optional and not all drivers support it. It
35was introduced in Linux 2.6.15.</para>
36 </refsect1>
37
38 <refsect1>
39 &return-value;
40 </refsect1>
41</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-overlay.xml b/Documentation/DocBook/media/v4l/vidioc-overlay.xml
new file mode 100644
index 00000000000..250a7de1877
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-overlay.xml
@@ -0,0 +1,74 @@
1<refentry id="vidioc-overlay">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_OVERLAY</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_OVERLAY</refname>
9 <refpurpose>Start or stop video overlay</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>const int *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_OVERLAY</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>This ioctl is part of the <link linkend="overlay">video
52 overlay</link> I/O method. Applications call
53 <constant>VIDIOC_OVERLAY</constant> to start or stop the
54 overlay. It takes a pointer to an integer which must be set to
55 zero by the application to stop overlay, to one to start.</para>
56
57 <para>Drivers do not support &VIDIOC-STREAMON; or
58&VIDIOC-STREAMOFF; with <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>.</para>
59 </refsect1>
60
61 <refsect1>
62 &return-value;
63
64 <variablelist>
65 <varlistentry>
66 <term><errorcode>EINVAL</errorcode></term>
67 <listitem>
68 <para>The overlay parameters have not been set up. See <xref
69linkend="overlay" /> for the necessary steps.</para>
70 </listitem>
71 </varlistentry>
72 </variablelist>
73 </refsect1>
74</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml b/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml
new file mode 100644
index 00000000000..fa7ad7e3322
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml
@@ -0,0 +1,94 @@
1<refentry id="vidioc-prepare-buf">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_PREPARE_BUF</refname>
9 <refpurpose>Prepare a buffer for I/O</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_PREPARE_BUF</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <note>
52 <title>Experimental</title>
53 <para>This is an <link linkend="experimental"> experimental </link>
54 interface and may change in the future.</para>
55 </note>
56
57 <para>Applications can optionally call the
58<constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer
59to the driver before actually enqueuing it, using the
60<constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O.
61Such preparations may include cache invalidation or cleaning. Performing them
62in advance saves time during the actual I/O. In case such cache operations are
63not required, the application can use one of
64<constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and
65<constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective
66step.</para>
67
68 <para>The <structname>v4l2_buffer</structname> structure is
69specified in <xref linkend="buffer" />.</para>
70 </refsect1>
71
72 <refsect1>
73 &return-value;
74
75 <variablelist>
76 <varlistentry>
77 <term><errorcode>EBUSY</errorcode></term>
78 <listitem>
79 <para>File I/O is in progress.</para>
80 </listitem>
81 </varlistentry>
82 <varlistentry>
83 <term><errorcode>EINVAL</errorcode></term>
84 <listitem>
85 <para>The buffer <structfield>type</structfield> is not
86supported, or the <structfield>index</structfield> is out of bounds,
87or no buffers have been allocated yet, or the
88<structfield>userptr</structfield> or
89<structfield>length</structfield> are invalid.</para>
90 </listitem>
91 </varlistentry>
92 </variablelist>
93 </refsect1>
94</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
new file mode 100644
index 00000000000..3504a7f2f38
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
@@ -0,0 +1,192 @@
1<refentry id="vidioc-qbuf">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QBUF</refname>
9 <refname>VIDIOC_DQBUF</refname>
10 <refpurpose>Exchange a buffer with the driver</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_QBUF, VIDIOC_DQBUF</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>Applications call the <constant>VIDIOC_QBUF</constant> ioctl
53to enqueue an empty (capturing) or filled (output) buffer in the
54driver's incoming queue. The semantics depend on the selected I/O
55method.</para>
56
57 <para>To enqueue a buffer applications set the <structfield>type</structfield>
58field of a &v4l2-buffer; to the same buffer type as was previously used
59with &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
60<structfield>type</structfield>. Applications must also set the
61<structfield>index</structfield> field. Valid index numbers range from
62zero to the number of buffers allocated with &VIDIOC-REQBUFS;
63(&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The
64contents of the struct <structname>v4l2_buffer</structname> returned
65by a &VIDIOC-QUERYBUF; ioctl will do as well. When the buffer is
66intended for output (<structfield>type</structfield> is
67<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
68<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, or
69<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also
70initialize the <structfield>bytesused</structfield>,
71<structfield>field</structfield> and
72<structfield>timestamp</structfield> fields, see <xref
73linkend="buffer" /> for details.
74Applications must also set <structfield>flags</structfield> to 0.
75The <structfield>reserved2</structfield> and
76<structfield>reserved</structfield> fields must be set to 0. When using
77the <link linkend="planar-apis">multi-planar API</link>, the
78<structfield>m.planes</structfield> field must contain a userspace pointer
79to a filled-in array of &v4l2-plane; and the <structfield>length</structfield>
80field must be set to the number of elements in that array.
81</para>
82
83 <para>To enqueue a <link linkend="mmap">memory mapped</link>
84buffer applications set the <structfield>memory</structfield>
85field to <constant>V4L2_MEMORY_MMAP</constant>. When
86<constant>VIDIOC_QBUF</constant> is called with a pointer to this
87structure the driver sets the
88<constant>V4L2_BUF_FLAG_MAPPED</constant> and
89<constant>V4L2_BUF_FLAG_QUEUED</constant> flags and clears the
90<constant>V4L2_BUF_FLAG_DONE</constant> flag in the
91<structfield>flags</structfield> field, or it returns an
92&EINVAL;.</para>
93
94 <para>To enqueue a <link linkend="userp">user pointer</link>
95buffer applications set the <structfield>memory</structfield>
96field to <constant>V4L2_MEMORY_USERPTR</constant>, the
97<structfield>m.userptr</structfield> field to the address of the
98buffer and <structfield>length</structfield> to its size. When the multi-planar
99API is used, <structfield>m.userptr</structfield> and
100<structfield>length</structfield> members of the passed array of &v4l2-plane;
101have to be used instead. When <constant>VIDIOC_QBUF</constant> is called with
102a pointer to this structure the driver sets the
103<constant>V4L2_BUF_FLAG_QUEUED</constant> flag and clears the
104<constant>V4L2_BUF_FLAG_MAPPED</constant> and
105<constant>V4L2_BUF_FLAG_DONE</constant> flags in the
106<structfield>flags</structfield> field, or it returns an error code.
107This ioctl locks the memory pages of the buffer in physical memory,
108they cannot be swapped out to disk. Buffers remain locked until
109dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl is
110called, or until the device is closed.</para>
111
112 <para>To enqueue a <link linkend="dmabuf">DMABUF</link> buffer applications
113set the <structfield>memory</structfield> field to
114<constant>V4L2_MEMORY_DMABUF</constant> and the <structfield>m.fd</structfield>
115field to a file descriptor associated with a DMABUF buffer. When the
116multi-planar API is used the <structfield>m.fd</structfield> fields of the
117passed array of &v4l2-plane; have to be used instead. When
118<constant>VIDIOC_QBUF</constant> is called with a pointer to this structure the
119driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> flag and clears the
120<constant>V4L2_BUF_FLAG_MAPPED</constant> and
121<constant>V4L2_BUF_FLAG_DONE</constant> flags in the
122<structfield>flags</structfield> field, or it returns an error code. This
123ioctl locks the buffer. Locking a buffer means passing it to a driver for a
124hardware access (usually DMA). If an application accesses (reads/writes) a
125locked buffer then the result is undefined. Buffers remain locked until
126dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl is called, or
127until the device is closed.</para>
128
129 <para>Applications call the <constant>VIDIOC_DQBUF</constant>
130ioctl to dequeue a filled (capturing) or displayed (output) buffer
131from the driver's outgoing queue. They just set the
132<structfield>type</structfield>, <structfield>memory</structfield>
133and <structfield>reserved</structfield>
134fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant>
135is called with a pointer to this structure the driver fills the
136remaining fields or returns an error code. The driver may also set
137<constant>V4L2_BUF_FLAG_ERROR</constant> in the <structfield>flags</structfield>
138field. It indicates a non-critical (recoverable) streaming error. In such case
139the application may continue as normal, but should be aware that data in the
140dequeued buffer might be corrupted. When using the multi-planar API, the
141planes array must be passed in as well.</para>
142
143 <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no
144buffer is in the outgoing queue. When the
145<constant>O_NONBLOCK</constant> flag was given to the &func-open;
146function, <constant>VIDIOC_DQBUF</constant> returns immediately
147with an &EAGAIN; when no buffer is available.</para>
148
149 <para>The <structname>v4l2_buffer</structname> structure is
150specified in <xref linkend="buffer" />.</para>
151 </refsect1>
152
153 <refsect1>
154 &return-value;
155
156 <variablelist>
157 <varlistentry>
158 <term><errorcode>EAGAIN</errorcode></term>
159 <listitem>
160 <para>Non-blocking I/O has been selected using
161<constant>O_NONBLOCK</constant> and no buffer was in the outgoing
162queue.</para>
163 </listitem>
164 </varlistentry>
165 <varlistentry>
166 <term><errorcode>EINVAL</errorcode></term>
167 <listitem>
168 <para>The buffer <structfield>type</structfield> is not
169supported, or the <structfield>index</structfield> is out of bounds,
170or no buffers have been allocated yet, or the
171<structfield>userptr</structfield> or
172<structfield>length</structfield> are invalid.</para>
173 </listitem>
174 </varlistentry>
175 <varlistentry>
176 <term><errorcode>EIO</errorcode></term>
177 <listitem>
178 <para><constant>VIDIOC_DQBUF</constant> failed due to an
179internal error. Can also indicate temporary problems like signal
180loss. Note the driver might dequeue an (empty) buffer despite
181returning an error, or even stop capturing. Reusing such buffer may be unsafe
182though and its details (e.g. <structfield>index</structfield>) may not be
183returned either. It is recommended that drivers indicate recoverable errors
184by setting the <constant>V4L2_BUF_FLAG_ERROR</constant> and returning 0 instead.
185In that case the application should be able to safely reuse the buffer and
186continue streaming.
187 </para>
188 </listitem>
189 </varlistentry>
190 </variablelist>
191 </refsect1>
192</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
new file mode 100644
index 00000000000..68b49d09e24
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
@@ -0,0 +1,78 @@
1<refentry id="vidioc-query-dv-preset">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERY_DV_PRESET</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERY_DV_PRESET</refname>
9 <refpurpose>Sense the DV preset received by the current
10input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_QUERY_DV_PRESET</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>This ioctl is <emphasis role="bold">deprecated</emphasis>.
53 New drivers and applications should use &VIDIOC-QUERY-DV-TIMINGS; instead.
54 </para>
55
56 <para>The hardware may be able to detect the current DV preset
57automatically, similar to sensing the video standard. To do so, applications
58call <constant> VIDIOC_QUERY_DV_PRESET</constant> with a pointer to a
59&v4l2-dv-preset; type. Once the hardware detects a preset, that preset is
60returned in the preset field of &v4l2-dv-preset;. If the preset could not be
61detected because there was no signal, or the signal was unreliable, or the
62signal did not map to a supported preset, then the value V4L2_DV_INVALID is
63returned.</para>
64 </refsect1>
65
66 <refsect1>
67 &return-value;
68
69 <variablelist>
70 <varlistentry>
71 <term><errorcode>ENODATA</errorcode></term>
72 <listitem>
73 <para>Digital video presets are not supported for this input or output.</para>
74 </listitem>
75 </varlistentry>
76 </variablelist>
77 </refsect1>
78</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml
new file mode 100644
index 00000000000..e185f149e0a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml
@@ -0,0 +1,110 @@
1<refentry id="vidioc-query-dv-timings">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERY_DV_TIMINGS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERY_DV_TIMINGS</refname>
9 <refpurpose>Sense the DV preset received by the current
10input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_QUERY_DV_TIMINGS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental"> experimental </link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>The hardware may be able to detect the current DV timings
59automatically, similar to sensing the video standard. To do so, applications
60call <constant>VIDIOC_QUERY_DV_TIMINGS</constant> with a pointer to a
61&v4l2-dv-timings;. Once the hardware detects the timings, it will fill in the
62timings structure.
63
64If the timings could not be detected because there was no signal, then
65<errorcode>ENOLINK</errorcode> is returned. If a signal was detected, but
66it was unstable and the receiver could not lock to the signal, then
67<errorcode>ENOLCK</errorcode> is returned. If the receiver could lock to the signal,
68but the format is unsupported (e.g. because the pixelclock is out of range
69of the hardware capabilities), then the driver fills in whatever timings it
70could find and returns <errorcode>ERANGE</errorcode>. In that case the application
71can call &VIDIOC-DV-TIMINGS-CAP; to compare the found timings with the hardware's
72capabilities in order to give more precise feedback to the user.
73</para>
74 </refsect1>
75
76 <refsect1>
77 &return-value;
78
79 <variablelist>
80 <varlistentry>
81 <term><errorcode>ENODATA</errorcode></term>
82 <listitem>
83 <para>Digital video timings are not supported for this input or output.</para>
84 </listitem>
85 </varlistentry>
86 <varlistentry>
87 <term><errorcode>ENOLINK</errorcode></term>
88 <listitem>
89 <para>No timings could be detected because no signal was found.
90</para>
91 </listitem>
92 </varlistentry>
93 <varlistentry>
94 <term><errorcode>ENOLCK</errorcode></term>
95 <listitem>
96 <para>The signal was unstable and the hardware could not lock on to it.
97</para>
98 </listitem>
99 </varlistentry>
100 <varlistentry>
101 <term><errorcode>ERANGE</errorcode></term>
102 <listitem>
103 <para>Timings were found, but they are out of range of the hardware
104capabilities.
105</para>
106 </listitem>
107 </varlistentry>
108 </variablelist>
109 </refsect1>
110</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml
new file mode 100644
index 00000000000..a597155c052
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml
@@ -0,0 +1,105 @@
1<refentry id="vidioc-querybuf">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERYBUF</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERYBUF</refname>
9 <refpurpose>Query the status of a buffer</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_QUERYBUF</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>This ioctl is part of the <link linkend="mmap">streaming
52</link> I/O method. It can be used to query the status of a
53buffer at any time after buffers have been allocated with the
54&VIDIOC-REQBUFS; ioctl.</para>
55
56 <para>Applications set the <structfield>type</structfield> field
57 of a &v4l2-buffer; to the same buffer type as was previously used with
58&v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
59<structfield>type</structfield>, and the <structfield>index</structfield>
60 field. Valid index numbers range from zero
61to the number of buffers allocated with &VIDIOC-REQBUFS;
62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
63The <structfield>reserved</structfield> field should to set to 0.
64When using the <link linkend="planar-apis">multi-planar API</link>, the
65<structfield>m.planes</structfield> field must contain a userspace pointer to an
66array of &v4l2-plane; and the <structfield>length</structfield> field has
67to be set to the number of elements in that array.
68After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
69 this structure drivers return an error code or fill the rest of
70the structure.</para>
71
72 <para>In the <structfield>flags</structfield> field the
73<constant>V4L2_BUF_FLAG_MAPPED</constant>,
74<constant>V4L2_BUF_FLAG_PREPARED</constant>,
75<constant>V4L2_BUF_FLAG_QUEUED</constant> and
76<constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
77<structfield>memory</structfield> field will be set to the current
78I/O method. For the single-planar API, the <structfield>m.offset</structfield>
79contains the offset of the buffer from the start of the device memory,
80the <structfield>length</structfield> field its size. For the multi-planar API,
81fields <structfield>m.mem_offset</structfield> and
82<structfield>length</structfield> in the <structfield>m.planes</structfield>
83array elements will be used instead and the <structfield>length</structfield>
84field of &v4l2-buffer; is set to the number of filled-in array elements.
85The driver may or may not set the remaining fields and flags, they are
86meaningless in this context.</para>
87
88 <para>The <structname>v4l2_buffer</structname> structure is
89 specified in <xref linkend="buffer" />.</para>
90 </refsect1>
91
92 <refsect1>
93 &return-value;
94
95 <variablelist>
96 <varlistentry>
97 <term><errorcode>EINVAL</errorcode></term>
98 <listitem>
99 <para>The buffer <structfield>type</structfield> is not
100supported, or the <structfield>index</structfield> is out of bounds.</para>
101 </listitem>
102 </varlistentry>
103 </variablelist>
104 </refsect1>
105</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
new file mode 100644
index 00000000000..4c70215ae03
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
@@ -0,0 +1,332 @@
1<refentry id="vidioc-querycap">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERYCAP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERYCAP</refname>
9 <refpurpose>Query device capabilities</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_capability *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_QUERYCAP</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>All V4L2 devices support the
52<constant>VIDIOC_QUERYCAP</constant> ioctl. It is used to identify
53kernel devices compatible with this specification and to obtain
54information about driver and hardware capabilities. The ioctl takes a
55pointer to a &v4l2-capability; which is filled by the driver. When the
56driver is not compatible with this specification the ioctl returns an
57&EINVAL;.</para>
58
59 <table pgwide="1" frame="none" id="v4l2-capability">
60 <title>struct <structname>v4l2_capability</structname></title>
61 <tgroup cols="3">
62 &cs-str;
63 <tbody valign="top">
64 <row>
65 <entry>__u8</entry>
66 <entry><structfield>driver</structfield>[16]</entry>
67 <entry><para>Name of the driver, a unique NUL-terminated
68ASCII string. For example: "bttv". Driver specific applications can
69use this information to verify the driver identity. It is also useful
70to work around known bugs, or to identify drivers in error reports.</para>
71<para>Storing strings in fixed sized arrays is bad
72practice but unavoidable here. Drivers and applications should take
73precautions to never read or write beyond the end of the array and to
74make sure the strings are properly NUL-terminated.</para></entry>
75 </row>
76 <row>
77 <entry>__u8</entry>
78 <entry><structfield>card</structfield>[32]</entry>
79 <entry>Name of the device, a NUL-terminated ASCII string.
80For example: "Yoyodyne TV/FM". One driver may support different brands
81or models of video hardware. This information is intended for users,
82for example in a menu of available devices. Since multiple TV cards of
83the same brand may be installed which are supported by the same
84driver, this name should be combined with the character device file
85name (&eg; <filename>/dev/video2</filename>) or the
86<structfield>bus_info</structfield> string to avoid
87ambiguities.</entry>
88 </row>
89 <row>
90 <entry>__u8</entry>
91 <entry><structfield>bus_info</structfield>[32]</entry>
92 <entry>Location of the device in the system, a
93NUL-terminated ASCII string. For example: "PCI:0000:05:06.0". This
94information is intended for users, to distinguish multiple
95identical devices. If no such information is available the field must
96simply count the devices controlled by the driver ("platform:vivi-000").
97The bus_info must start with "PCI:" for PCI boards, "PCIe:" for PCI Express boards,
98"usb-" for USB devices, "I2C:" for i2c devices, "ISA:" for ISA devices,
99"parport" for parallel port devices and "platform:" for platform devices.</entry>
100 </row>
101 <row>
102 <entry>__u32</entry>
103 <entry><structfield>version</structfield></entry>
104 <entry><para>Version number of the driver.</para>
105<para>Starting on kernel 3.1, the version reported is provided per
106V4L2 subsystem, following the same Kernel numberation scheme. However, it
107should not always return the same version as the kernel, if, for example,
108an stable or distribution-modified kernel uses the V4L2 stack from a
109newer kernel.</para>
110<para>The version number is formatted using the
111<constant>KERNEL_VERSION()</constant> macro:</para></entry>
112 </row>
113 <row>
114 <entry spanname="hspan"><para>
115<programlisting>
116#define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
117
118__u32 version = KERNEL_VERSION(0, 8, 1);
119
120printf ("Version: %u.%u.%u\n",
121 (version &gt;&gt; 16) &amp; 0xFF,
122 (version &gt;&gt; 8) &amp; 0xFF,
123 version &amp; 0xFF);
124</programlisting></para></entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>capabilities</structfield></entry>
129 <entry>Available capabilities of the physical device as a whole, see <xref
130 linkend="device-capabilities" />. The same physical device can export
131 multiple devices in /dev (e.g. /dev/videoX, /dev/vbiY and /dev/radioZ).
132 The <structfield>capabilities</structfield> field should contain a union
133 of all capabilities available around the several V4L2 devices exported
134 to userspace.
135 For all those devices the <structfield>capabilities</structfield> field
136 returns the same set of capabilities. This allows applications to open
137 just one of the devices (typically the video device) and discover whether
138 video, vbi and/or radio are also supported.
139 </entry>
140 </row>
141 <row>
142 <entry>__u32</entry>
143 <entry><structfield>device_caps</structfield></entry>
144 <entry>Device capabilities of the opened device, see <xref
145 linkend="device-capabilities" />. Should contain the available capabilities
146 of that specific device node. So, for example, <structfield>device_caps</structfield>
147 of a radio device will only contain radio related capabilities and
148 no video or vbi capabilities. This field is only set if the <structfield>capabilities</structfield>
149 field contains the <constant>V4L2_CAP_DEVICE_CAPS</constant> capability.
150 Only the <structfield>capabilities</structfield> field can have the
151 <constant>V4L2_CAP_DEVICE_CAPS</constant> capability, <structfield>device_caps</structfield>
152 will never set <constant>V4L2_CAP_DEVICE_CAPS</constant>.
153 </entry>
154 </row>
155 <row>
156 <entry>__u32</entry>
157 <entry><structfield>reserved</structfield>[3]</entry>
158 <entry>Reserved for future extensions. Drivers must set
159this array to zero.</entry>
160 </row>
161 </tbody>
162 </tgroup>
163 </table>
164
165 <table pgwide="1" frame="none" id="device-capabilities">
166 <title>Device Capabilities Flags</title>
167 <tgroup cols="3">
168 &cs-def;
169 <tbody valign="top">
170 <row>
171 <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
172 <entry>0x00000001</entry>
173 <entry>The device supports the single-planar API through the <link
174linkend="capture">Video Capture</link> interface.</entry>
175 </row>
176 <row>
177 <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
178 <entry>0x00001000</entry>
179 <entry>The device supports the
180 <link linkend="planar-apis">multi-planar API</link> through the
181 <link linkend="capture">Video Capture</link> interface.</entry>
182 </row>
183 <row>
184 <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
185 <entry>0x00000002</entry>
186 <entry>The device supports the single-planar API through the <link
187linkend="output">Video Output</link> interface.</entry>
188 </row>
189 <row>
190 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
191 <entry>0x00002000</entry>
192 <entry>The device supports the
193 <link linkend="planar-apis">multi-planar API</link> through the
194 <link linkend="output">Video Output</link> interface.</entry>
195 </row>
196 <row>
197 <entry><constant>V4L2_CAP_VIDEO_M2M</constant></entry>
198 <entry>0x00004000</entry>
199 <entry>The device supports the single-planar API through the
200 Video Memory-To-Memory interface.</entry>
201 </row>
202 <row>
203 <entry><constant>V4L2_CAP_VIDEO_M2M_MPLANE</constant></entry>
204 <entry>0x00008000</entry>
205 <entry>The device supports the
206 <link linkend="planar-apis">multi-planar API</link> through the
207 Video Memory-To-Memory interface.</entry>
208 </row>
209 <row>
210 <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
211 <entry>0x00000004</entry>
212 <entry>The device supports the <link
213linkend="overlay">Video Overlay</link> interface. A video overlay device
214typically stores captured images directly in the video memory of a
215graphics card, with hardware clipping and scaling.</entry>
216 </row>
217 <row>
218 <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
219 <entry>0x00000010</entry>
220 <entry>The device supports the <link linkend="raw-vbi">Raw
221VBI Capture</link> interface, providing Teletext and Closed Caption
222data.</entry>
223 </row>
224 <row>
225 <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
226 <entry>0x00000020</entry>
227 <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
228 </row>
229 <row>
230 <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
231 <entry>0x00000040</entry>
232 <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
233 </row>
234 <row>
235 <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
236 <entry>0x00000080</entry>
237 <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
238 </row>
239 <row>
240 <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
241 <entry>0x00000100</entry>
242 <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
243 </row>
244 <row>
245 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
246 <entry>0x00000200</entry>
247 <entry>The device supports the <link linkend="osd">Video
248Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
249Overlay</wordasword> interface, this is a secondary function of video
250output devices and overlays an image onto an outgoing video signal.
251When the driver sets this flag, it must clear the
252<constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
253versa.<footnote><para>The &v4l2-framebuffer; lacks an
254&v4l2-buf-type; field, therefore the type of overlay is implied by the
255driver capabilities.</para></footnote></entry>
256 </row>
257 <row>
258 <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
259 <entry>0x00000400</entry>
260 <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
261hardware frequency seeking.</entry>
262 </row>
263 <row>
264 <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
265 <entry>0x00000800</entry>
266 <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
267 </row>
268 <row>
269 <entry><constant>V4L2_CAP_TUNER</constant></entry>
270 <entry>0x00010000</entry>
271 <entry>The device has some sort of tuner to
272receive RF-modulated video signals. For more information about
273tuner programming see
274<xref linkend="tuner" />.</entry>
275 </row>
276 <row>
277 <entry><constant>V4L2_CAP_AUDIO</constant></entry>
278 <entry>0x00020000</entry>
279 <entry>The device has audio inputs or outputs. It may or
280may not support audio recording or playback, in PCM or compressed
281formats. PCM audio support must be implemented as ALSA or OSS
282interface. For more information on audio inputs and outputs see <xref
283 linkend="audio" />.</entry>
284 </row>
285 <row>
286 <entry><constant>V4L2_CAP_RADIO</constant></entry>
287 <entry>0x00040000</entry>
288 <entry>This is a radio receiver.</entry>
289 </row>
290 <row>
291 <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
292 <entry>0x00080000</entry>
293 <entry>The device has some sort of modulator to
294emit RF-modulated video/audio signals. For more information about
295modulator programming see
296<xref linkend="tuner" />.</entry>
297 </row>
298 <row>
299 <entry><constant>V4L2_CAP_READWRITE</constant></entry>
300 <entry>0x01000000</entry>
301 <entry>The device supports the <link
302linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
303I/O methods.</entry>
304 </row>
305 <row>
306 <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
307 <entry>0x02000000</entry>
308 <entry>The device supports the <link
309linkend="async">asynchronous</link> I/O methods.</entry>
310 </row>
311 <row>
312 <entry><constant>V4L2_CAP_STREAMING</constant></entry>
313 <entry>0x04000000</entry>
314 <entry>The device supports the <link
315linkend="mmap">streaming</link> I/O method.</entry>
316 </row>
317 <row>
318 <entry><constant>V4L2_CAP_DEVICE_CAPS</constant></entry>
319 <entry>0x80000000</entry>
320 <entry>The driver fills the <structfield>device_caps</structfield>
321 field. This capability can only appear in the <structfield>capabilities</structfield>
322 field and never in the <structfield>device_caps</structfield> field.</entry>
323 </row>
324 </tbody>
325 </tgroup>
326 </table>
327 </refsect1>
328
329 <refsect1>
330 &return-value;
331 </refsect1>
332</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
new file mode 100644
index 00000000000..e6645b99655
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
@@ -0,0 +1,480 @@
1<refentry id="vidioc-queryctrl">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERYCTRL</refname>
9 <refname>VIDIOC_QUERYMENU</refname>
10 <refpurpose>Enumerate controls and menu control items</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_queryctrl *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>struct v4l2_querymenu *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>To query the attributes of a control applications set the
61<structfield>id</structfield> field of a &v4l2-queryctrl; and call the
62<constant>VIDIOC_QUERYCTRL</constant> ioctl with a pointer to this
63structure. The driver fills the rest of the structure or returns an
64&EINVAL; when the <structfield>id</structfield> is invalid.</para>
65
66 <para>It is possible to enumerate controls by calling
67<constant>VIDIOC_QUERYCTRL</constant> with successive
68<structfield>id</structfield> values starting from
69<constant>V4L2_CID_BASE</constant> up to and exclusive
70<constant>V4L2_CID_BASE_LASTP1</constant>. Drivers may return
71<errorcode>EINVAL</errorcode> if a control in this range is not
72supported. Further applications can enumerate private controls, which
73are not defined in this specification, by starting at
74<constant>V4L2_CID_PRIVATE_BASE</constant> and incrementing
75<structfield>id</structfield> until the driver returns
76<errorcode>EINVAL</errorcode>.</para>
77
78 <para>In both cases, when the driver sets the
79<constant>V4L2_CTRL_FLAG_DISABLED</constant> flag in the
80<structfield>flags</structfield> field this control is permanently
81disabled and should be ignored by the application.<footnote>
82 <para><constant>V4L2_CTRL_FLAG_DISABLED</constant> was
83intended for two purposes: Drivers can skip predefined controls not
84supported by the hardware (although returning EINVAL would do as
85well), or disable predefined and private controls after hardware
86detection without the trouble of reordering control arrays and indices
87(EINVAL cannot be used to skip private controls because it would
88prematurely end the enumeration).</para></footnote></para>
89
90 <para>When the application ORs <structfield>id</structfield> with
91<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver returns the
92next supported control, or <errorcode>EINVAL</errorcode> if there is
93none. Drivers which do not support this flag yet always return
94<errorcode>EINVAL</errorcode>.</para>
95
96 <para>Additional information is required for menu controls: the
97names of the menu items. To query them applications set the
98<structfield>id</structfield> and <structfield>index</structfield>
99fields of &v4l2-querymenu; and call the
100<constant>VIDIOC_QUERYMENU</constant> ioctl with a pointer to this
101structure. The driver fills the rest of the structure or returns an
102&EINVAL; when the <structfield>id</structfield> or
103<structfield>index</structfield> is invalid. Menu items are enumerated
104by calling <constant>VIDIOC_QUERYMENU</constant> with successive
105<structfield>index</structfield> values from &v4l2-queryctrl;
106<structfield>minimum</structfield> to
107<structfield>maximum</structfield>, inclusive. Note that it is possible
108for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some
109indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>.
110In that case that particular menu item is not supported by this driver. Also note that
111the <structfield>minimum</structfield> value is not necessarily 0.</para>
112
113 <para>See also the examples in <xref linkend="control" />.</para>
114
115 <table pgwide="1" frame="none" id="v4l2-queryctrl">
116 <title>struct <structname>v4l2_queryctrl</structname></title>
117 <tgroup cols="3">
118 &cs-str;
119 <tbody valign="top">
120 <row>
121 <entry>__u32</entry>
122 <entry><structfield>id</structfield></entry>
123 <entry>Identifies the control, set by the application. See
124<xref linkend="control-id" /> for predefined IDs. When the ID is ORed
125with V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and returns
126the first control with a higher ID. Drivers which do not support this
127flag yet always return an &EINVAL;.</entry>
128 </row>
129 <row>
130 <entry>__u32</entry>
131 <entry><structfield>type</structfield></entry>
132 <entry>Type of control, see <xref
133 linkend="v4l2-ctrl-type" />.</entry>
134 </row>
135 <row>
136 <entry>__u8</entry>
137 <entry><structfield>name</structfield>[32]</entry>
138 <entry>Name of the control, a NUL-terminated ASCII
139string. This information is intended for the user.</entry>
140 </row>
141 <row>
142 <entry>__s32</entry>
143 <entry><structfield>minimum</structfield></entry>
144 <entry>Minimum value, inclusive. This field gives a lower
145bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the
146lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls.
147For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value
148gives the minimum length of the string. This length <emphasis>does not include the terminating
149zero</emphasis>. It may not be valid for any other type of control, including
150<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
151signed value.</entry>
152 </row>
153 <row>
154 <entry>__s32</entry>
155 <entry><structfield>maximum</structfield></entry>
156 <entry>Maximum value, inclusive. This field gives an upper
157bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the
158highest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant>
159controls. For <constant>V4L2_CTRL_TYPE_BITMASK</constant> controls it is the
160set of usable bits.
161For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the maximum value
162gives the maximum length of the string. This length <emphasis>does not include the terminating
163zero</emphasis>. It may not be valid for any other type of control, including
164<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
165signed value.</entry>
166 </row>
167 <row>
168 <entry>__s32</entry>
169 <entry><structfield>step</structfield></entry>
170 <entry><para>This field gives a step size for
171<constant>V4L2_CTRL_TYPE_INTEGER</constant> controls. For
172<constant>V4L2_CTRL_TYPE_STRING</constant> controls this field refers to
173the string length that has to be a multiple of this step size.
174It may not be valid for any other type of control, including
175<constant>V4L2_CTRL_TYPE_INTEGER64</constant>
176controls.</para><para>Generally drivers should not scale hardware
177control values. It may be necessary for example when the
178<structfield>name</structfield> or <structfield>id</structfield> imply
179a particular unit and the hardware actually accepts only multiples of
180said unit. If so, drivers must take care values are properly rounded
181when scaling, such that errors will not accumulate on repeated
182read-write cycles.</para><para>This field gives the smallest change of
183an integer control actually affecting hardware. Often the information
184is needed when the user can change controls by keyboard or GUI
185buttons, rather than a slider. When for example a hardware register
186accepts values 0-511 and the driver reports 0-65535, step should be
187128.</para><para>Note that although signed, the step value is supposed to
188be always positive.</para></entry>
189 </row>
190 <row>
191 <entry>__s32</entry>
192 <entry><structfield>default_value</structfield></entry>
193 <entry>The default value of a
194<constant>V4L2_CTRL_TYPE_INTEGER</constant>,
195<constant>_BOOLEAN</constant> or <constant>_MENU</constant> control.
196Not valid for other types of controls. Drivers reset controls only
197when the driver is loaded, not later, in particular not when the
198func-open; is called.</entry>
199 </row>
200 <row>
201 <entry>__u32</entry>
202 <entry><structfield>flags</structfield></entry>
203 <entry>Control flags, see <xref
204 linkend="control-flags" />.</entry>
205 </row>
206 <row>
207 <entry>__u32</entry>
208 <entry><structfield>reserved</structfield>[2]</entry>
209 <entry>Reserved for future extensions. Drivers must set
210the array to zero.</entry>
211 </row>
212 </tbody>
213 </tgroup>
214 </table>
215
216 <table pgwide="1" frame="none" id="v4l2-querymenu">
217 <title>struct <structname>v4l2_querymenu</structname></title>
218 <tgroup cols="4">
219 &cs-str;
220 <tbody valign="top">
221 <row>
222 <entry>__u32</entry>
223 <entry></entry>
224 <entry><structfield>id</structfield></entry>
225 <entry>Identifies the control, set by the application
226from the respective &v4l2-queryctrl;
227<structfield>id</structfield>.</entry>
228 </row>
229 <row>
230 <entry>__u32</entry>
231 <entry></entry>
232 <entry><structfield>index</structfield></entry>
233 <entry>Index of the menu item, starting at zero, set by
234 the application.</entry>
235 </row>
236 <row>
237 <entry>union</entry>
238 <entry></entry>
239 <entry></entry>
240 <entry></entry>
241 </row>
242 <row>
243 <entry></entry>
244 <entry>__u8</entry>
245 <entry><structfield>name</structfield>[32]</entry>
246 <entry>Name of the menu item, a NUL-terminated ASCII
247string. This information is intended for the user. This field is valid
248for <constant>V4L2_CTRL_FLAG_MENU</constant> type controls.</entry>
249 </row>
250 <row>
251 <entry></entry>
252 <entry>__s64</entry>
253 <entry><structfield>value</structfield></entry>
254 <entry>
255 Value of the integer menu item. This field is valid for
256 <constant>V4L2_CTRL_FLAG_INTEGER_MENU</constant> type
257 controls.
258 </entry>
259 </row>
260 <row>
261 <entry>__u32</entry>
262 <entry></entry>
263 <entry><structfield>reserved</structfield></entry>
264 <entry>Reserved for future extensions. Drivers must set
265the array to zero.</entry>
266 </row>
267 </tbody>
268 </tgroup>
269 </table>
270
271 <table pgwide="1" frame="none" id="v4l2-ctrl-type">
272 <title>enum v4l2_ctrl_type</title>
273 <tgroup cols="5" align="left">
274 <colspec colwidth="30*" />
275 <colspec colwidth="5*" align="center" />
276 <colspec colwidth="5*" align="center" />
277 <colspec colwidth="5*" align="center" />
278 <colspec colwidth="55*" />
279 <thead>
280 <row>
281 <entry>Type</entry>
282 <entry><structfield>minimum</structfield></entry>
283 <entry><structfield>step</structfield></entry>
284 <entry><structfield>maximum</structfield></entry>
285 <entry>Description</entry>
286 </row>
287 </thead>
288 <tbody valign="top">
289 <row>
290 <entry><constant>V4L2_CTRL_TYPE_INTEGER</constant></entry>
291 <entry>any</entry>
292 <entry>any</entry>
293 <entry>any</entry>
294 <entry>An integer-valued control ranging from minimum to
295maximum inclusive. The step value indicates the increment between
296values which are actually different on the hardware.</entry>
297 </row>
298 <row>
299 <entry><constant>V4L2_CTRL_TYPE_BOOLEAN</constant></entry>
300 <entry>0</entry>
301 <entry>1</entry>
302 <entry>1</entry>
303 <entry>A boolean-valued control. Zero corresponds to
304"disabled", and one means "enabled".</entry>
305 </row>
306 <row>
307 <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry>
308 <entry>&ge; 0</entry>
309 <entry>1</entry>
310 <entry>N-1</entry>
311 <entry>The control has a menu of N choices. The names of
312the menu items can be enumerated with the
313<constant>VIDIOC_QUERYMENU</constant> ioctl.</entry>
314 </row>
315 <row>
316 <entry><constant>V4L2_CTRL_TYPE_INTEGER_MENU</constant></entry>
317 <entry>&ge; 0</entry>
318 <entry>1</entry>
319 <entry>N-1</entry>
320 <entry>
321 The control has a menu of N choices. The values of the
322 menu items can be enumerated with the
323 <constant>VIDIOC_QUERYMENU</constant> ioctl. This is
324 similar to <constant>V4L2_CTRL_TYPE_MENU</constant>
325 except that instead of strings, the menu items are
326 signed 64-bit integers.
327 </entry>
328 </row>
329 <row>
330 <entry><constant>V4L2_CTRL_TYPE_BITMASK</constant></entry>
331 <entry>0</entry>
332 <entry>n/a</entry>
333 <entry>any</entry>
334 <entry>A bitmask field. The maximum value is the set of bits that can
335be used, all other bits are to be 0. The maximum value is interpreted as a __u32,
336allowing the use of bit 31 in the bitmask.</entry>
337 </row>
338 <row>
339 <entry><constant>V4L2_CTRL_TYPE_BUTTON</constant></entry>
340 <entry>0</entry>
341 <entry>0</entry>
342 <entry>0</entry>
343 <entry>A control which performs an action when set.
344Drivers must ignore the value passed with
345<constant>VIDIOC_S_CTRL</constant> and return an &EINVAL; on a
346<constant>VIDIOC_G_CTRL</constant> attempt.</entry>
347 </row>
348 <row>
349 <entry><constant>V4L2_CTRL_TYPE_INTEGER64</constant></entry>
350 <entry>n/a</entry>
351 <entry>n/a</entry>
352 <entry>n/a</entry>
353 <entry>A 64-bit integer valued control. Minimum, maximum
354and step size cannot be queried.</entry>
355 </row>
356 <row>
357 <entry><constant>V4L2_CTRL_TYPE_STRING</constant></entry>
358 <entry>&ge; 0</entry>
359 <entry>&ge; 1</entry>
360 <entry>&ge; 0</entry>
361 <entry>The minimum and maximum string lengths. The step size
362means that the string must be (minimum + N * step) characters long for
363N &ge; 0. These lengths do not include the terminating zero, so in order to
364pass a string of length 8 to &VIDIOC-S-EXT-CTRLS; you need to set the
365<structfield>size</structfield> field of &v4l2-ext-control; to 9. For &VIDIOC-G-EXT-CTRLS; you can
366set the <structfield>size</structfield> field to <structfield>maximum</structfield> + 1.
367Which character encoding is used will depend on the string control itself and
368should be part of the control documentation.</entry>
369 </row>
370 <row>
371 <entry><constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant></entry>
372 <entry>n/a</entry>
373 <entry>n/a</entry>
374 <entry>n/a</entry>
375 <entry>This is not a control. When
376<constant>VIDIOC_QUERYCTRL</constant> is called with a control ID
377equal to a control class code (see <xref linkend="ctrl-class" />) + 1, the
378ioctl returns the name of the control class and this control type.
379Older drivers which do not support this feature return an
380&EINVAL;.</entry>
381 </row>
382 </tbody>
383 </tgroup>
384 </table>
385
386 <table pgwide="1" frame="none" id="control-flags">
387 <title>Control Flags</title>
388 <tgroup cols="3">
389 &cs-def;
390 <tbody valign="top">
391 <row>
392 <entry><constant>V4L2_CTRL_FLAG_DISABLED</constant></entry>
393 <entry>0x0001</entry>
394 <entry>This control is permanently disabled and should be
395ignored by the application. Any attempt to change the control will
396result in an &EINVAL;.</entry>
397 </row>
398 <row>
399 <entry><constant>V4L2_CTRL_FLAG_GRABBED</constant></entry>
400 <entry>0x0002</entry>
401 <entry>This control is temporarily unchangeable, for
402example because another application took over control of the
403respective resource. Such controls may be displayed specially in a
404user interface. Attempts to change the control may result in an
405&EBUSY;.</entry>
406 </row>
407 <row>
408 <entry><constant>V4L2_CTRL_FLAG_READ_ONLY</constant></entry>
409 <entry>0x0004</entry>
410 <entry>This control is permanently readable only. Any
411attempt to change the control will result in an &EINVAL;.</entry>
412 </row>
413 <row>
414 <entry><constant>V4L2_CTRL_FLAG_UPDATE</constant></entry>
415 <entry>0x0008</entry>
416 <entry>A hint that changing this control may affect the
417value of other controls within the same control class. Applications
418should update their user interface accordingly.</entry>
419 </row>
420 <row>
421 <entry><constant>V4L2_CTRL_FLAG_INACTIVE</constant></entry>
422 <entry>0x0010</entry>
423 <entry>This control is not applicable to the current
424configuration and should be displayed accordingly in a user interface.
425For example the flag may be set on a MPEG audio level 2 bitrate
426control when MPEG audio encoding level 1 was selected with another
427control.</entry>
428 </row>
429 <row>
430 <entry><constant>V4L2_CTRL_FLAG_SLIDER</constant></entry>
431 <entry>0x0020</entry>
432 <entry>A hint that this control is best represented as a
433slider-like element in a user interface.</entry>
434 </row>
435 <row>
436 <entry><constant>V4L2_CTRL_FLAG_WRITE_ONLY</constant></entry>
437 <entry>0x0040</entry>
438 <entry>This control is permanently writable only. Any
439attempt to read the control will result in an &EACCES; error code. This
440flag is typically present for relative controls or action controls where
441writing a value will cause the device to carry out a given action
442(&eg; motor control) but no meaningful value can be returned.</entry>
443 </row>
444 <row>
445 <entry><constant>V4L2_CTRL_FLAG_VOLATILE</constant></entry>
446 <entry>0x0080</entry>
447 <entry>This control is volatile, which means that the value of the control
448changes continuously. A typical example would be the current gain value if the device
449is in auto-gain mode. In such a case the hardware calculates the gain value based on
450the lighting conditions which can change over time. Note that setting a new value for
451a volatile control will have no effect. The new value will just be ignored.</entry>
452 </row>
453 </tbody>
454 </tgroup>
455 </table>
456 </refsect1>
457
458 <refsect1>
459 &return-value;
460
461 <variablelist>
462 <varlistentry>
463 <term><errorcode>EINVAL</errorcode></term>
464 <listitem>
465 <para>The &v4l2-queryctrl; <structfield>id</structfield>
466is invalid. The &v4l2-querymenu; <structfield>id</structfield> is
467invalid or <structfield>index</structfield> is out of range (less than
468<structfield>minimum</structfield> or greater than <structfield>maximum</structfield>)
469or this particular menu item is not supported by the driver.</para>
470 </listitem>
471 </varlistentry>
472 <varlistentry>
473 <term><errorcode>EACCES</errorcode></term>
474 <listitem>
475 <para>An attempt was made to read a write-only control.</para>
476 </listitem>
477 </varlistentry>
478 </variablelist>
479 </refsect1>
480</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-querystd.xml b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
new file mode 100644
index 00000000000..fe80a183d95
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
@@ -0,0 +1,74 @@
1<refentry id="vidioc-querystd">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERYSTD</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERYSTD</refname>
9 <refpurpose>Sense the video standard received by the current
10input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>v4l2_std_id *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_QUERYSTD</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>The hardware may be able to detect the current video
53standard automatically. To do so, applications call <constant>
54VIDIOC_QUERYSTD</constant> with a pointer to a &v4l2-std-id; type. The
55driver stores here a set of candidates, this can be a single flag or a
56set of supported standards if for example the hardware can only
57distinguish between 50 and 60 Hz systems. When detection is not
58possible or fails, the set must contain all standards supported by the
59current video input or output.</para>
60
61 </refsect1>
62
63 <refsect1>
64 &return-value;
65 <variablelist>
66 <varlistentry>
67 <term><errorcode>ENODATA</errorcode></term>
68 <listitem>
69 <para>Standard video timings are not supported for this input or output.</para>
70 </listitem>
71 </varlistentry>
72 </variablelist>
73 </refsect1>
74</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
new file mode 100644
index 00000000000..78a06a9a5ec
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
@@ -0,0 +1,137 @@
1<refentry id="vidioc-reqbufs">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_REQBUFS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_REQBUFS</refname>
9 <refpurpose>Initiate Memory Mapping or User Pointer I/O</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_requestbuffers *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_REQBUFS</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51<para>This ioctl is used to initiate <link linkend="mmap">memory mapped</link>,
52<link linkend="userp">user pointer</link> or <link
53linkend="dmabuf">DMABUF</link> based I/O. Memory mapped buffers are located in
54device memory and must be allocated with this ioctl before they can be mapped
55into the application's address space. User buffers are allocated by
56applications themselves, and this ioctl is merely used to switch the driver
57into user pointer I/O mode and to setup some internal structures.
58Similarly, DMABUF buffers are allocated by applications through a device
59driver, and this ioctl only configures the driver into DMABUF I/O mode without
60performing any direct allocation.</para>
61
62 <para>To allocate device buffers applications initialize all fields of the
63<structname>v4l2_requestbuffers</structname> structure. They set the
64<structfield>type</structfield> field to the respective stream or buffer type,
65the <structfield>count</structfield> field to the desired number of buffers,
66<structfield>memory</structfield> must be set to the requested I/O method and
67the <structfield>reserved</structfield> array must be zeroed. When the ioctl is
68called with a pointer to this structure the driver will attempt to allocate the
69requested number of buffers and it stores the actual number allocated in the
70<structfield>count</structfield> field. It can be smaller than the number
71requested, even zero, when the driver runs out of free memory. A larger number
72is also possible when the driver requires more buffers to function correctly.
73For example video output requires at least two buffers, one displayed and one
74filled by the application.</para>
75 <para>When the I/O method is not supported the ioctl
76returns an &EINVAL;.</para>
77
78 <para>Applications can call <constant>VIDIOC_REQBUFS</constant>
79again to change the number of buffers, however this cannot succeed
80when any buffers are still mapped. A <structfield>count</structfield>
81value of zero frees all buffers, after aborting or finishing any DMA
82in progress, an implicit &VIDIOC-STREAMOFF;. <!-- mhs: I see no
83reason why munmap()ping one or even all buffers must imply
84streamoff.--></para>
85
86 <table pgwide="1" frame="none" id="v4l2-requestbuffers">
87 <title>struct <structname>v4l2_requestbuffers</structname></title>
88 <tgroup cols="3">
89 &cs-str;
90 <tbody valign="top">
91 <row>
92 <entry>__u32</entry>
93 <entry><structfield>count</structfield></entry>
94 <entry>The number of buffers requested or granted.</entry>
95 </row>
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>type</structfield></entry>
99 <entry>Type of the stream or buffers, this is the same
100as the &v4l2-format; <structfield>type</structfield> field. See <xref
101 linkend="v4l2-buf-type" /> for valid values.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>memory</structfield></entry>
106 <entry>Applications set this field to
107<constant>V4L2_MEMORY_MMAP</constant>,
108<constant>V4L2_MEMORY_DMABUF</constant> or
109<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
110/>.</entry>
111 </row>
112 <row>
113 <entry>__u32</entry>
114 <entry><structfield>reserved</structfield>[2]</entry>
115 <entry>A place holder for future extensions. This array should
116be zeroed by applications.</entry>
117 </row>
118 </tbody>
119 </tgroup>
120 </table>
121 </refsect1>
122
123 <refsect1>
124 &return-value;
125
126 <variablelist>
127 <varlistentry>
128 <term><errorcode>EINVAL</errorcode></term>
129 <listitem>
130 <para>The buffer type (<structfield>type</structfield> field) or the
131requested I/O method (<structfield>memory</structfield>) is not
132supported.</para>
133 </listitem>
134 </varlistentry>
135 </variablelist>
136 </refsect1>
137</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
new file mode 100644
index 00000000000..5b379e75219
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -0,0 +1,184 @@
1<refentry id="vidioc-s-hw-freq-seek">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_S_HW_FREQ_SEEK</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_S_HW_FREQ_SEEK</refname>
9 <refpurpose>Perform a hardware frequency seek</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_hw_freq_seek
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_S_HW_FREQ_SEEK</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>Start a hardware frequency seek from the current frequency.
53To do this applications initialize the <structfield>tuner</structfield>,
54<structfield>type</structfield>, <structfield>seek_upward</structfield>,
55<structfield>wrap_around</structfield>, <structfield>spacing</structfield>,
56<structfield>rangelow</structfield> and <structfield>rangehigh</structfield>
57fields, and zero out the <structfield>reserved</structfield> array of a
58&v4l2-hw-freq-seek; and call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
59ioctl with a pointer to this structure.</para>
60
61 <para>The <structfield>rangelow</structfield> and
62<structfield>rangehigh</structfield> fields can be set to a non-zero value to
63tell the driver to search a specific band. If the &v4l2-tuner;
64<structfield>capability</structfield> field has the
65<constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag set, these values
66must fall within one of the bands returned by &VIDIOC-ENUM-FREQ-BANDS;. If
67the <constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag is not set,
68then these values must exactly match those of one of the bands returned by
69&VIDIOC-ENUM-FREQ-BANDS;. If the current frequency of the tuner does not fall
70within the selected band it will be clamped to fit in the band before the
71seek is started.</para>
72
73 <para>If an error is returned, then the original frequency will
74 be restored.</para>
75
76 <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para>
77
78 <para>If this ioctl is called from a non-blocking filehandle, then &EAGAIN; is
79 returned and no seek takes place.</para>
80
81 <table pgwide="1" frame="none" id="v4l2-hw-freq-seek">
82 <title>struct <structname>v4l2_hw_freq_seek</structname></title>
83 <tgroup cols="3">
84 &cs-str;
85 <tbody valign="top">
86 <row>
87 <entry>__u32</entry>
88 <entry><structfield>tuner</structfield></entry>
89 <entry>The tuner index number. This is the
90same value as in the &v4l2-input; <structfield>tuner</structfield>
91field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
92 </row>
93 <row>
94 <entry>__u32</entry>
95 <entry><structfield>type</structfield></entry>
96 <entry>The tuner type. This is the same value as in the
97&v4l2-tuner; <structfield>type</structfield> field. See <xref
98 linkend="v4l2-tuner-type" /></entry>
99 </row>
100 <row>
101 <entry>__u32</entry>
102 <entry><structfield>seek_upward</structfield></entry>
103 <entry>If non-zero, seek upward from the current frequency, else seek downward.</entry>
104 </row>
105 <row>
106 <entry>__u32</entry>
107 <entry><structfield>wrap_around</structfield></entry>
108 <entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking.
109 The &v4l2-tuner; <structfield>capability</structfield> field will tell you what the
110 hardware supports.
111 </entry>
112 </row>
113 <row>
114 <entry>__u32</entry>
115 <entry><structfield>spacing</structfield></entry>
116 <entry>If non-zero, defines the hardware seek resolution in Hz. The driver selects the nearest value that is supported by the device. If spacing is zero a reasonable default value is used.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>rangelow</structfield></entry>
121 <entry>If non-zero, the lowest tunable frequency of the band to
122search in units of 62.5 kHz, or if the &v4l2-tuner;
123<structfield>capability</structfield> field has the
124<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
125If <structfield>rangelow</structfield> is zero a reasonable default value
126is used.</entry>
127 </row>
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>rangehigh</structfield></entry>
131 <entry>If non-zero, the highest tunable frequency of the band to
132search in units of 62.5 kHz, or if the &v4l2-tuner;
133<structfield>capability</structfield> field has the
134<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
135If <structfield>rangehigh</structfield> is zero a reasonable default value
136is used.</entry>
137 </row>
138 <row>
139 <entry>__u32</entry>
140 <entry><structfield>reserved</structfield>[5]</entry>
141 <entry>Reserved for future extensions. Applications
142 must set the array to zero.</entry>
143 </row>
144 </tbody>
145 </tgroup>
146 </table>
147 </refsect1>
148
149 <refsect1>
150 &return-value;
151
152 <variablelist>
153 <varlistentry>
154 <term><errorcode>EINVAL</errorcode></term>
155 <listitem>
156 <para>The <structfield>tuner</structfield> index is out of
157bounds, the <structfield>wrap_around</structfield> value is not supported or
158one of the values in the <structfield>type</structfield>,
159<structfield>rangelow</structfield> or <structfield>rangehigh</structfield>
160fields is wrong.</para>
161 </listitem>
162 </varlistentry>
163 <varlistentry>
164 <term><errorcode>EAGAIN</errorcode></term>
165 <listitem>
166 <para>Attempted to call <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
167 with the filehandle in non-blocking mode.</para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><errorcode>ENODATA</errorcode></term>
172 <listitem>
173 <para>The hardware seek found no channels.</para>
174 </listitem>
175 </varlistentry>
176 <varlistentry>
177 <term><errorcode>EBUSY</errorcode></term>
178 <listitem>
179 <para>Another hardware seek is already in progress.</para>
180 </listitem>
181 </varlistentry>
182 </variablelist>
183 </refsect1>
184</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-streamon.xml b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
new file mode 100644
index 00000000000..716ea15e54a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
@@ -0,0 +1,112 @@
1<refentry id="vidioc-streamon">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_STREAMON</refname>
9 <refname>VIDIOC_STREAMOFF</refname>
10 <refpurpose>Start or stop streaming I/O</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>const int *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_STREAMON, VIDIOC_STREAMOFF</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>The <constant>VIDIOC_STREAMON</constant> and
53<constant>VIDIOC_STREAMOFF</constant> ioctl start and stop the capture
54or output process during streaming (<link linkend="mmap">memory
55mapping</link> or <link linkend="userp">user pointer</link>) I/O.</para>
56
57 <para>Specifically the capture hardware is disabled and no input
58buffers are filled (if there are any empty buffers in the incoming
59queue) until <constant>VIDIOC_STREAMON</constant> has been called.
60Accordingly the output hardware is disabled, no video signal is
61produced until <constant>VIDIOC_STREAMON</constant> has been called.
62The ioctl will succeed only when at least one output buffer is in the
63incoming queue.</para>
64
65 <para>The <constant>VIDIOC_STREAMOFF</constant> ioctl, apart of
66aborting or finishing any DMA in progress, unlocks any user pointer
67buffers locked in physical memory, and it removes all buffers from the
68incoming and outgoing queues. That means all images captured but not
69dequeued yet will be lost, likewise all images enqueued for output but
70not transmitted yet. I/O returns to the same state as after calling
71&VIDIOC-REQBUFS; and can be restarted accordingly.</para>
72
73 <para>Both ioctls take a pointer to an integer, the desired buffer or
74stream type. This is the same as &v4l2-requestbuffers;
75<structfield>type</structfield>.</para>
76
77 <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming
78is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called
79when streaming is already stopped, then the ioctl does nothing and 0 is
80returned.</para>
81
82 <para>Note that applications can be preempted for unknown periods right
83before or after the <constant>VIDIOC_STREAMON</constant> or
84<constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of
85starting or stopping "now". Buffer timestamps can be used to
86synchronize with other events.</para>
87 </refsect1>
88
89 <refsect1>
90 &return-value;
91
92 <variablelist>
93 <varlistentry>
94 <term><errorcode>EINVAL</errorcode></term>
95 <listitem>
96 <para>The buffer<structfield>type</structfield> is not supported,
97 or no buffers have been allocated (memory mapping) or enqueued
98 (output) yet.</para>
99 </listitem>
100 </varlistentry>
101 <varlistentry>
102 <term><errorcode>EPIPE</errorcode></term>
103 <listitem>
104 <para>The driver implements <link
105 linkend="pad-level-formats">pad-level format configuration</link> and
106 the pipeline configuration is invalid.
107 </para>
108 </listitem>
109 </varlistentry>
110 </variablelist>
111 </refsect1>
112</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-interval.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-interval.xml
new file mode 100644
index 00000000000..2f8f4f0a023
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-interval.xml
@@ -0,0 +1,152 @@
1<refentry id="vidioc-subdev-enum-frame-interval">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</refname>
9 <refpurpose>Enumerate frame intervals</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_frame_interval_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>This ioctl lets applications enumerate available frame intervals on a
59 given sub-device pad. Frame intervals only makes sense for sub-devices that
60 can control the frame period on their own. This includes, for instance,
61 image sensors and TV tuners.</para>
62
63 <para>For the common use case of image sensors, the frame intervals
64 available on the sub-device output pad depend on the frame format and size
65 on the same pad. Applications must thus specify the desired format and size
66 when enumerating frame intervals.</para>
67
68 <para>To enumerate frame intervals applications initialize the
69 <structfield>index</structfield>, <structfield>pad</structfield>,
70 <structfield>code</structfield>, <structfield>width</structfield> and
71 <structfield>height</structfield> fields of
72 &v4l2-subdev-frame-interval-enum; and call the
73 <constant>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</constant> ioctl with a pointer
74 to this structure. Drivers fill the rest of the structure or return
75 an &EINVAL; if one of the input fields is invalid. All frame intervals are
76 enumerable by beginning at index zero and incrementing by one until
77 <errorcode>EINVAL</errorcode> is returned.</para>
78
79 <para>Available frame intervals may depend on the current 'try' formats
80 at other pads of the sub-device, as well as on the current active links. See
81 &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
82
83 <para>Sub-devices that support the frame interval enumeration ioctl should
84 implemented it on a single pad only. Its behaviour when supported on
85 multiple pads of the same sub-device is not defined.</para>
86
87 <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval-enum">
88 <title>struct <structname>v4l2_subdev_frame_interval_enum</structname></title>
89 <tgroup cols="3">
90 &cs-str;
91 <tbody valign="top">
92 <row>
93 <entry>__u32</entry>
94 <entry><structfield>index</structfield></entry>
95 <entry>Number of the format in the enumeration, set by the
96 application.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>pad</structfield></entry>
101 <entry>Pad number as reported by the media controller API.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>code</structfield></entry>
106 <entry>The media bus format code, as defined in
107 <xref linkend="v4l2-mbus-format" />.</entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>width</structfield></entry>
112 <entry>Frame width, in pixels.</entry>
113 </row>
114 <row>
115 <entry>__u32</entry>
116 <entry><structfield>height</structfield></entry>
117 <entry>Frame height, in pixels.</entry>
118 </row>
119 <row>
120 <entry>&v4l2-fract;</entry>
121 <entry><structfield>interval</structfield></entry>
122 <entry>Period, in seconds, between consecutive video frames.</entry>
123 </row>
124 <row>
125 <entry>__u32</entry>
126 <entry><structfield>reserved</structfield>[9]</entry>
127 <entry>Reserved for future extensions. Applications and drivers must
128 set the array to zero.</entry>
129 </row>
130 </tbody>
131 </tgroup>
132 </table>
133 </refsect1>
134
135 <refsect1>
136 &return-value;
137
138 <variablelist>
139 <varlistentry>
140 <term><errorcode>EINVAL</errorcode></term>
141 <listitem>
142 <para>The &v4l2-subdev-frame-interval-enum;
143 <structfield>pad</structfield> references a non-existing pad, one of
144 the <structfield>code</structfield>, <structfield>width</structfield>
145 or <structfield>height</structfield> fields are invalid for the given
146 pad or the <structfield>index</structfield> field is out of bounds.
147 </para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
151 </refsect1>
152</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-size.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-size.xml
new file mode 100644
index 00000000000..79ce42b7c60
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-frame-size.xml
@@ -0,0 +1,154 @@
1<refentry id="vidioc-subdev-enum-frame-size">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refname>
9 <refpurpose>Enumerate media bus frame sizes</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_frame_size_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>This ioctl allows applications to enumerate all frame sizes
59 supported by a sub-device on the given pad for the given media bus format.
60 Supported formats can be retrieved with the &VIDIOC-SUBDEV-ENUM-MBUS-CODE;
61 ioctl.</para>
62
63 <para>To enumerate frame sizes applications initialize the
64 <structfield>pad</structfield>, <structfield>code</structfield> and
65 <structfield>index</structfield> fields of the
66 &v4l2-subdev-mbus-code-enum; and call the
67 <constant>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</constant> ioctl with a pointer to
68 the structure. Drivers fill the minimum and maximum frame sizes or return
69 an &EINVAL; if one of the input parameters is invalid.</para>
70
71 <para>Sub-devices that only support discrete frame sizes (such as most
72 sensors) will return one or more frame sizes with identical minimum and
73 maximum values.</para>
74
75 <para>Not all possible sizes in given [minimum, maximum] ranges need to be
76 supported. For instance, a scaler that uses a fixed-point scaling ratio
77 might not be able to produce every frame size between the minimum and
78 maximum values. Applications must use the &VIDIOC-SUBDEV-S-FMT; ioctl to
79 try the sub-device for an exact supported frame size.</para>
80
81 <para>Available frame sizes may depend on the current 'try' formats at other
82 pads of the sub-device, as well as on the current active links and the
83 current values of V4L2 controls. See &VIDIOC-SUBDEV-G-FMT; for more
84 information about try formats.</para>
85
86 <table pgwide="1" frame="none" id="v4l2-subdev-frame-size-enum">
87 <title>struct <structname>v4l2_subdev_frame_size_enum</structname></title>
88 <tgroup cols="3">
89 &cs-str;
90 <tbody valign="top">
91 <row>
92 <entry>__u32</entry>
93 <entry><structfield>index</structfield></entry>
94 <entry>Number of the format in the enumeration, set by the
95 application.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>pad</structfield></entry>
100 <entry>Pad number as reported by the media controller API.</entry>
101 </row>
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>code</structfield></entry>
105 <entry>The media bus format code, as defined in
106 <xref linkend="v4l2-mbus-format" />.</entry>
107 </row>
108 <row>
109 <entry>__u32</entry>
110 <entry><structfield>min_width</structfield></entry>
111 <entry>Minimum frame width, in pixels.</entry>
112 </row>
113 <row>
114 <entry>__u32</entry>
115 <entry><structfield>max_width</structfield></entry>
116 <entry>Maximum frame width, in pixels.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>min_height</structfield></entry>
121 <entry>Minimum frame height, in pixels.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>max_height</structfield></entry>
126 <entry>Maximum frame height, in pixels.</entry>
127 </row>
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>reserved</structfield>[9]</entry>
131 <entry>Reserved for future extensions. Applications and drivers must
132 set the array to zero.</entry>
133 </row>
134 </tbody>
135 </tgroup>
136 </table>
137 </refsect1>
138
139 <refsect1>
140 &return-value;
141
142 <variablelist>
143 <varlistentry>
144 <term><errorcode>EINVAL</errorcode></term>
145 <listitem>
146 <para>The &v4l2-subdev-frame-size-enum; <structfield>pad</structfield>
147 references a non-existing pad, the <structfield>code</structfield> is
148 invalid for the given pad or the <structfield>index</structfield>
149 field is out of bounds.</para>
150 </listitem>
151 </varlistentry>
152 </variablelist>
153 </refsect1>
154</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-enum-mbus-code.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-mbus-code.xml
new file mode 100644
index 00000000000..a6b3432449f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-enum-mbus-code.xml
@@ -0,0 +1,119 @@
1<refentry id="vidioc-subdev-enum-mbus-code">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_MBUS_CODE</refname>
9 <refpurpose>Enumerate media bus formats</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_mbus_code_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_MBUS_CODE</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>To enumerate media bus formats available at a given sub-device pad
59 applications initialize the <structfield>pad</structfield> and
60 <structfield>index</structfield> fields of &v4l2-subdev-mbus-code-enum; and
61 call the <constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant> ioctl with a
62 pointer to this structure. Drivers fill the rest of the structure or return
63 an &EINVAL; if either the <structfield>pad</structfield> or
64 <structfield>index</structfield> are invalid. All media bus formats are
65 enumerable by beginning at index zero and incrementing by one until
66 <errorcode>EINVAL</errorcode> is returned.</para>
67
68 <para>Available media bus formats may depend on the current 'try' formats
69 at other pads of the sub-device, as well as on the current active links. See
70 &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
71
72 <table pgwide="1" frame="none" id="v4l2-subdev-mbus-code-enum">
73 <title>struct <structname>v4l2_subdev_mbus_code_enum</structname></title>
74 <tgroup cols="3">
75 &cs-str;
76 <tbody valign="top">
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>pad</structfield></entry>
80 <entry>Pad number as reported by the media controller API.</entry>
81 </row>
82 <row>
83 <entry>__u32</entry>
84 <entry><structfield>index</structfield></entry>
85 <entry>Number of the format in the enumeration, set by the
86 application.</entry>
87 </row>
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>code</structfield></entry>
91 <entry>The media bus format code, as defined in
92 <xref linkend="v4l2-mbus-format" />.</entry>
93 </row>
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>reserved</structfield>[9]</entry>
97 <entry>Reserved for future extensions. Applications and drivers must
98 set the array to zero.</entry>
99 </row>
100 </tbody>
101 </tgroup>
102 </table>
103 </refsect1>
104
105 <refsect1>
106 &return-value;
107
108 <variablelist>
109 <varlistentry>
110 <term><errorcode>EINVAL</errorcode></term>
111 <listitem>
112 <para>The &v4l2-subdev-mbus-code-enum; <structfield>pad</structfield>
113 references a non-existing pad, or the <structfield>index</structfield>
114 field is out of bounds.</para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118 </refsect1>
119</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-crop.xml
new file mode 100644
index 00000000000..4cddd788c58
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-crop.xml
@@ -0,0 +1,158 @@
1<refentry id="vidioc-subdev-g-crop">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_CROP</refname>
9 <refname>VIDIOC_SUBDEV_S_CROP</refname>
10 <refpurpose>Get or set the crop rectangle on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_crop *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_subdev_crop *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <note>
61 <title>Obsolete</title>
62
63 <para>This is an <link linkend="obsolete">obsolete</link>
64 interface and may be removed in the future. It is superseded by
65 <link linkend="vidioc-subdev-g-selection">the selection
66 API</link>.</para>
67 </note>
68
69 <para>To retrieve the current crop rectangle applications set the
70 <structfield>pad</structfield> field of a &v4l2-subdev-crop; to the
71 desired pad number as reported by the media API and the
72 <structfield>which</structfield> field to
73 <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. They then call the
74 <constant>VIDIOC_SUBDEV_G_CROP</constant> ioctl with a pointer to this
75 structure. The driver fills the members of the <structfield>rect</structfield>
76 field or returns &EINVAL; if the input arguments are invalid, or if cropping
77 is not supported on the given pad.</para>
78
79 <para>To change the current crop rectangle applications set both the
80 <structfield>pad</structfield> and <structfield>which</structfield> fields
81 and all members of the <structfield>rect</structfield> field. They then call
82 the <constant>VIDIOC_SUBDEV_S_CROP</constant> ioctl with a pointer to this
83 structure. The driver verifies the requested crop rectangle, adjusts it
84 based on the hardware capabilities and configures the device. Upon return
85 the &v4l2-subdev-crop; contains the current format as would be returned
86 by a <constant>VIDIOC_SUBDEV_G_CROP</constant> call.</para>
87
88 <para>Applications can query the device capabilities by setting the
89 <structfield>which</structfield> to
90 <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. When set, 'try' crop
91 rectangles are not applied to the device by the driver, but are mangled
92 exactly as active crop rectangles and stored in the sub-device file handle.
93 Two applications querying the same sub-device would thus not interact with
94 each other.</para>
95
96 <para>Drivers must not return an error solely because the requested crop
97 rectangle doesn't match the device capabilities. They must instead modify
98 the rectangle to match what the hardware can provide. The modified format
99 should be as close as possible to the original request.</para>
100
101 <table pgwide="1" frame="none" id="v4l2-subdev-crop">
102 <title>struct <structname>v4l2_subdev_crop</structname></title>
103 <tgroup cols="3">
104 &cs-str;
105 <tbody valign="top">
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>pad</structfield></entry>
109 <entry>Pad number as reported by the media framework.</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>which</structfield></entry>
114 <entry>Crop rectangle to get or set, from
115 &v4l2-subdev-format-whence;.</entry>
116 </row>
117 <row>
118 <entry>&v4l2-rect;</entry>
119 <entry><structfield>rect</structfield></entry>
120 <entry>Crop rectangle boundaries, in pixels.</entry>
121 </row>
122 <row>
123 <entry>__u32</entry>
124 <entry><structfield>reserved</structfield>[8]</entry>
125 <entry>Reserved for future extensions. Applications and drivers must
126 set the array to zero.</entry>
127 </row>
128 </tbody>
129 </tgroup>
130 </table>
131 </refsect1>
132
133 <refsect1>
134 &return-value;
135
136 <variablelist>
137 <varlistentry>
138 <term><errorcode>EBUSY</errorcode></term>
139 <listitem>
140 <para>The crop rectangle can't be changed because the pad is currently
141 busy. This can be caused, for instance, by an active video stream on
142 the pad. The ioctl must not be retried without performing another
143 action to fix the problem first. Only returned by
144 <constant>VIDIOC_SUBDEV_S_CROP</constant></para>
145 </listitem>
146 </varlistentry>
147 <varlistentry>
148 <term><errorcode>EINVAL</errorcode></term>
149 <listitem>
150 <para>The &v4l2-subdev-crop; <structfield>pad</structfield>
151 references a non-existing pad, the <structfield>which</structfield>
152 field references a non-existing format, or cropping is not supported
153 on the given subdev pad.</para>
154 </listitem>
155 </varlistentry>
156 </variablelist>
157 </refsect1>
158</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
new file mode 100644
index 00000000000..bbd18f0e6ed
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
@@ -0,0 +1,152 @@
1<refentry id="vidioc-subdev-g-edid">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_EDID</refname>
9 <refname>VIDIOC_SUBDEV_S_EDID</refname>
10 <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59 <para>These ioctls can be used to get or set an EDID associated with an input pad
60 from a receiver or an output pad of a transmitter subdevice.</para>
61
62 <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
63 <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
64 fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block
65 <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
66 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
67 pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes
68 large (the size of one block is 128 bytes).</para>
69
70 <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield>
71 to the actual number of blocks. If there are no EDID blocks available at all, then the error code
72 ENODATA is set.</para>
73
74 <para>If blocks have to be retrieved from the sink, then this call will block until they
75 have been read.</para>
76
77 <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
78 <structfield>blocks</structfield> and <structfield>edid</structfield> fields and set
79 <structfield>start_block</structfield> to 0. It is not possible to set part of an EDID,
80 it is always all or nothing. Setting the EDID data is only valid for receivers as it makes
81 no sense for a transmitter.</para>
82
83 <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than
84 the hardware can handle then the EDID is not written, but instead the error code E2BIG is set
85 and <structfield>blocks</structfield> is set to the maximum that the hardware supports.
86 If <structfield>start_block</structfield> is any
87 value other than 0 then the error code EINVAL is set.</para>
88
89 <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the
90 hardware this will drive the hotplug pin low and/or block the source from reading the EDID
91 data in some way. In any case, the end result is the same: the EDID is no longer available.
92 </para>
93
94 <table pgwide="1" frame="none" id="v4l2-subdev-edid">
95 <title>struct <structname>v4l2_subdev_edid</structname></title>
96 <tgroup cols="3">
97 &cs-str;
98 <tbody valign="top">
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>pad</structfield></entry>
102 <entry>Pad for which to get/set the EDID blocks.</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>start_block</structfield></entry>
107 <entry>Read the EDID from starting with this block. Must be 0 when setting
108 the EDID.</entry>
109 </row>
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>blocks</structfield></entry>
113 <entry>The number of blocks to get or set. Must be less or equal to 256 (the
114 maximum number of blocks as defined by the standard). When you set the EDID and
115 <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry>
116 </row>
117 <row>
118 <entry>__u8&nbsp;*</entry>
119 <entry><structfield>edid</structfield></entry>
120 <entry>Pointer to memory that contains the EDID. The minimum size is
121 <structfield>blocks</structfield>&nbsp;*&nbsp;128.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>reserved</structfield>[5]</entry>
126 <entry>Reserved for future extensions. Applications and drivers must
127 set the array to zero.</entry>
128 </row>
129 </tbody>
130 </tgroup>
131 </table>
132 </refsect1>
133
134 <refsect1>
135 &return-value;
136
137 <variablelist>
138 <varlistentry>
139 <term><errorcode>ENODATA</errorcode></term>
140 <listitem>
141 <para>The EDID data is not available.</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term><errorcode>E2BIG</errorcode></term>
146 <listitem>
147 <para>The EDID data you provided is more than the hardware can handle.</para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
151 </refsect1>
152</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
new file mode 100644
index 00000000000..a67cde6f8c5
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
@@ -0,0 +1,183 @@
1<refentry id="vidioc-subdev-g-fmt">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_FMT</refname>
9 <refname>VIDIOC_SUBDEV_S_FMT</refname>
10 <refpurpose>Get or set the data format on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_format *<parameter>argp</parameter>
20 </paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <note>
54 <title>Experimental</title>
55 <para>This is an <link linkend="experimental">experimental</link>
56 interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls are used to negotiate the frame format at specific
60 subdev pads in the image pipeline.</para>
61
62 <para>To retrieve the current format applications set the
63 <structfield>pad</structfield> field of a &v4l2-subdev-format; to the
64 desired pad number as reported by the media API and the
65 <structfield>which</structfield> field to
66 <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. When they call the
67 <constant>VIDIOC_SUBDEV_G_FMT</constant> ioctl with a pointer to this
68 structure the driver fills the members of the <structfield>format</structfield>
69 field.</para>
70
71 <para>To change the current format applications set both the
72 <structfield>pad</structfield> and <structfield>which</structfield> fields
73 and all members of the <structfield>format</structfield> field. When they
74 call the <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl with a pointer to this
75 structure the driver verifies the requested format, adjusts it based on the
76 hardware capabilities and configures the device. Upon return the
77 &v4l2-subdev-format; contains the current format as would be returned by a
78 <constant>VIDIOC_SUBDEV_G_FMT</constant> call.</para>
79
80 <para>Applications can query the device capabilities by setting the
81 <structfield>which</structfield> to
82 <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. When set, 'try' formats are not
83 applied to the device by the driver, but are changed exactly as active
84 formats and stored in the sub-device file handle. Two applications querying
85 the same sub-device would thus not interact with each other.</para>
86
87 <para>For instance, to try a format at the output pad of a sub-device,
88 applications would first set the try format at the sub-device input with the
89 <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl. They would then either
90 retrieve the default format at the output pad with the
91 <constant>VIDIOC_SUBDEV_G_FMT</constant> ioctl, or set the desired output
92 pad format with the <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl and check
93 the returned value.</para>
94
95 <para>Try formats do not depend on active formats, but can depend on the
96 current links configuration or sub-device controls value. For instance, a
97 low-pass noise filter might crop pixels at the frame boundaries, modifying
98 its output frame size.</para>
99
100 <para>Drivers must not return an error solely because the requested format
101 doesn't match the device capabilities. They must instead modify the format
102 to match what the hardware can provide. The modified format should be as
103 close as possible to the original request.</para>
104
105 <table pgwide="1" frame="none" id="v4l2-subdev-format">
106 <title>struct <structname>v4l2_subdev_format</structname></title>
107 <tgroup cols="3">
108 &cs-str;
109 <tbody valign="top">
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>pad</structfield></entry>
113 <entry>Pad number as reported by the media controller API.</entry>
114 </row>
115 <row>
116 <entry>__u32</entry>
117 <entry><structfield>which</structfield></entry>
118 <entry>Format to modified, from &v4l2-subdev-format-whence;.</entry>
119 </row>
120 <row>
121 <entry>&v4l2-mbus-framefmt;</entry>
122 <entry><structfield>format</structfield></entry>
123 <entry>Definition of an image format, see <xref
124 linkend="v4l2-mbus-framefmt" /> for details.</entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>reserved</structfield>[8]</entry>
129 <entry>Reserved for future extensions. Applications and drivers must
130 set the array to zero.</entry>
131 </row>
132 </tbody>
133 </tgroup>
134 </table>
135
136 <table pgwide="1" frame="none" id="v4l2-subdev-format-whence">
137 <title>enum <structname>v4l2_subdev_format_whence</structname></title>
138 <tgroup cols="3">
139 &cs-def;
140 <tbody valign="top">
141 <row>
142 <entry>V4L2_SUBDEV_FORMAT_TRY</entry>
143 <entry>0</entry>
144 <entry>Try formats, used for querying device capabilities.</entry>
145 </row>
146 <row>
147 <entry>V4L2_SUBDEV_FORMAT_ACTIVE</entry>
148 <entry>1</entry>
149 <entry>Active formats, applied to the hardware.</entry>
150 </row>
151 </tbody>
152 </tgroup>
153 </table>
154 </refsect1>
155
156 <refsect1>
157 &return-value;
158
159 <variablelist>
160 <varlistentry>
161 <term><errorcode>EBUSY</errorcode></term>
162 <listitem>
163 <para>The format can't be changed because the pad is currently busy.
164 This can be caused, for instance, by an active video stream on the
165 pad. The ioctl must not be retried without performing another action
166 to fix the problem first. Only returned by
167 <constant>VIDIOC_SUBDEV_S_FMT</constant></para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><errorcode>EINVAL</errorcode></term>
172 <listitem>
173 <para>The &v4l2-subdev-format; <structfield>pad</structfield>
174 references a non-existing pad, or the <structfield>which</structfield>
175 field references a non-existing format.</para>
176 </listitem>
177 </varlistentry>
178 </variablelist>
179 </refsect1>
180 <refsect1>
181 &return-value;
182 </refsect1>
183</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-frame-interval.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-frame-interval.xml
new file mode 100644
index 00000000000..0bc3ea22d31
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-frame-interval.xml
@@ -0,0 +1,141 @@
1<refentry id="vidioc-subdev-g-frame-interval">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_FRAME_INTERVAL</refname>
9 <refname>VIDIOC_SUBDEV_S_FRAME_INTERVAL</refname>
10 <refpurpose>Get or set the frame interval on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_frame_interval *<parameter>argp</parameter>
20 </paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <note>
54 <title>Experimental</title>
55 <para>This is an <link linkend="experimental">experimental</link>
56 interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls are used to get and set the frame interval at specific
60 subdev pads in the image pipeline. The frame interval only makes sense for
61 sub-devices that can control the frame period on their own. This includes,
62 for instance, image sensors and TV tuners. Sub-devices that don't support
63 frame intervals must not implement these ioctls.</para>
64
65 <para>To retrieve the current frame interval applications set the
66 <structfield>pad</structfield> field of a &v4l2-subdev-frame-interval; to
67 the desired pad number as reported by the media controller API. When they
68 call the <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> ioctl with a
69 pointer to this structure the driver fills the members of the
70 <structfield>interval</structfield> field.</para>
71
72 <para>To change the current frame interval applications set both the
73 <structfield>pad</structfield> field and all members of the
74 <structfield>interval</structfield> field. When they call the
75 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant> ioctl with a pointer to
76 this structure the driver verifies the requested interval, adjusts it based
77 on the hardware capabilities and configures the device. Upon return the
78 &v4l2-subdev-frame-interval; contains the current frame interval as would be
79 returned by a <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> call.
80 </para>
81
82 <para>Drivers must not return an error solely because the requested interval
83 doesn't match the device capabilities. They must instead modify the interval
84 to match what the hardware can provide. The modified interval should be as
85 close as possible to the original request.</para>
86
87 <para>Sub-devices that support the frame interval ioctls should implement
88 them on a single pad only. Their behaviour when supported on multiple pads
89 of the same sub-device is not defined.</para>
90
91 <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval">
92 <title>struct <structname>v4l2_subdev_frame_interval</structname></title>
93 <tgroup cols="3">
94 &cs-str;
95 <tbody valign="top">
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>pad</structfield></entry>
99 <entry>Pad number as reported by the media controller API.</entry>
100 </row>
101 <row>
102 <entry>&v4l2-fract;</entry>
103 <entry><structfield>interval</structfield></entry>
104 <entry>Period, in seconds, between consecutive video frames.</entry>
105 </row>
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>reserved</structfield>[9]</entry>
109 <entry>Reserved for future extensions. Applications and drivers must
110 set the array to zero.</entry>
111 </row>
112 </tbody>
113 </tgroup>
114 </table>
115 </refsect1>
116
117 <refsect1>
118 &return-value;
119
120 <variablelist>
121 <varlistentry>
122 <term><errorcode>EBUSY</errorcode></term>
123 <listitem>
124 <para>The frame interval can't be changed because the pad is currently
125 busy. This can be caused, for instance, by an active video stream on
126 the pad. The ioctl must not be retried without performing another
127 action to fix the problem first. Only returned by
128 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant></para>
129 </listitem>
130 </varlistentry>
131 <varlistentry>
132 <term><errorcode>EINVAL</errorcode></term>
133 <listitem>
134 <para>The &v4l2-subdev-frame-interval; <structfield>pad</structfield>
135 references a non-existing pad, or the pad doesn't support frame
136 intervals.</para>
137 </listitem>
138 </varlistentry>
139 </variablelist>
140 </refsect1>
141</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
new file mode 100644
index 00000000000..1ba9e999af3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -0,0 +1,165 @@
1<refentry id="vidioc-subdev-g-selection">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_SELECTION</refname>
9 <refname>VIDIOC_SUBDEV_S_SELECTION</refname>
10 <refpurpose>Get or set selection rectangles on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_selection *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>The selections are used to configure various image
59 processing functionality performed by the subdevs which affect the
60 image size. This currently includes cropping, scaling and
61 composition.</para>
62
63 <para>The selection API replaces <link
64 linkend="vidioc-subdev-g-crop">the old subdev crop API</link>. All
65 the function of the crop API, and more, are supported by the
66 selections API.</para>
67
68 <para>See <xref linkend="subdev"></xref> for
69 more information on how each selection target affects the image
70 processing pipeline inside the subdevice.</para>
71
72 <refsect2>
73 <title>Types of selection targets</title>
74
75 <para>There are two types of selection targets: actual and bounds. The
76 actual targets are the targets which configure the hardware. The BOUNDS
77 target will return a rectangle that contain all possible actual
78 rectangles.</para>
79 </refsect2>
80
81 <refsect2>
82 <title>Discovering supported features</title>
83
84 <para>To discover which targets are supported, the user can
85 perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them.
86 Any unsupported target will return
87 <constant>EINVAL</constant>.</para>
88
89 <para>Selection targets and flags are documented in <xref
90 linkend="v4l2-selections-common"/>.</para>
91
92 <table pgwide="1" frame="none" id="v4l2-subdev-selection">
93 <title>struct <structname>v4l2_subdev_selection</structname></title>
94 <tgroup cols="3">
95 &cs-str;
96 <tbody valign="top">
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>which</structfield></entry>
100 <entry>Active or try selection, from
101 &v4l2-subdev-format-whence;.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>pad</structfield></entry>
106 <entry>Pad number as reported by the media framework.</entry>
107 </row>
108 <row>
109 <entry>__u32</entry>
110 <entry><structfield>target</structfield></entry>
111 <entry>Target selection rectangle. See
112 <xref linkend="v4l2-selections-common" />.</entry>
113 </row>
114 <row>
115 <entry>__u32</entry>
116 <entry><structfield>flags</structfield></entry>
117 <entry>Flags. See
118 <xref linkend="v4l2-selection-flags" />.</entry>
119 </row>
120 <row>
121 <entry>&v4l2-rect;</entry>
122 <entry><structfield>rect</structfield></entry>
123 <entry>Selection rectangle, in pixels.</entry>
124 </row>
125 <row>
126 <entry>__u32</entry>
127 <entry><structfield>reserved</structfield>[8]</entry>
128 <entry>Reserved for future extensions. Applications and drivers must
129 set the array to zero.</entry>
130 </row>
131 </tbody>
132 </tgroup>
133 </table>
134 </refsect2>
135
136 </refsect1>
137
138 <refsect1>
139 &return-value;
140
141 <variablelist>
142 <varlistentry>
143 <term><errorcode>EBUSY</errorcode></term>
144 <listitem>
145 <para>The selection rectangle can't be changed because the
146 pad is currently busy. This can be caused, for instance, by
147 an active video stream on the pad. The ioctl must not be
148 retried without performing another action to fix the problem
149 first. Only returned by
150 <constant>VIDIOC_SUBDEV_S_SELECTION</constant></para>
151 </listitem>
152 </varlistentry>
153 <varlistentry>
154 <term><errorcode>EINVAL</errorcode></term>
155 <listitem>
156 <para>The &v4l2-subdev-selection;
157 <structfield>pad</structfield> references a non-existing
158 pad, the <structfield>which</structfield> field references a
159 non-existing format, or the selection target is not
160 supported on the given subdev pad.</para>
161 </listitem>
162 </varlistentry>
163 </variablelist>
164 </refsect1>
165</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
new file mode 100644
index 00000000000..5c70b616d81
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
@@ -0,0 +1,206 @@
1<refentry id="vidioc-subscribe-event">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refname>
9 <refpurpose>Subscribe or unsubscribe event</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_event_subscription
19*<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>Subscribe or unsubscribe V4L2 event. Subscribed events are
53 dequeued by using the &VIDIOC-DQEVENT; ioctl.</para>
54
55 <table frame="none" pgwide="1" id="v4l2-event-subscription">
56 <title>struct <structname>v4l2_event_subscription</structname></title>
57 <tgroup cols="3">
58 &cs-str;
59 <tbody valign="top">
60 <row>
61 <entry>__u32</entry>
62 <entry><structfield>type</structfield></entry>
63 <entry>Type of the event.</entry>
64 </row>
65 <row>
66 <entry>__u32</entry>
67 <entry><structfield>id</structfield></entry>
68 <entry>ID of the event source. If there is no ID associated with
69 the event source, then set this to 0. Whether or not an event
70 needs an ID depends on the event type.</entry>
71 </row>
72 <row>
73 <entry>__u32</entry>
74 <entry><structfield>flags</structfield></entry>
75 <entry>Event flags, see <xref linkend="event-flags" />.</entry>
76 </row>
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>reserved</structfield>[5]</entry>
80 <entry>Reserved for future extensions. Drivers and applications
81 must set the array to zero.</entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </table>
86
87 <table frame="none" pgwide="1" id="event-type">
88 <title>Event Types</title>
89 <tgroup cols="3">
90 &cs-def;
91 <tbody valign="top">
92 <row>
93 <entry><constant>V4L2_EVENT_ALL</constant></entry>
94 <entry>0</entry>
95 <entry>All events. V4L2_EVENT_ALL is valid only for
96 VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once.
97 </entry>
98 </row>
99 <row>
100 <entry><constant>V4L2_EVENT_VSYNC</constant></entry>
101 <entry>1</entry>
102 <entry>This event is triggered on the vertical sync.
103 This event has a &v4l2-event-vsync; associated with it.
104 </entry>
105 </row>
106 <row>
107 <entry><constant>V4L2_EVENT_EOS</constant></entry>
108 <entry>2</entry>
109 <entry>This event is triggered when the end of a stream is reached.
110 This is typically used with MPEG decoders to report to the application
111 when the last of the MPEG stream has been decoded.
112 </entry>
113 </row>
114 <row>
115 <entry><constant>V4L2_EVENT_CTRL</constant></entry>
116 <entry>3</entry>
117 <entry><para>This event requires that the <structfield>id</structfield>
118 matches the control ID from which you want to receive events.
119 This event is triggered if the control's value changes, if a
120 button control is pressed or if the control's flags change.
121 This event has a &v4l2-event-ctrl; associated with it. This struct
122 contains much of the same information as &v4l2-queryctrl; and
123 &v4l2-control;.</para>
124
125 <para>If the event is generated due to a call to &VIDIOC-S-CTRL; or
126 &VIDIOC-S-EXT-CTRLS;, then the event will <emphasis>not</emphasis> be sent to
127 the file handle that called the ioctl function. This prevents
128 nasty feedback loops. If you <emphasis>do</emphasis> want to get the
129 event, then set the <constant>V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK</constant>
130 flag.
131 </para>
132
133 <para>This event type will ensure that no information is lost when
134 more events are raised than there is room internally. In that
135 case the &v4l2-event-ctrl; of the second-oldest event is kept,
136 but the <structfield>changes</structfield> field of the
137 second-oldest event is ORed with the <structfield>changes</structfield>
138 field of the oldest event.</para>
139 </entry>
140 </row>
141 <row>
142 <entry><constant>V4L2_EVENT_FRAME_SYNC</constant></entry>
143 <entry>4</entry>
144 <entry>
145 <para>Triggered immediately when the reception of a
146 frame has begun. This event has a
147 &v4l2-event-frame-sync; associated with it.</para>
148
149 <para>If the hardware needs to be stopped in the case of a
150 buffer underrun it might not be able to generate this event.
151 In such cases the <structfield>frame_sequence</structfield>
152 field in &v4l2-event-frame-sync; will not be incremented. This
153 causes two consecutive frame sequence numbers to have n times
154 frame interval in between them.</para>
155 </entry>
156 </row>
157 <row>
158 <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry>
159 <entry>0x08000000</entry>
160 <entry>Base event number for driver-private events.</entry>
161 </row>
162 </tbody>
163 </tgroup>
164 </table>
165
166 <table pgwide="1" frame="none" id="event-flags">
167 <title>Event Flags</title>
168 <tgroup cols="3">
169 &cs-def;
170 <tbody valign="top">
171 <row>
172 <entry><constant>V4L2_EVENT_SUB_FL_SEND_INITIAL</constant></entry>
173 <entry>0x0001</entry>
174 <entry>When this event is subscribed an initial event will be sent
175 containing the current status. This only makes sense for events
176 that are triggered by a status change such as <constant>V4L2_EVENT_CTRL</constant>.
177 Other events will ignore this flag.</entry>
178 </row>
179 <row>
180 <entry><constant>V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK</constant></entry>
181 <entry>0x0002</entry>
182 <entry><para>If set, then events directly caused by an ioctl will also be sent to
183 the filehandle that called that ioctl. For example, changing a control using
184 &VIDIOC-S-CTRL; will cause a V4L2_EVENT_CTRL to be sent back to that same
185 filehandle. Normally such events are suppressed to prevent feedback loops
186 where an application changes a control to a one value and then another, and
187 then receives an event telling it that that control has changed to the first
188 value.</para>
189
190 <para>Since it can't tell whether that event was caused by another application
191 or by the &VIDIOC-S-CTRL; call it is hard to decide whether to set the
192 control to the value in the event, or ignore it.</para>
193
194 <para>Think carefully when you set this flag so you won't get into situations
195 like that.</para>
196 </entry>
197 </row>
198 </tbody>
199 </tgroup>
200 </table>
201
202 </refsect1>
203 <refsect1>
204 &return-value;
205 </refsect1>
206</refentry>
diff --git a/Documentation/DocBook/media/vbi_525.gif.b64 b/Documentation/DocBook/media/vbi_525.gif.b64
new file mode 100644
index 00000000000..d5dcf06f2ae
--- /dev/null
+++ b/Documentation/DocBook/media/vbi_525.gif.b64
@@ -0,0 +1,84 @@
1R0lGODlhKgPIAIAAAAAAAP///yH5BAEAAAEALAAAAAAqA8gAAAL+jI+py+0Po5y02ouz3rz7D4bi
2SJbmiabqWgJs475LLCt0fdy4oeN9/QPuEEFZkXVcJZXDXNP5pC0TgGrMSrRMidhA1/uNbB9j2CZ8
3Kc+qHDXDTT2jK3BuPau13vFpdmc/p6Uh5SeYoXMHyFNomEeYiNEVKCFFx8Wz2Eh56YWp2bfnGXk1
4OEhaKnem2rYa6vp3KIqaBhULmsk4Ufc1KTbq4rfbhxkcOQx22limZ4P8STYH3PsGu8pqe439aw36
5eji9qT1rGCpraf5MkQynyJeuG0c73imvLYzuUAwF/P6WTK8vHDdj2Qia8hYL4bF2o/CpmydOXa6I
6uqQNPFepny/+d+cM0qsH8qNGCI8M3gvG7KG8iSJJVoNIp1w5h/C+gSPjgWE9hR0Lqmzp0RFPjLV+
7hoRki2XNPJyCVmy2U6KnHm6WnboRcOPFkS59xqQpEKZRpkDHfi1rdqlXgTMVKVVL7h/cnmi1rtxq
8t27Yn1n5xrySUi81iYAlvR2MN23Fm/nkyHzp9G9iSof3Ps1pE3PmyV2dhaSL1Jiee3/ZjI5Mkhlj
9xDPXGnkClgns1pxV0K6d4rbYF7pRv44CW7Dtojt6f/YxO7hxrrmVJ3/eZDnd4tCjVw+OPbv27dy7
10e/8OPrz48eTLmz+PPr369ezbu38PP778+fTr27+PP7/+/fz++/v/D2CAAg5IYIEGHohgggouSNFv
111l2HHIRCACehgw9eOIR0001I4YVq8MJIVZItUpJiG564GG75VJaXb5aVthtljwnV1mauyXijVqtB
12FVRoK7Foxi0kNphaYdhYNRUxQMZDWZKd9IXTQTmmFluUDQln5TcqBrnlYEOhaGJXNZrUpR24sLPN
13kC6uaBGWMywERpWISeUZacIE5iZH8OApJ3FrtvhnY5AdR1iZVOw4p1BTZhljlGNG1aijfgIKl4+f
14kNZjoIL2ySOacX4kYlyyfDgooWBSWmikOH15mU5ksfqiqUVqNsySXN7FqZ5jWdoTr7sSqaOtTH6Y
15EajMNZX+kbC53qopDDMuymhprgLbGaTUbgrtm8smCqOqQRYbZrV58vijtzZgNW2TTHZEag7rHFuU
16Pp4aSq6sc9EJa7jinpVuq/Ruy+xSj9KibL0YyRXrXr7WlC+242qrDMJsEYYSVvAiUzGJwg7c7BqI
17GjyiuQ5f7PG/7j57VqkpqryyyJ0WDDBxC29ymr3+YFEzyRpLE5qG91qYYYVAR4hh0B0WTbTRR1Mn
18NBKTDs0h0lErTTXTSyddNdZabw311ET7nLDTTct2tddmn82bc2V3zbbYazMId9xyz0133XbfjXfe
19eu/Nd99+/w144IIPTnjhhh+OeOKKczcR2CYvDnnkkgf+XoTF2eUCs9uTb85554MrVUjmJGDuuMue
20n4566gKyxM+T2L37cNqqz0577QG2/ikpVxEie7LflW578MIPL1vroVdifOy3outkscD/THz00k+v
21ne46ApQT70o2ZWz1RT5Pffji2w4YWcqLkrzvMhNT/Wjuvy/6+PLPL/w/854vr+t58gP+vufySb8A
22CnB8phEBmo7nhDHwz3vQGKADH0jAT4UgVGZQILjeBsEManB6GqKgP+h0vtFtcIQk5KAJpqAa/znL
23Xc4CXv9KCMP2fMyA8fvDDCdYwzbg7IQbwZ0Iq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y5Z2
79yZjsyrGMzOBoxlYcsrXsyMHMum28yKSsyz8cub9cw8Kczc1MzK+szHl8zMX8zXVcuNh8uIT8zJ/c
80utUsvVHMyxTszA3MxOWMw8mMx+BcxOIczsY8y9s8zOZsy9DcvOv8zrvcy+zcgI0sz+RsugBdvPic
81z/Z8zxmSoqNT0aq4a1JiI92Q0bm2aqeqt3cb0qk20q1W0iYttbR4ax3N0RsNBBdNQ114QjCNQzLd
82AjRttDmt0zvN0z1u7dM/DdRBLdRDTdRFbdRHjdRJrdRLzdRN7dRPDdVRLdVTTdVVbdVXjdVfVBkx
83+APSnNU5bZaaCsVfPdQnR8TkJwlnTdZAnSwXJIidutZBHbhrqpqnuKpx/a9c3RdvndZ43dO+pCSY
84E9gqF8bNWgAAOw==
diff --git a/Documentation/DocBook/media/vbi_625.gif.b64 b/Documentation/DocBook/media/vbi_625.gif.b64
new file mode 100644
index 00000000000..831f49a0282
--- /dev/null
+++ b/Documentation/DocBook/media/vbi_625.gif.b64
@@ -0,0 +1,90 @@
1R0lGODlhKgPIAIAAAAAAAP///yH5BAEAAAEALAAAAAAqA8gAAAL+jI+py+0Po5y02ouz3rz7D4bi
2SJbmiabqWgJs475LLCt0fdy4oeN9/QPuEEFZkXVcJZXDXNP5pC0TgGrOCqVMidhAVdqVbLmx73Wc
3FXfNabGFzfbG3Rz0bDO/2G1hzJ7o8ceT56dB+Gb4JciD16fnh3VI97bmOCE4tyhVUSbHKOlg1xnp
46aWFKDfaecrqQlrK2vqK2bjImPFaiLuKuxvY+2HLq1tniHcLzFmWy6mnitxMeWs5iaZo0xZhTahj
5rdzXHa3m6Eod+h1+LW7MXpx83P7962y+ju4O//5oGr8PHUvs36VjoCBsujTsxp5t0MIB1MZLYb07
6CBt+QlWRHz/+Zto62NLYD+Ouj7Q+ZlMj0J80kCr1iaSHT6WmeAXPAXOVzNs0hw8fHAwzkeLATz9E
7xVo2qCa2o7AA9Wz5cmXIgFAhKu2Yb2q1rFSrDmUZFeUgrQaLd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A6xyhoRviTxpyMqkV/Zy9+iPEMf+v+q2cqaGw8BSxEsGaZyR
78jWsWZmdmyM92xLOGyD9cyfdWc7iBN5Dsb678b6ZMyaWVcqjcY6XcbKfMySAGiqO8iUFMaJncaxh8
79rpucboucyoxMXTksybP2ygZnYzIXRrXsxLfsy3Wmy5A8wGH6Wbh8admMaNesusCMS+AMw7RcawUH
80wgm5otzscs8sy+mMzNW8cSjmzeNmzrkcaUr4yYFGzhh0z738z4c80PaLcvK8yo08nu68o84cy/qM
810Adtyay8rcRcXsY8yW56buKsptPTzwkX0C6Xzx03zy1MzcccngxdcfDcbNE8yyatziSdbSFdzgX9
82yxqdaRxdZIpm0b/+iaY+PcgeJs2UEW3KjKeQGMmPDM2cHNHJbMv1DNKAbMpYLNKJ2kH1I9W5TNWk
83nNWwTHJ9M9SKnNDL7Mgq7YpevdTa/NJuUNRPjXNvbWQKt3NwPdc8nSNhjRdtTc9wqtQOjdZ+PclN
84jc4TrdBy/dV0bdcjp62SZNYEdtdr3RF6jdKH2s6VLYqN/cuCDdOETdYX2G6f7dmGfdg3F9c7gtex
85FdOXvNCWrV6sDZF3KNGqbNT6FNqKDWyiXdqkXdeL/diazdYnDdXsfNmuXWVq7duRDdznPNqJrdvM
86vdu8XdG4DWan3bypTdFlTdzmNm4ufdzTbN2FbdvFLN3OvdzkHd7RF93bJf3b393ZKZ3dSY3Z2AzZ
873s3ZAhzd551mNv3Ozw3U5lHGpfPfl3NGA351Rmfgj6XHd7xYUKdZCR51rGE2vVJ1E04eAU45Fl7F
881htMGv5LHN7hXZ3EIS7iI07iJW7iJ47iKa7iK87iLe7iLw7jMS7jM07jNW7jN47jOa7jO87jPe7j
89Pw7kQV68E+EQhqrAQs6aZmirzYzkQC4aAmmIygHlTS7kP0G3gRJ8VB7kAGCRbQB8uqflTu6Ci4jl
90ehjmPs7laf58XB7Fau6DR56aBQAAOw==
diff --git a/Documentation/DocBook/media/vbi_hsync.gif.b64 b/Documentation/DocBook/media/vbi_hsync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