[{"id":2243,"web_url":"https://patchwork.libcamera.org/comment/2243/","msgid":"<20190714070613.GA31025@wyvern>","date":"2019-07-14T07:06:13","subject":"Re: [libcamera-devel] [PATCH v2 01/16] libcamera: camera: Don't\n\tmove buffers away from request at completion","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 patch.\n\nOn 2019-07-13 20:23:36 +0300, Laurent Pinchart wrote:\n> For a historical reason that isn't fully understood, the request\n> completion handler in the Camera class moves all buffers away from the\n> request's buffer map to a local variable before emitting the request\n> completion signal. There's no reason to do so, and it makes it\n> impossible for requests to access buffers in their destructor. Fix it.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/camera.cpp | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index 592dfd39eacc..094f1b63b7f1 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -894,8 +894,7 @@ int Camera::stop()\n>   */\n>  void Camera::requestComplete(Request *request)\n>  {\n> -\tstd::map<Stream *, Buffer *> buffers(std::move(request->bufferMap_));\n> -\trequestCompleted.emit(request, buffers);\n> +\trequestCompleted.emit(request, request->bufferMap_);\n>  \tdelete request;\n>  }\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-pf1-x442.google.com (mail-pf1-x442.google.com\n\t[IPv6:2607:f8b0:4864:20::442])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F10DD60E3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Jul 2019 09:06:19 +0200 (CEST)","by mail-pf1-x442.google.com with SMTP id y15so6046869pfn.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Jul 2019 00:06:19 -0700 (PDT)","from localhost (softbank126159224182.bbtec.net. [126.159.224.182])\n\tby smtp.gmail.com with ESMTPSA id\n\tt7sm2411697pfh.101.2019.07.14.00.06.16\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tSun, 14 Jul 2019 00:06:17 -0700 (PDT)"],"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=tbn23w/rrWApyqU43bOqjP5y8WILbz+fJ8mLVS+06Gg=;\n\tb=jBZmymtIdXEcCWhe4upiCJ3jD3aZnWYKb504odsGJ/l3vP0ZhEzzklIzYvqLv/7VkN\n\tKO5hAYWN2EYCcl3T3o9CvIKN2jX68HofuNz46kxdRvK5AbUl3AjFbcnWBr5pAvgUTh1I\n\tD0jJR+s4g0da3NAbRIr6jXQ7D4elSFh802GKQPDDZG9uZ/jlatH4GWa2xVBJax8z6uTv\n\tHB+JS6Ls43LO2d6DUl3sryJUlrlw5fL7UdkYu5quk2SVnaN45iDYCYcDShgzaKWvfizR\n\tJFMQ9NJXLZ32TJyGxpRjLtdG+Z/uBljLnCJoKTN5qQL3Z2f/0B/b0oF3jiNPOkTJiYWj\n\tmmfw==","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=tbn23w/rrWApyqU43bOqjP5y8WILbz+fJ8mLVS+06Gg=;\n\tb=qjKnZMHvvqN0B2UWFFuvoks8rKWP0BKKWt9uoY5ClT/gVrRkDAa/f5A1w6CaKyoDYW\n\tgcg3FnEsm1lvAwxXpazNY8cJ/b+l9ut9b80wIu4/53JnZD2YNMvsxZdsSQnp7Fu9E4ZA\n\tDIK1GrOBc2RGm5iMCilAFa0TIl+OIwwAcA6TFVO+z2xDaIip+7A3H0+6QTV6PLsRIi7p\n\ttbXyaDKSvfemeB2dCmLdfTEYXTXUQ0a/ZcZ1YqJPamus6WOxjdvfoiFYWUiipgHQQwh6\n\tnK7tazqmkeZl3U77Qr2K59xzvRaIEPAd4ghWaCzoeiZk8sTEmWGlCAUvUoe7IhjHo5W7\n\tcwhQ==","X-Gm-Message-State":"APjAAAW1X9A9cDUrzXyiRn8zeN7wBxibw2JM1NrpVcnMrtetjyd4W2RQ\n\t73LuiXB/Ce0+1k3MIP9um9Y=","X-Google-Smtp-Source":"APXvYqzlPGhQJhvkQ3zNSNonV4bVSMOd+MgXFaJ/XW93qVli4HtPpGIz50ypQiL2GafbOsoJG0AWbg==","X-Received":"by 2002:a17:90a:7787:: with SMTP id\n\tv7mr22205300pjk.143.1563087977980; \n\tSun, 14 Jul 2019 00:06:17 -0700 (PDT)","Date":"Sun, 14 Jul 2019 16:06:13 +0900","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":"<20190714070613.GA31025@wyvern>","References":"<20190713172351.25452-1-laurent.pinchart@ideasonboard.com>\n\t<20190713172351.25452-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190713172351.25452-2-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 01/16] libcamera: camera: Don't\n\tmove buffers away from request at completion","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Sun, 14 Jul 2019 07:06:21 -0000"}}]