{"id":2873,"url":"https://patchwork.libcamera.org/api/patches/2873/?format=json","web_url":"https://patchwork.libcamera.org/patch/2873/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200224130855.4858-1-kieran.bingham@ideasonboard.com>","date":"2020-02-24T13:08:55","name":"[libcamera-devel] qcam: format_convertor: Extend 32 bit ARGB format combinations","commit_ref":"32ccaf458f1137b717c5a66c77d3e7dede9aa7a2","pull_url":null,"state":"accepted","archived":false,"hash":"ee3fb06c1156ab8c2bb2d5bd4bc845a8e593a8b5","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2873/mbox/","series":[{"id":690,"url":"https://patchwork.libcamera.org/api/series/690/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=690","date":"2020-02-24T13:08:55","name":"[libcamera-devel] qcam: format_convertor: Extend 32 bit ARGB format combinations","version":1,"mbox":"https://patchwork.libcamera.org/series/690/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2873/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2873/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 41AE06042F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Feb 2020 14:08:59 +0100 (CET)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A5009E89;\n\tMon, 24 Feb 2020 14:08:58 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582549738;\n\tbh=OyRp8/m8k38MSR5yuIp69dCJyViPLbE7s/7fHfwHGko=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=kCYpWiq4akCB5FxrRi50DtLfTiuTV8jM8cYZuJNHzNY74+EybZc6hKsSDnpAEkz9m\n\tb0g+zynRgJYycNrmSXAjkgICgsMWssL25Hy2YHTkodbo0o5vXRnOk4uB2uqYSLVwnT\n\t9JpGqO4Rl/0cmyHPXo2hnnfW27F8EfFQzcXXUTtQ=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Mon, 24 Feb 2020 13:08:55 +0000","Message-Id":"<20200224130855.4858-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] qcam: format_convertor: Extend 32 bit\n\tARGB format combinations","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Mon, 24 Feb 2020 13:08:59 -0000"},"content":"Add further support to the pixel format convertor to allow ARGB, RGBA,\nand ABGR formats to be displayed in qcam.\n\nBlank lines are added between the sections for NV, RGB, YUV, and MJPEG\nconfigurations.\n\nThe implementation of the RGB conversions are highly inefficient, and\nwhere possible should be extended to use hardware accellerations such as\nOpenGL, or in the event that the input format is identical (or\ncompatible) with the output format - a more optimised memcpy should be\nimplemented.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/qcam/format_converter.cpp | 25 +++++++++++++++++++++++++\n 1 file changed, 25 insertions(+)","diff":"diff --git a/src/qcam/format_converter.cpp b/src/qcam/format_converter.cpp\nindex 383d48223140..4604143419dd 100644\n--- a/src/qcam/format_converter.cpp\n+++ b/src/qcam/format_converter.cpp\n@@ -67,6 +67,7 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n \t\tvertSubSample_ = 1;\n \t\tnvSwap_ = true;\n \t\tbreak;\n+\n \tcase DRM_FORMAT_RGB888:\n \t\tformatFamily_ = RGB;\n \t\tr_pos_ = 2;\n@@ -81,6 +82,27 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n \t\tb_pos_ = 2;\n \t\tbpp_ = 3;\n \t\tbreak;\n+\tcase DRM_FORMAT_ARGB8888:\n+\t\tformatFamily_ = RGB;\n+\t\tr_pos_ = 2;\n+\t\tg_pos_ = 1;\n+\t\tb_pos_ = 0;\n+\t\tbpp_ = 4;\n+\t\tbreak;\n+\tcase DRM_FORMAT_RGBA8888:\n+\t\tformatFamily_ = RGB;\n+\t\tr_pos_ = 3;\n+\t\tg_pos_ = 2;\n+\t\tb_pos_ = 1;\n+\t\tbpp_ = 4;\n+\t\tbreak;\n+\tcase DRM_FORMAT_ABGR8888:\n+\t\tformatFamily_ = RGB;\n+\t\tr_pos_ = 0;\n+\t\tg_pos_ = 1;\n+\t\tb_pos_ = 2;\n+\t\tbpp_ = 4;\n+\t\tbreak;\n \tcase DRM_FORMAT_BGRA8888:\n \t\tformatFamily_ = RGB;\n \t\tr_pos_ = 1;\n@@ -88,6 +110,7 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n \t\tb_pos_ = 3;\n \t\tbpp_ = 4;\n \t\tbreak;\n+\n \tcase DRM_FORMAT_VYUY:\n \t\tformatFamily_ = YUV;\n \t\ty_pos_ = 1;\n@@ -108,9 +131,11 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n \t\ty_pos_ = 0;\n \t\tcb_pos_ = 1;\n \t\tbreak;\n+\n \tcase DRM_FORMAT_MJPEG:\n \t\tformatFamily_ = MJPEG;\n \t\tbreak;\n+\n \tdefault:\n \t\treturn -EINVAL;\n \t};\n","prefixes":["libcamera-devel"]}