{"id":4024,"url":"https://patchwork.libcamera.org/api/1.1/patches/4024/?format=json","web_url":"https://patchwork.libcamera.org/patch/4024/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200611171528.9381-2-email@uajain.com>","date":"2020-06-11T17:16:02","name":"[libcamera-devel,v4,1/6] libcamera: CameraManager: Drop the vector of created PipelineHandlers","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"5ecec555ae424b4535703ae022880dbb6346b2a8","submitter":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/people/1/?format=json","name":"Umang Jain","email":"email@uajain.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/4024/mbox/","series":[{"id":993,"url":"https://patchwork.libcamera.org/api/1.1/series/993/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=993","date":"2020-06-11T17:16:02","name":"Introduce UVC hotplugging support","version":4,"mbox":"https://patchwork.libcamera.org/series/993/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/4024/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/4024/checks/","tags":{},"headers":{"Return-Path":"<bounces+15657259-5c31-libcamera-devel=lists.libcamera.org@em7280.uajain.com>","Received":["from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2B3461027\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Jun 2020 19:16:03 +0200 (CEST)","by filterdrecv-p3iad2-784dbb6bd8-pfkxc with SMTP id\n\tfilterdrecv-p3iad2-784dbb6bd8-pfkxc-19-5EE266D2-19\n\t2020-06-11 17:16:02.265012104 +0000 UTC m=+680947.585168719","from mail.uajain.com (unknown)\n\tby ismtpd0002p1hnd1.sendgrid.net (SG) with ESMTP\n\tid JkbzlI51T2uT2U_ULET41w Thu, 11 Jun 2020 17:16:01.887 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=uajain.com\n\theader.i=@uajain.com header.b=\"gSwJ5D0U\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:in-reply-to:references:mime-version:to:cc:content-type:\n\tcontent-transfer-encoding;\n\ts=s1; bh=AOsWfebRFA6ErG2RAs6ttl4LB0gt5ThztqU8dHnZVRk=;\n\tb=gSwJ5D0Uoh/cygkrqlucIgdDsjVzK12aVAozrqCBo4s0Dqjro0eP4PgW8MPd5oJdihp1\n\tC40GuaBdA4QFKqYRSdBr0Q2E7TviT1r19gvTGC+dWa3grr2Eg5lSn147hy2Wk2zd3Y2eA7\n\ttql0gGedS6luUU7+sI2SNFTRUx3HXM8NY=","From":"Umang Jain <email@uajain.com>","Date":"Thu, 11 Jun 2020 17:16:02 +0000 (UTC)","Message-Id":"<20200611171528.9381-2-email@uajain.com>","In-Reply-To":"<20200611171528.9381-1-email@uajain.com>","References":"<20200611171528.9381-1-email@uajain.com>","Mime-Version":"1.0","X-SG-EID":"1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcGsFXrTC3nkaVUz7y/MXE3XUcgQ86CGdnwAGSBYcas7hRdz37+jERDWJQITOSZgEsMGL5UDkVbNyzlEQe1Z++UJRuaht3LAS/e8h9ZMxTTVJtxofhExRCGxZnNAiJVfnQ6xSKMwE7IJKjufmj1APjKi5pcLOSKU6VwbQEZ66FxttuKaO8BK0zhcoMTElJtENRdqX2msWGW5Uy0UXhoOQ5lA==","To":"laurent.pinchart@ideasonboard.com, libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 1/6] libcamera: CameraManager: Drop the\n\tvector of created PipelineHandlers","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":"Thu, 11 Jun 2020 17:16:04 -0000"},"content":"This placeholder for the pipeline-handlers created by CameraManager,\nwas responsible to hold a reference to pipeline-handlers which were\nnot getting dropped anywhere in the code-path. Instead of introducing\na fix of decrementing the reference, it is decided to eliminate this\nvector entirely from  the CameraManager. This is due to the fact that\nthe vector does not seem to have much use in CameraManager and thus\nreducing futile book-keeping.\n\nSince the vector is eliminated, there are no unchecked reference of the\npipeline-handlers. This fixes the initial issue of dangling driver directories\n(for e.g. for UVC camera - in /sys/bus/usb/drivers/uvcvideo) on 'unbind' → 'bind'\noperation while the CameraManager is running. The directories were still kept\naround even after 'unbind' because of the pipeline-handler's unchecked reference\nholding onto them.\n\nSigned-off-by: Umang Jain <email@uajain.com>\n---\n src/libcamera/camera_manager.cpp | 3 ---\n 1 file changed, 3 deletions(-)","diff":"diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\nindex 576856a..b8128df 100644\n--- a/src/libcamera/camera_manager.cpp\n+++ b/src/libcamera/camera_manager.cpp\n@@ -63,7 +63,6 @@ private:\n \tbool initialized_;\n \tint status_;\n \n-\tstd::vector<std::shared_ptr<PipelineHandler>> pipes_;\n \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n \n \tIPAManager ipaManager_;\n@@ -144,7 +143,6 @@ int CameraManager::Private::init()\n \t\t\tLOG(Camera, Debug)\n \t\t\t\t<< \"Pipeline handler \\\"\" << factory->name()\n \t\t\t\t<< \"\\\" matched\";\n-\t\t\tpipes_.push_back(std::move(pipe));\n \t\t}\n \t}\n \n@@ -162,7 +160,6 @@ void CameraManager::Private::cleanup()\n \t * they all get destroyed before the device enumerator deletes the\n \t * media devices.\n \t */\n-\tpipes_.clear();\n \tcameras_.clear();\n \n \tenumerator_.reset(nullptr);\n","prefixes":["libcamera-devel","v4","1/6"]}