diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-01-20 13:37:44 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-02-28 16:53:16 -0500 |
commit | c7361ae1e7a5a5395693f1f978af032c41cdb10d (patch) | |
tree | d17eede7e66e85e5eb836fa5755c18bb8053c802 /include/linux | |
parent | e8ca6d20a65d9d94693a0ed99b12d95b882dc859 (diff) |
[media] V4L: Add JPEG compression control class
The V4L2_CID_JPEG_CLASS control class is intended to expose various
adjustable parameters of JPEG encoders and decoders. Following controls
are defined:
- V4L2_CID_JPEG_CHROMA_SUBSAMPLING,
- V4L2_CID_JPEG_RESTART_INTERVAL,
- V4L2_CID_JPEG_COMPRESSION_QUALITY,
- V4L2_CID_JPEG_ACTIVE_MARKER.
This covers only a part of relevant standard specifications. More
controls should be added in future if required.
The purpose of V4L2_CID_JPEG_CLASS class is also to replace some
functionality covered by VIDIOC_S/G_JPEGCOMP ioctls, i.e. the JPEG
markers presence and compression quality control. The applications
and drivers should switch from the ioctl to control based API, as
described in the subsequent patches for the Media API DocBook.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/videodev2.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index b739d7d6f7e7..3fab6cacccbe 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1136,6 +1136,7 @@ struct v4l2_ext_controls { | |||
1136 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ | 1136 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ |
1137 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ | 1137 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ |
1138 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ | 1138 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ |
1139 | #define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */ | ||
1139 | 1140 | ||
1140 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1141 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
1141 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1142 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
@@ -1758,6 +1759,29 @@ enum v4l2_flash_strobe_source { | |||
1758 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | 1759 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) |
1759 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | 1760 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) |
1760 | 1761 | ||
1762 | /* JPEG-class control IDs defined by V4L2 */ | ||
1763 | #define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900) | ||
1764 | #define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1) | ||
1765 | |||
1766 | #define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1) | ||
1767 | enum v4l2_jpeg_chroma_subsampling { | ||
1768 | V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0, | ||
1769 | V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1, | ||
1770 | V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2, | ||
1771 | V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3, | ||
1772 | V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4, | ||
1773 | V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5, | ||
1774 | }; | ||
1775 | #define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2) | ||
1776 | #define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3) | ||
1777 | |||
1778 | #define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4) | ||
1779 | #define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0) | ||
1780 | #define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1) | ||
1781 | #define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16) | ||
1782 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) | ||
1783 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) | ||
1784 | |||
1761 | /* | 1785 | /* |
1762 | * T U N I N G | 1786 | * T U N I N G |
1763 | */ | 1787 | */ |