Patch Detail
Show a patch.
GET /api/patches/17008/?format=api
{ "id": 17008, "url": "https://patchwork.libcamera.org/api/patches/17008/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17008/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220807021718.9789-5-laurent.pinchart@ideasonboard.com>", "date": "2022-08-07T02:17:18", "name": "[libcamera-devel,4/4] cam: sdl_sink: Add NV12 texture support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ab068b0025ecb055a21cb9efcce25f48e431220b", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17008/mbox/", "series": [ { "id": 3381, "url": "https://patchwork.libcamera.org/api/series/3381/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3381", "date": "2022-08-07T02:17:14", "name": "cam: Add support for NV12 in the SDL sink", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3381/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17008/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17008/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 998D6BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 7 Aug 2022 02:17:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55C026332E;\n\tSun, 7 Aug 2022 04:17:35 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 20BA663331\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 7 Aug 2022 04:17:32 +0200 (CEST)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AB4A2749;\n\tSun, 7 Aug 2022 04:17:31 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659838655;\n\tbh=t0x7iEmrjVYVZIpr1cK7XLRTsEHqHUuC03jI5hSuqco=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Y6eftFDCz3rmOWKMm5dZWmmj+NwSz9iKufsUDa/NwbVSzOadds0rqgXlfoM61N/0j\n\t9issS2lmfoMGOB7ZGGK7EhQNMm2QyRDIZJ1AoJxTuwHVGlkmgMdtUP9yCyuk31xybv\n\ttqzWah4cSRIBGd3shlX1ouGXDkrCo9dKnvoWTkr3QIdK9vyspLuyJItWcNHLWchFZP\n\toTk+KlWFpPRDIy/mcanhU64BtvQyXG5zf2sfCVieJEY/SvVbmzuCbR2ZusqDo4sz6o\n\tP9bfcvN+AH3ehGNGn3jIJwXXBXw2vTFgcvA/91KsByC388d/l8wO58Q3U0sq6G5PgF\n\t1kvDYB7JqL/uA==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659838651;\n\tbh=t0x7iEmrjVYVZIpr1cK7XLRTsEHqHUuC03jI5hSuqco=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rHdNUG7lg6L+haxzT4ls6jZagOwtNRIEvugm9HKJnQQdwYs+pFuLYasiS8z0KCnCl\n\tqrp16txMq7Eu1ORgDpphb+Vvne9WPnSQOEbpgkEwodYq/OKO2KCZ5wjlkWWgFHCAJM\n\t94ye89M3IC98jmCCyKHv66EPhNGNXcRx/6/jxOaE=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rHdNUG7l\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 7 Aug 2022 05:17:18 +0300", "Message-Id": "<20220807021718.9789-5-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>", "References": "<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 4/4] cam: sdl_sink: Add NV12 texture\n\tsupport", "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>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Extend the SDL sink with support for NV12 textures, useful on platforms\nthat don't support packed YUYV formats.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/cam/sdl_sink.cpp | 3 +++\n src/cam/sdl_texture_yuv.cpp | 13 ++++++++++++-\n src/cam/sdl_texture_yuv.h | 9 ++++++++-\n 3 files changed, 23 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp\nindex 9675cf275186..23fe2b1e9f05 100644\n--- a/src/cam/sdl_sink.cpp\n+++ b/src/cam/sdl_sink.cpp\n@@ -67,6 +67,9 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n \t\ttexture_ = std::make_unique<SDLTextureMJPG>(rect_);\n \t\tbreak;\n #endif\n+\tcase libcamera::formats::NV12:\n+\t\ttexture_ = std::make_unique<SDLTextureNV12>(rect_, cfg.stride);\n+\t\tbreak;\n \tcase libcamera::formats::YUYV:\n \t\ttexture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);\n \t\tbreak;\ndiff --git a/src/cam/sdl_texture_yuv.cpp b/src/cam/sdl_texture_yuv.cpp\nindex a5721182a68b..431e836d2d2c 100644\n--- a/src/cam/sdl_texture_yuv.cpp\n+++ b/src/cam/sdl_texture_yuv.cpp\n@@ -2,13 +2,24 @@\n /*\n * Copyright (C) 2022, Ideas on Board Oy\n *\n- * sdl_texture_yuv.cpp - SDL Texture YUYV\n+ * sdl_texture_yuv.cpp - SDL YUV Textures\n */\n \n #include \"sdl_texture_yuv.h\"\n \n using namespace libcamera;\n \n+SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride)\n+\t: SDLTexture(rect, SDL_PIXELFORMAT_NV12, stride)\n+{\n+}\n+\n+void SDLTextureNV12::update(const std::vector<libcamera::Span<const uint8_t>> &data)\n+{\n+\tSDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), pitch_,\n+\t\t\t data[1].data(), pitch_);\n+}\n+\n SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)\n \t: SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)\n {\ndiff --git a/src/cam/sdl_texture_yuv.h b/src/cam/sdl_texture_yuv.h\nindex c9130298b91d..9da611fe0e36 100644\n--- a/src/cam/sdl_texture_yuv.h\n+++ b/src/cam/sdl_texture_yuv.h\n@@ -2,13 +2,20 @@\n /*\n * Copyright (C) 2022, Ideas on Board Oy\n *\n- * sdl_texture_yuyv.h - SDL Texture YUYV\n+ * sdl_texture_yuyv.h - SDL YUV Textures\n */\n \n #pragma once\n \n #include \"sdl_texture.h\"\n \n+class SDLTextureNV12 : public SDLTexture\n+{\n+public:\n+\tSDLTextureNV12(const SDL_Rect &rect, unsigned int stride);\n+\tvoid update(const std::vector<libcamera::Span<const uint8_t>> &data) override;\n+};\n+\n class SDLTextureYUYV : public SDLTexture\n {\n public:\n", "prefixes": [ "libcamera-devel", "4/4" ] }