From 977ff0e4fb3460df9f3dd27de92d60786be28645 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 21 May 2014 22:07:55 -0300 Subject: [media] v4l: Add ARGB and XRGB pixel formats The existing RGB pixel formats are ill-defined in respect to their alpha bits and their meaning is driver dependent. Create new standard ARGB and XRGB variants with clearly defined meanings and make the existing variants deprecated. The new pixel formats 4CC values have been selected to match the DRM 4CCs for the same in-memory formats. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- .../DocBook/media/v4l/pixfmt-packed-rgb.xml | 415 ++++++++++++++++++++- 1 file changed, 395 insertions(+), 20 deletions(-) (limited to 'Documentation/DocBook') diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index e1c4f8b4c0b3..5f1602fe5494 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml @@ -130,9 +130,9 @@ colorspace V4L2_COLORSPACE_SRGB. b1 b0 - - V4L2_PIX_FMT_RGB444 - 'R444' + + V4L2_PIX_FMT_ARGB444 + 'AR12' g3 g2 @@ -152,9 +152,31 @@ colorspace V4L2_COLORSPACE_SRGB. r1 r0 - - V4L2_PIX_FMT_RGB555 - 'RGBO' + + V4L2_PIX_FMT_XRGB444 + 'XR12' + + g3 + g2 + g1 + g0 + b3 + b2 + b1 + b0 + + - + - + - + - + r3 + r2 + r1 + r0 + + + V4L2_PIX_FMT_ARGB555 + 'AR15' g2 g1 @@ -174,6 +196,28 @@ colorspace V4L2_COLORSPACE_SRGB. g4 g3 + + V4L2_PIX_FMT_XRGB555 + 'XR15' + + g2 + g1 + g0 + b4 + b3 + b2 + b1 + b0 + + - + r4 + r3 + r2 + r1 + r0 + g4 + g3 + V4L2_PIX_FMT_RGB565 'RGBP' @@ -341,9 +385,9 @@ colorspace V4L2_COLORSPACE_SRGB. b1 b0 - - V4L2_PIX_FMT_BGR32 - 'BGR4' + + V4L2_PIX_FMT_ABGR32 + 'AR24' b7 b6 @@ -381,9 +425,49 @@ colorspace V4L2_COLORSPACE_SRGB. a1 a0 - - V4L2_PIX_FMT_RGB32 - 'RGB4' + + V4L2_PIX_FMT_XBGR32 + 'XR24' + + b7 + b6 + b5 + b4 + b3 + b2 + b1 + b0 + + g7 + g6 + g5 + g4 + g3 + g2 + g1 + g0 + + r7 + r6 + r5 + r4 + r3 + r2 + r1 + r0 + + - + - + - + - + - + - + - + - + + + V4L2_PIX_FMT_ARGB32 + 'AX24' a7 a6 @@ -421,18 +505,76 @@ colorspace V4L2_COLORSPACE_SRGB. b1 b0 + + V4L2_PIX_FMT_XRGB32 + 'BX24' + + - + - + - + - + - + - + - + - + + r7 + r6 + r5 + r4 + r3 + r2 + r1 + r0 + + g7 + g6 + g5 + g4 + g3 + g2 + g1 + g0 + + b7 + b6 + b5 + b4 + b3 + b2 + b1 + b0 + - Bit 7 is the most significant bit. The value of the a = alpha -bits is undefined when reading from the driver, ignored when writing -to the driver, except when alpha blending has been negotiated for a -Video Overlay or -Video Output Overlay or when the alpha component has been configured -for a Video Capture by means of V4L2_CID_ALPHA_COMPONENT - control. + Bit 7 is the most significant bit. + + The usage and value of the alpha bits (a) in the ARGB and ABGR formats + (collectively referred to as alpha formats) depend on the device type and + hardware operation. Capture devices + (including capture queues of mem-to-mem devices) fill the alpha component in + memory. When the device outputs an alpha channel the alpha component will + have a meaningful value. Otherwise, when the device doesn't output an alpha + channel but can set the alpha bit to a user-configurable value, the V4L2_CID_ALPHA_COMPONENT + control is used to specify that alpha value, and the alpha component + of all pixels will be set to the value specified by that control. Otherwise + a corresponding format without an alpha component (XRGB or XBGR) must be + used instead of an alpha format. + + Output devices (including output queues + of mem-to-mem devices and video output overlay + devices) read the alpha component from memory. When the device processes the + alpha channel the alpha component must be filled with meaningful values by + applications. Otherwise a corresponding format without an alpha component + (XRGB or XBGR) must be used instead of an alpha format. + + The XRGB and XBGR formats contain undefined bits (-). Applications, + devices and drivers must ignore those bits, for both capture and output + devices. <constant>V4L2_PIX_FMT_BGR24</constant> 4 × 4 pixel @@ -512,6 +654,239 @@ image + Formats defined in are + deprecated and must not be used by new drivers. They are documented here for + reference. The meaning of their alpha bits (a) is ill-defined and + interpreted as in either the corresponding ARGB or XRGB format, depending on + the driver. + + + Deprecated Packed RGB Image Formats + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifier + Code +   + Byte 0 in memory + Byte 1 + Byte 2 + Byte 3 + + +   +   + Bit + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 +   + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 +   + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 +   + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 + + + + + V4L2_PIX_FMT_RGB444 + 'R444' + + g3 + g2 + g1 + g0 + b3 + b2 + b1 + b0 + + a3 + a2 + a1 + a0 + r3 + r2 + r1 + r0 + + + V4L2_PIX_FMT_RGB555 + 'RGBO' + + g2 + g1 + g0 + b4 + b3 + b2 + b1 + b0 + + a + r4 + r3 + r2 + r1 + r0 + g4 + g3 + + + V4L2_PIX_FMT_BGR32 + 'BGR4' + + b7 + b6 + b5 + b4 + b3 + b2 + b1 + b0 + + g7 + g6 + g5 + g4 + g3 + g2 + g1 + g0 + + r7 + r6 + r5 + r4 + r3 + r2 + r1 + r0 + + a7 + a6 + a5 + a4 + a3 + a2 + a1 + a0 + + + V4L2_PIX_FMT_RGB32 + 'RGB4' + + a7 + a6 + a5 + a4 + a3 + a2 + a1 + a0 + + r7 + r6 + r5 + r4 + r3 + r2 + r1 + r0 + + g7 + g6 + g5 + g4 + g3 + g2 + g1 + g0 + + b7 + b6 + b5 + b4 + b3 + b2 + b1 + b0 + + + +
+ A test utility to determine which RGB formats a driver actually supports is available from the LinuxTV v4l-dvb repository. See &v4l-dvb; for access instructions. -- cgit v1.2.3