[{"id":24397,"web_url":"https://patchwork.libcamera.org/comment/24397/","msgid":"<165991086596.1706285.5557160656120018502@Monstersaurus>","date":"2022-08-07T22:21:05","subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-08-07 03:17:15)\n> The line stride of the texture is currently hardcoded based on the image\n> width, which may not match the real stride. Use the stride value from\n> the stream configuration instead.\n> \n\nLooks reasonable\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/cam/sdl_sink.cpp         | 2 +-\n>  src/cam/sdl_texture_yuyv.cpp | 4 ++--\n>  src/cam/sdl_texture_yuyv.h   | 2 +-\n>  3 files changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp\n> index 19fdfd6dced5..a59d07519e1f 100644\n> --- a/src/cam/sdl_sink.cpp\n> +++ b/src/cam/sdl_sink.cpp\n> @@ -68,7 +68,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n>                 break;\n>  #endif\n>         case libcamera::formats::YUYV:\n> -               texture_ = std::make_unique<SDLTextureYUYV>(rect_);\n> +               texture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);\n>                 break;\n>         default:\n>                 std::cerr << \"Unsupported pixel format \"\n> diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp\n> index 637c0900edff..cb51fb0ef478 100644\n> --- a/src/cam/sdl_texture_yuyv.cpp\n> +++ b/src/cam/sdl_texture_yuyv.cpp\n> @@ -9,8 +9,8 @@\n>  \n>  using namespace libcamera;\n>  \n> -SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect)\n> -       : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, 4 * ((rect.w + 1) / 2))\n> +SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)\n> +       : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)\n>  {\n>  }\n>  \n> diff --git a/src/cam/sdl_texture_yuyv.h b/src/cam/sdl_texture_yuyv.h\n> index 529a72d6a40e..81e51381ec62 100644\n> --- a/src/cam/sdl_texture_yuyv.h\n> +++ b/src/cam/sdl_texture_yuyv.h\n> @@ -12,6 +12,6 @@\n>  class SDLTextureYUYV : public SDLTexture\n>  {\n>  public:\n> -       SDLTextureYUYV(const SDL_Rect &rect);\n> +       SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride);\n>         void update(libcamera::Span<const uint8_t> data) override;\n>  };\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 2E459BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  7 Aug 2022 22:21:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5B0E56332B;\n\tMon,  8 Aug 2022 00:21:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 132B9603EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Aug 2022 00:21:09 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 494C63F1;\n\tMon,  8 Aug 2022 00:21:08 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659910871;\n\tbh=9rdrWLlnjqnYjQOFUjQOnPSWfM8MsXqtJHE3vygKS0U=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Hz+up6ZvR8E8F3uXlPTG9xe56jNcJDaZ3nHZtTUsypuExuqCxI1AG8Td3sVDkBsaU\n\t//VzvwI6p//rtfxBLV4pVIjIitGQvoLAtSf8/SMApij4hLxp4X4q+ha4yBs6JJJmj4\n\to5uthchjko77qgwMVZ2iRxx6x0KBYzjzmlU16L6laPiyKm4FCIlXz9VwtTNckwIH3A\n\tFIQpocGPmBkWgsJeMNHFiF14XNuMmCwQu3BFhu2majl6Sb7hT9rs4DHKQpvq40Ui2X\n\tExpzPaPMtAOYPcGn/rJyS89GM6QjnDUyoLplXlKp9koEy988Q4SRiT03VMS/w6Vd87\n\tJRpXlIPGpaSeA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659910868;\n\tbh=9rdrWLlnjqnYjQOFUjQOnPSWfM8MsXqtJHE3vygKS0U=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=ogtwjXE6VitzFIJODAfUylX3HunpE3ng5mRXE5IR7BaTBpnC7+tEXAlcdlpifLLbT\n\tqyysGLf0kRvCKhwXRC1G4B2yaXvaQWw7Sq73bw66nygwnImCj8qrdAjJEUJ3sxWi7r\n\tQ4PtU4vnZyGw/sov/8sQDW4cUwBbj7DakjaXz6vs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ogtwjXE6\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","References":"<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>\n\t<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Sun, 07 Aug 2022 23:21:05 +0100","Message-ID":"<165991086596.1706285.5557160656120018502@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24408,"web_url":"https://patchwork.libcamera.org/comment/24408/","msgid":"<20220808082034.gpac3hbyz7ep2dqx@uno.localdomain>","date":"2022-08-08T08:20:34","subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Sun, Aug 07, 2022 at 05:17:15AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> The line stride of the texture is currently hardcoded based on the image\n> width, which may not match the real stride. Use the stride value from\n> the stream configuration instead.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/cam/sdl_sink.cpp         | 2 +-\n>  src/cam/sdl_texture_yuyv.cpp | 4 ++--\n>  src/cam/sdl_texture_yuyv.h   | 2 +-\n>  3 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp\n> index 19fdfd6dced5..a59d07519e1f 100644\n> --- a/src/cam/sdl_sink.cpp\n> +++ b/src/cam/sdl_sink.cpp\n> @@ -68,7 +68,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n>  \t\tbreak;\n>  #endif\n>  \tcase libcamera::formats::YUYV:\n> -\t\ttexture_ = std::make_unique<SDLTextureYUYV>(rect_);\n> +\t\ttexture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);\n>  \t\tbreak;\n>  \tdefault:\n>  \t\tstd::cerr << \"Unsupported pixel format \"\n> diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp\n> index 637c0900edff..cb51fb0ef478 100644\n> --- a/src/cam/sdl_texture_yuyv.cpp\n> +++ b/src/cam/sdl_texture_yuyv.cpp\n> @@ -9,8 +9,8 @@\n>\n>  using namespace libcamera;\n>\n> -SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect)\n> -\t: SDLTexture(rect, SDL_PIXELFORMAT_YUY2, 4 * ((rect.w + 1) / 2))\n> +SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)\n\nnit: the base class has the same parameter but calls it \"pitch\".\n\nThe rest looks good\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n\n> +\t: SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)\n>  {\n>  }\n>\n> diff --git a/src/cam/sdl_texture_yuyv.h b/src/cam/sdl_texture_yuyv.h\n> index 529a72d6a40e..81e51381ec62 100644\n> --- a/src/cam/sdl_texture_yuyv.h\n> +++ b/src/cam/sdl_texture_yuyv.h\n> @@ -12,6 +12,6 @@\n>  class SDLTextureYUYV : public SDLTexture\n>  {\n>  public:\n> -\tSDLTextureYUYV(const SDL_Rect &rect);\n> +\tSDLTextureYUYV(const SDL_Rect &rect, unsigned int stride);\n>  \tvoid update(libcamera::Span<const uint8_t> data) override;\n>  };\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 BBEDEC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Aug 2022 08:20:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B37463327;\n\tMon,  8 Aug 2022 10:20:45 +0200 (CEST)","from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A539863326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Aug 2022 10:20:43 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 0007FC0007;\n\tMon,  8 Aug 2022 08:20:42 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659946845;\n\tbh=tKD+H+VcbqD8ovYTFRIF4Gcl8fGcFVNj5e41oeB045A=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=J1WS/EbRd03QJzZZs4Q8XpAVXJMgdQk8Tc26JzC6dXu2iHLBaqZOIeyZQ+TQR9ach\n\t32ljP8bnJj4dhrzzwo5+UO0o9Xn8eIHOF9Y81vwe6QnWVpqnSFr72Lf5bC+7WpL6mG\n\trOTxHl2EzEUzD74IVWn8niwWLBSK3O5cb1vfRXQoRvibWWd4NKmJhfcQMfLgof+BQ6\n\t4SxO7y+On9BMXE7bH8RspjANmvzPohzw/aYyju7zC3iFfbLT1QLWoWZ1B+DRAW54jq\n\t/wLVHwHNDzsMnfewx6WyPoHXjgm0FFMi7/BjtNFN6P/JR4zKO98kQ113NKZEhNMh+D\n\tSZMbRZTYuqFow==","Date":"Mon, 8 Aug 2022 10:20:34 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220808082034.gpac3hbyz7ep2dqx@uno.localdomain>","References":"<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>\n\t<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24419,"web_url":"https://patchwork.libcamera.org/comment/24419/","msgid":"<CAOgh=FxZfmJEaKVphnp52p2GYR878RfdGPDi-=unz8zdD5k+uw@mail.gmail.com>","date":"2022-08-08T09:19:52","subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/people/101/","name":"Eric Curtin","email":"ecurtin@redhat.com"},"content":"Hi Laurent,\n\nGood morning.\n\nOn Sun, 7 Aug 2022 at 03:17, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> The line stride of the texture is currently hardcoded based on the image\n> width, which may not match the real stride. Use the stride value from\n> the stream configuration instead.\n>\n\nOptionally if you'd like to fix the pitch/stride inconsistency in the\ncode, pre-existing this change of course.\n\nReviewed-by: Eric Curtin <ecurtin@redhat.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/cam/sdl_sink.cpp         | 2 +-\n>  src/cam/sdl_texture_yuyv.cpp | 4 ++--\n>  src/cam/sdl_texture_yuyv.h   | 2 +-\n>  3 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp\n> index 19fdfd6dced5..a59d07519e1f 100644\n> --- a/src/cam/sdl_sink.cpp\n> +++ b/src/cam/sdl_sink.cpp\n> @@ -68,7 +68,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n>                 break;\n>  #endif\n>         case libcamera::formats::YUYV:\n> -               texture_ = std::make_unique<SDLTextureYUYV>(rect_);\n> +               texture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);\n>                 break;\n>         default:\n>                 std::cerr << \"Unsupported pixel format \"\n> diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp\n> index 637c0900edff..cb51fb0ef478 100644\n> --- a/src/cam/sdl_texture_yuyv.cpp\n> +++ b/src/cam/sdl_texture_yuyv.cpp\n> @@ -9,8 +9,8 @@\n>\n>  using namespace libcamera;\n>\n> -SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect)\n> -       : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, 4 * ((rect.w + 1) / 2))\n> +SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)\n> +       : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)\n>  {\n>  }\n>\n> diff --git a/src/cam/sdl_texture_yuyv.h b/src/cam/sdl_texture_yuyv.h\n> index 529a72d6a40e..81e51381ec62 100644\n> --- a/src/cam/sdl_texture_yuyv.h\n> +++ b/src/cam/sdl_texture_yuyv.h\n> @@ -12,6 +12,6 @@\n>  class SDLTextureYUYV : public SDLTexture\n>  {\n>  public:\n> -       SDLTextureYUYV(const SDL_Rect &rect);\n> +       SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride);\n>         void update(libcamera::Span<const uint8_t> data) override;\n>  };\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 6FE6BC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Aug 2022 09:20:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ADCBB6332B;\n\tMon,  8 Aug 2022 11:20:12 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 31D5463326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Aug 2022 11:20:11 +0200 (CEST)","from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n\t[209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-231-VkL2AgTDOXSheQoiocTl0w-1; Mon, 08 Aug 2022 05:20:08 -0400","by mail-qk1-f197.google.com with SMTP id\n\tay35-20020a05620a17a300b006b5d9646d31so7426526qkb.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 08 Aug 2022 02:20:08 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659950412;\n\tbh=8sZzKlrhRVMltBrthOQT7JWTD14apRkmvqjThJToK1c=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=pnsoIHkMy5MdBCN+P5QWsA74r+aOAnIXEVv/oIJJdwJ90ExxR+rgJNBNf11jylBGQ\n\t7L5rjZTX+FBvghwfM7qDyBmbPB8S74pKfaifeDnWYh8PXc0st0ZxOwNo62Yzyaq0mE\n\tu8ar1vxJ5JfzQln5or4CJztwswars8Gte3PMShoXEL5OBURTC5MTeiYrVvFsf6XUXx\n\tjCfsX5/k5cIRLsrIcduAai4RHqmVMS9YjzWa9W3o6VyGGUwK9ud9wCCHvRWYYl0Q+z\n\tSEsBG09TsIVmwEj2Qh7fpdKoyihcb7vAj8a6y93Rqrq9wfc6g8Sogbl66s6y71zj+k\n\tiv9T79wWz7gZQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1659950409;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=qahFmQPSRufrEbdUfFTlDjrtX/WnOJlQsHP+Zj6eKGA=;\n\tb=Xj2odf3EaKCqHcELq5kuyjJMtHLKuxtffJLVM5qMeI21pLar/JcHL0JDKHDVRV/udmel6E\n\tuXfxLswn/HbF435CFebXyDrZmf5O7dGkJdwpTmaVSdGIRQPJAQKCdLFw9pE8brfVxlQ4dJ\n\tDjPAGDCv2wmZdz1J3ouuT0ncDrFd1DQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"Xj2odf3E\"; \n\tdkim-atps=neutral","X-MC-Unique":"VkL2AgTDOXSheQoiocTl0w-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=qahFmQPSRufrEbdUfFTlDjrtX/WnOJlQsHP+Zj6eKGA=;\n\tb=F+vjUe75TxjMocAm0SdN8Qmv3+ifKFYFqCMg5YD71HJOJdliSghz50oRffvw9Lp49v\n\tNgBKyywf6i95erwEbV/tKxesqxzwhP9cygGruNAhqB86CYFELTJHZYwq9mAdgt3k1X2J\n\tss+LmsaBMZ5r79DXyn/j19VCKHRTMFZMjELBB77GapvAvdSxhZWDrXY8W/zw4PgjQNnQ\n\ty68r/h1uu9Y+3YfMsyf0ioedVzoT7NW29VZaxK8QxRRFul5tpjqZ/+LkIV7b0CNU27/x\n\t6ifbJWpjyp9cXgByf+FNtPiM6Hh9r0U8+i9TLqseYRtzlXcJnKa9pK/wv7Mvvgjc96Eb\n\tuPRA==","X-Gm-Message-State":"ACgBeo2OpQUSZLkEXhAt9bqeovn4iGPD0YnhO2gIJtKE9IEJXPXHRokB\n\tYuReKbS8WOfQ3dst/dCjuJ8HevISJgnM7/gTONgWYu7nTvW7spT/PRk2XOYGEQwvrnatAtNO7EY\n\txisNUp+TAM4tvinF7Qz8wcog6T1GPVzD+9W5OZ5zHdceY34i5Gg==","X-Received":["by 2002:ac8:5cd0:0:b0:342:eb4f:6e36 with SMTP id\n\ts16-20020ac85cd0000000b00342eb4f6e36mr7274101qta.638.1659950408247; \n\tMon, 08 Aug 2022 02:20:08 -0700 (PDT)","by 2002:ac8:5cd0:0:b0:342:eb4f:6e36 with SMTP id\n\ts16-20020ac85cd0000000b00342eb4f6e36mr7274093qta.638.1659950408016;\n\tMon, 08 Aug 2022 02:20:08 -0700 (PDT)"],"X-Google-Smtp-Source":"AA6agR6m0mV23/gLkaYUAlOFu8Hxluf1mDvrllILOXPv0MdqMp6nPy5s9DtplO04FRFPQj6CRqUWut56TNTVXy64jQs=","MIME-Version":"1.0","References":"<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>\n\t<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>","Date":"Mon, 8 Aug 2022 10:19:52 +0100","Message-ID":"<CAOgh=FxZfmJEaKVphnp52p2GYR878RfdGPDi-=unz8zdD5k+uw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","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":"Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Eric Curtin <ecurtin@redhat.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24430,"web_url":"https://patchwork.libcamera.org/comment/24430/","msgid":"<YvEZ33RcRKBvhyiy@pendragon.ideasonboard.com>","date":"2022-08-08T14:12:47","subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Aug 08, 2022 at 10:20:34AM +0200, Jacopo Mondi wrote:\n> On Sun, Aug 07, 2022 at 05:17:15AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > The line stride of the texture is currently hardcoded based on the image\n> > width, which may not match the real stride. Use the stride value from\n> > the stream configuration instead.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/cam/sdl_sink.cpp         | 2 +-\n> >  src/cam/sdl_texture_yuyv.cpp | 4 ++--\n> >  src/cam/sdl_texture_yuyv.h   | 2 +-\n> >  3 files changed, 4 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp\n> > index 19fdfd6dced5..a59d07519e1f 100644\n> > --- a/src/cam/sdl_sink.cpp\n> > +++ b/src/cam/sdl_sink.cpp\n> > @@ -68,7 +68,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n> >  \t\tbreak;\n> >  #endif\n> >  \tcase libcamera::formats::YUYV:\n> > -\t\ttexture_ = std::make_unique<SDLTextureYUYV>(rect_);\n> > +\t\ttexture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);\n> >  \t\tbreak;\n> >  \tdefault:\n> >  \t\tstd::cerr << \"Unsupported pixel format \"\n> > diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp\n> > index 637c0900edff..cb51fb0ef478 100644\n> > --- a/src/cam/sdl_texture_yuyv.cpp\n> > +++ b/src/cam/sdl_texture_yuyv.cpp\n> > @@ -9,8 +9,8 @@\n> >\n> >  using namespace libcamera;\n> >\n> > -SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect)\n> > -\t: SDLTexture(rect, SDL_PIXELFORMAT_YUY2, 4 * ((rect.w + 1) / 2))\n> > +SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)\n> \n> nit: the base class has the same parameter but calls it \"pitch\".\n\nI know, we have stride coming from libcamera, and pitch in the base\nclass, so it's bound to be inconsistent somewhere. Should I submit\nanother patch to rename pitch to stride in the base class too ?\n\n> The rest looks good\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> > +\t: SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)\n> >  {\n> >  }\n> >\n> > diff --git a/src/cam/sdl_texture_yuyv.h b/src/cam/sdl_texture_yuyv.h\n> > index 529a72d6a40e..81e51381ec62 100644\n> > --- a/src/cam/sdl_texture_yuyv.h\n> > +++ b/src/cam/sdl_texture_yuyv.h\n> > @@ -12,6 +12,6 @@\n> >  class SDLTextureYUYV : public SDLTexture\n> >  {\n> >  public:\n> > -\tSDLTextureYUYV(const SDL_Rect &rect);\n> > +\tSDLTextureYUYV(const SDL_Rect &rect, unsigned int stride);\n> >  \tvoid update(libcamera::Span<const uint8_t> data) override;\n> >  };","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 0D617BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Aug 2022 14:13:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8AD3C6332B;\n\tMon,  8 Aug 2022 16:12:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73C8B63315\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Aug 2022 16:12:58 +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 CB1FA481;\n\tMon,  8 Aug 2022 16:12:57 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659967979;\n\tbh=JzlFUlmjmHlAnSi8C0Z/NgxqDop1mNnmrVas8z1fxoI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=jPVwU/MPpl161vTKO6J5WcYJi1kHdkWt0TxX4aVtO6eP7doLvNCH0K14fcWbqENmA\n\tmtDCxHNZGxX+suUwzZL00sVAHu1PmjXOpTigGB66AZqiQYX0nE4mInli/918PCm49D\n\tC+m3/1odviMtZfdQ3Do2r4thSqsFJF51cQxGQVgEzBRkNH4/2ThpBXr08ipr8xocYq\n\t5KKP9d+PvvQwwQGiSN6pZwfLkAKfz7/vJ7rldhMdRixP5eN9E8fspULqaYo5h3kwr4\n\tK5r1hxor2s26CEwaIV85fslaHzN7S2tzvhh5n+PAas2rCtHuryK6RB6AVhF7FczOSx\n\t+tIuMBQfch3ZA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659967978;\n\tbh=JzlFUlmjmHlAnSi8C0Z/NgxqDop1mNnmrVas8z1fxoI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BbpN+NhrABH5I0G8O4CnH09r75J7uaOZ0M71AyDsJKOKJeI9fMMAimhVpeRocJ4qX\n\twJ7throzzUdQ5k5PTzMhBtgnhs0uj9d17/TxS7aHbm2Ow6mP1u+q8dLz71BeqmdSW6\n\ta8Kj80f07NFql3X+eLEa/I9d5RPZ7q8tsEHfMs7s="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"BbpN+Nhr\"; dkim-atps=neutral","Date":"Mon, 8 Aug 2022 17:12:47 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YvEZ33RcRKBvhyiy@pendragon.ideasonboard.com>","References":"<20220807021718.9789-1-laurent.pinchart@ideasonboard.com>\n\t<20220807021718.9789-2-laurent.pinchart@ideasonboard.com>\n\t<20220808082034.gpac3hbyz7ep2dqx@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220808082034.gpac3hbyz7ep2dqx@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH 1/4] cam: sdl_texture_yuyv: Make line\n\tstride configurable","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]