From patchwork Tue Feb 26 02:18:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 624 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C7994610BB for ; Tue, 26 Feb 2019 03:19:18 +0100 (CET) X-Halon-ID: eab9f82b-396c-11e9-985a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id eab9f82b-396c-11e9-985a-005056917f90; Tue, 26 Feb 2019 03:19:17 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Feb 2019 03:18:52 +0100 Message-Id: <20190226021857.28255-4-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190226021857.28255-1-niklas.soderlund@ragnatech.se> References: <20190226021857.28255-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/8] libcamera: camera: document return values for application facing functions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 02:19:19 -0000 In preparation for adding a state machine to control access to the functions facing the application document the error codes which will be returned once it's in place. Signed-off-by: Niklas Söderlund --- src/libcamera/camera.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index e2372fea31e2921a..d4258fe3c7551af3 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -158,6 +158,7 @@ void Camera::disconnect() * \todo Implement exclusive access across processes. * * \return 0 on success or a negative error code + * \retval -EBUSY The camera is not free and can't be acquired by the caller. */ int Camera::acquire() { @@ -236,9 +237,8 @@ Camera::streamConfiguration(std::vector &streams) * to calling this function, otherwise an -EACCES error will be returned. * * \return 0 on success or a negative error code - * \retval -ENODEV The camera is not connected to any hardware - * \retval -EACCES The user has not acquired exclusive access to the camera - * \retval -EINVAL The configuration is not valid + * \retval -EACCES The camera is not in a state where it can be configured. + * \retval -EINVAL The configuration is not valid. */ int Camera::configureStreams(std::map &config) { @@ -279,6 +279,8 @@ int Camera::configureStreams(std::map &config) /** * \brief Allocate buffers for all configured streams * \return 0 on success or a negative error code + * \retval -EACCES The camera is not in a state where it can allocate buffers. + * \retval -EINVAL The configuration is not valid. */ int Camera::allocateBuffers() { @@ -330,6 +332,7 @@ void Camera::freeBuffers() * responsible for either queueing the request or deleting it. * * \return A pointer to the newly created request, or nullptr on error + * \retval -EACCES The camera is not in a state where requests can be created. */ Request *Camera::createRequest() { @@ -351,6 +354,7 @@ Request *Camera::createRequest() * automatically after it completes. * * \return 0 on success or a negative error code + * \retval -EACCES The camera is not running so requests can't be queued. */ int Camera::queueRequest(Request *request) { @@ -377,6 +381,7 @@ int Camera::queueRequest(Request *request) * until the capture session is terminated with \a stop(). * * \return 0 on success or a negative error code + * \retval -EACCES The camera is not in a state where it can be started. */ int Camera::start() { @@ -396,6 +401,7 @@ int Camera::start() * requests are cancelled and complete synchronously in an error state. * * \return 0 on success or a negative error code + * \retval -EACCES The camera is not running so can't be stopped. */ int Camera::stop() {