From patchwork Thu Aug 2 20:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10554135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BEF3D13BF for ; Thu, 2 Aug 2018 20:00:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A895D2C3EF for ; Thu, 2 Aug 2018 20:00:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CA8A2C46C; Thu, 2 Aug 2018 20:00:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4B2222C3F3 for ; Thu, 2 Aug 2018 20:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=k1zg5NZ8fo3y2ZYqh+m2TLSDxGMl3tneX9bgGvIyL20=; b=LO+cQlcOZeLSG4yHp4UFTuFIfF jGETUlmRt9pd6oPHbe5Od4X5kFSFs80CmYZSJbkCeksZQd/d1ahGgmLggAZnsyYka8L8+gDRR0nMa 13MTE9g1TgqMNj1+lKA4u/ilhMxSDeZ+26qzxFFu6W2NpUXJUUWnl4AMc7WV5ZgHYJRmSLTCg04JI ovdJwxvTYARlso/dk0pWaJiBlwB6dCgoyoWAvfkr2y0BWDFTq1BIFE6opSmzmSOXsMF+iHdqLg0T5 LywekAyYhNteHAw0iYYJprlZb2W6UvMhWcTwbPYgPoDIPI/EGXB6oCYIbBdl6UgpE/HzVEPYiNWM7 raI/npZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flJmF-0005fU-7j; Thu, 02 Aug 2018 20:00:51 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1flJmB-0005Vj-LA for linux-rockchip@lists.infradead.org; Thu, 02 Aug 2018 20:00:49 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 57C5A27E0AF From: Ezequiel Garcia To: linux-media@vger.kernel.org Subject: [PATCH v2 4/6] media: Add JPEG_RAW format Date: Thu, 2 Aug 2018 17:00:08 -0300 Message-Id: <20180802200010.24365-5-ezequiel@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180802200010.24365-1-ezequiel@collabora.com> References: <20180802200010.24365-1-ezequiel@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180802_130047_845210_F569B74C X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Nicolas Dufresne , Ezequiel Garcia , Tomasz Figa , linux-rockchip@lists.infradead.org, Rob Herring , Hans Verkuil , kernel@collabora.com, Shunqian Zheng MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shunqian Zheng Add V4L2_PIX_FMT_JPEG_RAW format that does not contain JPEG header in the output frame. Signed-off-by: Shunqian Zheng Signed-off-by: Ezequiel Garcia --- Documentation/media/uapi/v4l/pixfmt-compressed.rst | 9 +++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 11 insertions(+) diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documentation/media/uapi/v4l/pixfmt-compressed.rst index d382e7a5c38e..4dffe40097f2 100644 --- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst +++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst @@ -23,6 +23,15 @@ Compressed Formats - 'JPEG' - TBD. See also :ref:`VIDIOC_G_JPEGCOMP `, :ref:`VIDIOC_S_JPEGCOMP `. + * .. _V4L2-PIX-FMT-JPEG-RAW: + + - ``V4L2_PIX_FMT_JPEG_RAW`` + - 'Raw JPEG' + - Raw JPEG bitstream, containing a compressed payload. This format + contains an image scan, i.e. without any metadata or headers. + The user is expected to set the needed metadata such as + quantization and entropy encoding tables, via ``V4L2_CID_JPEG`` + controls, see :ref:`jpeg-control-id`. * .. _V4L2-PIX-FMT-MPEG: - ``V4L2_PIX_FMT_MPEG`` diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 26d9702069fd..7eac5e39ddac 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1296,6 +1296,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) /* Max description length mask: descr = "0123456789012345678901234567890" */ case V4L2_PIX_FMT_MJPEG: descr = "Motion-JPEG"; break; case V4L2_PIX_FMT_JPEG: descr = "JFIF JPEG"; break; + case V4L2_PIX_FMT_JPEG_RAW: descr = "Raw JPEG"; break; case V4L2_PIX_FMT_DV: descr = "1394"; break; case V4L2_PIX_FMT_MPEG: descr = "MPEG-1/2/4"; break; case V4L2_PIX_FMT_H264: descr = "H.264"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index d8b33095abe0..72b458c8f49f 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -621,6 +621,7 @@ struct v4l2_pix_format { /* compressed formats */ #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ +#define V4L2_PIX_FMT_JPEG_RAW v4l2_fourcc('J', 'P', 'G', 'R') /* JFIF JPEG RAW without headers */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */ #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */