[{"id":3581,"web_url":"https://patchwork.libcamera.org/comment/3581/","msgid":"<20200122164100.GA1124294@oden.dyn.berto.se>","date":"2020-01-22T16:41:00","subject":"Re: [libcamera-devel] [PATCH] libcamera: Fix documentation of\n\tbuffer allocation/export functions","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-01-20 13:33:08 +0200, Laurent Pinchart wrote:\n> The V4L2VideoDevice::exportBuffers(),\n> PipelineHandler::exportFrameBuffers() and\n> FrameBufferAllocator::allocate() functions all return the number of\n> allocated buffers on success, but are documented as returning 0 in that\n> case. Fix their documentation.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/framebuffer_allocator.cpp | 11 ++++-------\n>  src/libcamera/pipeline_handler.cpp      |  3 ++-\n>  src/libcamera/v4l2_videodevice.cpp      |  3 ++-\n>  3 files changed, 8 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp\n> index 207a13bd841d..296bd3355aa8 100644\n> --- a/src/libcamera/framebuffer_allocator.cpp\n> +++ b/src/libcamera/framebuffer_allocator.cpp\n> @@ -108,7 +108,8 @@ FrameBufferAllocator::~FrameBufferAllocator()\n>   * Upon successful allocation, the allocated buffers can be retrieved with the\n>   * buffers() method.\n>   *\n> - * \\return 0 on success or a negative error code otherwise\n> + * \\return The number of allocated buffers on success or a negative error code\n> + * otherwise\n>   * \\retval -EACCES The camera is not in a state where buffers can be allocated\n>   * \\retval -EINVAL The \\a stream does not belong to the camera or the stream is\n>   * not part of the active camera configuration\n> @@ -140,12 +141,8 @@ int FrameBufferAllocator::allocate(Stream *stream)\n>  \t\treturn -EBUSY;\n>  \t}\n>  \n> -\tint ret = camera_->pipe_->exportFrameBuffers(camera_.get(), stream,\n> -\t\t\t\t\t\t     &buffers_[stream]);\n> -\tif (ret)\n> -\t\treturn ret;\n> -\n> -\treturn 0;\n> +\treturn camera_->pipe_->exportFrameBuffers(camera_.get(), stream,\n> +\t\t\t\t\t\t  &buffers_[stream]);\n>  }\n>  \n>  /**\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 669097f609ab..01b9ede34b53 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -316,7 +316,8 @@ const ControlInfoMap &PipelineHandler::controls(Camera *camera)\n>   *\n>   * The only intended caller is the FrameBufferAllocator helper.\n>   *\n> - * \\return 0 on success or a negative error code otherwise\n> + * \\return The number of allocated buffers on success or a negative error code\n> + * otherwise\n>   */\n>  \n>  /**\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 18220b81af21..82267730289d 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -973,7 +973,8 @@ int V4L2VideoDevice::requestBuffers(unsigned int count)\n>   * \\brief Allocate buffers from the video device\n>   * \\param[in] count Number of buffers to allocate\n>   * \\param[out] buffers Vector to store allocated buffers\n> - * \\return 0 on success or a negative error code otherwise\n> + * \\return The number of allocated buffers on success or a negative error code\n> + * otherwise\n>   */\n>  int V4L2VideoDevice::exportBuffers(unsigned int count,\n>  \t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3EC4660804\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2020 17:41:02 +0100 (CET)","by mail-lj1-x243.google.com with SMTP id y4so7551382ljj.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2020 08:41:02 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\td26sm8700841lfa.44.2020.01.22.08.41.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Jan 2020 08:41:00 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=Ra7RU/4oKlE5V9+dq3uMHvz+ph5UnZvPvvSec97FdAM=;\n\tb=FtsnDqwG2XGbsJQmI1y9oyX4bDRY3SbYEbHTfdwMAmfidCilLt/cWDyAv8ZOJSn6c1\n\tWvVHXouhTGzjgwiVJz1Srnxo8OKJLiOR3NE7C8zIOYVhWCym4e7RKA/Sai9I4hIPS+D7\n\tHUqsop4wCWNWp2l2YNONY8TBCZzFfog/Ek5oQeoa8WkYKK5fLQZs+x3b9T1hfzobmJQa\n\tCyLkNY01Qkk1llJcqtWLfovsyx1p0+K4DS5EfVh9kbgYm4oXvgkCzQyvFVX0im/b3h3C\n\tL3CG9Oa2Nr+RZevbXgMPN4A1Rp3X6AiesdHrJmCBcZK2Kk2MZS7vlUOTx90CZ7mOAPdT\n\txUHg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=Ra7RU/4oKlE5V9+dq3uMHvz+ph5UnZvPvvSec97FdAM=;\n\tb=ZaDaJxSF3XFGMv+BycbjMmMCieDY/nLXFQcDEVRUe7uJ31YGRVyAqA+2PwwwFqXI9R\n\tHr7ADj9O85MlWfT3BPM3w/dkY/RPD1wZLfVn/uaXWXFtQ6xNVwSYGcrvS6sEH3SFwtE5\n\tKn+b9ct+SKpJpZYF7KdNHoOi7etaiCSyxHblq7jpCNEZ6qWg9XdPSCjFtAllussxUvNG\n\tDSMASfnO5CZvdEdyvzjg5BYs5WXr40D/odPCTavkZUfjhvXSVxrdLuoYoU9slzfUl8qf\n\tHhTz1R4N0MhEqL0RnRWIUJuMrzE6sLBifWnE1TDF//cwSPS4lEfnwyMV5sGrVhO5UjwK\n\tH5lg==","X-Gm-Message-State":"APjAAAWTQA9zrsljtl12UvnFgh8y3b4YKr4SttLR3bFyA2TOLvk+JVGM\n\tWB64twAFUi9rzwMMsE7ZGF/PELFPiGw=","X-Google-Smtp-Source":"APXvYqw8A9swHnwDzpK+rWHsWAylar0os5NYLJN2QcbL5OiPJWRxItQWhRn0sYr4melJGRXkLGZ5Hw==","X-Received":"by 2002:a2e:3619:: with SMTP id\n\td25mr19946772lja.231.1579711261544; \n\tWed, 22 Jan 2020 08:41:01 -0800 (PST)","Date":"Wed, 22 Jan 2020 17:41:00 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200122164100.GA1124294@oden.dyn.berto.se>","References":"<20200120113308.23623-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200120113308.23623-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Fix documentation of\n\tbuffer allocation/export functions","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 22 Jan 2020 16:41:02 -0000"}}]