{"id":12533,"url":"https://patchwork.libcamera.org/api/1.1/covers/12533/?format=json","web_url":"https://patchwork.libcamera.org/cover/12533/","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":"<20210610075027.523672-1-hiroh@chromium.org>","date":"2021-06-10T07:50:17","name":"[libcamera-devel,v2,00/10] Introduce ScopedFD","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"mbox":"https://patchwork.libcamera.org/cover/12533/mbox/","series":[{"id":2115,"url":"https://patchwork.libcamera.org/api/1.1/series/2115/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2115","date":"2021-06-10T07:50:17","name":"Introduce ScopedFD","version":2,"mbox":"https://patchwork.libcamera.org/series/2115/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/12533/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 93ECEBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jun 2021 07:50:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 076A368931;\n\tThu, 10 Jun 2021 09:50:38 +0200 (CEST)","from mail-pg1-x534.google.com (mail-pg1-x534.google.com\n\t[IPv6:2607:f8b0:4864:20::534])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99837602C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jun 2021 09:50:35 +0200 (CEST)","by mail-pg1-x534.google.com with SMTP id y11so13785529pgp.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jun 2021 00:50:35 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:98e0:b356:1c8a:25d4])\n\tby smtp.gmail.com with ESMTPSA id\n\td66sm1565161pfa.32.2021.06.10.00.50.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Jun 2021 00:50:32 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"GEYkRIBw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=yMF5taR7KEjEMX6xq1ja7QRGY9EdPLS9COVFA1Q84Ys=;\n\tb=GEYkRIBwAXP5ReoC9lwZwQqxYOgCSRkljzFbiNcPLc4KGwRxAFGibG9mJBIBgiHLlZ\n\t8pV1gnAp9XGEFg5oAY1YSjMCJuvpX8forJn1eruPvr7Z/NMYXaTx4Pln5E3yi+IpQ5Yv\n\t/7kt3hf7ruCBdzvmTMK4llSfhqOFEK7ZencOU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=yMF5taR7KEjEMX6xq1ja7QRGY9EdPLS9COVFA1Q84Ys=;\n\tb=pZrdEMJiokyu4uj6yvOd0TE3TchY/bXVATfwkCaNENBwmIaya25lLA6f0LrEnzXUHM\n\t1vvdeOJQTUwFG3Ajdp4RRK4hHPpR0Z2Thj7ymmXTnDEQiHOrpHhvq5Gbr/vw89INdURz\n\tM7We93EnGwJXy7eQqiVp/VLsHWeAjSph2r+I0XEnrV2bXry46bdEjfCSeCMiQdhMOLpv\n\tAAbHWzVr10EtUH2SQMdCbcInnerCryHbPHyxY9PX35vZQDBS4lLWjsp7YY+0sC0EXhxg\n\tnhWb33oL3BesvslpuRRHNnHGYps58V7GkUpdbDRiTy6ZsQrHDYnSNpH7DyZoiWlD/wgv\n\tZY5A==","X-Gm-Message-State":"AOAM530Oqdx92S0CRE7Z0J83ohQY+un0H5lMTsecPB0Fh2gXzc8Kfbrl\n\t7HsptItri0Zgk2x5dDANpeWi2yQWMriPog==","X-Google-Smtp-Source":"ABdhPJz6IZrOZmeuPHRpCpBtj0FhhiODkGp3L5hGrcEEahASyuTo2ClW9zDpuBBIaMo7IWK9xdNqoA==","X-Received":"by 2002:a62:1c48:0:b029:2ea:1c13:e229 with SMTP id\n\tc69-20020a621c480000b02902ea1c13e229mr1776129pfc.17.1623311433415; \n\tThu, 10 Jun 2021 00:50:33 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 10 Jun 2021 16:50:17 +0900","Message-Id":"<20210610075027.523672-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.32.0.rc1.229.g3e70b5a671-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 00/10] Introduce ScopedFD","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This series introduces ScopedFD that is a file descriptor wrapper\nthat owns a file descriptor and acts like unique_ptr.\nIt enables to not only reduce close() manually, but also clarify an\nownership of a file descriptor.\n\nChange in v2\n- Address Lauren'ts comments to v1\n\nHirokazu Honda (10):\n  libcamera: ScopedFD: Introduce ScopedFD\n  libcamera: EventDispatcherPoll: Manage fd by ScopedFD\n  libcamera: File: Manage fd by ScopedFD\n  libcamera: Process: Manage pipe fds by ScopedFD\n  libcamera: MediaDevice: Manage fd by ScopedFD\n  libcamera: V4L2Device: Use ScopedFD for a file descriptor\n  libcamera: V4L2VideoDevice: Use fd for a file descriptor\n  libcamera: IPCUnixSocket: Use ScopedFD for a file descriptor\n  libcamera: pipeline: raspberrypi: DmaHeaps: Use ScopedFD for a file\n    descriptor\n  v4l2: V4L2Camera: Return int in getBufferFd()\n\n include/libcamera/file_descriptor.h           |   3 +\n .../internal/event_dispatcher_poll.h          |   4 +-\n include/libcamera/internal/file.h             |   5 +-\n include/libcamera/internal/ipc_unixsocket.h   |   5 +-\n include/libcamera/internal/media_device.h     |   3 +-\n include/libcamera/internal/process.h          |   4 +-\n include/libcamera/internal/v4l2_device.h      |   9 +-\n include/libcamera/internal/v4l2_videodevice.h |   4 +-\n include/libcamera/meson.build                 |   1 +\n include/libcamera/scoped_fd.h                 |  36 +++++\n src/libcamera/event_dispatcher_poll.cpp       |  11 +-\n src/libcamera/file.cpp                        |  25 ++--\n src/libcamera/file_descriptor.cpp             |  20 +++\n src/libcamera/ipc_pipe_unixsocket.cpp         |   8 +-\n src/libcamera/ipc_unixsocket.cpp              |  40 +++---\n src/libcamera/media_device.cpp                |  39 +++---\n src/libcamera/meson.build                     |   1 +\n .../pipeline/raspberrypi/dma_heaps.cpp        |  23 ++--\n .../pipeline/raspberrypi/dma_heaps.h          |  10 +-\n .../pipeline/raspberrypi/raspberrypi.cpp      |   7 +-\n src/libcamera/process.cpp                     |  16 ++-\n src/libcamera/scoped_fd.cpp                   | 129 ++++++++++++++++++\n src/libcamera/v4l2_device.cpp                 |  26 ++--\n src/libcamera/v4l2_videodevice.cpp            |  48 +++----\n src/v4l2/v4l2_camera.cpp                      |   6 +-\n src/v4l2/v4l2_camera.h                        |   2 +-\n src/v4l2/v4l2_camera_proxy.cpp                |   6 +-\n test/ipc/unixsocket.cpp                       |   6 +-\n 28 files changed, 339 insertions(+), 158 deletions(-)\n create mode 100644 include/libcamera/scoped_fd.h\n create mode 100644 src/libcamera/scoped_fd.cpp\n\n--\n2.32.0.rc1.229.g3e70b5a671-goog"}