Patch Detail
Show a patch.
GET /api/patches/2826/?format=api
{ "id": 2826, "url": "https://patchwork.libcamera.org/api/patches/2826/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2826/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20200214001810.19302-2-kieran.bingham@ideasonboard.com>", "date": "2020-02-14T00:18:04", "name": "[libcamera-devel,v2,1/7] qcam: Tie FrameBufferAllocator to stream life", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "add9293cf9e5f5833855f8c517d246233790fb59", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2826/mbox/", "series": [ { "id": 673, "url": "https://patchwork.libcamera.org/api/series/673/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=673", "date": "2020-02-14T00:18:03", "name": "qcam: Provide an initial toolbar", "version": 2, "mbox": "https://patchwork.libcamera.org/series/673/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2826/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2826/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@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 3C635600FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Feb 2020 01:18:14 +0100 (CET)", "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ABC619D3;\n\tFri, 14 Feb 2020 01:18:13 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1581639493;\n\tbh=AzL5UoPbhR066r1KELklVWXAMFIrvOVlhJ+NTafcCcQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=JOPz5fl8XByYPGGT+o/Szgcaqbtv95iLWAReZbWAHt+KlnMKu1/LVqHFiHA4ctp7L\n\tyKTxM9ogzYHS8yqJYC6mltvnY66znjarOaDzHwzfDRdxdp38VIM7WxXKd3k0Ls9tUF\n\t48eqts29UFtbddE9uw29azmSge6I8XUR/YIcJ3vI=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Fri, 14 Feb 2020 00:18:04 +0000", "Message-Id": "<20200214001810.19302-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200214001810.19302-1-kieran.bingham@ideasonboard.com>", "References": "<20200214001810.19302-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/7] qcam: Tie FrameBufferAllocator to\n\tstream life", "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": "Fri, 14 Feb 2020 00:18:14 -0000" }, "content": "The FrameBufferAllocator must be deleted and reconstructed before performing\nany reconfiguration of the stream.\n\nConstruct the allocator at startCapture, and destroy it during stopCapture so\nthat we can successfully stop and restart the stream.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nv2:\n - Remove unnecessary braces\n - Clean up in start_capture() error path.\n\n src/qcam/main_window.cpp | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 70a3e61c66d8..db14245d7f51 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -36,10 +36,8 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)\n \tadjustSize();\n \n \tret = openCamera(cm);\n-\tif (!ret) {\n-\t\tallocator_ = FrameBufferAllocator::create(camera_);\n+\tif (!ret)\n \t\tret = startCapture();\n-\t}\n \n \tif (ret < 0)\n \t\tQTimer::singleShot(0, QCoreApplication::instance(),\n@@ -50,7 +48,6 @@ MainWindow::~MainWindow()\n {\n \tif (camera_) {\n \t\tstopCapture();\n-\t\tdelete allocator_;\n \t\tcamera_->release();\n \t\tcamera_.reset();\n \t}\n@@ -171,6 +168,7 @@ int MainWindow::startCapture()\n \n \tadjustSize();\n \n+\tallocator_ = FrameBufferAllocator::create(camera_);\n \tret = allocator_->allocate(stream);\n \tif (ret < 0) {\n \t\tstd::cerr << \"Failed to allocate capture buffers\" << std::endl;\n@@ -236,6 +234,9 @@ error:\n \t}\n \tmappedBuffers_.clear();\n \n+\tdelete allocator_;\n+\tallocator_ = nullptr;\n+\n \treturn ret;\n }\n \n@@ -255,6 +256,8 @@ void MainWindow::stopCapture()\n \t}\n \tmappedBuffers_.clear();\n \n+\tdelete allocator_;\n+\n \tisCapturing_ = false;\n \n \tconfig_.reset();\n", "prefixes": [ "libcamera-devel", "v2", "1/7" ] }