[{"id":3071,"web_url":"https://patchwork.libcamera.org/comment/3071/","msgid":"<20191118191442.GF4888@pendragon.ideasonboard.com>","date":"2019-11-18T19:14:42","subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, Oct 28, 2019 at 03:25:16AM +0100, Niklas Söderlund wrote:\n> The pipeline knows which buffer coming from the application belongs to\n> which request. Add a helper to allow pipeline implementations to access\n> this knowledge.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nWhy is this needed, given that Buffer stores a pointer to Request ? I\nassume I'll find out later in the series, but it seems more efficient to\nrely on the pointer.\n\n> ---\n>  src/libcamera/include/pipeline_handler.h |  2 ++\n>  src/libcamera/pipeline_handler.cpp       | 10 ++++++++++\n>  2 files changed, 12 insertions(+)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index 320740746bc6e998..6024357e266c2e2b 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -39,6 +39,8 @@ public:\n>  \t}\n>  \tvirtual ~CameraData() {}\n>  \n> +\tRequest *requestFromBuffer(Buffer *buffer);\n> +\n>  \tCamera *camera_;\n>  \tPipelineHandler *pipe_;\n>  \tstd::list<Request *> queuedRequests_;\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index f9ae767d529d44d9..d70e286661aded8e 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -58,6 +58,16 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>   * exists.\n>   */\n>  \n> +Request *CameraData::requestFromBuffer(Buffer *buffer)\n> +{\n> +\tfor (Request *request : queuedRequests_)\n> +\t\tfor (const auto &it : request->buffers())\n> +\t\t\tif (it.second == buffer)\n> +\t\t\t\treturn request;\n> +\n> +\treturn nullptr;\n> +}\n> +\n>  /**\n>   * \\var CameraData::camera_\n>   * \\brief The camera related to this CameraData instance","headers":{"Return-Path":"<laurent.pinchart@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 2492A60F1C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2019 20:15:01 +0100 (CET)","from pendragon.ideasonboard.com (unknown [38.98.37.142])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 29C76311;\n\tMon, 18 Nov 2019 20:14:58 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1574104500;\n\tbh=LW3nVVL8YM4I6OvYnKrWre0b+SuGXN69vVyYhXIOVX8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Lppkfs+MHCXPZNvS6BuEJqOcNiP0SCg7MmDTUqxqH0vuF29twKvcOiUDzQE9/dX+O\n\t3QNndqJF6vIhw3fONYivwm9UFiKEIllCQLPkRtjq0ADzAqup663oOu5cWXic07Fft3\n\txGWKPZRy6uftUZyhzGNnZkn4Pqrx97wJCzl5Vq5s=","Date":"Mon, 18 Nov 2019 21:14:42 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191118191442.GF4888@pendragon.ideasonboard.com>","References":"<20191028022525.796995-1-niklas.soderlund@ragnatech.se>\n\t<20191028022525.796995-4-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191028022525.796995-4-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","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, 18 Nov 2019 19:15:01 -0000"}},{"id":3120,"web_url":"https://patchwork.libcamera.org/comment/3120/","msgid":"<20191120163356.GA10793@bigcity.dyn.berto.se>","date":"2019-11-20T16:33:56","subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your feedback.\n\nOn 2019-11-18 21:14:42 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Mon, Oct 28, 2019 at 03:25:16AM +0100, Niklas Söderlund wrote:\n> > The pipeline knows which buffer coming from the application belongs to\n> > which request. Add a helper to allow pipeline implementations to access\n> > this knowledge.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> Why is this needed, given that Buffer stores a pointer to Request ? I\n> assume I'll find out later in the series, but it seems more efficient to\n> rely on the pointer.\n\nThis is needed as the Buffer will no longer keep a reference to a \nRequest.\n\n> \n> > ---\n> >  src/libcamera/include/pipeline_handler.h |  2 ++\n> >  src/libcamera/pipeline_handler.cpp       | 10 ++++++++++\n> >  2 files changed, 12 insertions(+)\n> > \n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index 320740746bc6e998..6024357e266c2e2b 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -39,6 +39,8 @@ public:\n> >  \t}\n> >  \tvirtual ~CameraData() {}\n> >  \n> > +\tRequest *requestFromBuffer(Buffer *buffer);\n> > +\n> >  \tCamera *camera_;\n> >  \tPipelineHandler *pipe_;\n> >  \tstd::list<Request *> queuedRequests_;\n> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > index f9ae767d529d44d9..d70e286661aded8e 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -58,6 +58,16 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> >   * exists.\n> >   */\n> >  \n> > +Request *CameraData::requestFromBuffer(Buffer *buffer)\n> > +{\n> > +\tfor (Request *request : queuedRequests_)\n> > +\t\tfor (const auto &it : request->buffers())\n> > +\t\t\tif (it.second == buffer)\n> > +\t\t\t\treturn request;\n> > +\n> > +\treturn nullptr;\n> > +}\n> > +\n> >  /**\n> >   * \\var CameraData::camera_\n> >   * \\brief The camera related to this CameraData instance\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0806C60C21\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Nov 2019 17:33:59 +0100 (CET)","by mail-lf1-x144.google.com with SMTP id f18so50962lfj.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Nov 2019 08:33:58 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tj10sm13409849lfc.43.2019.11.20.08.33.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 20 Nov 2019 08:33:57 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=VX7SSHwmIhWVDlFOduoG9CRiJYVRHeXJz4ayZmn6Rgo=;\n\tb=hMkPZfrEXdSmfjJynUXJzrfM6c0h2cDAq2B0SU2ZZWMgPSGjSUtAjX1iwrfT1kROwA\n\twN8PmLfhqUg9vfA/H6xUYhdwu1urhNoHJGZYgIB+0sXYekvtjhfRjSlRqMIWF+gr5J+V\n\t/TJYtVWH0I4JE18KbfGJccDxbrKULBygL4ZplI7pzhKCKngmahKP6DjAv2bcPQTjtofF\n\t0Z9uP5ueABsmhGc2XMGndeet4ORCPCskjK7c/iKqFX4As75DonYLzyDruvg+1sjkOPgz\n\tdbo3qjZCa0xtzBEmC3uCbsPCcfTYSn1qVOoVOGB8H3NxPomXUrxLQHglsDj9rWfZR+QG\n\t5cvw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=VX7SSHwmIhWVDlFOduoG9CRiJYVRHeXJz4ayZmn6Rgo=;\n\tb=h7iQqyGqM5CLKHR+IYIUJbCr2u1GK//Tve2l7dJLPjf/aGiSPrLRx3lLBN7ktg4TIb\n\tIO+gn3d842jlX0dvi2kCF7KMj6HolimSpUitJrsieJlrfK+J3dYaJUM9KOZ0a0lNbq8l\n\tvVyyda87zE1/fURJYa5lpSHnn+Q2iERmSBGurxQTTPQ9+W+kVQexJhwioyKzU7LKxo5Y\n\thXN8jI/e8/MayyZnJlVTk3TPGf+OaR1p6v8afHzUEUYvvuGpQ+JISWdMZmCnkFGyoeLJ\n\tmhsGRnklRIfgdZcyrfXUX1iAUaRpCQyaJtCLFLJmfBYGsIc55yEWwRPS1pemPUA0Dre+\n\txASg==","X-Gm-Message-State":"APjAAAVCCqzky/5dWmXPxTJzq4Cw8D093ARU5wFkVWN2Os+qPgbmeKja\n\tgl3WGqLcX50Idkpn8C1MIeRFIg==","X-Google-Smtp-Source":"APXvYqycWumy7h82puKa78CFnwI7mptgnBc8bjci7hTt6q8bDdiqKX+jDkQQ2ISF37wSid43g6bb1w==","X-Received":"by 2002:ac2:5a08:: with SMTP id q8mr3693487lfn.106.1574267638431;\n\tWed, 20 Nov 2019 08:33:58 -0800 (PST)","Date":"Wed, 20 Nov 2019 17:33:56 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191120163356.GA10793@bigcity.dyn.berto.se>","References":"<20191028022525.796995-1-niklas.soderlund@ragnatech.se>\n\t<20191028022525.796995-4-niklas.soderlund@ragnatech.se>\n\t<20191118191442.GF4888@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191118191442.GF4888@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","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":"Wed, 20 Nov 2019 16:33:59 -0000"}},{"id":3123,"web_url":"https://patchwork.libcamera.org/comment/3123/","msgid":"<20191121031153.GC4958@pendragon.ideasonboard.com>","date":"2019-11-21T03:11:53","subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nOn Wed, Nov 20, 2019 at 05:33:56PM +0100, Niklas Söderlund wrote:\n> On 2019-11-18 21:14:42 +0200, Laurent Pinchart wrote:\n> > On Mon, Oct 28, 2019 at 03:25:16AM +0100, Niklas Söderlund wrote:\n> > > The pipeline knows which buffer coming from the application belongs to\n> > > which request. Add a helper to allow pipeline implementations to access\n> > > this knowledge.\n> > > \n> > > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > \n> > Why is this needed, given that Buffer stores a pointer to Request ? I\n> > assume I'll find out later in the series, but it seems more efficient to\n> > rely on the pointer.\n> \n> This is needed as the Buffer will no longer keep a reference to a \n> Request.\n\nBut why can't it keep a reference to a request ? I understand the Buffer\nobject won't be transient anymore, but can't we still have a request\npointer, that will only be valid from the time the buffer is added to\nthe request to the time the request completes ? As long as we document\nthe lifetime of that pointer, I think it should be fine.\n\n> > > ---\n> > >  src/libcamera/include/pipeline_handler.h |  2 ++\n> > >  src/libcamera/pipeline_handler.cpp       | 10 ++++++++++\n> > >  2 files changed, 12 insertions(+)\n> > > \n> > > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > > index 320740746bc6e998..6024357e266c2e2b 100644\n> > > --- a/src/libcamera/include/pipeline_handler.h\n> > > +++ b/src/libcamera/include/pipeline_handler.h\n> > > @@ -39,6 +39,8 @@ public:\n> > >  \t}\n> > >  \tvirtual ~CameraData() {}\n> > >  \n> > > +\tRequest *requestFromBuffer(Buffer *buffer);\n> > > +\n> > >  \tCamera *camera_;\n> > >  \tPipelineHandler *pipe_;\n> > >  \tstd::list<Request *> queuedRequests_;\n> > > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > > index f9ae767d529d44d9..d70e286661aded8e 100644\n> > > --- a/src/libcamera/pipeline_handler.cpp\n> > > +++ b/src/libcamera/pipeline_handler.cpp\n> > > @@ -58,6 +58,16 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> > >   * exists.\n> > >   */\n> > >  \n> > > +Request *CameraData::requestFromBuffer(Buffer *buffer)\n> > > +{\n> > > +\tfor (Request *request : queuedRequests_)\n> > > +\t\tfor (const auto &it : request->buffers())\n> > > +\t\t\tif (it.second == buffer)\n> > > +\t\t\t\treturn request;\n> > > +\n> > > +\treturn nullptr;\n> > > +}\n> > > +\n> > >  /**\n> > >   * \\var CameraData::camera_\n> > >   * \\brief The camera related to this CameraData instance","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 87F976136C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Nov 2019 04:12:03 +0100 (CET)","from pendragon.ideasonboard.com (unknown [124.219.31.93])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E431497D;\n\tThu, 21 Nov 2019 04:12:01 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1574305923;\n\tbh=0wMQxpWDzAw2f72bYTqcGaPYn6MWGhUcXcPnvc6tg+s=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mldzF7a/FvopchscdmS4Mn+yl+QJOgtJjDuJ2b1T+P9MVuywvA1Eu9T4Rif9Jbx28\n\tlhrt6FwQL0iXIOPQJ10QOQJB8sc03JZ2cinKNWbBfPJUcdLFKY8nFIstzXuskT5fd2\n\tG3NDbSStXt8YjuGfTnvfx8TZpEPpcgu9W4DkXEs8=","Date":"Thu, 21 Nov 2019 05:11:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191121031153.GC4958@pendragon.ideasonboard.com>","References":"<20191028022525.796995-1-niklas.soderlund@ragnatech.se>\n\t<20191028022525.796995-4-niklas.soderlund@ragnatech.se>\n\t<20191118191442.GF4888@pendragon.ideasonboard.com>\n\t<20191120163356.GA10793@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191120163356.GA10793@bigcity.dyn.berto.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","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":"Thu, 21 Nov 2019 03:12:03 -0000"}},{"id":3132,"web_url":"https://patchwork.libcamera.org/comment/3132/","msgid":"<20191121210445.GD10793@bigcity.dyn.berto.se>","date":"2019-11-21T21:04:45","subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nOn 2019-11-21 05:11:53 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> On Wed, Nov 20, 2019 at 05:33:56PM +0100, Niklas Söderlund wrote:\n> > On 2019-11-18 21:14:42 +0200, Laurent Pinchart wrote:\n> > > On Mon, Oct 28, 2019 at 03:25:16AM +0100, Niklas Söderlund wrote:\n> > > > The pipeline knows which buffer coming from the application belongs to\n> > > > which request. Add a helper to allow pipeline implementations to access\n> > > > this knowledge.\n> > > > \n> > > > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > > \n> > > Why is this needed, given that Buffer stores a pointer to Request ? I\n> > > assume I'll find out later in the series, but it seems more efficient to\n> > > rely on the pointer.\n> > \n> > This is needed as the Buffer will no longer keep a reference to a \n> > Request.\n> \n> But why can't it keep a reference to a request ? I understand the Buffer\n> object won't be transient anymore, but can't we still have a request\n> pointer, that will only be valid from the time the buffer is added to\n> the request to the time the request completes ? As long as we document\n> the lifetime of that pointer, I think it should be fine.\n\nYou convinced me, I have restored the request reference in the next \nversion.\n\n> \n> > > > ---\n> > > >  src/libcamera/include/pipeline_handler.h |  2 ++\n> > > >  src/libcamera/pipeline_handler.cpp       | 10 ++++++++++\n> > > >  2 files changed, 12 insertions(+)\n> > > > \n> > > > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > > > index 320740746bc6e998..6024357e266c2e2b 100644\n> > > > --- a/src/libcamera/include/pipeline_handler.h\n> > > > +++ b/src/libcamera/include/pipeline_handler.h\n> > > > @@ -39,6 +39,8 @@ public:\n> > > >  \t}\n> > > >  \tvirtual ~CameraData() {}\n> > > >  \n> > > > +\tRequest *requestFromBuffer(Buffer *buffer);\n> > > > +\n> > > >  \tCamera *camera_;\n> > > >  \tPipelineHandler *pipe_;\n> > > >  \tstd::list<Request *> queuedRequests_;\n> > > > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > > > index f9ae767d529d44d9..d70e286661aded8e 100644\n> > > > --- a/src/libcamera/pipeline_handler.cpp\n> > > > +++ b/src/libcamera/pipeline_handler.cpp\n> > > > @@ -58,6 +58,16 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> > > >   * exists.\n> > > >   */\n> > > >  \n> > > > +Request *CameraData::requestFromBuffer(Buffer *buffer)\n> > > > +{\n> > > > +\tfor (Request *request : queuedRequests_)\n> > > > +\t\tfor (const auto &it : request->buffers())\n> > > > +\t\t\tif (it.second == buffer)\n> > > > +\t\t\t\treturn request;\n> > > > +\n> > > > +\treturn nullptr;\n> > > > +}\n> > > > +\n> > > >  /**\n> > > >   * \\var CameraData::camera_\n> > > >   * \\brief The camera related to this CameraData instance\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0FC3060C22\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Nov 2019 22:04:47 +0100 (CET)","by mail-lj1-x243.google.com with SMTP id 139so4867681ljf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Nov 2019 13:04:47 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tu7sm1810720ljj.102.2019.11.21.13.04.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 21 Nov 2019 13:04:45 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=XFsSGO/5WKZYY9tx+qbijhjYi8v6lCmCkZRlVD+NMBY=;\n\tb=DvC9Bfb/PGMfrY1B1s41L2aUhxaU7kYdmLO3NjBtTy1aILplnjRz92fcaoWX1g62YR\n\tbxtopx91ECIReYXTlm78GN5jn1z1n0UpRSJ3/G2Qi/I4+aLEcIa9ScDwNr14dWAxk9mD\n\tjL3YLktfaoB0KSVtHaJqFXRYJ46Eh74VBA2dhzkRK+YhIXmuEAy2FaxgMtDUFIdVnS9P\n\t+DKkYW9vj7AaXetMi8BkRzjU04GpnWVISr0cE48Nfw8MIXBFncpqvoJzA3ZVAOhI4oi+\n\tkwEJH6BCTFtE0RrP/xYKK+TBqdIR6iCAEfJeqG3gvBiBQwvFnalgfVztBK8PRS9JOVQg\n\tvZ0g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=XFsSGO/5WKZYY9tx+qbijhjYi8v6lCmCkZRlVD+NMBY=;\n\tb=N+dZ7z0sGsbgrbIRowR2AWZMSJkS4Tpwdfs17pnzqEyiVYP4d6XROvzIQQuX1Zbu9p\n\tplqJ+WLO6i08pjULJRU0awnCpkbmSAsDalHF7jjwnwwnBMDl7Dd8VNrqM3ibMKibkuab\n\ttrGd4KCmjYeOOPCQD+8C1mOYu+TLYi1r2Kt0p1pGSFcoKaloPDxZSs+9fJZ//dU3QjT+\n\tQ8k/JjWrI+GqlXuSyyAof1hrWJX8J8vqObhaZ5ZRO7pKD9aJ1gJKy5mtwv5W8j5hjgoK\n\tGj5Bc7dpSscIURLpCX9H7kJpJKJbIEqED0nm0IUFr04uNuQxNJ7nQ7y1NpCRVjIQTAVp\n\ts2sw==","X-Gm-Message-State":"APjAAAU2pbfWCiUhhKbGyaKrK2UxxCNAd2WiJobWwClYE0gGGIPbADon\n\tjiDLv5VaLbhhpXHLBhVKE+4WVFhlKB4=","X-Google-Smtp-Source":"APXvYqxA+usJhYSLuTZ/v3tBMBMscyXBQpB2NvlUK3RrabrAr5QTUlIgLiXAcgicOJUhTEL2MRqMAw==","X-Received":"by 2002:a2e:a304:: with SMTP id l4mr9181160lje.178.1574370286391;\n\tThu, 21 Nov 2019 13:04:46 -0800 (PST)","Date":"Thu, 21 Nov 2019 22:04:45 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191121210445.GD10793@bigcity.dyn.berto.se>","References":"<20191028022525.796995-1-niklas.soderlund@ragnatech.se>\n\t<20191028022525.796995-4-niklas.soderlund@ragnatech.se>\n\t<20191118191442.GF4888@pendragon.ideasonboard.com>\n\t<20191120163356.GA10793@bigcity.dyn.berto.se>\n\t<20191121031153.GC4958@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191121031153.GC4958@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [RFC 03/12] libcamera: pipeline: Add helper\n\tto find request from buffer","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":"Thu, 21 Nov 2019 21:04:47 -0000"}}]