From patchwork Fri Jun 17 14:35:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 16267 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 B7E1CC3274 for ; Fri, 17 Jun 2022 14:36:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3610B65640; Fri, 17 Jun 2022 16:36:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655476563; bh=KjH4tmNS63vJcpsSiWI8j5ifpvfdCF5cYnDJT1LX3ak=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TLXW5mWKgT5n4cP0OLTcJAAbI0aZFf3NWi/+Y941pRzcR+BYijr4G2gJSG5ly7klC 7rqsgGEdSnXzI8QHPnbA0TIf3+KQLJ9RhqKqFZD1+xXNZdanBBgIxNlA4HgNcLYg77 ZPRx2c/tkM5wpMc/FHsamg7xzNDSk2uAFJS1q5TxlpF5hc5UnHi2Seg7+Ao7+1M91V DwAZR2DLvcat5EyCwPk+kYARXqCaFrhNpvAS5iZgO6tHw/8/vhv65pjfvPob08VUAe VphtqAT6N53bz276jr/oaauMqBlGWkXJH3+6I7eYTNV3zSqgbtOFhRVTHCQ0Jvh9Su VNGbVLm6NjOMw== Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EBC8E6563B for ; Fri, 17 Jun 2022 16:36:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=thaumatec-com.20210112.gappssmtp.com header.i=@thaumatec-com.20210112.gappssmtp.com header.b="pmLe5vO0"; dkim-atps=neutral Received: by mail-ej1-x62b.google.com with SMTP id me5so9188986ejb.2 for ; Fri, 17 Jun 2022 07:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w0e7YC6nMwbowNG2N+5NhLg9552WzqKVUgC+4FV5e9E=; b=pmLe5vO03nAIs3I+ZJEihxykNgUldwtNef5tfjnmWqth5dYwXpGQx/sUaMx7JFYyjB 4RUg9EpTK5NAeEWNiIl48k7I8265U4PmYpFElQzk/56kfhvRC2ooW3BLhujce5mjeEhx pDKNGPKedAGdaRrfmv4F6AHi9RYI4RPZ+d+zdjHgDzvL86ErU0zsswlj0pEMkrhaTgnr JgYEtgZzuP8nVRlHAqoGtCucLJjr27DKrA3+VNCqXtWNLbLJmLS6tCJO5yPyzYq9d9eL tq+xPeR5fNHiGOkWPgb8iwzIQlHqxS/MVDA1y9SYbNk4qa/TLJ/Lt9kd3S3sLPBwCYM6 TGDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w0e7YC6nMwbowNG2N+5NhLg9552WzqKVUgC+4FV5e9E=; b=kDrfgTd6Ff8di63ROp/Wu4OpFx0JkPTbnAvoDdDbbNJbK1qxZJ8fEmntPR1RVFUT7h lu8qFHnG0uS8JeKDbfoOEXWNyIFtpXNfzj7SlKS1Y9TEuK+LYcsn3mZJjqzTD+7xgp71 V/4W9hfBqZdzJRy9yB+VpkAgka6YTWNdrsZzbULfJM9NuPu635bRnfgCDJ2En2UjF9Co MLPIPa5GeMbMYF8v9ok6w3EaSsQyi4gLzCrFkEJlEbMASwnsPcA1EiA5/KJn+zNw5cPr kUJs+LPwHaSnuI0lzSv7EVRubkRhLjz+V5oZCGQJaTaHiYCaI2n/Xas+mvX6GPi/ngZY WpUA== X-Gm-Message-State: AJIora96ztEIPGccCpV1zXTrYsBMO/P7LEyTT0VNnWPR7QjFbeVLqY/R +BwboacKj6h9nZRtkVtkUPX1TLIMASDJCg== X-Google-Smtp-Source: AGRyM1uJoEVwTRJGmUpg9Y6/pNsvQjH9yUExlajnSF4Zub0hWipZnys4vjx8F71aSQeadWDAXOPONw== X-Received: by 2002:a17:906:ece3:b0:6f3:da10:138a with SMTP id qt3-20020a170906ece300b006f3da10138amr9736427ejb.438.1655476561457; Fri, 17 Jun 2022 07:36:01 -0700 (PDT) Received: from localhost.localdomain (ip092042140082.rev.nessus.at. [92.42.140.82]) by smtp.gmail.com with ESMTPSA id u20-20020aa7d554000000b0042a2d9af0f8sm3746189edr.79.2022.06.17.07.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 07:36:00 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 17 Jun 2022 16:35:48 +0200 Message-Id: <20220617143549.35442-3-dse@thaumatec.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220617143549.35442-1-dse@thaumatec.com> References: <20220617143549.35442-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/3] Documentation: Update code examples to use the Request::reuse() method 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: Daniel Semkowicz via libcamera-devel From: Daniel Semkowicz Reply-To: Daniel Semkowicz Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" After introduction of reuse(), there is no need of manual request reconfiguration. Furthermore, current example code does not work anymore. Signed-off-by: Daniel Semkowicz Reviewed-by: Laurent Pinchart --- .../guides/application-developer.rst | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst index 6ab8b7e5..a5f363cf 100644 --- a/Documentation/guides/application-developer.rst +++ b/Documentation/guides/application-developer.rst @@ -480,26 +480,12 @@ libcamera repository. .. _FileSink class: https://git.libcamera.org/libcamera/libcamera.git/tree/src/cam/file_sink.cpp With the handling of this request completed, it is possible to re-use the -buffers by adding them to a new ``Request`` instance with their matching -streams, and finally, queue the new capture request to the camera device: +request and the associated buffers and re-queue it to the camera +device: .. code:: cpp - request = camera->createRequest(); - if (!request) - { - std::cerr << "Can't create request" << std::endl; - return; - } - - for (auto it = buffers.begin(); it != buffers.end(); ++it) - { - Stream *stream = it->first; - FrameBuffer *buffer = it->second; - - request->addBuffer(stream, buffer); - } - + request->reuse(Request::ReuseBuffers); camera->queueRequest(request); Request queueing