[{"id":27952,"web_url":"https://patchwork.libcamera.org/comment/27952/","msgid":"<4wsnk46usz6geprohnyeapfcqqlj4c5u6iqfhsdl64qac3ibfb@pzbx7mck5nbt>","date":"2023-10-12T09:36:29","subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Fri, Oct 06, 2023 at 02:19:52PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Record if additional software downscaling is needed for a particular\n> stream in the RPi::Stream class. Additional software downscaling may be\n> needed if the user required downscale factor is greater than what the\n> ISP hardware is capable of.\n\nWhy this is not a flag ?\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 10 ++++++++++\n>  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 11 +++++++++--\n>  2 files changed, 19 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index fd6f2efc6e27..25e6a4383bf6 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -57,6 +57,16 @@ const std::string &Stream::name() const\n>  \treturn name_;\n>  }\n>\n> +unsigned int Stream::swDownscale() const\n> +{\n> +\treturn swDownscale_;\n> +}\n> +\n> +void Stream::setSwDownscale(unsigned int swDownscale)\n> +{\n> +\tswDownscale_ = swDownscale;\n> +}\n> +\n>  void Stream::resetBuffers()\n>  {\n>  \t/* Add all internal buffers to the queue of usable buffers. */\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index c5e35d134926..fc2bdfe25d4a 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -86,13 +86,14 @@ public:\n>  \tusing StreamFlags = Flags<StreamFlag>;\n>\n>  \tStream()\n> -\t\t: flags_(StreamFlag::None), id_(0)\n> +\t\t: flags_(StreamFlag::None), id_(0), swDownscale_(0)\n>  \t{\n>  \t}\n>\n>  \tStream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None)\n>  \t\t: flags_(flags), name_(name),\n> -\t\t  dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0)\n> +\t\t  dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0),\n> +\t\t  swDownscale_(0)\n>  \t{\n>  \t}\n>\n> @@ -104,6 +105,9 @@ public:\n>  \tconst std::string &name() const;\n>  \tvoid resetBuffers();\n>\n> +\tunsigned int swDownscale() const;\n> +\tvoid setSwDownscale(unsigned int swDownscale);\n> +\n>  \tvoid setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n>  \tconst BufferMap &getBuffers() const;\n>  \tunsigned int getBufferId(FrameBuffer *buffer) const;\n> @@ -139,6 +143,9 @@ private:\n>  \t/* Tracks a unique id key for the bufferMap_ */\n>  \tunsigned int id_;\n>\n> +\t/* Power of 2 greater than one if software downscaling will be required. */\n> +\tunsigned int swDownscale_;\n> +\n>  \t/* All frame buffers associated with this device stream. */\n>  \tBufferMap bufferMap_;\n>\n> --\n> 2.34.1\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 50243BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Oct 2023 09:36:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0F81E62980;\n\tThu, 12 Oct 2023 11:36:33 +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 676C46297B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Oct 2023 11:36:32 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B0B08C2;\n\tThu, 12 Oct 2023 11:36:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697103393;\n\tbh=MssLYKi/2+mdF+Rb0thYY8KyZvkzZdtTEJFj/MG3aho=;\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=QV2H4N4pmExUupYEeK1xofMW8fOySEfCJf7C4quUciHp1rBhf9SUkDipGA5RcxbBk\n\tqopDCP7C8GcAMyaWmsqcRRkukQpHUfKaGu3blWNPS0gu2rGGTynuIDitvoN+Gur1rL\n\tfzSUuJpnoOS1lycQgFHAthYKAAXKzm0xTn1p49KsrW3RQDElXYcF1IF9adojD4tHNL\n\tw+mnkHWx68mCY308OmkEY5OqOMV+ubNU9y17/UZTvrKIqn8CLgPbtZVIEgoZcYXBZ8\n\tqTafJPE8tCKhbbd8o2SMUk61YtV86u34pMKmMqWJyOCj6eZ/hK7EFFYYl1gICWrZWj\n\tV4pjIkcLbV+Hw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697103389;\n\tbh=MssLYKi/2+mdF+Rb0thYY8KyZvkzZdtTEJFj/MG3aho=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vE4FeWQldW+S24k39eQZN+7Sh28bhluPOueEzcPCJexASH9uAVn3ovWURFUbzlEoN\n\thegI1Cy4nQ96UKp+3cbuJFFtoSIFbn7DiFlfBnAonzzQFjcIuez+cS+eliJvDXzt0e\n\tKTjUA/sC4O8AYgLMazuESzEv/c6bn6dQKoZte+2E="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vE4FeWQl\"; dkim-atps=neutral","Date":"Thu, 12 Oct 2023 11:36:29 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<4wsnk46usz6geprohnyeapfcqqlj4c5u6iqfhsdl64qac3ibfb@pzbx7mck5nbt>","References":"<20231006132000.23504-1-naush@raspberrypi.com>\n\t<20231006132000.23504-13-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20231006132000.23504-13-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","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.mondi@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>"}},{"id":27953,"web_url":"https://patchwork.libcamera.org/comment/27953/","msgid":"<CAEmqJPqWozpx7BZX3S3X9cZ+jsctiCv_M9oz2zgpwaAcgK-iag@mail.gmail.com>","date":"2023-10-12T09:50:01","subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nOn Thu, 12 Oct 2023 at 10:36, Jacopo Mondi\n<jacopo.mondi@ideasonboard.com> wrote:\n>\n> Hi Naush\n>\n> On Fri, Oct 06, 2023 at 02:19:52PM +0100, Naushir Patuck via libcamera-devel wrote:\n> > Record if additional software downscaling is needed for a particular\n> > stream in the RPi::Stream class. Additional software downscaling may be\n> > needed if the user required downscale factor is greater than what the\n> > ISP hardware is capable of.\n>\n> Why this is not a flag ?\n\nBecause we need to store the downscale factor used (2/4/8...) instead\nof just a boolean.\n\nRegards,\nNaush\n\n\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 10 ++++++++++\n> >  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 11 +++++++++--\n> >  2 files changed, 19 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > index fd6f2efc6e27..25e6a4383bf6 100644\n> > --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > @@ -57,6 +57,16 @@ const std::string &Stream::name() const\n> >       return name_;\n> >  }\n> >\n> > +unsigned int Stream::swDownscale() const\n> > +{\n> > +     return swDownscale_;\n> > +}\n> > +\n> > +void Stream::setSwDownscale(unsigned int swDownscale)\n> > +{\n> > +     swDownscale_ = swDownscale;\n> > +}\n> > +\n> >  void Stream::resetBuffers()\n> >  {\n> >       /* Add all internal buffers to the queue of usable buffers. */\n> > diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > index c5e35d134926..fc2bdfe25d4a 100644\n> > --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > @@ -86,13 +86,14 @@ public:\n> >       using StreamFlags = Flags<StreamFlag>;\n> >\n> >       Stream()\n> > -             : flags_(StreamFlag::None), id_(0)\n> > +             : flags_(StreamFlag::None), id_(0), swDownscale_(0)\n> >       {\n> >       }\n> >\n> >       Stream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None)\n> >               : flags_(flags), name_(name),\n> > -               dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0)\n> > +               dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0),\n> > +               swDownscale_(0)\n> >       {\n> >       }\n> >\n> > @@ -104,6 +105,9 @@ public:\n> >       const std::string &name() const;\n> >       void resetBuffers();\n> >\n> > +     unsigned int swDownscale() const;\n> > +     void setSwDownscale(unsigned int swDownscale);\n> > +\n> >       void setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n> >       const BufferMap &getBuffers() const;\n> >       unsigned int getBufferId(FrameBuffer *buffer) const;\n> > @@ -139,6 +143,9 @@ private:\n> >       /* Tracks a unique id key for the bufferMap_ */\n> >       unsigned int id_;\n> >\n> > +     /* Power of 2 greater than one if software downscaling will be required. */\n> > +     unsigned int swDownscale_;\n> > +\n> >       /* All frame buffers associated with this device stream. */\n> >       BufferMap bufferMap_;\n> >\n> > --\n> > 2.34.1\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 1C09BC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Oct 2023 09:50:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 83D3E62962;\n\tThu, 12 Oct 2023 11:50:31 +0200 (CEST)","from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com\n\t[IPv6:2607:f8b0:4864:20::1136])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D23CB62962\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Oct 2023 11:50:29 +0200 (CEST)","by mail-yw1-x1136.google.com with SMTP id\n\t00721157ae682-5a7c08b7744so9387097b3.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Oct 2023 02:50:29 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697104231;\n\tbh=1DPy13lbJHeTBJYCmAYph33ws+mD0I2rRqYptkMtp6Q=;\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=JkhFeBc5y5as7iePG5hwVI4GJrrrOORxvp1nMOVr7CAEwW52gZFYB/LjOjlN+m+HH\n\t3CKkJy3k/oN/WP7Rd4DVpkxMWU+gDmeq7vE8GGgdvUmJ14nsEVvD8V9uuIlfAH8HnM\n\t6tBFr6lqNCGNi8+ZM7RLxhqmON7yq10FZIdOb/yMpsFm9P6j5BzKmgbmPPkPqC8+HP\n\tBiuDIjFDTWHA8oaHF3gmEuFgSgMN9hl+BilXStNz9kUvzXsbYQLmP6lfSGboGYHdr3\n\tVAKE0LIh/19+Prgezl2sFbHYQGDhJo6/zJO5GPlToH1/Q6Py73VpnBjxww4OUpzcVl\n\tXDAm74LoqKHzA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697104228; x=1697709028;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=eYLUfe4M0kpwkRKElEikyuDQsgZ94EALl1yq9SU49fI=;\n\tb=FqHat4qqCKAQMIKS7QceRuIofw8SnE7nvaVD1o1FSFivy8FLafSu2t8CPuPtY2kPDh\n\t+nyszWc2YtDvqw/xKwREaH+POGvrSqcPA0X1YauHr4dJNvAmV+LjIravmZ7PvMhWH/O9\n\tQT2wRjliSlEucvp8EVlvEh8MC4jiluWiY9G1Gahd5529m/j+dxk62St33Wl6Y5sgZ6vO\n\tAFwX45jbP/7XQuPDRECaCBdsp8vRthY74j0j6Tm6her60iac8kUlqElSxDJhhgI0mjff\n\tVSYkw9dcNMTLprROwLej+7aMmlryJGVyc0G/FWFMSeCY4ZocubnMAJzwS3moBX5Lz5DM\n\tIbEg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"FqHat4qq\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697104228; x=1697709028;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=eYLUfe4M0kpwkRKElEikyuDQsgZ94EALl1yq9SU49fI=;\n\tb=USpzFkL21LrOOrJnDpK+ZofVVEqdUGEFiESbin31ZyuHL9NEpTb42QSPnK4h5EoAPQ\n\tcPBJiM3zP5FQRuFo0swI3Vb5+I7MmGoLOzk8xnvwgCI6ZmN/rlHTH8RkQAMJRBTahOdK\n\tTotbqPltGxz+VNp7oGh72WS9fJtWIlkKdSiQDdrHauGmeQAPl77s9zA9rjpiH1EmaJj+\n\t0vHZcyNvbPV//K3hEoMd9xC1Hcw07TjnX2mZCrPwRcMSj9Uyw1rfLgs0ufzbA6tLhyrB\n\tzWzhwUUOusR18+5AUgLAvok2jU3vo50VGi+jpTp0dAv74sBocB1n9tEXVNB2JApv8fq0\n\tDNoA==","X-Gm-Message-State":"AOJu0YyUrcK1PpfYgOg2gpxBv/6CML/mdRT/spy9bz9JM4PU1FjYfv8o\n\tMXJU/LRpn9pnkIy2DwN+FDxkC6EXpbYMsPYa8+4iV0uFkyiIBx5f0ug=","X-Google-Smtp-Source":"AGHT+IHFIQs4WuSa/52OLMDtGDV3MapZO4/PTaG4PA8gI/XytBHAKtpugsY0bInrEHmR+twVuwGgNnTjiR24EOeLLUU=","X-Received":"by 2002:a0d:e88d:0:b0:59b:d7c0:ea0c with SMTP id\n\tr135-20020a0de88d000000b0059bd7c0ea0cmr25523785ywe.11.1697104228557;\n\tThu, 12 Oct 2023 02:50:28 -0700 (PDT)","MIME-Version":"1.0","References":"<20231006132000.23504-1-naush@raspberrypi.com>\n\t<20231006132000.23504-13-naush@raspberrypi.com>\n\t<4wsnk46usz6geprohnyeapfcqqlj4c5u6iqfhsdl64qac3ibfb@pzbx7mck5nbt>","In-Reply-To":"<4wsnk46usz6geprohnyeapfcqqlj4c5u6iqfhsdl64qac3ibfb@pzbx7mck5nbt>","Date":"Thu, 12 Oct 2023 10:50:01 +0100","Message-ID":"<CAEmqJPqWozpx7BZX3S3X9cZ+jsctiCv_M9oz2zgpwaAcgK-iag@mail.gmail.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27956,"web_url":"https://patchwork.libcamera.org/comment/27956/","msgid":"<l2dcbr7q2ijdgrogn6c5qa567h4gxfccok7yuhuthcqdm2x74m@q4rvfvwmbkz4>","date":"2023-10-12T10:07:21","subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Thu, Oct 12, 2023 at 10:50:01AM +0100, Naushir Patuck via libcamera-devel wrote:\n> Hi Jacopo,\n>\n> On Thu, 12 Oct 2023 at 10:36, Jacopo Mondi\n> <jacopo.mondi@ideasonboard.com> wrote:\n> >\n> > Hi Naush\n> >\n> > On Fri, Oct 06, 2023 at 02:19:52PM +0100, Naushir Patuck via libcamera-devel wrote:\n> > > Record if additional software downscaling is needed for a particular\n> > > stream in the RPi::Stream class. Additional software downscaling may be\n> > > needed if the user required downscale factor is greater than what the\n> > > ISP hardware is capable of.\n> >\n> > Why this is not a flag ?\n>\n> Because we need to store the downscale factor used (2/4/8...) instead\n> of just a boolean.\n\nThe comment reports that too :/\n\n/* Power of 2 greater than one if software downscaling will be required. */\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nSorry for the noise\n\n>\n> Regards,\n> Naush\n>\n>\n> > >\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > ---\n> > >  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 10 ++++++++++\n> > >  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 11 +++++++++--\n> > >  2 files changed, 19 insertions(+), 2 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > > index fd6f2efc6e27..25e6a4383bf6 100644\n> > > --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > > +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> > > @@ -57,6 +57,16 @@ const std::string &Stream::name() const\n> > >       return name_;\n> > >  }\n> > >\n> > > +unsigned int Stream::swDownscale() const\n> > > +{\n> > > +     return swDownscale_;\n> > > +}\n> > > +\n> > > +void Stream::setSwDownscale(unsigned int swDownscale)\n> > > +{\n> > > +     swDownscale_ = swDownscale;\n> > > +}\n> > > +\n> > >  void Stream::resetBuffers()\n> > >  {\n> > >       /* Add all internal buffers to the queue of usable buffers. */\n> > > diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > > index c5e35d134926..fc2bdfe25d4a 100644\n> > > --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > > +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> > > @@ -86,13 +86,14 @@ public:\n> > >       using StreamFlags = Flags<StreamFlag>;\n> > >\n> > >       Stream()\n> > > -             : flags_(StreamFlag::None), id_(0)\n> > > +             : flags_(StreamFlag::None), id_(0), swDownscale_(0)\n> > >       {\n> > >       }\n> > >\n> > >       Stream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None)\n> > >               : flags_(flags), name_(name),\n> > > -               dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0)\n> > > +               dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0),\n> > > +               swDownscale_(0)\n> > >       {\n> > >       }\n> > >\n> > > @@ -104,6 +105,9 @@ public:\n> > >       const std::string &name() const;\n> > >       void resetBuffers();\n> > >\n> > > +     unsigned int swDownscale() const;\n> > > +     void setSwDownscale(unsigned int swDownscale);\n> > > +\n> > >       void setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n> > >       const BufferMap &getBuffers() const;\n> > >       unsigned int getBufferId(FrameBuffer *buffer) const;\n> > > @@ -139,6 +143,9 @@ private:\n> > >       /* Tracks a unique id key for the bufferMap_ */\n> > >       unsigned int id_;\n> > >\n> > > +     /* Power of 2 greater than one if software downscaling will be required. */\n> > > +     unsigned int swDownscale_;\n> > > +\n> > >       /* All frame buffers associated with this device stream. */\n> > >       BufferMap bufferMap_;\n> > >\n> > > --\n> > > 2.34.1\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 2BDF6C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Oct 2023 10:07:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C71B62980;\n\tThu, 12 Oct 2023 12:07:26 +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 5F2346296D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Oct 2023 12:07:25 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2B05D7FC;\n\tThu, 12 Oct 2023 12:07:22 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697105246;\n\tbh=ALieJ+7h9s5pWIvwNkiBr6RWlCqH+00jWfqEObGKO7g=;\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=FmXsn4and0kJZYeb/hjj+dFuu8p/xSYi/5jGW+xs8vcAQHXRgBTat+lsAoUeAtzXI\n\t/b/HyQYzF+jKnSzFu9uOt2IfjQHm/3nrtVVEfZb9VGAoER3EcD0dxYlRm3Oa6lKPFU\n\tVDTks3utA5NLGzSjgxiswLtL1SC0DZ7Ct6d6kEg5F5DBfg82vzG40OuQeycMd61b7c\n\t8C1Xpj6RBGp158lGWeIr6+RKBGxrzXnaQ0YbjtTc5yIu11bAM25WHMlEMYCUwTc+qs\n\tNMd7+RZkKK9wokTXMLKSis6mkWq2yWGrFy7wYDUlormBb9cgpM3ChRcBs6eQ1N/S8K\n\tIEQUrSDlyUQcQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697105242;\n\tbh=ALieJ+7h9s5pWIvwNkiBr6RWlCqH+00jWfqEObGKO7g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Og38jYRbMyJHbFMkjhSTlXYQ0aOCOsexTCrszagVy8vgL9EtlV03g5m0Ec0gaz86+\n\tcKWuO4rK3t79aqdlSvTWglpVZe1JwgN+m3SYpKghfqigT5k1XKahZ/+fLMMBamgCFs\n\tzoLtchehPw7sFTdNk03uNpoKC4mJGETP/OLfURDs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Og38jYRb\"; dkim-atps=neutral","Date":"Thu, 12 Oct 2023 12:07:21 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<l2dcbr7q2ijdgrogn6c5qa567h4gxfccok7yuhuthcqdm2x74m@q4rvfvwmbkz4>","References":"<20231006132000.23504-1-naush@raspberrypi.com>\n\t<20231006132000.23504-13-naush@raspberrypi.com>\n\t<4wsnk46usz6geprohnyeapfcqqlj4c5u6iqfhsdl64qac3ibfb@pzbx7mck5nbt>\n\t<CAEmqJPqWozpx7BZX3S3X9cZ+jsctiCv_M9oz2zgpwaAcgK-iag@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPqWozpx7BZX3S3X9cZ+jsctiCv_M9oz2zgpwaAcgK-iag@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 12/20] pipeline: rpi: Add SW downscale\n\tstatus to RPi::Stream","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.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]