From patchwork Mon Jun 13 08:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 16207 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 BEA24BD161 for ; Mon, 13 Jun 2022 08:27:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1643465635; Mon, 13 Jun 2022 10:27:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655108852; bh=GA4lgZ/8wC4peCqnaPA9xL9eHB8El0m3qo8MlvTJzOk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=LImvFs3t+Xa6m9jwdenU0Jj32IYBW1G/v6WYpuoymppiLkzRDGTA6MDfdD7QpVlDW NRYIVKACAN5oSU30PeqzgytDM7Aqw4GBrLQ9oDVI8F8pgqbeNd5L31Vbo59f5T7Zq/ ppc/zZgp9i1+EMksWaG/Wfb4ZioyOKgpr4lF4A6++kkwznxNrppyPmmaDNnbOXOe+6 juT0gz15YsqpFOiVZILtIGCIMb50P2N81a2FyQ+BnZ1EmeCT+9LIhkQbQcyTrjW/qb G/x7CohrBqTj68+x3+6qfLdPzqFv/AaLaXtfiIBMNV+8SVokVUHN/+7A2mwrK6yOGk 0HMziO/+LvVLA== Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6064F601F0 for ; Mon, 13 Jun 2022 10:27:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="W2kTlBXR"; dkim-atps=neutral Received: by mail-wm1-x331.google.com with SMTP id n185so2499829wmn.4 for ; Mon, 13 Jun 2022 01:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p1yJOvY6WAQ9oWgcRPdOk58CJtoW5K1gi9Wd7BSK5/w=; b=W2kTlBXRLIbuTAvTJw9mpPX3lHhzLNaYxX7omBvQCRx6udbjffu7w+uadX17GgHDip QE36Bb+qpIVkfOaju0Zqw4k2y9kLVsCZ3eb5R2TiYpEdZc3tELhLzhyB6CQSl431jX8s llF2QzJXjLVf1MT0/YQqPRExOAiOSE9dLN/vk= 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:mime-version :content-transfer-encoding; bh=p1yJOvY6WAQ9oWgcRPdOk58CJtoW5K1gi9Wd7BSK5/w=; b=aXQRK69LQDKwpPaGwG91ptXq5qBg3KioE3Fi1s+5+Cd41juHTuueW4BRrmgt951w+Y ck6DOiXhDtdTHaFFRo+kV492MYF+xm3evaBfmZwRM5KDX4dC7dlURy26mH9N+DG25B/T tkI2v6J+UjKVLl8vvLYPuoVtjOqG26uyuBhVAMOA7ZchW3GafLFHCnaXKU+uarekcR2Y lO9GYZ4J+/09A0QF60VKogOqMO7wD8m2U1eZCnO89Xs4R6VioBkZmAU37CpkFE4QtInO HhEub/N27bIK2VlLfYXeZtmQZvtl1ORagNxTqhz32J0CuvP4pIPyOH3j5K5kk7TWXWTA 2j4A== X-Gm-Message-State: AOAM530IS+3atqRUIOQ9d9CkUyB9L8kacjeTRlni4sMJgE4HjsOUpv47 TVt0lfBIZwwkodKEVLiyGWioOA== X-Google-Smtp-Source: ABdhPJyym9sPYRjS9KbUXrAkZD3p0V1FRVv96GJtg6cTU7LOxgyzUUvE0aL8OX/b4Bq0XilOTiksAg== X-Received: by 2002:a05:600c:2241:b0:39c:405f:fba5 with SMTP id a1-20020a05600c224100b0039c405ffba5mr13271409wmm.75.1655108850046; Mon, 13 Jun 2022 01:27:30 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-51-34.cust.vodafonedsl.it. [188.217.51.34]) by smtp.gmail.com with ESMTPSA id n8-20020a7bc5c8000000b003974860e15esm12417247wmk.40.2022.06.13.01.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 01:27:29 -0700 (PDT) To: Date: Mon, 13 Jun 2022 10:27:25 +0200 Message-Id: <20220613082725.16315-1-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] Documentation: fix createRequest unique_ptr 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: Tommaso Merciai via libcamera-devel From: Tommaso Merciai Reply-To: Tommaso Merciai Cc: linux-amarula@amarulasolutions.com, libcamera-devel@lists.libcamera.org, linuxfancy@googlegroups.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" camera->createRequest() function return std::unique_ptr, then manipulate Request as std::unique_ptr. This solve the following error, during compilation: error: cannot convert ‘std::unique_ptr’ to ‘libcamera::Request*’ in initialization References: - https://github.com/kbingham/simple-cam/blob/bb97f3bbd96a9d347e1b7f6cb68d94efaf8db574/simple-cam.cpp#L369 Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- Documentation/guides/application-developer.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst index 16bea9c4..8d12a208 100644 --- a/Documentation/guides/application-developer.rst +++ b/Documentation/guides/application-developer.rst @@ -308,7 +308,7 @@ the camera. Stream *stream = streamConfig.stream(); const std::vector> &buffers = allocator->buffers(stream); - std::vector requests; + std::vector> requests; Proceed to fill the request vector by creating ``Request`` instances from the camera device, and associate a buffer for each of them for the ``Stream``. @@ -316,7 +316,7 @@ camera device, and associate a buffer for each of them for the ``Stream``. .. code:: cpp for (unsigned int i = 0; i < buffers.size(); ++i) { - Request *request = camera->createRequest(); + std::unique_ptr request = camera->createRequest(); if (!request) { std::cerr << "Can't create request" << std::endl; @@ -332,7 +332,7 @@ camera device, and associate a buffer for each of them for the ``Stream``. return ret; } - requests.push_back(request); + requests.push_back(std::move(request)); } .. TODO: Controls @@ -517,8 +517,8 @@ and queue all the previously created requests. .. code:: cpp camera->start(); - for (Request *request : requests) - camera->queueRequest(request); + for (std::unique_ptr &request : requests) + camera->queueRequest(request.get()); Start an event loop ~~~~~~~~~~~~~~~~~~~