1 .. SPDX-License-Identifier: GFDL-1.1-no-invari !! 1 .. Permission is granted to copy, distribute and/or modify this 2 .. c:namespace:: V4L !! 2 .. document under the terms of the GNU Free Documentation License, >> 3 .. Version 1.1 or any later version published by the Free Software >> 4 .. Foundation, with no Invariant Sections, no Front-Cover Texts >> 5 .. and no Back-Cover Texts. A copy of the license is included at >> 6 .. Documentation/userspace-api/media/fdl-appendix.rst. >> 7 .. >> 8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections 3 9 4 .. _VIDIOC_G_FBUF: 10 .. _VIDIOC_G_FBUF: 5 11 6 ********************************** 12 ********************************** 7 ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF 13 ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF 8 ********************************** 14 ********************************** 9 15 10 Name 16 Name 11 ==== 17 ==== 12 18 13 VIDIOC_G_FBUF - VIDIOC_S_FBUF - Get or set fra 19 VIDIOC_G_FBUF - VIDIOC_S_FBUF - Get or set frame buffer overlay parameters 14 20 >> 21 15 Synopsis 22 Synopsis 16 ======== 23 ======== 17 24 18 .. c:macro:: VIDIOC_G_FBUF !! 25 .. c:function:: int ioctl( int fd, VIDIOC_G_FBUF, struct v4l2_framebuffer *argp ) 19 !! 26 :name: VIDIOC_G_FBUF 20 ``int ioctl(int fd, VIDIOC_G_FBUF, struct v4l2 << 21 27 22 .. c:macro:: VIDIOC_S_FBUF !! 28 .. c:function:: int ioctl( int fd, VIDIOC_S_FBUF, const struct v4l2_framebuffer *argp ) >> 29 :name: VIDIOC_S_FBUF 23 30 24 ``int ioctl(int fd, VIDIOC_S_FBUF, const struc << 25 31 26 Arguments 32 Arguments 27 ========= 33 ========= 28 34 29 ``fd`` 35 ``fd`` 30 File descriptor returned by :c:func:`open( !! 36 File descriptor returned by :ref:`open() <func-open>`. 31 37 32 ``argp`` 38 ``argp`` 33 Pointer to struct :c:type:`v4l2_framebuffe 39 Pointer to struct :c:type:`v4l2_framebuffer`. 34 40 >> 41 35 Description 42 Description 36 =========== 43 =========== 37 44 38 Applications can use the :ref:`VIDIOC_G_FBUF < 45 Applications can use the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` and :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctl 39 to get and set the framebuffer parameters for 46 to get and set the framebuffer parameters for a 40 :ref:`Video Overlay <overlay>` or :ref:`Video 47 :ref:`Video Overlay <overlay>` or :ref:`Video Output Overlay <osd>` 41 (OSD). The type of overlay is implied by the d 48 (OSD). The type of overlay is implied by the device type (capture or 42 output device) and can be determined with the 49 output device) and can be determined with the 43 :ref:`VIDIOC_QUERYCAP` ioctl. One ``/dev/video 50 :ref:`VIDIOC_QUERYCAP` ioctl. One ``/dev/videoN`` 44 device must not support both kinds of overlay. 51 device must not support both kinds of overlay. 45 52 46 The V4L2 API distinguishes destructive and non 53 The V4L2 API distinguishes destructive and non-destructive overlays. A 47 destructive overlay copies captured video imag 54 destructive overlay copies captured video images into the video memory 48 of a graphics card. A non-destructive overlay 55 of a graphics card. A non-destructive overlay blends video images into a 49 VGA signal or graphics into a video signal. *V 56 VGA signal or graphics into a video signal. *Video Output Overlays* are 50 always non-destructive. 57 always non-destructive. 51 58 52 Destructive overlay support has been removed: << 53 this is no longer needed, and it was always a << 54 << 55 To get the current parameters applications cal 59 To get the current parameters applications call the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` 56 ioctl with a pointer to a struct :c:type:`v4l2 60 ioctl with a pointer to a struct :c:type:`v4l2_framebuffer` 57 structure. The driver fills all fields of the 61 structure. The driver fills all fields of the structure or returns an 58 EINVAL error code when overlays are not suppor 62 EINVAL error code when overlays are not supported. 59 63 60 To set the parameters for a *Video Output Over 64 To set the parameters for a *Video Output Overlay*, applications must 61 initialize the ``flags`` field of a struct 65 initialize the ``flags`` field of a struct 62 :c:type:`v4l2_framebuffer`. Since the framebuf 66 :c:type:`v4l2_framebuffer`. Since the framebuffer is 63 implemented on the TV card all other parameter 67 implemented on the TV card all other parameters are determined by the 64 driver. When an application calls :ref:`VIDIOC 68 driver. When an application calls :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` with a pointer to 65 this structure, the driver prepares for the ov 69 this structure, the driver prepares for the overlay and returns the 66 framebuffer parameters as :ref:`VIDIOC_G_FBUF 70 framebuffer parameters as :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` does, or it returns an error 67 code. 71 code. 68 72 69 To set the parameters for a *Video Capture Ove !! 73 To set the parameters for a *non-destructive Video Overlay*, 70 applications must initialize the ``flags`` fie 74 applications must initialize the ``flags`` field, the ``fmt`` 71 substructure, and call :ref:`VIDIOC_S_FBUF <VI 75 substructure, and call :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`. Again the driver prepares for 72 the overlay and returns the framebuffer parame 76 the overlay and returns the framebuffer parameters as :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` 73 does, or it returns an error code. 77 does, or it returns an error code. 74 78 75 .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm !! 79 For a *destructive Video Overlay* applications must additionally provide >> 80 a ``base`` address. Setting up a DMA to a random memory location can >> 81 jeopardize the system security, its stability or even damage the >> 82 hardware, therefore only the superuser can set the parameters for a >> 83 destructive video overlay. >> 84 >> 85 >> 86 .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}| 76 87 77 .. c:type:: v4l2_framebuffer 88 .. c:type:: v4l2_framebuffer 78 89 79 .. cssclass:: longtable 90 .. cssclass:: longtable 80 91 81 .. flat-table:: struct v4l2_framebuffer 92 .. flat-table:: struct v4l2_framebuffer 82 :header-rows: 0 93 :header-rows: 0 83 :stub-columns: 0 94 :stub-columns: 0 84 :widths: 1 1 1 2 95 :widths: 1 1 1 2 85 96 86 * - __u32 97 * - __u32 87 - ``capability`` 98 - ``capability`` 88 - 99 - 89 - Overlay capability flags set by the dr 100 - Overlay capability flags set by the driver, see 90 :ref:`framebuffer-cap`. 101 :ref:`framebuffer-cap`. 91 * - __u32 102 * - __u32 92 - ``flags`` 103 - ``flags`` 93 - 104 - 94 - Overlay control flags set by applicati 105 - Overlay control flags set by application and driver, see 95 :ref:`framebuffer-flags` 106 :ref:`framebuffer-flags` 96 * - void * 107 * - void * 97 - ``base`` 108 - ``base`` 98 - 109 - 99 - Physical base address of the framebuff 110 - Physical base address of the framebuffer, that is the address of 100 the pixel in the top left corner of th !! 111 the pixel in the top left corner of the framebuffer. [#f1]_ 101 For :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF !! 112 * - 102 and the kernel will always set this to !! 113 - 103 For *Video Output Overlays* !! 114 - 104 the driver will return a valid base ad !! 115 - This field is irrelevant to *non-destructive Video Overlays*. For >> 116 *destructive Video Overlays* applications must provide a base >> 117 address. The driver may accept only base addresses which are a >> 118 multiple of two, four or eight bytes. For *Video Output Overlays* >> 119 the driver must return a valid base address, so applications can 105 find the corresponding Linux framebuff 120 find the corresponding Linux framebuffer device (see 106 :ref:`osd`). For *Video Capture Overla !! 121 :ref:`osd`). 107 NULL. << 108 * - struct 122 * - struct 109 - ``fmt`` 123 - ``fmt`` 110 - 124 - 111 - Layout of the frame buffer. 125 - Layout of the frame buffer. 112 * - 126 * - 113 - __u32 127 - __u32 114 - ``width`` 128 - ``width`` 115 - Width of the frame buffer in pixels. 129 - Width of the frame buffer in pixels. 116 * - 130 * - 117 - __u32 131 - __u32 118 - ``height`` 132 - ``height`` 119 - Height of the frame buffer in pixels. 133 - Height of the frame buffer in pixels. 120 * - 134 * - 121 - __u32 135 - __u32 122 - ``pixelformat`` 136 - ``pixelformat`` 123 - The pixel format of the framebuffer. 137 - The pixel format of the framebuffer. 124 * - 138 * - 125 - 139 - 126 - 140 - 127 - For *non-destructive Video Overlays* t 141 - For *non-destructive Video Overlays* this field only defines a 128 format for the struct :c:type:`v4l2_wi 142 format for the struct :c:type:`v4l2_window` 129 ``chromakey`` field. 143 ``chromakey`` field. 130 * - 144 * - 131 - 145 - 132 - 146 - 133 - For *Video Output Overlays* the driver !! 147 - For *destructive Video Overlays* applications must initialize this >> 148 field. For *Video Output Overlays* the driver must return a valid 134 format. 149 format. 135 * - 150 * - 136 - 151 - 137 - 152 - 138 - Usually this is an RGB format (for exa 153 - Usually this is an RGB format (for example 139 :ref:`V4L2_PIX_FMT_RGB565 <V4L2-PIX-FM 154 :ref:`V4L2_PIX_FMT_RGB565 <V4L2-PIX-FMT-RGB565>`) but YUV 140 formats (only packed YUV formats when 155 formats (only packed YUV formats when chroma keying is used, not 141 including ``V4L2_PIX_FMT_YUYV`` and `` 156 including ``V4L2_PIX_FMT_YUYV`` and ``V4L2_PIX_FMT_UYVY``) and the 142 ``V4L2_PIX_FMT_PAL8`` format are also 157 ``V4L2_PIX_FMT_PAL8`` format are also permitted. The behavior of 143 the driver when an application request 158 the driver when an application requests a compressed format is 144 undefined. See :ref:`pixfmt` for infor 159 undefined. See :ref:`pixfmt` for information on pixel formats. 145 * - 160 * - 146 - enum :c:type:`v4l2_field` 161 - enum :c:type:`v4l2_field` 147 - ``field`` 162 - ``field`` 148 - Drivers and applications shall ignore 163 - Drivers and applications shall ignore this field. If applicable, 149 the field order is selected with the 164 the field order is selected with the 150 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioc 165 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, using the ``field`` 151 field of struct :c:type:`v4l2_window`. 166 field of struct :c:type:`v4l2_window`. 152 * - 167 * - 153 - __u32 168 - __u32 154 - ``bytesperline`` 169 - ``bytesperline`` 155 - Distance in bytes between the leftmost 170 - Distance in bytes between the leftmost pixels in two adjacent 156 lines. 171 lines. 157 * - :cspan:`3` 172 * - :cspan:`3` 158 173 159 This field is irrelevant to *non-destr 174 This field is irrelevant to *non-destructive Video Overlays*. 160 175 >> 176 For *destructive Video Overlays* both applications and drivers can >> 177 set this field to request padding bytes at the end of each line. >> 178 Drivers however may ignore the requested value, returning >> 179 ``width`` times bytes-per-pixel or a larger value required by the >> 180 hardware. That implies applications can just set this field to >> 181 zero to get a reasonable default. >> 182 161 For *Video Output Overlays* the driver 183 For *Video Output Overlays* the driver must return a valid value. 162 184 163 Video hardware may access padding byte 185 Video hardware may access padding bytes, therefore they must 164 reside in accessible memory. Consider 186 reside in accessible memory. Consider for example the case where 165 padding bytes after the last line of a 187 padding bytes after the last line of an image cross a system page 166 boundary. Capture devices may write pa 188 boundary. Capture devices may write padding bytes, the value is 167 undefined. Output devices ignore the c 189 undefined. Output devices ignore the contents of padding bytes. 168 190 169 When the image format is planar the `` 191 When the image format is planar the ``bytesperline`` value applies 170 to the first plane and is divided by t 192 to the first plane and is divided by the same factor as the 171 ``width`` field for the other planes. 193 ``width`` field for the other planes. For example the Cb and Cr 172 planes of a YUV 4:2:0 image have half 194 planes of a YUV 4:2:0 image have half as many padding bytes 173 following each line as the Y plane. To 195 following each line as the Y plane. To avoid ambiguities drivers 174 must return a ``bytesperline`` value r 196 must return a ``bytesperline`` value rounded up to a multiple of 175 the scale factor. 197 the scale factor. 176 * - 198 * - 177 - __u32 199 - __u32 178 - ``sizeimage`` 200 - ``sizeimage`` 179 - This field is irrelevant to *non-destr !! 201 - This field is irrelevant to *non-destructive Video Overlays*. For 180 For *Video Output Overlays* the driver !! 202 *destructive Video Overlays* applications must initialize this >> 203 field. For *Video Output Overlays* the driver must return a valid 181 format. 204 format. 182 205 183 Together with ``base`` it defines the 206 Together with ``base`` it defines the framebuffer memory 184 accessible by the driver. 207 accessible by the driver. 185 * - 208 * - 186 - enum :c:type:`v4l2_colorspace` 209 - enum :c:type:`v4l2_colorspace` 187 - ``colorspace`` 210 - ``colorspace`` 188 - This information supplements the ``pix 211 - This information supplements the ``pixelformat`` and must be set 189 by the driver, see :ref:`colorspaces`. 212 by the driver, see :ref:`colorspaces`. 190 * - 213 * - 191 - __u32 214 - __u32 192 - ``priv`` 215 - ``priv`` 193 - Reserved. Drivers and applications mus 216 - Reserved. Drivers and applications must set this field to zero. 194 217 195 .. tabularcolumns:: |p{7.4cm}|p{1.6cm}|p{8.3cm !! 218 >> 219 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 196 220 197 .. _framebuffer-cap: 221 .. _framebuffer-cap: 198 222 199 .. flat-table:: Frame Buffer Capability Flags 223 .. flat-table:: Frame Buffer Capability Flags 200 :header-rows: 0 224 :header-rows: 0 201 :stub-columns: 0 225 :stub-columns: 0 202 :widths: 3 1 4 226 :widths: 3 1 4 203 227 204 * - ``V4L2_FBUF_CAP_EXTERNOVERLAY`` 228 * - ``V4L2_FBUF_CAP_EXTERNOVERLAY`` 205 - 0x0001 229 - 0x0001 206 - The device is capable of non-destructi 230 - The device is capable of non-destructive overlays. When the driver 207 clears this flag, only destructive ove 231 clears this flag, only destructive overlays are supported. There 208 are no drivers yet which support both 232 are no drivers yet which support both destructive and 209 non-destructive overlays. Video Output 233 non-destructive overlays. Video Output Overlays are in practice 210 always non-destructive. 234 always non-destructive. 211 * - ``V4L2_FBUF_CAP_CHROMAKEY`` 235 * - ``V4L2_FBUF_CAP_CHROMAKEY`` 212 - 0x0002 236 - 0x0002 213 - The device supports clipping by chroma 237 - The device supports clipping by chroma-keying the images. That is, 214 image pixels replace pixels in the VGA 238 image pixels replace pixels in the VGA or video signal only where 215 the latter assume a certain color. Chr 239 the latter assume a certain color. Chroma-keying makes no sense 216 for destructive overlays. 240 for destructive overlays. 217 * - ``V4L2_FBUF_CAP_LIST_CLIPPING`` 241 * - ``V4L2_FBUF_CAP_LIST_CLIPPING`` 218 - 0x0004 242 - 0x0004 219 - The device supports clipping using a l 243 - The device supports clipping using a list of clip rectangles. 220 Note that this is no longer supported. << 221 * - ``V4L2_FBUF_CAP_BITMAP_CLIPPING`` 244 * - ``V4L2_FBUF_CAP_BITMAP_CLIPPING`` 222 - 0x0008 245 - 0x0008 223 - The device supports clipping using a b 246 - The device supports clipping using a bit mask. 224 Note that this is no longer supported. << 225 * - ``V4L2_FBUF_CAP_LOCAL_ALPHA`` 247 * - ``V4L2_FBUF_CAP_LOCAL_ALPHA`` 226 - 0x0010 248 - 0x0010 227 - The device supports clipping/blending 249 - The device supports clipping/blending using the alpha channel of 228 the framebuffer or VGA signal. Alpha b 250 the framebuffer or VGA signal. Alpha blending makes no sense for 229 destructive overlays. 251 destructive overlays. 230 * - ``V4L2_FBUF_CAP_GLOBAL_ALPHA`` 252 * - ``V4L2_FBUF_CAP_GLOBAL_ALPHA`` 231 - 0x0020 253 - 0x0020 232 - The device supports alpha blending usi 254 - The device supports alpha blending using a global alpha value. 233 Alpha blending makes no sense for dest 255 Alpha blending makes no sense for destructive overlays. 234 * - ``V4L2_FBUF_CAP_LOCAL_INV_ALPHA`` 256 * - ``V4L2_FBUF_CAP_LOCAL_INV_ALPHA`` 235 - 0x0040 257 - 0x0040 236 - The device supports clipping/blending 258 - The device supports clipping/blending using the inverted alpha 237 channel of the framebuffer or VGA sign 259 channel of the framebuffer or VGA signal. Alpha blending makes no 238 sense for destructive overlays. 260 sense for destructive overlays. 239 * - ``V4L2_FBUF_CAP_SRC_CHROMAKEY`` 261 * - ``V4L2_FBUF_CAP_SRC_CHROMAKEY`` 240 - 0x0080 262 - 0x0080 241 - The device supports Source Chroma-keyi 263 - The device supports Source Chroma-keying. Video pixels with the 242 chroma-key colors are replaced by fram 264 chroma-key colors are replaced by framebuffer pixels, which is 243 exactly opposite of ``V4L2_FBUF_CAP_CH 265 exactly opposite of ``V4L2_FBUF_CAP_CHROMAKEY`` 244 266 245 .. tabularcolumns:: |p{7.4cm}|p{1.6cm}|p{8.3cm !! 267 >> 268 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 246 269 247 .. _framebuffer-flags: 270 .. _framebuffer-flags: 248 271 249 .. cssclass:: longtable 272 .. cssclass:: longtable 250 273 251 .. flat-table:: Frame Buffer Flags 274 .. flat-table:: Frame Buffer Flags 252 :header-rows: 0 275 :header-rows: 0 253 :stub-columns: 0 276 :stub-columns: 0 254 :widths: 3 1 4 277 :widths: 3 1 4 255 278 256 * - ``V4L2_FBUF_FLAG_PRIMARY`` 279 * - ``V4L2_FBUF_FLAG_PRIMARY`` 257 - 0x0001 280 - 0x0001 258 - The framebuffer is the primary graphic 281 - The framebuffer is the primary graphics surface. In other words, 259 the overlay is destructive. This flag 282 the overlay is destructive. This flag is typically set by any 260 driver that doesn't have the ``V4L2_FB 283 driver that doesn't have the ``V4L2_FBUF_CAP_EXTERNOVERLAY`` 261 capability and it is cleared otherwise 284 capability and it is cleared otherwise. 262 * - ``V4L2_FBUF_FLAG_OVERLAY`` 285 * - ``V4L2_FBUF_FLAG_OVERLAY`` 263 - 0x0002 286 - 0x0002 264 - If this flag is set for a video captur 287 - If this flag is set for a video capture device, then the driver 265 will set the initial overlay size to c 288 will set the initial overlay size to cover the full framebuffer 266 size, otherwise the existing overlay s 289 size, otherwise the existing overlay size (as set by 267 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`) wi 290 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`) will be used. Only one 268 video capture driver (bttv) supports t 291 video capture driver (bttv) supports this flag. The use of this 269 flag for capture devices is deprecated 292 flag for capture devices is deprecated. There is no way to detect 270 which drivers support this flag, so th 293 which drivers support this flag, so the only reliable method of 271 setting the overlay size is through 294 setting the overlay size is through 272 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`. If 295 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`. If this flag is set for a 273 video output device, then the video ou 296 video output device, then the video output overlay window is 274 relative to the top-left corner of the 297 relative to the top-left corner of the framebuffer and restricted 275 to the size of the framebuffer. If it 298 to the size of the framebuffer. If it is cleared, then the video 276 output overlay window is relative to t 299 output overlay window is relative to the video output display. 277 * - ``V4L2_FBUF_FLAG_CHROMAKEY`` 300 * - ``V4L2_FBUF_FLAG_CHROMAKEY`` 278 - 0x0004 301 - 0x0004 279 - Use chroma-keying. The chroma-key colo 302 - Use chroma-keying. The chroma-key color is determined by the 280 ``chromakey`` field of struct :c:type: 303 ``chromakey`` field of struct :c:type:`v4l2_window` 281 and negotiated with the :ref:`VIDIOC_S 304 and negotiated with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` 282 ioctl, see :ref:`overlay` and :ref:`os 305 ioctl, see :ref:`overlay` and :ref:`osd`. 283 * - :cspan:`2` There are no flags to enabl 306 * - :cspan:`2` There are no flags to enable clipping using a list of 284 clip rectangles or a bitmap. These met 307 clip rectangles or a bitmap. These methods are negotiated with the 285 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioc 308 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay` 286 and :ref:`osd`. 309 and :ref:`osd`. 287 * - ``V4L2_FBUF_FLAG_LOCAL_ALPHA`` 310 * - ``V4L2_FBUF_FLAG_LOCAL_ALPHA`` 288 - 0x0008 311 - 0x0008 289 - Use the alpha channel of the framebuff 312 - Use the alpha channel of the framebuffer to clip or blend 290 framebuffer pixels with video images. 313 framebuffer pixels with video images. The blend function is: 291 output = framebuffer pixel * alpha + v 314 output = framebuffer pixel * alpha + video pixel * (1 - alpha). 292 The actual alpha depth depends on the 315 The actual alpha depth depends on the framebuffer pixel format. 293 * - ``V4L2_FBUF_FLAG_GLOBAL_ALPHA`` 316 * - ``V4L2_FBUF_FLAG_GLOBAL_ALPHA`` 294 - 0x0010 317 - 0x0010 295 - Use a global alpha value to blend the 318 - Use a global alpha value to blend the framebuffer with video 296 images. The blend function is: output 319 images. The blend function is: output = (framebuffer pixel * alpha 297 + video pixel * (255 - alpha)) / 255. 320 + video pixel * (255 - alpha)) / 255. The alpha value is 298 determined by the ``global_alpha`` fie 321 determined by the ``global_alpha`` field of struct 299 :c:type:`v4l2_window` and negotiated w 322 :c:type:`v4l2_window` and negotiated with the 300 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioc 323 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay` 301 and :ref:`osd`. 324 and :ref:`osd`. 302 * - ``V4L2_FBUF_FLAG_LOCAL_INV_ALPHA`` 325 * - ``V4L2_FBUF_FLAG_LOCAL_INV_ALPHA`` 303 - 0x0020 326 - 0x0020 304 - Like ``V4L2_FBUF_FLAG_LOCAL_ALPHA``, u 327 - Like ``V4L2_FBUF_FLAG_LOCAL_ALPHA``, use the alpha channel of the 305 framebuffer to clip or blend framebuff 328 framebuffer to clip or blend framebuffer pixels with video images, 306 but with an inverted alpha value. The 329 but with an inverted alpha value. The blend function is: output = 307 framebuffer pixel * (1 - alpha) + vide 330 framebuffer pixel * (1 - alpha) + video pixel * alpha. The actual 308 alpha depth depends on the framebuffer 331 alpha depth depends on the framebuffer pixel format. 309 * - ``V4L2_FBUF_FLAG_SRC_CHROMAKEY`` 332 * - ``V4L2_FBUF_FLAG_SRC_CHROMAKEY`` 310 - 0x0040 333 - 0x0040 311 - Use source chroma-keying. The source c 334 - Use source chroma-keying. The source chroma-key color is 312 determined by the ``chromakey`` field 335 determined by the ``chromakey`` field of struct 313 :c:type:`v4l2_window` and negotiated w 336 :c:type:`v4l2_window` and negotiated with the 314 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioc 337 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay` 315 and :ref:`osd`. Both chroma-keying are 338 and :ref:`osd`. Both chroma-keying are mutual exclusive to each 316 other, so same ``chromakey`` field of 339 other, so same ``chromakey`` field of struct 317 :c:type:`v4l2_window` is being used. 340 :c:type:`v4l2_window` is being used. 318 341 >> 342 319 Return Value 343 Return Value 320 ============ 344 ============ 321 345 322 On success 0 is returned, on error -1 and the 346 On success 0 is returned, on error -1 and the ``errno`` variable is set 323 appropriately. The generic error codes are des 347 appropriately. The generic error codes are described at the 324 :ref:`Generic Error Codes <gen-errors>` chapte 348 :ref:`Generic Error Codes <gen-errors>` chapter. 325 349 326 EPERM 350 EPERM 327 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` can o 351 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` can only be called by a privileged user to 328 negotiate the parameters for a destructive 352 negotiate the parameters for a destructive overlay. 329 353 330 EINVAL 354 EINVAL 331 The :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` p 355 The :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` parameters are unsuitable. >> 356 >> 357 .. [#f1] >> 358 A physical base address may not suit all platforms. GK notes in >> 359 theory we should pass something like PCI device + memory region + >> 360 offset instead. If you encounter problems please discuss on the >> 361 linux-media mailing list: >> 362 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.