[{"id":19094,"web_url":"https://patchwork.libcamera.org/comment/19094/","msgid":"<YSeOOGe020w/DIQA@pendragon.ideasonboard.com>","date":"2021-08-26T12:51:04","subject":"Re: [libcamera-devel] [PATCH v3 6/9] gstreamer:\n\tgstlibcameraallocator: Use offset in creating a buffer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Thu, Aug 26, 2021 at 08:25:36PM +0900, Hirokazu Honda wrote:\n> The plane length is the length of the plane size. The buffer length\n> to be allocated for a plane is the offset and the length of\n> FrameBuffer::Plane.\n> \n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/gstreamer/gstlibcameraallocator.cpp | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\n> index 7bd8ba2d..60ead273 100644\n> --- a/src/gstreamer/gstlibcameraallocator.cpp\n> +++ b/src/gstreamer/gstlibcameraallocator.cpp\n> @@ -52,8 +52,10 @@ FrameWrap::FrameWrap(GstAllocator *allocator, FrameBuffer *buffer,\n>  \t  outstandingPlanes_(0)\n>  {\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tGstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(), plane.length,\n> +\t\tGstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(),\n> +\t\t\t\t\t\t\tplane.offset + plane.length,\n>  \t\t\t\t\t\t\tGST_FD_MEMORY_FLAG_DONT_CLOSE);\n> +\t\tgst_memory_resize(mem, plane.offset, plane.length);\n>  \t\tgst_mini_object_set_qdata(GST_MINI_OBJECT(mem), getQuark(), this, nullptr);\n>  \t\tGST_MINI_OBJECT(mem)->dispose = gst_libcamera_allocator_release;\n>  \t\tg_object_unref(mem->allocator);","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 4D4CDBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Aug 2021 12:51:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A74A868920;\n\tThu, 26 Aug 2021 14:51:19 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E40396888F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Aug 2021 14:51:17 +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 4B253191F;\n\tThu, 26 Aug 2021 14:51:17 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gaWe8Wnp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629982277;\n\tbh=QLCUC503aUnz6nuqrRlPA9weP/blFCQP3PZSwBxWxwk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gaWe8WnpE18pF7vtS6fn0+1rAoTTVFDTHryS/vGuG5SEbYwtHcYgZYZofqqlloH2N\n\t2275dronZSnkx6YuXP3GYFdxTU8woltT9gSAKguhyrnSCymcpmUA/pqni6rtOxL2yj\n\taGJ9Rrz5cQ02qjAAzthf2Bj7jaq//mCZLFNHK4yo=","Date":"Thu, 26 Aug 2021 15:51:04 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YSeOOGe020w/DIQA@pendragon.ideasonboard.com>","References":"<20210826112539.170694-1-hiroh@chromium.org>\n\t<20210826112539.170694-7-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210826112539.170694-7-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v3 6/9] gstreamer:\n\tgstlibcameraallocator: Use offset in creating a 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>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]