libcamera: align the documentation for numeric error codes
Rapid growth of the library have resulted in slightly different wording to document that a function returns 0 on success or a negative error code otherwise. Align all different variations. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
9aceed70a2
commit
acb56ebef8
9 changed files with 31 additions and 33 deletions
|
@ -71,7 +71,7 @@ Plane::~Plane()
|
||||||
* The \a fd dmabuf file handle is duplicated and stored. The caller may close
|
* The \a fd dmabuf file handle is duplicated and stored. The caller may close
|
||||||
* the original file handle.
|
* the original file handle.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error value otherwise.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Plane::setDmabuf(int fd, unsigned int length)
|
int Plane::setDmabuf(int fd, unsigned int length)
|
||||||
{
|
{
|
||||||
|
@ -106,7 +106,7 @@ int Plane::setDmabuf(int fd, unsigned int length)
|
||||||
*
|
*
|
||||||
* \sa setDmaBuf()
|
* \sa setDmaBuf()
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error value otherwise.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Plane::mmap()
|
int Plane::mmap()
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ int Plane::mmap()
|
||||||
*
|
*
|
||||||
* Unmap the memory mapped by an earlier call to mmap().
|
* Unmap the memory mapped by an earlier call to mmap().
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error value otherwise.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Plane::munmap()
|
int Plane::munmap()
|
||||||
{
|
{
|
||||||
|
|
|
@ -157,7 +157,7 @@ void Camera::disconnect()
|
||||||
*
|
*
|
||||||
* \todo Implement exclusive access across processes.
|
* \todo Implement exclusive access across processes.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Camera::acquire()
|
int Camera::acquire()
|
||||||
{
|
{
|
||||||
|
@ -235,7 +235,7 @@ Camera::streamConfiguration(std::vector<Stream *> &streams)
|
||||||
* Exclusive access to the camera shall be ensured by a call to acquire() prior
|
* Exclusive access to the camera shall be ensured by a call to acquire() prior
|
||||||
* to calling this function, otherwise an -EACCES error will be returned.
|
* to calling this function, otherwise an -EACCES error will be returned.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error.
|
* \return 0 on success or a negative error code otherwise
|
||||||
* \retval -ENODEV The camera is not connected to any hardware
|
* \retval -ENODEV The camera is not connected to any hardware
|
||||||
* \retval -EACCES The user has not acquired exclusive access to the camera
|
* \retval -EACCES The user has not acquired exclusive access to the camera
|
||||||
* \retval -EINVAL The configuration is not valid
|
* \retval -EINVAL The configuration is not valid
|
||||||
|
@ -350,7 +350,7 @@ Request *Camera::createRequest()
|
||||||
* Ownership of the request is transferred to the camera. It will be deleted
|
* Ownership of the request is transferred to the camera. It will be deleted
|
||||||
* automatically after it completes.
|
* automatically after it completes.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Camera::queueRequest(Request *request)
|
int Camera::queueRequest(Request *request)
|
||||||
{
|
{
|
||||||
|
@ -376,7 +376,7 @@ int Camera::queueRequest(Request *request)
|
||||||
* can queue requests to the camera to process and return to the application
|
* can queue requests to the camera to process and return to the application
|
||||||
* until the capture session is terminated with \a stop().
|
* until the capture session is terminated with \a stop().
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Camera::start()
|
int Camera::start()
|
||||||
{
|
{
|
||||||
|
@ -395,7 +395,7 @@ int Camera::start()
|
||||||
* This method stops capturing and processing requests immediately. All pending
|
* This method stops capturing and processing requests immediately. All pending
|
||||||
* requests are cancelled and complete synchronously in an error state.
|
* requests are cancelled and complete synchronously in an error state.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int Camera::stop()
|
int Camera::stop()
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,7 +74,7 @@ CameraManager::~CameraManager()
|
||||||
* interact with cameras in the system until either the camera manager
|
* interact with cameras in the system until either the camera manager
|
||||||
* is stopped or the camera is unplugged from the system.
|
* is stopped or the camera is unplugged from the system.
|
||||||
*
|
*
|
||||||
* \return 0 on successful start, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int CameraManager::start()
|
int CameraManager::start()
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ DeviceEnumerator::~DeviceEnumerator()
|
||||||
/**
|
/**
|
||||||
* \fn DeviceEnumerator::init()
|
* \fn DeviceEnumerator::init()
|
||||||
* \brief Initialize the enumerator
|
* \brief Initialize the enumerator
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
* \retval -EBUSY the enumerator has already been initialized
|
* \retval -EBUSY the enumerator has already been initialized
|
||||||
* \retval -ENODEV the enumerator can't enumerate devices
|
* \retval -ENODEV the enumerator can't enumerate devices
|
||||||
*/
|
*/
|
||||||
|
@ -195,7 +195,7 @@ DeviceEnumerator::~DeviceEnumerator()
|
||||||
* with a warning message logged, without returning an error. Only errors that
|
* with a warning message logged, without returning an error. Only errors that
|
||||||
* prevent enumeration altogether shall be fatal.
|
* prevent enumeration altogether shall be fatal.
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code on fatal errors.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,8 +206,7 @@ DeviceEnumerator::~DeviceEnumerator()
|
||||||
* and look up device nodes associated with all entities. Store the media device
|
* and look up device nodes associated with all entities. Store the media device
|
||||||
* in the internal list for later matching with pipeline handlers.
|
* in the internal list for later matching with pipeline handlers.
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code if the media device can't be
|
* \return 0 on success or a negative error code otherwise
|
||||||
* created or populated
|
|
||||||
*/
|
*/
|
||||||
int DeviceEnumerator::addDevice(const std::string &deviceNode)
|
int DeviceEnumerator::addDevice(const std::string &deviceNode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,7 +206,7 @@ void MediaDevice::close()
|
||||||
* while pads are accessible from the entity they belong to and links from the
|
* while pads are accessible from the entity they belong to and links from the
|
||||||
* pads they connect.
|
* pads they connect.
|
||||||
*
|
*
|
||||||
* \return 0 on success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int MediaDevice::populate()
|
int MediaDevice::populate()
|
||||||
{
|
{
|
||||||
|
@ -405,7 +405,7 @@ MediaLink *MediaDevice::link(const MediaPad *source, const MediaPad *sink)
|
||||||
* Disable all the media device links, clearing the MEDIA_LNK_FL_ENABLED flag
|
* Disable all the media device links, clearing the MEDIA_LNK_FL_ENABLED flag
|
||||||
* on links which are not flagged as IMMUTABLE.
|
* on links which are not flagged as IMMUTABLE.
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int MediaDevice::disableLinks()
|
int MediaDevice::disableLinks()
|
||||||
{
|
{
|
||||||
|
@ -705,7 +705,7 @@ void MediaDevice::fixupEntityFlags(struct media_v2_entity *entity)
|
||||||
*
|
*
|
||||||
* \sa MediaLink::setEnabled(bool enable)
|
* \sa MediaLink::setEnabled(bool enable)
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)
|
int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -111,7 +111,7 @@ LOG_DECLARE_CATEGORY(MediaDevice)
|
||||||
* Enabling a link establishes a data connection between two pads, while
|
* Enabling a link establishes a data connection between two pads, while
|
||||||
* disabling it interrupts that connection.
|
* disabling it interrupts that connection.
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int MediaLink::setEnabled(bool enable)
|
int MediaLink::setEnabled(bool enable)
|
||||||
{
|
{
|
||||||
|
@ -337,8 +337,7 @@ const MediaPad *MediaEntity::getPadById(unsigned int id) const
|
||||||
/**
|
/**
|
||||||
* \brief Set the path to the device node for the associated interface
|
* \brief Set the path to the device node for the associated interface
|
||||||
* \param deviceNode The interface device node path associated with this entity
|
* \param deviceNode The interface device node path associated with this entity
|
||||||
* \return 0 on success, or a negative error code if the device node can't be
|
* \return 0 on success or a negative error code otherwise
|
||||||
* accessed
|
|
||||||
*/
|
*/
|
||||||
int MediaEntity::setDeviceNode(const std::string &deviceNode)
|
int MediaEntity::setDeviceNode(const std::string &deviceNode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,7 +144,7 @@ PipelineHandler::~PipelineHandler()
|
||||||
* configuration of a subset of the streams can't be satisfied, the
|
* configuration of a subset of the streams can't be satisfied, the
|
||||||
* whole configuration is considered invalid.
|
* whole configuration is considered invalid.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error.
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -158,7 +158,7 @@ PipelineHandler::~PipelineHandler()
|
||||||
*
|
*
|
||||||
* The intended caller of this method is the Camera class.
|
* The intended caller of this method is the Camera class.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,7 +172,7 @@ PipelineHandler::~PipelineHandler()
|
||||||
*
|
*
|
||||||
* The intended caller of this method is the Camera class.
|
* The intended caller of this method is the Camera class.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,7 +185,7 @@ PipelineHandler::~PipelineHandler()
|
||||||
* class which will in turn be called from the application to indicate that it
|
* class which will in turn be called from the application to indicate that it
|
||||||
* has configured the streams and is ready to capture.
|
* has configured the streams and is ready to capture.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -211,7 +211,7 @@ PipelineHandler::~PipelineHandler()
|
||||||
* parameters will be applied to the frames captured in the buffers provided in
|
* parameters will be applied to the frames captured in the buffers provided in
|
||||||
* the request.
|
* the request.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code on error
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -247,7 +247,7 @@ V4L2Device::~V4L2Device()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Open a V4L2 device and query its capabilities
|
* \brief Open a V4L2 device and query its capabilities
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Device::open()
|
int V4L2Device::open()
|
||||||
{
|
{
|
||||||
|
@ -365,7 +365,7 @@ std::string V4L2Device::logPrefix() const
|
||||||
* \brief Retrieve the image format set on the V4L2 device
|
* \brief Retrieve the image format set on the V4L2 device
|
||||||
* \param[out] format The image format applied on the device
|
* \param[out] format The image format applied on the device
|
||||||
*
|
*
|
||||||
* \return 0 for success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Device::getFormat(V4L2DeviceFormat *format)
|
int V4L2Device::getFormat(V4L2DeviceFormat *format)
|
||||||
{
|
{
|
||||||
|
@ -380,7 +380,7 @@ int V4L2Device::getFormat(V4L2DeviceFormat *format)
|
||||||
* Apply the supplied \a format to the device, and return the actually
|
* Apply the supplied \a format to the device, and return the actually
|
||||||
* applied format parameters, as \ref V4L2Device::getFormat would do.
|
* applied format parameters, as \ref V4L2Device::getFormat would do.
|
||||||
*
|
*
|
||||||
* \return 0 for success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Device::setFormat(V4L2DeviceFormat *format)
|
int V4L2Device::setFormat(V4L2DeviceFormat *format)
|
||||||
{
|
{
|
||||||
|
@ -697,7 +697,7 @@ int V4L2Device::releaseBuffers()
|
||||||
* \todo Support output devices (bytesused, ...)
|
* \todo Support output devices (bytesused, ...)
|
||||||
* \todo Support imported buffers (dmabuf fd)
|
* \todo Support imported buffers (dmabuf fd)
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error number otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Device::queueBuffer(Buffer *buffer)
|
int V4L2Device::queueBuffer(Buffer *buffer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,7 +95,7 @@ V4L2Subdevice::V4L2Subdevice(const MediaEntity *entity)
|
||||||
/**
|
/**
|
||||||
* \brief Open a V4L2 subdevice
|
* \brief Open a V4L2 subdevice
|
||||||
*
|
*
|
||||||
* \return 0 on success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Subdevice::open()
|
int V4L2Subdevice::open()
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ void V4L2Subdevice::close()
|
||||||
* \param[in] pad The 0-indexed pad number the rectangle is to be applied to
|
* \param[in] pad The 0-indexed pad number the rectangle is to be applied to
|
||||||
* \param[inout] rect The rectangle describing crop target area
|
* \param[inout] rect The rectangle describing crop target area
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)
|
int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)
|
||||||
{
|
{
|
||||||
|
@ -164,7 +164,7 @@ int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)
|
||||||
* \param[in] pad The 0-indexed pad number the rectangle is to be applied to
|
* \param[in] pad The 0-indexed pad number the rectangle is to be applied to
|
||||||
* \param[inout] rect The rectangle describing the compose target area
|
* \param[inout] rect The rectangle describing the compose target area
|
||||||
*
|
*
|
||||||
* \return 0 on success, or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)
|
int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,7 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)
|
||||||
* \param[in] pad The 0-indexed pad number the format is to be retrieved from
|
* \param[in] pad The 0-indexed pad number the format is to be retrieved from
|
||||||
* \param[out] format The image bus format
|
* \param[out] format The image bus format
|
||||||
*
|
*
|
||||||
* \return 0 for success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Subdevice::getFormat(unsigned int pad, V4L2SubdeviceFormat *format)
|
int V4L2Subdevice::getFormat(unsigned int pad, V4L2SubdeviceFormat *format)
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@ int V4L2Subdevice::getFormat(unsigned int pad, V4L2SubdeviceFormat *format)
|
||||||
* actually applied format parameters, as \ref V4L2Subdevice::getFormat would
|
* actually applied format parameters, as \ref V4L2Subdevice::getFormat would
|
||||||
* do.
|
* do.
|
||||||
*
|
*
|
||||||
* \return 0 for success, a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format)
|
int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue