{"id":21643,"url":"https://patchwork.libcamera.org/api/patches/21643/?format=json","web_url":"https://patchwork.libcamera.org/patch/21643/","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":"<20241016134640.3648224-1-chenghaoyang@chromium.org>","date":"2024-10-16T13:46:33","name":"libcamera: v4l2: Support changing poller thread for V4L2VideoDevice","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"f065f8b8883a1dc98299d54d1e066454227c6b3d","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21643/mbox/","series":[{"id":4707,"url":"https://patchwork.libcamera.org/api/series/4707/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4707","date":"2024-10-16T13:46:33","name":"libcamera: v4l2: Support changing poller thread for V4L2VideoDevice","version":1,"mbox":"https://patchwork.libcamera.org/series/4707/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21643/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21643/checks/","tags":{},"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 09D57C32FA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Oct 2024 13:46:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69C0E65383;\n\tWed, 16 Oct 2024 15:46:49 +0200 (CEST)","from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com\n\t[IPv6:2607:f8b0:4864:20::62e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 029B76537E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Oct 2024 15:46:46 +0200 (CEST)","by mail-pl1-x62e.google.com with SMTP id\n\td9443c01a7336-20c70abba48so45517555ad.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Oct 2024 06:46:46 -0700 (PDT)","from chenghaoyang-low.c.googlers.com.com\n\t(199.211.81.34.bc.googleusercontent.com. [34.81.211.199])\n\tby smtp.gmail.com with ESMTPSA id\n\td9443c01a7336-20d1805b0basm28812385ad.256.2024.10.16.06.46.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 16 Oct 2024 06:46:44 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"BRHoowAy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1729086405; x=1729691205;\n\tdarn=lists.libcamera.org; \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=p0G47O65SSLbRRBP/mR58lRpYG7Q1ot291VzY8fu42s=;\n\tb=BRHoowAyXcvWPRmFpWMjAgoEuVZ8IQZUqd+/ANYit3aV1pHJ5VcR7jiLLHFBmcG+o2\n\tGzsB5L6AR0b+hDGhYblHDfz/9mizAkhsjG7ofyqWPX1ny/kZZ+H0keNX8YrO+zHizHHH\n\t4/SrFp22uoxzVkUx/PH3cf3TUDznfazGjSwbY=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1729086405; x=1729691205;\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=p0G47O65SSLbRRBP/mR58lRpYG7Q1ot291VzY8fu42s=;\n\tb=wNSOkRynGCm+YasZYIQwNLUkEWK9ugt830tm88cV2hgKeaqsk8tbXpyGTdSAE8g6kv\n\t/HBe/FJ4Do9CvzSEma8Z/8SAm/7emxdOP8MIS44WnwDqJhOI7tDeF9vmyycJo1SivGqK\n\t6zY4R7mIsi2FNOLnAkZ2OzUT/kf/59O3Ra+COu+c9uCgMDCEqCygjvLbOqlIjYtLgQ4R\n\t6oneAylNvB+qlu3Sn/KwU/mJlspiI7S/fukzkn1SakKkqB7esSNEhZN8eKMMsmSf81Xz\n\tGdDQ9npRi0FXQTwEvP64QF0gmiUtS68dzMg+fRv7IPpcTK9TOiqrlxw0A88HLrTpL2i9\n\tiaxw==","X-Gm-Message-State":"AOJu0YyL3P6sNQ3c0gdpSyVQGD57R5F2m2jn1174iRTEwEp/0LdSqvBR\n\txRiPZMD9f25cz8A/3NNoPjdcKvvyvzSpRzN/Gh12MKWoeiGt0wUJTk3jK0kGb28dUMLcN4nftmY\n\t=","X-Google-Smtp-Source":"AGHT+IEnF+bOIE+bPf7R4oQNR65PTDe1qeN78gkFamG61bE19ug022mB19Y94ujmc31nq7GIGOgEpQ==","X-Received":"by 2002:a17:902:f686:b0:20c:e4c3:27a3 with SMTP id\n\td9443c01a7336-20ce4c32957mr134439105ad.43.1729086404977; \n\tWed, 16 Oct 2024 06:46:44 -0700 (PDT)","From":"Harvey Yang <chenghaoyang@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"Han-Lin Chen <hanlinchen@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>","Subject":"[PATCH] libcamera: v4l2: Support changing poller thread for\n\tV4L2VideoDevice","Date":"Wed, 16 Oct 2024 13:46:33 +0000","Message-ID":"<20241016134640.3648224-1-chenghaoyang@chromium.org>","X-Mailer":"git-send-email 2.47.0.rc1.288.g06298d1525-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"From: Han-Lin Chen <hanlinchen@chromium.org>\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\nCo-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nSigned-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/internal/v4l2_videodevice.h |  2 ++\n src/libcamera/v4l2_videodevice.cpp            | 13 +++++++++++++\n 2 files changed, 15 insertions(+)","diff":"diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\nindex f021c2a01..f8d017b01 100644\n--- a/include/libcamera/internal/v4l2_videodevice.h\n+++ b/include/libcamera/internal/v4l2_videodevice.h\n@@ -232,6 +232,8 @@ public:\n \n \tV4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat) const;\n \n+\tvoid changePollerThread(Thread *thread);\n+\n protected:\n \tstd::string logPrefix() const override;\n \ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 14eba0561..fc6b88ec1 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -2120,6 +2120,19 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma\n \treturn {};\n }\n \n+/**\n+ * \\brief Move the event notifier and timer to \\a thread\n+ * \\param[in] thread The thread to poll on\n+ */\n+void V4L2VideoDevice::changePollerThread(Thread *thread)\n+{\n+\tif (!isOpen())\n+\t\treturn;\n+\n+\tfdBufferNotifier_->moveToThread(thread);\n+\twatchdog_.moveToThread(thread);\n+}\n+\n /**\n  * \\class V4L2M2MDevice\n  * \\brief Memory-to-Memory video device\n","prefixes":[]}