From patchwork Thu Feb 28 16:29:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 663 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8FF1E610F5 for ; Thu, 28 Feb 2019 17:29:28 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2A61E67 for ; Thu, 28 Feb 2019 17:29:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1551371368; bh=2544lptDAQRB451qgD7SxR37VsqdziLTuQ1XKbpMrmU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hxhMiVr2J2J5/L60pEN2nSPmFWRemmem1GIc8FFeVN6LlfSl15h4pcLDgSBozi7TY JP76WkYcYZO8kb9hfv6f/LEBS8M92RKx15LqNa9eGXMNj9TI676P4QlvGKHIqmc4jC Xvh7Qv7nHg9BFHZIP0++5npXrf14310Y/8VuL0Dc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Feb 2019 18:29:13 +0200 Message-Id: <20190228162913.6508-11-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190228162913.6508-1-laurent.pinchart@ideasonboard.com> References: <20190228162913.6508-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/10] cam: Don't requeue requests when stopping stream X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 16:29:29 -0000 When stopping the stream all pending requests are cancelled, resulting in the request completion signal being emitted with the request status set appropriately. Check the request status in the request completion slot and skip requeuing the request if it has been cancelled. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 4c2df583fe8e..c8e673e30c0b 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -102,6 +102,9 @@ static void requestComplete(Request *request, const std::map { static uint64_t last = 0; + if (request->status() == Request::RequestCancelled) + return; + Buffer *buffer = buffers.begin()->second; double fps = buffer->timestamp() - last;