Patch Detail
Show a patch.
GET /api/1.1/patches/2717/?format=api
{ "id": 2717, "url": "https://patchwork.libcamera.org/api/1.1/patches/2717/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2717/", "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": "<20200122205723.8865-2-laurent.pinchart@ideasonboard.com>", "date": "2020-01-22T20:57:11", "name": "[libcamera-devel,v2,01/13] libcamera: Fix documentation of buffer allocation/export functions", "commit_ref": null, "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/2717/mbox/", "series": [ { "id": 645, "url": "https://patchwork.libcamera.org/api/1.1/series/645/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=645", "date": "2020-01-22T20:57:10", "name": "Initial libcamera threading model", "version": 2, "mbox": "https://patchwork.libcamera.org/series/645/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2717/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2717/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 28CF160871\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2020 21:57:43 +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 CF2DE2F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2020 21:57:42 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579726663;\n\tbh=RYzAJ/Do9yiXZrKTgiF64fSQHcD03ntuRoEUIMr0iWU=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=XO4dYHlMK0EBXDC+SKfoZ4m4uYMa2mbEz8NrtiiXepzj56K+UQ63pyqoGOtuU+slK\n\tUPxCbZuRYuvZEOW8agQEleTJD98Ks4SFnXcMizR0CpTDv5knkwtEVvUM1ojgx6Er3C\n\t4tI5fErAjPxLmGuyYjarVR47adN+GDdsTrXWPbHg=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 22 Jan 2020 22:57:11 +0200", "Message-Id": "<20200122205723.8865-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20200122205723.8865-1-laurent.pinchart@ideasonboard.com>", "References": "<20200122205723.8865-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 01/13] libcamera: Fix documentation of\n\tbuffer allocation/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": "Wed, 22 Jan 2020 20:57:43 -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>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\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 a7588c7fe4c2..c772b5165bbf 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", "v2", "01/13" ] }