{"id":17786,"url":"https://patchwork.libcamera.org/api/covers/17786/?format=json","web_url":"https://patchwork.libcamera.org/cover/17786/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20221111133025.3102-1-david.plowman@raspberrypi.com>","date":"2022-11-11T13:30:23","name":"[libcamera-devel,0/2] Notify pipeline handlers when a camera is released","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"mbox":"https://patchwork.libcamera.org/cover/17786/mbox/","series":[{"id":3606,"url":"https://patchwork.libcamera.org/api/series/3606/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3606","date":"2022-11-11T13:30:23","name":"Notify pipeline handlers when a camera is released","version":1,"mbox":"https://patchwork.libcamera.org/series/3606/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/17786/comments/","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 7439EBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Nov 2022 13:30:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF75163086;\n\tFri, 11 Nov 2022 14:30:31 +0100 (CET)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7568161F3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Nov 2022 14:30:29 +0100 (CET)","by mail-wm1-x329.google.com with SMTP id\n\tj5-20020a05600c410500b003cfa9c0ea76so3156221wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Nov 2022 05:30:29 -0800 (PST)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tbk11-20020a0560001d8b00b002416f0f1e96sm1511487wrb.43.2022.11.11.05.30.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 11 Nov 2022 05:30:27 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1668173431;\n\tbh=pB1PYREOXgYc2ClQfMHOjKtOb8qDrAz/oPuCK3EDF9w=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=MLf34uorxydg18tvMwZTlvBSodux0cz1UYour6oeWWMEoVDR3GlA/lRyB3BLxi/P4\n\tME5Q1Mu+x2R/WkbLqE/+PPbSWSEgmk5SgLp/YgFem1kC98HbyGMPHX95yZLnJY7963\n\tHMpJ2qFC1ZH/qvKyY0YT04IPElOruIvAxp1sEoMhYfEhBNTXRls4g6QyGQIclihajq\n\tukSg7vTFwp2K+xVsI1Jqh/EkLRL/M42gCr/0hi7capNQVrFYFf881N9GwCNE1xbFpL\n\tVfay1A4UGZ8iZYKBIVQbUvylHOPdNYZUI9Ln27Ip4h3h8KlQujq8/T8qtVGg3g5/Y/\n\t3xt9HPoqjuJoA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Ekbbt09piBEBte9uDIi8DjUo5H4ys86ukZPWBp/9K8k=;\n\tb=qVYYLc2qIBkm2Xd817LOBxINA1wP29cEzkWCxM4WKTbvZHNB3jx9LQ+K1VLoFJiLP1\n\tzsY4uPWs1aLJzHWFOeXpccZTx4goW+sFeROT4jUlyaSUA1xhlaaK79Hl63OsZXWuIdmM\n\t2YTw7sN3NonDLWokMRLdbof4jFCtEsGtbKIjQkTEWR08YX8masxuHSvBQF/J5pMcrEAR\n\tBWjasQWuj0zORK/O9ORCy6eQtzW6gkM8e5ZS99nVpd8VX1eXkFxqsJEPbB480SQFbEYX\n\tm7HncN8huN+jdYS3Oo6smJ5c3tfR5MyWeULPrt40e0v4AyljdkgPuYG8+KMowDJToDVk\n\tVlew=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"qVYYLc2q\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=Ekbbt09piBEBte9uDIi8DjUo5H4ys86ukZPWBp/9K8k=;\n\tb=SPTzXO6dbxEr7Brlr2sPEiavqUQOmkH9Yi8iWFA9h7bMpPDdvZMV4GsA4i2FdxwqZV\n\te+osaIvQHQ8v7FPBI0eKEhEHSLzBG+ioSBPryb8T6yG3UYFJhS77CUvxvc2wZNVtDRNv\n\tEaztzcOQbacVYerVbn9RJLa9JeT5+ij3EH1+uokmukVf42gTSYPcnRo4mKY3BLMbST/s\n\t1pJDptqlSH/QTUMKJoT2iM8Cc/LjK0dH/pdAu6zGna6Rh6dU6+aWcKOLz4VCS7fbkMlI\n\tllaH5tAK3umdjonJ8j8FHgtMF6csv1I3HUotnzApiXM+/q2d4XP423weegGvbAVZjBwg\n\tMiVg==","X-Gm-Message-State":"ANoB5pmEHQATPUmXfCFaXJyvt5oq+Tw0nNZ2FXEXtcCfq8jWOWeaDePE\n\teAkfC2rtVgjUDbVPG1ujFvfvlOBPvpL2Zg==","X-Google-Smtp-Source":"AA0mqf57F3EC2zLXXN/pgk1gODTuHHNy4Lxhhk5J2lpXKUwFg9nnCJpbp0hS2fwhvE6umKTGf0sZRg==","X-Received":"by 2002:a05:600c:231a:b0:3cf:681a:43e1 with SMTP id\n\t26-20020a05600c231a00b003cf681a43e1mr1203268wmo.126.1668173428538; \n\tFri, 11 Nov 2022 05:30:28 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 11 Nov 2022 13:30:23 +0000","Message-Id":"<20221111133025.3102-1-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 0/2] Notify pipeline handlers when a\n\tcamera is released","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi\n\nThese patches are actually a follow-up to an email I circulated on 7th\nNovember, entitled \"Problems opening/closing camera in different\nprocesses\".\n\nIt address the problem that when a camera is released, our pipeline\nhandler never gets to find out. So we have no way to know that this\nwould be a good moment to free all the buffers we allocated for it.\n\nRather than continue the discussion, I thought I'd submit some code!\n\nThere are 2 small patches here.\n\nThe first adds a \"releaseDevice\" method to the PipelineHandler, that\nit calls from its \"release\" method (trying to follow the \"xxx calls\nxxxDevice\" pattern that I saw).\n\nThe second merely implements a \"releaseDevice\" method for the Pi,\nwhich frees any allocated buffers.\n\nThanks!\nDavid\n\nDavid Plowman (2):\n  libcamera: Add a PipelineHandler::releaseDevice method\n  libcamera: pipeline: raspberrypi: Free buffers when a camera is\n    released\n\n include/libcamera/internal/pipeline_handler.h    |  4 +++-\n src/libcamera/camera.cpp                         |  2 +-\n .../pipeline/raspberrypi/raspberrypi.cpp         |  8 ++++++++\n src/libcamera/pipeline_handler.cpp               | 16 +++++++++++++++-\n 4 files changed, 27 insertions(+), 3 deletions(-)"}