From patchwork Tue Mar 30 06:27:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11787 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1E695C32EA for ; Tue, 30 Mar 2021 06:27:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5E0DC68782; Tue, 30 Mar 2021 08:27:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mxBF+7Q4"; dkim-atps=neutral Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 16C20602D7 for ; Tue, 30 Mar 2021 08:27:46 +0200 (CEST) Received: by mail-pf1-x42e.google.com with SMTP id l123so11443175pfl.8 for ; Mon, 29 Mar 2021 23:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AxAEdE0s8KVO8nA/f8PNyhdGjLuWWQo/q0x3H/1QTHs=; b=mxBF+7Q412KAIJgSY1N2GaCPZyE3vzgu0ExUwjdzGe4PJzk9skQpGDhx4RPfK7WE/V mdRUpIuwRL1NFV7subaD0ejwGzA8DtM9xB2wPNpLSRR01ohX09oqiJkFqYO8n54eBMps EQiDPINs63x8u3kImOsjSzIs9cEFWuBPqTulc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AxAEdE0s8KVO8nA/f8PNyhdGjLuWWQo/q0x3H/1QTHs=; b=MmkipNVjjjCYrpvTIHP+ccQMelOR8u0onDAm/ZZn/sSvZ76Nmc7+OI4uf5EaQgwC7X wSbxkZJL4VF/fa3ztFDEFiNw79WAtMAMdBK4z1WFXjY2PuhNT5LzKJ1lzKZjBW0rn1Hj o9OleNnfYXiyNLGii4YAYMYDg5IkUkknK1L+F59d0RRQAfQJlQL1S7Ne2mJQG8aN11O/ VDO1qK220vJB08PLGzZIBKEdKLTYFUtK/U26+iFCaPVVeoSfdkdjp4rbsi1IKfKFD9Co Hpyupz4VybxUCqyYqASBkYrvMY5XvZVrALGRJ5hC1zp+3jB3u/CqEu39prfd9ee0ZSEw mwgg== X-Gm-Message-State: AOAM530gpxKPhTIa1QF2X7XjLHppKPr72FZg4khzxOsNhzrFDdi/9yGs HIdaZJ9UiRKx8ijK27ecr48mwPw5llyewg== X-Google-Smtp-Source: ABdhPJyuSzWKArtv0WsTWZHbWXPS55SyU7G24FPYZLNyep1OFazimgB0bvq/LtWVoNJCmIbsRw4Nqg== X-Received: by 2002:a62:528e:0:b029:1f5:c5ee:a487 with SMTP id g136-20020a62528e0000b02901f5c5eea487mr27973651pfb.7.1617085663999; Mon, 29 Mar 2021 23:27:43 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:c112:2822:484f:486]) by smtp.gmail.com with ESMTPSA id 202sm18554884pfu.46.2021.03.29.23.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 23:27:43 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 30 Mar 2021 15:27:36 +0900 Message-Id: <20210330062736.391600-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: CameraData: Change queuedRequests_ type to std::dequeue X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A more appropriate type is std::dequeue as requests are reported and removed in the order of queuing. Signed-off-by: Hirokazu Honda Reviewed-by: Sebastian Fricke Reviewed-by: Jacopo Mondi --- include/libcamera/internal/pipeline_handler.h | 4 ++-- src/libcamera/pipeline_handler.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 9bdda8f3..ff9d88d8 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -7,9 +7,9 @@ #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__ #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__ -#include #include #include +#include #include #include #include @@ -44,7 +44,7 @@ public: virtual ~CameraData() = default; PipelineHandler *pipe_; - std::list queuedRequests_; + std::deque queuedRequests_; ControlInfoMap controlInfo_; ControlList properties_; diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index e3d4975d..0fe913e9 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline) /** * \var CameraData::queuedRequests_ - * \brief The list of queued and not yet completed request + * \brief The queue of incomplete requests. * - * The list of queued request is used to track requests queued in order to - * ensure completion of all requests when the pipeline handler is stopped. + * This queue is used to ensure that all requests are completed when the pipeline + * handler is stopped. * * \sa PipelineHandler::queueRequest(), PipelineHandler::stop(), * PipelineHandler::completeRequest() @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request) int ret = queueRequestDevice(camera, request); if (ret) - data->queuedRequests_.remove(request); + data->queuedRequests_.pop_back(request); return ret; }