Patch Detail
Show a patch.
GET /api/1.1/patches/2707/?format=api
{ "id": 2707, "url": "https://patchwork.libcamera.org/api/1.1/patches/2707/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2707/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200120113308.23623-1-laurent.pinchart@ideasonboard.com>", "date": "2020-01-20T11:33:08", "name": "[libcamera-devel] libcamera: Fix documentation of buffer allocation/export functions", "commit_ref": "ce2ea24fb46f924bda14721c7cee0d2e4ea0d74f", "pull_url": null, "state": "accepted", "archived": false, "hash": "9c59d9ca8746b662849fcc99cccd8b7711956e39", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2707/mbox/", "series": [ { "id": 642, "url": "https://patchwork.libcamera.org/api/1.1/series/642/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=642", "date": "2020-01-20T11:33:08", "name": "[libcamera-devel] libcamera: Fix documentation of buffer allocation/export functions", "version": 1, "mbox": "https://patchwork.libcamera.org/series/642/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2707/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2707/checks/", "tags": {}, "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 2EED6600F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jan 2020 12:33:12 +0100 (CET)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ABA42A62\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jan 2020 12:33:11 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579519991;\n\tbh=t70r9+jbE9J1V3st0PTJ8bdRrxdGIkhRPpNUMChFKZ0=;\n\th=From:To:Subject:Date:From;\n\tb=QHh4Ce6k9ZEvRn63LDCL3FDRcFStv05I0XEwai8BvLoVL8Q82sUERXOyJhKYk1wKn\n\tDQB+am8jgeZnd3CdQp7jAXbqSm6KqZ+DdXto/tFM0rWe8W/Tuy1yP19q3coCMxwRbI\n\tPlbTMeRvFxP7nifwTbHyKqxSWA3Ws+AY3uUNZjNE=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 20 Jan 2020 13:33:08 +0200", "Message-Id": "<20200120113308.23623-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: Fix documentation of buffer\n\tallocation/export functions", "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, 20 Jan 2020 11:33:12 -0000" }, "content": "The V4L2VideoDevice::exportBuffers(),\nPipelineHandler::exportFrameBuffers() and\nFrameBufferAllocator::allocate() functions all return the number of\nallocated buffers on success, but are documented as returning 0 in that\ncase. Fix their documentation.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/framebuffer_allocator.cpp | 11 ++++-------\n src/libcamera/pipeline_handler.cpp | 3 ++-\n src/libcamera/v4l2_videodevice.cpp | 3 ++-\n 3 files changed, 8 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp\nindex 207a13bd841d..296bd3355aa8 100644\n--- a/src/libcamera/framebuffer_allocator.cpp\n+++ b/src/libcamera/framebuffer_allocator.cpp\n@@ -108,7 +108,8 @@ FrameBufferAllocator::~FrameBufferAllocator()\n * Upon successful allocation, the allocated buffers can be retrieved with the\n * buffers() method.\n *\n- * \\return 0 on success or a negative error code otherwise\n+ * \\return The number of allocated buffers on success or a negative error code\n+ * otherwise\n * \\retval -EACCES The camera is not in a state where buffers can be allocated\n * \\retval -EINVAL The \\a stream does not belong to the camera or the stream is\n * not part of the active camera configuration\n@@ -140,12 +141,8 @@ int FrameBufferAllocator::allocate(Stream *stream)\n \t\treturn -EBUSY;\n \t}\n \n-\tint ret = camera_->pipe_->exportFrameBuffers(camera_.get(), stream,\n-\t\t\t\t\t\t &buffers_[stream]);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\treturn 0;\n+\treturn camera_->pipe_->exportFrameBuffers(camera_.get(), stream,\n+\t\t\t\t\t\t &buffers_[stream]);\n }\n \n /**\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 669097f609ab..01b9ede34b53 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -316,7 +316,8 @@ const ControlInfoMap &PipelineHandler::controls(Camera *camera)\n *\n * The only intended caller is the FrameBufferAllocator helper.\n *\n- * \\return 0 on success or a negative error code otherwise\n+ * \\return The number of allocated buffers on success or a negative error code\n+ * otherwise\n */\n \n /**\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 18220b81af21..82267730289d 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -973,7 +973,8 @@ int V4L2VideoDevice::requestBuffers(unsigned int count)\n * \\brief Allocate buffers from the video device\n * \\param[in] count Number of buffers to allocate\n * \\param[out] buffers Vector to store allocated buffers\n- * \\return 0 on success or a negative error code otherwise\n+ * \\return The number of allocated buffers on success or a negative error code\n+ * otherwise\n */\n int V4L2VideoDevice::exportBuffers(unsigned int count,\n \t\t\t\t std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n", "prefixes": [ "libcamera-devel" ] }