From patchwork Thu Jun 23 23:21:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16346 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 658C8BD808 for ; Thu, 23 Jun 2022 23:22:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7322B6563A; Fri, 24 Jun 2022 01:22:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656026550; bh=9K9tucfu6/SUgHLl8frLf5KptonYI+em3AMKx7LKB2M=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=W6Ffa2B4SJTrx3wfFHd/6RJsk38DYPIotKa4Pc/Usam9VKpjYWXIPbxwNZ9hRv0eR OrHXDK8Ui9bdiaW3Nrr922rWHM3vLHmaJ3YI7Idh8OYj6rAQF4hebSi9hNNTievjJS 4y/1f7mXVGroj+/c5NnPxBDMp60xvf7osxaaSJFzs+VxxewCYXN5TNRZdajxKlqkhP LGfdBni+ubkVSsnd3Hhr34+KZtdMbczAQvQD9ABq9AU407fFbrwodT1xTlwjR/aSPn gcIK+DzWcoXaZt5Yw6ikUQxV1350LLON6lJfcKZpOS4N5mL2bG3VhDJFHfOib/Jug0 2FQK611figEFg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F29B561FB2 for ; Fri, 24 Jun 2022 01:22:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZvYwDITy"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 460B5DD; Fri, 24 Jun 2022 01:22:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1656026548; bh=9K9tucfu6/SUgHLl8frLf5KptonYI+em3AMKx7LKB2M=; h=From:To:Cc:Subject:Date:From; b=ZvYwDITygU0BJOTOv9WtRIBzLDhO5bjWu6FBO50tIJDXkrMc3l4i2eiYmo7R+pQpH ZU2jToSDbyxrmLCr+1XXDu8kJRCGlBkKB6gurPVXkwLrsnzlT694MCwvh/Gu5ARbYI TJ03lZ7NtBQ0ZJLom4T2pdT/S7sunSTHuNK4IkCc= To: libcamera-devel@lists.libcamera.org Date: Fri, 24 Jun 2022 02:21:57 +0300 Message-Id: <20220623232210.18742-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/13] gstreamer: Queue multiple requests 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Cc: Nicolas Dufresne , Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series fixes a long-standing issue in the libcamerasrc element, namely the fact that it never queues more than one request at a time. It took me quite a while to grasp the implementation of libcamerasrc, and this probably shows through the patch series. I don't claim any of this is particularly good, only that it enables libcamerasrc usage with rkisp1 and vimc, which isn't possible today, and that it didn't introduce any regression I could notice. Reviews from developers with more experience in GStreamer than me would be appreciated :-) Laurent Pinchart (13): gstreamer: Use gst_task_resume() when available gstreamer: Inline gst_libcamera_buffer_get_frame_buffer() gstreamer: Move variable to loop scope gstreamer: Pass Stream to RequestWrap::addBuffer() gstreamer: Move timestamp calculation out of pad loop gstreamer: Rename queued requests queue to queuedRequests_ gstreamer: Handle completed requests in the libcamerasrc task gstreamer: Combine the two pad loops in the task run handler gstreamer: Use dedicated lock for request queues gstreamer: Fix pads locking gstreamer: Split request creation to a separate function gstreamer: Split completed request processing to a separate function gstreamer: Fix race conditions in task pause/resume src/gstreamer/gstlibcamera-utils.cpp | 16 +- src/gstreamer/gstlibcamera-utils.h | 4 +- src/gstreamer/gstlibcameraallocator.cpp | 3 +- src/gstreamer/gstlibcameraallocator.h | 2 +- src/gstreamer/gstlibcamerapad.cpp | 35 --- src/gstreamer/gstlibcamerapad.h | 6 - src/gstreamer/gstlibcamerapool.cpp | 14 -- src/gstreamer/gstlibcamerapool.h | 4 - src/gstreamer/gstlibcamerasrc.cpp | 308 ++++++++++++++++-------- 9 files changed, 227 insertions(+), 165 deletions(-) base-commit: 7ec3bfedbe22962600b438a13d9e13d37d55ce25