[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190924074303.22713-5-xia.jiang@mediatek.com>
Date: Tue, 24 Sep 2019 15:43:04 +0800
From: Xia Jiang <xia.jiang@...iatek.com>
To: Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Rick Chang <rick.chang@...iatek.com>
CC: <linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Tomasz Figa <tfiga@...omium.org>,
<srv_heupstream@...iatek.com>, Xia Jiang <xia.jiang@...iatek.com>
Subject: [PATCH v3 4/5] media: v4l2-ctrl: Add jpeg enc exif mode control
Add jpeg enc CID definition for exif mode control.
Signed-off-by: Xia Jiang <xia.jiang@...iatek.com>
---
v3: new add patch for V4L2_CID_JPEG_ENABLE_EXIF
---
Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst | 10 ++++++++++
drivers/media/v4l2-core/v4l2-ctrls.c | 1 +
include/uapi/linux/v4l2-controls.h | 2 ++
3 files changed, 13 insertions(+)
diff --git a/Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst b/Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst
index 60ce3f949319..d44a539e2eb4 100644
--- a/Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst
+++ b/Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst
@@ -109,5 +109,15 @@ JPEG Control IDs
+``V4L2_CID_JPEG_ENABLE_EXIF (integer)``
+ ``V4L2_CID_JPEG_ENABLE_EXIF (integer)`` control determines JPEG
+ encoder mode. Its value of 0 means JPEG mode, 1 means EXIF mode. If
+ EXIF mode is enabled, the JPEG encoder will not write out SOI marker
+ (start from 0xffd8) but write out from DQT marker(start from
+ 0xffdb). Software program can fill the EXIF content above the DQT
+ marker to finish one EXIF JPEG.
+
+
+
For more details about JPEG specification, refer to :ref:`itu-t81`,
:ref:`jfif`, :ref:`w3c-jpeg-jfif`.
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 371537dd8cd3..c96c10480ebd 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1025,6 +1025,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_JPEG_RESTART_INTERVAL: return "Restart Interval";
case V4L2_CID_JPEG_COMPRESSION_QUALITY: return "Compression Quality";
case V4L2_CID_JPEG_ACTIVE_MARKER: return "Active Markers";
+ case V4L2_CID_JPEG_ENABLE_EXIF: return "Enable Exif";
/* Image source controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index a2669b79b294..da619f43de65 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -1022,6 +1022,8 @@ enum v4l2_jpeg_chroma_subsampling {
#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
+#define V4L2_CID_JPEG_ENABLE_EXIF (V4L2_CID_JPEG_CLASS_BASE + 5)
+
/* Image source controls */
#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
--
2.18.0
Powered by blists - more mailing lists