From patchwork Wed Jun 15 16:25:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 16223 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 A826EC3273 for ; Wed, 15 Jun 2022 16:26:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 15DC665639; Wed, 15 Jun 2022 18:26:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655310405; bh=X9HxjkGgahIjpIqPOxLoBMPUddryFeMIEMmF7uB1Kbk=; 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=rdQvHCiOe8uDhdIGiPYmMCf09RmuKLsQpUh5PPOmMW8+3Uqjor9M6izraWX4QHSdo 3HIsKaxaOclPqDZ1YnceYX4wSh1E3pbd6Gmcka5tnHo7ZZAgp8KTbedzGNN+c2dBOP bCaCg7+I/hSH3pnfRfFO+8TIxt4O0MKAmmQyOe+62aEDLhlyU8sWigctx1QmBsOlR/ NtYxpijRuTsNZ0wL/4OVpo29V0Gg1MqP4IqwQbPIaHv7JakdS9ATXE+W4Kg3vLILxI fs3X8GSGMxOekCiFzPYO6WMMBJfw/52+BAUx/mEXmiyczRDCxGDBq5bc3usYZ0Lx5G aiqWtwZClMLrQ== Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0482B65631 for ; Wed, 15 Jun 2022 18:26:44 +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="KhI7O/ng"; dkim-atps=neutral Received: by mail-wr1-x430.google.com with SMTP id s1so16072259wra.9 for ; Wed, 15 Jun 2022 09:26:44 -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=hVAZs+2KGFmhbFIx3lcuE8BvVnEh3FH6A/D87gHArzE=; b=KhI7O/ng6lCmIxkf0coHxJbuD2Grdrpn33Vqjw2SChkZzQjebsoK7wjzGUJIgamQTu MDfD22fRkSx/VB0AcBwhZcWysbw23pflSUUz1osdQv3NnIRFp4m0LzxIq2ssFALwA7jd Wa5NiXlsoCqNUabDZ/seFC2jbYuWmBddSlnnFnbvmFHd3AyBjTqaXErXbo9fe2AVzrII Y5vnhCRRWM7xt7N7NYsX86aJTkms++SJpje/ehyJzcCOXl7xKXjyd+FxyAqojnuSBC+9 NSmXstntj3nfbxORsac3UhtZTUEbwS3q8364GcTiruwrLa0xz8m2lu5hYRlC48EzSTTg yL6A== 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=hVAZs+2KGFmhbFIx3lcuE8BvVnEh3FH6A/D87gHArzE=; b=xElDaBRajTeMAKzh4IxHErC4JA8nAPUpS/8qSxRsTrFkwlGuJ3bGBAy/u7LGP8kcOs PIE6jjYao+CD2UlBeVIXLS7+uj/JmQ7w4mbupP+W0BfGXUS3vAWOn7zPK5wFQEoGG3i/ o3aMC38OmYn27zpCkFcxfRxtML3lW0TZqWHU23aKNOxgsG2W4+lbJcKJ/1gwguR8dhiv IRC7PS27Ze2ffLW+utkW6xqs7S4VQD1HRfakfK2ZvyhCbWZFzxuRTsb7BH7MfFWJpGIS MO7aF/U72l/2O6Y0BfF3ofNNvCbwsEH8HcdHljKMtQS5dfhbQ3fA7qrhq2ubFHQyC3qX 2gbg== X-Gm-Message-State: AJIora/wga0swIkr0PSWKvNqUHSKwrBd2FMICosu+w1DYRMgPNbYalO5 Tu3WoUsPxsqw8mWYZBLQGQbRWHPIIcbFxHYF X-Google-Smtp-Source: AGRyM1tHLurMzmC+LZEE3KVPZkK/uvTESdIYnbCkzq8Egj5erWQcjt47rDfzJBkY/pNMA7XZxI5lZA== X-Received: by 2002:a05:6000:18a8:b0:212:ae71:a3f6 with SMTP id b8-20020a05600018a800b00212ae71a3f6mr549010wri.635.1655310403757; Wed, 15 Jun 2022 09:26:43 -0700 (PDT) Received: from localhost.localdomain (ip092042140082.rev.nessus.at. [92.42.140.82]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c35d100b0039c8d181ac6sm3135772wmq.26.2022.06.15.09.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 09:26:43 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 15 Jun 2022 18:25:59 +0200 Message-Id: <20220615162601.48619-2-dse@thaumatec.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220615162601.48619-1-dse@thaumatec.com> References: <20220615162601.48619-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] Documentation: Update code examples to match Request related changes 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" - Camera::createRequest() now returns unique_ptr instead of raw pointer - Request::BufferMap key type is now const --- Documentation/guides/application-developer.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst index 16bea9c4..6ab8b7e5 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 @@ -410,7 +410,7 @@ images. .. code:: cpp - const std::map &buffers = request->buffers(); + const std::map &buffers = request->buffers(); Iterating through the map allows applications to inspect each completed buffer in this request, and access the metadata associated to each frame. @@ -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 ~~~~~~~~~~~~~~~~~~~