libcamera: Rename 'method' to 'function'
Usage of 'method' to refer to member functions comes from Java. The C++ standard uses the term 'function' only. Replace 'method' with 'function' or 'member function' through the whole code base and documentation. While at it, fix two typos (s/backeng/backend/). The BoundMethod and Object::invokeMethod() are left as-is here, and will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
0536a9aa71
commit
a48a000a33
53 changed files with 314 additions and 309 deletions
|
@ -251,7 +251,7 @@ member function of the PipelineHandler class.
|
||||||
* \param[in] camera The camera to start
|
* \param[in] camera The camera to start
|
||||||
*
|
*
|
||||||
* Start the group of streams that have been configured for capture by
|
* Start the group of streams that have been configured for capture by
|
||||||
* \a configureStreams(). The intended caller of this method is the Camera
|
* \a configureStreams(). The intended caller of this function is the Camera
|
||||||
* class which will in turn be called from the application to indicate that
|
* class which will in turn be called from the application to indicate that
|
||||||
* it has configured the streams and is ready to capture.
|
* it has configured the streams and is ready to capture.
|
||||||
*
|
*
|
||||||
|
|
|
@ -310,7 +310,7 @@ Camera Device
|
||||||
thus the highest level object exposed by libcamera.
|
thus the highest level object exposed by libcamera.
|
||||||
|
|
||||||
Camera Device instances are created by the Camera Devices
|
Camera Device instances are created by the Camera Devices
|
||||||
Manager. An optional method to create new instances could be exposed
|
Manager. An optional function to create new instances could be exposed
|
||||||
through the public API to speed up initialization when the upper
|
through the public API to speed up initialization when the upper
|
||||||
layer knows how to directly address camera devices present in the
|
layer knows how to directly address camera devices present in the
|
||||||
system.
|
system.
|
||||||
|
|
|
@ -194,7 +194,7 @@ function. If the new values are not supported by the ``Camera`` device, the
|
||||||
validation process adjusts the parameters to what it considers to be the closest
|
validation process adjusts the parameters to what it considers to be the closest
|
||||||
supported values.
|
supported values.
|
||||||
|
|
||||||
The ``validate`` method returns a `Status`_ which applications shall check to
|
The ``validate`` function returns a `Status`_ which applications shall check to
|
||||||
see if the Pipeline Handler adjusted the configuration.
|
see if the Pipeline Handler adjusted the configuration.
|
||||||
|
|
||||||
.. _Status: http://libcamera.org/api-html/classlibcamera_1_1CameraConfiguration.html#a64163f21db2fe1ce0a6af5a6f6847744
|
.. _Status: http://libcamera.org/api-html/classlibcamera_1_1CameraConfiguration.html#a64163f21db2fe1ce0a6af5a6f6847744
|
||||||
|
@ -360,7 +360,7 @@ signal to handle it in the application code.
|
||||||
camera->requestCompleted.connect(requestComplete);
|
camera->requestCompleted.connect(requestComplete);
|
||||||
|
|
||||||
For this example application, only the ``Camera::requestCompleted`` signal gets
|
For this example application, only the ``Camera::requestCompleted`` signal gets
|
||||||
handled and the matching ``requestComplete`` slot method outputs information
|
handled and the matching ``requestComplete`` slot function outputs information
|
||||||
about the FrameBuffer to standard output. This callback is typically where an
|
about the FrameBuffer to standard output. This callback is typically where an
|
||||||
application accesses the image data from the camera and does something with it.
|
application accesses the image data from the camera and does something with it.
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ function of the IPAInterface.
|
||||||
stop() informs the IPA module that the camera is stopped. The IPA module shall
|
stop() informs the IPA module that the camera is stopped. The IPA module shall
|
||||||
release resources prepared in start().
|
release resources prepared in start().
|
||||||
|
|
||||||
A configure() method is recommended. Any ControlInfoMap instances that will be
|
A configure() function is recommended. Any ControlInfoMap instances that will be
|
||||||
used by the IPA must be sent to the IPA from the pipeline handler, at configure
|
used by the IPA must be sent to the IPA from the pipeline handler, at configure
|
||||||
time, for example.
|
time, for example.
|
||||||
|
|
||||||
|
@ -184,11 +184,11 @@ parameter, in which case it will become a regular return value.
|
||||||
const is not allowed inside of arrays and maps. mojo arrays will become C++
|
const is not allowed inside of arrays and maps. mojo arrays will become C++
|
||||||
std::vector<>.
|
std::vector<>.
|
||||||
|
|
||||||
By default, all methods defined in the main interface are synchronous. This
|
By default, all functions defined in the main interface are synchronous. This
|
||||||
means that in the case of IPC (i.e. isolated IPA), the function call will not
|
means that in the case of IPC (i.e. isolated IPA), the function call will not
|
||||||
return until the return value or output parameters are ready. To specify an
|
return until the return value or output parameters are ready. To specify an
|
||||||
asynchronous function, the [async] attribute can be used. Asynchronous
|
asynchronous function, the [async] attribute can be used. Asynchronous
|
||||||
methods must not have any return value or output parameters, since in the
|
functions must not have any return value or output parameters, since in the
|
||||||
case of IPC the call needs to return immediately.
|
case of IPC the call needs to return immediately.
|
||||||
|
|
||||||
It is also possible that the IPA will not be run in isolation. In this case,
|
It is also possible that the IPA will not be run in isolation. In this case,
|
||||||
|
@ -245,11 +245,11 @@ the camera pipeline from the IPA.
|
||||||
|
|
||||||
The event interface must be named as IPA{pipeline_name}EventInterface.
|
The event interface must be named as IPA{pipeline_name}EventInterface.
|
||||||
|
|
||||||
Methods defined in the event interface are implicitly asynchronous.
|
Functions defined in the event interface are implicitly asynchronous.
|
||||||
Thus they cannot return any value. Specifying the [async] tag is not
|
Thus they cannot return any value. Specifying the [async] tag is not
|
||||||
necessary.
|
necessary.
|
||||||
|
|
||||||
Methods defined in the event interface will become signals in the IPA
|
Functions defined in the event interface will become signals in the IPA
|
||||||
interface. The IPA can emit signals, while the pipeline handler can connect
|
interface. The IPA can emit signals, while the pipeline handler can connect
|
||||||
slots to them.
|
slots to them.
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ to the libcamera build options in the top level ``meson_options.txt``.
|
||||||
|
|
||||||
In *vivid.cpp* add the pipeline handler to the ``libcamera`` namespace, defining
|
In *vivid.cpp* add the pipeline handler to the ``libcamera`` namespace, defining
|
||||||
a `PipelineHandler`_ derived class named PipelineHandlerVivid, and add stub
|
a `PipelineHandler`_ derived class named PipelineHandlerVivid, and add stub
|
||||||
methods for the overridden class members.
|
implementations for the overridden class members.
|
||||||
|
|
||||||
.. _PipelineHandler: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html
|
.. _PipelineHandler: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html
|
||||||
|
|
||||||
|
@ -322,16 +322,16 @@ have been registered in the system and allows the pipeline handler to be
|
||||||
initialized.
|
initialized.
|
||||||
|
|
||||||
The main entry point of a pipeline handler is the `match()`_ class member
|
The main entry point of a pipeline handler is the `match()`_ class member
|
||||||
function. When the ``CameraManager`` is started (using the `start()`_ method),
|
function. When the ``CameraManager`` is started (using the `start()`_ function),
|
||||||
all the registered pipeline handlers are iterated and their ``match`` function
|
all the registered pipeline handlers are iterated and their ``match`` function
|
||||||
called with an enumerator of all devices it found on a system.
|
called with an enumerator of all devices it found on a system.
|
||||||
|
|
||||||
The match method should identify if there are suitable devices available in the
|
The match function should identify if there are suitable devices available in
|
||||||
``DeviceEnumerator`` which the pipeline supports, returning ``true`` if it
|
the ``DeviceEnumerator`` which the pipeline supports, returning ``true`` if it
|
||||||
matches a device, and ``false`` if it does not. To do this, construct a
|
matches a device, and ``false`` if it does not. To do this, construct a
|
||||||
`DeviceMatch`_ class with the name of the ``MediaController`` device to match.
|
`DeviceMatch`_ class with the name of the ``MediaController`` device to match.
|
||||||
You can specify the search further by adding specific media entities to the
|
You can specify the search further by adding specific media entities to the
|
||||||
search using the ``.add()`` method on the DeviceMatch.
|
search using the ``.add()`` function on the DeviceMatch.
|
||||||
|
|
||||||
.. _match(): https://www.libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a7cd5b652a2414b543ec20ba9dabf61b6
|
.. _match(): https://www.libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a7cd5b652a2414b543ec20ba9dabf61b6
|
||||||
.. _start(): http://libcamera.org/api-html/classlibcamera_1_1CameraManager.html#a49e322880a2a26013bb0076788b298c5
|
.. _start(): http://libcamera.org/api-html/classlibcamera_1_1CameraManager.html#a49e322880a2a26013bb0076788b298c5
|
||||||
|
@ -340,7 +340,7 @@ search using the ``.add()`` method on the DeviceMatch.
|
||||||
This example uses search patterns that match vivid, but when developing a new
|
This example uses search patterns that match vivid, but when developing a new
|
||||||
pipeline handler, you should change this value to suit your device identifier.
|
pipeline handler, you should change this value to suit your device identifier.
|
||||||
|
|
||||||
Replace the contents of the ``PipelineHandlerVivid::match`` method with the
|
Replace the contents of the ``PipelineHandlerVivid::match`` function with the
|
||||||
following:
|
following:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
@ -350,8 +350,8 @@ following:
|
||||||
return false; // Prevent infinite loops for now
|
return false; // Prevent infinite loops for now
|
||||||
|
|
||||||
With the device matching criteria defined, attempt to acquire exclusive access
|
With the device matching criteria defined, attempt to acquire exclusive access
|
||||||
to the matching media controller device with the `acquireMediaDevice`_ method.
|
to the matching media controller device with the `acquireMediaDevice`_ function.
|
||||||
If the method attempts to acquire a device it has already matched, it returns
|
If the function attempts to acquire a device it has already matched, it returns
|
||||||
``false``.
|
``false``.
|
||||||
|
|
||||||
.. _acquireMediaDevice: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a77e424fe704e7b26094164b9189e0f84
|
.. _acquireMediaDevice: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a77e424fe704e7b26094164b9189e0f84
|
||||||
|
@ -382,7 +382,7 @@ As a temporary validation step, add a debug print with
|
||||||
LOG(VIVID, Debug) << "Vivid Device Identified";
|
LOG(VIVID, Debug) << "Vivid Device Identified";
|
||||||
|
|
||||||
before the final closing return statement in the ``PipelineHandlerVivid::match``
|
before the final closing return statement in the ``PipelineHandlerVivid::match``
|
||||||
method for when when the pipeline handler successfully matches the
|
function for when when the pipeline handler successfully matches the
|
||||||
``MediaDevice`` and ``MediaEntity`` names.
|
``MediaDevice`` and ``MediaEntity`` names.
|
||||||
|
|
||||||
Test that the pipeline handler matches and finds a device by rebuilding, and
|
Test that the pipeline handler matches and finds a device by rebuilding, and
|
||||||
|
@ -469,11 +469,11 @@ respective pipeline handlers.
|
||||||
The CameraData class stores the context required for each camera instance and
|
The CameraData class stores the context required for each camera instance and
|
||||||
is usually responsible for opening all Devices used in the capture pipeline.
|
is usually responsible for opening all Devices used in the capture pipeline.
|
||||||
|
|
||||||
We can now implement the ``init`` method for our example Pipeline Handler to
|
We can now implement the ``init`` function for our example Pipeline Handler to
|
||||||
create a new V4L2 video device from the media entity, which we can specify using
|
create a new V4L2 video device from the media entity, which we can specify using
|
||||||
the `MediaDevice::getEntityByName`_ method from the MediaDevice. As our example
|
the `MediaDevice::getEntityByName`_ function from the MediaDevice. As our
|
||||||
is based upon the simplistic Vivid test device, we only need to open a single
|
example is based upon the simplistic Vivid test device, we only need to open a
|
||||||
capture device named 'vivid-000-vid-cap' by the device.
|
single capture device named 'vivid-000-vid-cap' by the device.
|
||||||
|
|
||||||
.. _MediaDevice::getEntityByName: http://libcamera.org/api-html/classlibcamera_1_1MediaDevice.html#ad5d9279329ef4987ceece2694b33e230
|
.. _MediaDevice::getEntityByName: http://libcamera.org/api-html/classlibcamera_1_1MediaDevice.html#ad5d9279329ef4987ceece2694b33e230
|
||||||
|
|
||||||
|
@ -495,7 +495,8 @@ PipelineHandlerVivid::match(). The VividCameraData is wrapped by a
|
||||||
std::unique_ptr to help manage the lifetime of our CameraData instance.
|
std::unique_ptr to help manage the lifetime of our CameraData instance.
|
||||||
|
|
||||||
If the camera data initialization fails, return ``false`` to indicate the
|
If the camera data initialization fails, return ``false`` to indicate the
|
||||||
failure to the ``match()`` method and prevent retrying of the pipeline handler.
|
failure to the ``match()`` function and prevent retrying of the pipeline
|
||||||
|
handler.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
@ -508,7 +509,7 @@ failure to the ``match()`` method and prevent retrying of the pipeline handler.
|
||||||
Once the camera data has been initialized, the Camera device instances and the
|
Once the camera data has been initialized, the Camera device instances and the
|
||||||
associated streams have to be registered. Create a set of streams for the
|
associated streams have to be registered. Create a set of streams for the
|
||||||
camera, which for this device is only one. You create a camera using the static
|
camera, which for this device is only one. You create a camera using the static
|
||||||
`Camera::create`_ method, passing the pipeline handler, the id of the camera,
|
`Camera::create`_ function, passing the pipeline handler, the id of the camera,
|
||||||
and the streams available. Then register the camera and its data with the
|
and the streams available. Then register the camera and its data with the
|
||||||
pipeline handler and camera manager using `registerCamera`_.
|
pipeline handler and camera manager using `registerCamera`_.
|
||||||
|
|
||||||
|
@ -614,7 +615,7 @@ associated values for each supported V4L2 control but demonstrates the mapping
|
||||||
of V4L2 Controls to libcamera ControlIDs.
|
of V4L2 Controls to libcamera ControlIDs.
|
||||||
|
|
||||||
Complete the initialization of the ``VividCameraData`` class by adding the
|
Complete the initialization of the ``VividCameraData`` class by adding the
|
||||||
following code to the ``VividCameraData::init()`` method to initialise the
|
following code to the ``VividCameraData::init()`` function to initialise the
|
||||||
controls. For more complex control configurations, this could of course be
|
controls. For more complex control configurations, this could of course be
|
||||||
broken out to a separate function, but for now we just initialise the small set
|
broken out to a separate function, but for now we just initialise the small set
|
||||||
inline in our CameraData init:
|
inline in our CameraData init:
|
||||||
|
@ -722,7 +723,7 @@ adjustment happens.
|
||||||
Applications generate a ``CameraConfiguration`` instance by calling the
|
Applications generate a ``CameraConfiguration`` instance by calling the
|
||||||
`Camera::generateConfiguration()`_ function, which calls into the pipeline
|
`Camera::generateConfiguration()`_ function, which calls into the pipeline
|
||||||
implementation of the overridden `PipelineHandler::generateConfiguration()`_
|
implementation of the overridden `PipelineHandler::generateConfiguration()`_
|
||||||
method.
|
function.
|
||||||
|
|
||||||
.. _Camera::generateConfiguration(): http://libcamera.org/api-html/classlibcamera_1_1Camera.html#a25c80eb7fc9b1cf32692ce0c7f09991d
|
.. _Camera::generateConfiguration(): http://libcamera.org/api-html/classlibcamera_1_1Camera.html#a25c80eb7fc9b1cf32692ce0c7f09991d
|
||||||
.. _PipelineHandler::generateConfiguration(): http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a7932e87735695500ce1f8c7ae449b65b
|
.. _PipelineHandler::generateConfiguration(): http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a7932e87735695500ce1f8c7ae449b65b
|
||||||
|
@ -839,7 +840,7 @@ Add the following code to complete the implementation of
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
To validate a camera configuration, a pipeline handler must implement the
|
To validate a camera configuration, a pipeline handler must implement the
|
||||||
`CameraConfiguration::validate()`_ method in it's derived class to inspect all
|
`CameraConfiguration::validate()`_ function in it's derived class to inspect all
|
||||||
the stream configuration associated to it, make any adjustments required to make
|
the stream configuration associated to it, make any adjustments required to make
|
||||||
the configuration valid, and return the validation status.
|
the configuration valid, and return the validation status.
|
||||||
|
|
||||||
|
@ -939,10 +940,10 @@ Configuring a device
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
With the configuration generated, and optionally modified and re-validated, a
|
With the configuration generated, and optionally modified and re-validated, a
|
||||||
pipeline handler needs a method that allows an application to apply a
|
pipeline handler needs a function that allows an application to apply a
|
||||||
configuration to the hardware devices.
|
configuration to the hardware devices.
|
||||||
|
|
||||||
The `PipelineHandler::configure()`_ method receives a valid
|
The `PipelineHandler::configure()`_ function receives a valid
|
||||||
`CameraConfiguration`_ and applies the settings to hardware devices, using its
|
`CameraConfiguration`_ and applies the settings to hardware devices, using its
|
||||||
parameters to prepare a device for a streaming session with the desired
|
parameters to prepare a device for a streaming session with the desired
|
||||||
properties.
|
properties.
|
||||||
|
@ -950,7 +951,7 @@ properties.
|
||||||
.. _PipelineHandler::configure(): http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a930f2a9cdfb51dfb4b9ca3824e84fc29
|
.. _PipelineHandler::configure(): http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a930f2a9cdfb51dfb4b9ca3824e84fc29
|
||||||
.. _CameraConfiguration: http://libcamera.org/api-html/classlibcamera_1_1CameraConfiguration.html
|
.. _CameraConfiguration: http://libcamera.org/api-html/classlibcamera_1_1CameraConfiguration.html
|
||||||
|
|
||||||
Replace the contents of the stubbed ``PipelineHandlerVivid::configure`` method
|
Replace the contents of the stubbed ``PipelineHandlerVivid::configure`` function
|
||||||
with the following to obtain the camera data and stream configuration. This
|
with the following to obtain the camera data and stream configuration. This
|
||||||
pipeline handler supports only a single stream, so it directly obtains the first
|
pipeline handler supports only a single stream, so it directly obtains the first
|
||||||
``StreamConfiguration`` from the camera configuration. A pipeline handler with
|
``StreamConfiguration`` from the camera configuration. A pipeline handler with
|
||||||
|
@ -983,7 +984,7 @@ Add the following code beneath the code from above:
|
||||||
format.size = cfg.size;
|
format.size = cfg.size;
|
||||||
|
|
||||||
Set the video device format defined above using the
|
Set the video device format defined above using the
|
||||||
`V4L2VideoDevice::setFormat()`_ method. You should check if the kernel
|
`V4L2VideoDevice::setFormat()`_ function. You should check if the kernel
|
||||||
driver has adjusted the format, as this shows the pipeline handler has failed to
|
driver has adjusted the format, as this shows the pipeline handler has failed to
|
||||||
handle the validation stages correctly, and the configure operation shall also
|
handle the validation stages correctly, and the configure operation shall also
|
||||||
fail.
|
fail.
|
||||||
|
@ -1004,7 +1005,7 @@ Continue the implementation with the following code:
|
||||||
|
|
||||||
Finally, store and set stream-specific data reflecting the state of the stream.
|
Finally, store and set stream-specific data reflecting the state of the stream.
|
||||||
Associate the configuration with the stream by using the
|
Associate the configuration with the stream by using the
|
||||||
`StreamConfiguration::setStream`_ method, and set the values of individual
|
`StreamConfiguration::setStream`_ function, and set the values of individual
|
||||||
stream configuration members as required.
|
stream configuration members as required.
|
||||||
|
|
||||||
.. _StreamConfiguration::setStream: http://libcamera.org/api-html/structlibcamera_1_1StreamConfiguration.html#a74a0eb44dad1b00112c7c0443ae54a12
|
.. _StreamConfiguration::setStream: http://libcamera.org/api-html/structlibcamera_1_1StreamConfiguration.html#a74a0eb44dad1b00112c7c0443ae54a12
|
||||||
|
@ -1053,12 +1054,12 @@ come directly from the kernel sources:
|
||||||
#define VIVID_CID_HOR_MOVEMENT (VIVID_CID_VIVID_BASE + 2)
|
#define VIVID_CID_HOR_MOVEMENT (VIVID_CID_VIVID_BASE + 2)
|
||||||
|
|
||||||
We can now use the V4L2 control IDs to prepare a list of controls with the
|
We can now use the V4L2 control IDs to prepare a list of controls with the
|
||||||
`ControlList`_ class, and set them using the `ControlList::set()`_ method.
|
`ControlList`_ class, and set them using the `ControlList::set()`_ function.
|
||||||
|
|
||||||
.. _ControlList: http://libcamera.org/api-html/classlibcamera_1_1ControlList.html
|
.. _ControlList: http://libcamera.org/api-html/classlibcamera_1_1ControlList.html
|
||||||
.. _ControlList::set(): http://libcamera.org/api-html/classlibcamera_1_1ControlList.html#a74a1a29abff5243e6e37ace8e24eb4ba
|
.. _ControlList::set(): http://libcamera.org/api-html/classlibcamera_1_1ControlList.html#a74a1a29abff5243e6e37ace8e24eb4ba
|
||||||
|
|
||||||
In our pipeline ``configure`` method, add the following code after the format
|
In our pipeline ``configure`` function, add the following code after the format
|
||||||
has been set and checked to initialise the ControlList and apply it to the
|
has been set and checked to initialise the ControlList and apply it to the
|
||||||
device:
|
device:
|
||||||
|
|
||||||
|
@ -1082,7 +1083,7 @@ device:
|
||||||
|
|
||||||
These controls configure VIVID to use a default test pattern, and enable all
|
These controls configure VIVID to use a default test pattern, and enable all
|
||||||
on-screen display text, while configuring sensible brightness, contrast and
|
on-screen display text, while configuring sensible brightness, contrast and
|
||||||
saturation values. Use the ``controls.set`` method to set individual controls.
|
saturation values. Use the ``controls.set`` function to set individual controls.
|
||||||
|
|
||||||
Buffer handling and stream control
|
Buffer handling and stream control
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -1097,8 +1098,8 @@ frames as soon as they are requested. Memory should be initialized and made
|
||||||
available to the devices which have to be started and ready to produce
|
available to the devices which have to be started and ready to produce
|
||||||
images. At the end of a capture session the ``Camera`` device needs to be
|
images. At the end of a capture session the ``Camera`` device needs to be
|
||||||
stopped, to gracefully clean up any allocated memory and stop the hardware
|
stopped, to gracefully clean up any allocated memory and stop the hardware
|
||||||
devices. Pipeline handlers implement two methods for these purposes, the
|
devices. Pipeline handlers implement two functions for these purposes, the
|
||||||
``start()`` and ``stop()`` methods.
|
``start()`` and ``stop()`` functions.
|
||||||
|
|
||||||
The memory initialization phase that happens at ``start()`` time serves to
|
The memory initialization phase that happens at ``start()`` time serves to
|
||||||
configure video devices to be able to use memory buffers exported as dma-buf
|
configure video devices to be able to use memory buffers exported as dma-buf
|
||||||
|
@ -1167,7 +1168,7 @@ the video device associated with a stream and export it.
|
||||||
|
|
||||||
.. _exportFrameBuffers: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a6312a69da7129c2ed41f9d9f790adf7c
|
.. _exportFrameBuffers: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a6312a69da7129c2ed41f9d9f790adf7c
|
||||||
|
|
||||||
Implement the ``exportFrameBuffers`` stub method with the following code to
|
Implement the ``exportFrameBuffers`` stub function with the following code to
|
||||||
handle this:
|
handle this:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
@ -1178,7 +1179,7 @@ handle this:
|
||||||
return data->video_->exportBuffers(count, buffers);
|
return data->video_->exportBuffers(count, buffers);
|
||||||
|
|
||||||
Once memory has been properly setup, the video devices can be started, to
|
Once memory has been properly setup, the video devices can be started, to
|
||||||
prepare for capture operations. Complete the ``start`` method implementation
|
prepare for capture operations. Complete the ``start`` function implementation
|
||||||
with the following code:
|
with the following code:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
@ -1191,18 +1192,18 @@ with the following code:
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
The method starts the video device associated with the stream with the
|
The function starts the video device associated with the stream with the
|
||||||
`streamOn`_ method. If the call fails, the error value is propagated to the
|
`streamOn`_ function. If the call fails, the error value is propagated to the
|
||||||
caller and the `releaseBuffers`_ method releases any buffers to leave the device
|
caller and the `releaseBuffers`_ function releases any buffers to leave the
|
||||||
in a consistent state. If your pipeline handler uses any image processing
|
device in a consistent state. If your pipeline handler uses any image processing
|
||||||
algorithms, or other devices you should also stop them.
|
algorithms, or other devices you should also stop them.
|
||||||
|
|
||||||
.. _streamOn: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a588a5dc9d6f4c54c61136ac43ff9a8cc
|
.. _streamOn: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a588a5dc9d6f4c54c61136ac43ff9a8cc
|
||||||
.. _releaseBuffers: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a191619c152f764e03bc461611f3fcd35
|
.. _releaseBuffers: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a191619c152f764e03bc461611f3fcd35
|
||||||
|
|
||||||
Of course we also need to handle the corresponding actions to stop streaming on
|
Of course we also need to handle the corresponding actions to stop streaming on
|
||||||
a device, Add the following to the ``stop`` method, to stop the stream with the
|
a device, Add the following to the ``stop`` function, to stop the stream with
|
||||||
`streamOff`_ method and release all buffers.
|
the `streamOff`_ function and release all buffers.
|
||||||
|
|
||||||
.. _streamOff: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a61998710615bdf7aa25a046c8565ed66
|
.. _streamOff: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a61998710615bdf7aa25a046c8565ed66
|
||||||
|
|
||||||
|
@ -1225,7 +1226,7 @@ the enabled streams.
|
||||||
|
|
||||||
This example pipeline handler identifies the buffer using the `findBuffer`_
|
This example pipeline handler identifies the buffer using the `findBuffer`_
|
||||||
helper from the only supported stream and queues it to the capture device
|
helper from the only supported stream and queues it to the capture device
|
||||||
directly with the `queueBuffer`_ method provided by the V4L2VideoDevice.
|
directly with the `queueBuffer`_ function provided by the V4L2VideoDevice.
|
||||||
|
|
||||||
.. _findBuffer: http://libcamera.org/api-html/classlibcamera_1_1Request.html#ac66050aeb9b92c64218945158559c4d4
|
.. _findBuffer: http://libcamera.org/api-html/classlibcamera_1_1Request.html#ac66050aeb9b92c64218945158559c4d4
|
||||||
.. _queueBuffer: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a594cd594686a8c1cf9ae8dba0b2a8a75
|
.. _queueBuffer: http://libcamera.org/api-html/classlibcamera_1_1V4L2VideoDevice.html#a594cd594686a8c1cf9ae8dba0b2a8a75
|
||||||
|
@ -1260,10 +1261,11 @@ Applications can set controls registered by the pipeline handler in the
|
||||||
initialization phase, as explained in the `Registering controls and properties`_
|
initialization phase, as explained in the `Registering controls and properties`_
|
||||||
section.
|
section.
|
||||||
|
|
||||||
Implement a ``processControls`` method above the ``queueRequestDevice`` method
|
Implement a ``processControls`` function above the ``queueRequestDevice``
|
||||||
to loop through the control list received with each request, and inspect the
|
function to loop through the control list received with each request, and
|
||||||
control values. Controls may need to be converted between the libcamera control
|
inspect the control values. Controls may need to be converted between the
|
||||||
range definitions and their corresponding values on the device before being set.
|
libcamera control range definitions and their corresponding values on the device
|
||||||
|
before being set.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
@ -1307,7 +1309,7 @@ range definitions and their corresponding values on the device before being set.
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Declare the function prototype for the ``processControls`` method within the
|
Declare the function prototype for the ``processControls`` function within the
|
||||||
private ``PipelineHandlerVivid`` class members, as it is only used internally as
|
private ``PipelineHandlerVivid`` class members, as it is only used internally as
|
||||||
a helper when processing Requests.
|
a helper when processing Requests.
|
||||||
|
|
||||||
|
@ -1323,12 +1325,12 @@ handler is responsible for understanding the correct procedure for applying
|
||||||
controls to the device they support.
|
controls to the device they support.
|
||||||
|
|
||||||
This example pipeline handler applies controls during the `queueRequestDevice`_
|
This example pipeline handler applies controls during the `queueRequestDevice`_
|
||||||
method for each request, and applies them to the capture device through the
|
function for each request, and applies them to the capture device through the
|
||||||
capture node.
|
capture node.
|
||||||
|
|
||||||
.. _queueRequestDevice: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a106914cca210640c9da9ee1f0419e83c
|
.. _queueRequestDevice: http://libcamera.org/api-html/classlibcamera_1_1PipelineHandler.html#a106914cca210640c9da9ee1f0419e83c
|
||||||
|
|
||||||
In the ``queueRequestDevice`` method, replace the following:
|
In the ``queueRequestDevice`` function, replace the following:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
@ -1396,19 +1398,19 @@ delivered to applications in the same order as they have been submitted.
|
||||||
|
|
||||||
.. _connecting: http://libcamera.org/api-html/classlibcamera_1_1Signal.html#aa04db72d5b3091ffbb4920565aeed382
|
.. _connecting: http://libcamera.org/api-html/classlibcamera_1_1Signal.html#aa04db72d5b3091ffbb4920565aeed382
|
||||||
|
|
||||||
Returning to the ``int VividCameraData::init()`` method, add the following above
|
Returning to the ``int VividCameraData::init()`` function, add the following
|
||||||
the closing ``return 0;`` to connect the pipeline handler ``bufferReady``
|
above the closing ``return 0;`` to connect the pipeline handler ``bufferReady``
|
||||||
method to the V4L2 device buffer signal.
|
function to the V4L2 device buffer signal.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
video_->bufferReady.connect(this, &VividCameraData::bufferReady);
|
video_->bufferReady.connect(this, &VividCameraData::bufferReady);
|
||||||
|
|
||||||
Create the matching ``VividCameraData::bufferReady`` method after your
|
Create the matching ``VividCameraData::bufferReady`` function after your
|
||||||
VividCameradata::init() impelementation.
|
VividCameradata::init() impelementation.
|
||||||
|
|
||||||
The ``bufferReady`` method obtains the request from the buffer using the
|
The ``bufferReady`` function obtains the request from the buffer using the
|
||||||
``request`` method, and notifies the ``Camera`` that the buffer and
|
``request`` function, and notifies the ``Camera`` that the buffer and
|
||||||
request are completed. In this simpler pipeline handler, there is only one
|
request are completed. In this simpler pipeline handler, there is only one
|
||||||
stream, so it completes the request immediately. You can find a more complex
|
stream, so it completes the request immediately. You can find a more complex
|
||||||
example of event handling with supporting multiple streams in the libcamera
|
example of event handling with supporting multiple streams in the libcamera
|
||||||
|
|
|
@ -291,7 +291,7 @@ struct IPASettings {
|
||||||
* \brief Stream configuration for the IPA interface
|
* \brief Stream configuration for the IPA interface
|
||||||
*
|
*
|
||||||
* The IPAStream structure stores stream configuration parameters needed by the
|
* The IPAStream structure stores stream configuration parameters needed by the
|
||||||
* IPAInterface::configure() method. It mirrors the StreamConfiguration class
|
* IPAInterface::configure() function. It mirrors the StreamConfiguration class
|
||||||
* that is not suitable for this purpose due to not being serializable.
|
* that is not suitable for this purpose due to not being serializable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ interface IPARPiInterface {
|
||||||
* \param[in] ipaConfig Pipeline-handler-specific configuration data
|
* \param[in] ipaConfig Pipeline-handler-specific configuration data
|
||||||
* \param[out] controls Controls to apply by the pipeline entity
|
* \param[out] controls Controls to apply by the pipeline entity
|
||||||
*
|
*
|
||||||
* This method shall be called when the camera is configured to inform
|
* This function shall be called when the camera is configured to inform
|
||||||
* the IPA of the camera's streams and the sensor settings.
|
* the IPA of the camera's streams and the sensor settings.
|
||||||
*
|
*
|
||||||
* The \a sensorInfo conveys information about the camera sensor settings that
|
* The \a sensorInfo conveys information about the camera sensor settings that
|
||||||
|
@ -78,20 +78,21 @@ interface IPARPiInterface {
|
||||||
* \brief Map buffers shared between the pipeline handler and the IPA
|
* \brief Map buffers shared between the pipeline handler and the IPA
|
||||||
* \param[in] buffers List of buffers to map
|
* \param[in] buffers List of buffers to map
|
||||||
*
|
*
|
||||||
* This method informs the IPA module of memory buffers set up by the pipeline
|
* This function informs the IPA module of memory buffers set up by the
|
||||||
* handler that the IPA needs to access. It provides dmabuf file handles for
|
* pipeline handler that the IPA needs to access. It provides dmabuf
|
||||||
* each buffer, and associates the buffers with unique numerical IDs.
|
* file handles for each buffer, and associates the buffers with unique
|
||||||
|
* numerical IDs.
|
||||||
*
|
*
|
||||||
* IPAs shall map the dmabuf file handles to their address space and keep a
|
* IPAs shall map the dmabuf file handles to their address space and
|
||||||
* cache of the mappings, indexed by the buffer numerical IDs. The IDs are used
|
* keep a cache of the mappings, indexed by the buffer numerical IDs.
|
||||||
* in all other IPA interface methods to refer to buffers, including the
|
* The IDs are used in all other IPA interface functions to refer to
|
||||||
* unmapBuffers() method.
|
* buffers, including the unmapBuffers() function.
|
||||||
*
|
*
|
||||||
* All buffers that the pipeline handler wishes to share with an IPA shall be
|
* All buffers that the pipeline handler wishes to share with an IPA
|
||||||
* mapped with this method. Buffers may be mapped all at once with a single
|
* shall be mapped with this function. Buffers may be mapped all at once
|
||||||
* call, or mapped and unmapped dynamically at runtime, depending on the IPA
|
* with a single call, or mapped and unmapped dynamically at runtime,
|
||||||
* protocol. Regardless of the protocol, all buffers mapped at a given time
|
* depending on the IPA protocol. Regardless of the protocol, all
|
||||||
* shall have unique numerical IDs.
|
* buffers mapped at a given time shall have unique numerical IDs.
|
||||||
*
|
*
|
||||||
* The numerical IDs have no meaning defined by the IPA interface, and
|
* The numerical IDs have no meaning defined by the IPA interface, and
|
||||||
* should be treated as opaque handles by IPAs, with the only exception
|
* should be treated as opaque handles by IPAs, with the only exception
|
||||||
|
@ -106,8 +107,8 @@ interface IPARPiInterface {
|
||||||
* \brief Unmap buffers shared by the pipeline to the IPA
|
* \brief Unmap buffers shared by the pipeline to the IPA
|
||||||
* \param[in] ids List of buffer IDs to unmap
|
* \param[in] ids List of buffer IDs to unmap
|
||||||
*
|
*
|
||||||
* This method removes mappings set up with mapBuffers(). Numerical IDs
|
* This function removes mappings set up with mapBuffers(). Numerical
|
||||||
* of unmapped buffers may be reused when mapping new buffers.
|
* IDs of unmapped buffers may be reused when mapping new buffers.
|
||||||
*
|
*
|
||||||
* \sa mapBuffers()
|
* \sa mapBuffers()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -305,7 +305,7 @@ std::unique_ptr<CameraDevice> CameraDevice::create(unsigned int id,
|
||||||
* cameraConfigData is optional for external camera devices and can be
|
* cameraConfigData is optional for external camera devices and can be
|
||||||
* nullptr.
|
* nullptr.
|
||||||
*
|
*
|
||||||
* This method is called before the camera device is opened.
|
* This function is called before the camera device is opened.
|
||||||
*/
|
*/
|
||||||
int CameraDevice::initialize(const CameraConfigData *cameraConfigData)
|
int CameraDevice::initialize(const CameraConfigData *cameraConfigData)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ enum class _ExifTag {
|
||||||
*
|
*
|
||||||
* Calls to generate() must check the return code to determine if any error
|
* Calls to generate() must check the return code to determine if any error
|
||||||
* occurred during the construction of the Exif data, and if successful the
|
* occurred during the construction of the Exif data, and if successful the
|
||||||
* data can be obtained using the data() method.
|
* data can be obtained using the data() function.
|
||||||
*/
|
*/
|
||||||
Exif::Exif()
|
Exif::Exif()
|
||||||
: valid_(false), data_(nullptr), order_(EXIF_BYTE_ORDER_INTEL),
|
: valid_(false), data_(nullptr), order_(EXIF_BYTE_ORDER_INTEL),
|
||||||
|
|
|
@ -105,7 +105,7 @@ int IPAIPU3::start()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method calculates a grid for the AWB algorithm in the IPU3 firmware.
|
* This function calculates a grid for the AWB algorithm in the IPU3 firmware.
|
||||||
* Its input is the BDS output size calculated in the ImgU.
|
* Its input is the BDS output size calculated in the ImgU.
|
||||||
* It is limited for now to the simplest method: find the lesser error
|
* It is limited for now to the simplest method: find the lesser error
|
||||||
* with the width/height and respective log2 width/height of the cells.
|
* with the width/height and respective log2 width/height of the cells.
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace ipa {
|
||||||
* \brief Construct a CameraSensorHelper instance
|
* \brief Construct a CameraSensorHelper instance
|
||||||
*
|
*
|
||||||
* CameraSensorHelper derived class instances shall never be constructed
|
* CameraSensorHelper derived class instances shall never be constructed
|
||||||
* manually but always through the CameraSensorHelperFactory::create() method.
|
* manually but always through the CameraSensorHelperFactory::create() function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -117,7 +117,7 @@ void CamHelper::GetDelays(int &exposure_delay, int &gain_delay,
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* These values are correct for many sensors. Other sensors will
|
* These values are correct for many sensors. Other sensors will
|
||||||
* need to over-ride this method.
|
* need to over-ride this function.
|
||||||
*/
|
*/
|
||||||
exposure_delay = 2;
|
exposure_delay = 2;
|
||||||
gain_delay = 1;
|
gain_delay = 1;
|
||||||
|
@ -133,7 +133,7 @@ double CamHelper::GetModeSensitivity([[maybe_unused]] const CameraMode &mode) co
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Most sensors have the same sensitivity in every mode, but this
|
* Most sensors have the same sensitivity in every mode, but this
|
||||||
* method can be overridden for those that do not. Note that it is
|
* function can be overridden for those that do not. Note that it is
|
||||||
* called before mode_ is set, so it must return the sensitivity
|
* called before mode_ is set, so it must return the sensitivity
|
||||||
* of the mode that is passed in.
|
* of the mode that is passed in.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -34,25 +34,25 @@ namespace RPiController {
|
||||||
// exposure time, and to convert between the sensor's gain codes and actual
|
// exposure time, and to convert between the sensor's gain codes and actual
|
||||||
// gains.
|
// gains.
|
||||||
//
|
//
|
||||||
// A method to return the number of frames of delay between updating exposure,
|
// A function to return the number of frames of delay between updating exposure,
|
||||||
// analogue gain and vblanking, and for the changes to take effect. For many
|
// analogue gain and vblanking, and for the changes to take effect. For many
|
||||||
// sensors these take the values 2, 1 and 2 respectively, but sensors that are
|
// sensors these take the values 2, 1 and 2 respectively, but sensors that are
|
||||||
// different will need to over-ride the default method provided.
|
// different will need to over-ride the default function provided.
|
||||||
//
|
//
|
||||||
// A method to query if the sensor outputs embedded data that can be parsed.
|
// A function to query if the sensor outputs embedded data that can be parsed.
|
||||||
//
|
//
|
||||||
// A method to return the sensitivity of a given camera mode.
|
// A function to return the sensitivity of a given camera mode.
|
||||||
//
|
//
|
||||||
// A parser to parse the embedded data buffers provided by some sensors (for
|
// A parser to parse the embedded data buffers provided by some sensors (for
|
||||||
// example, the imx219 does; the ov5647 doesn't). This allows us to know for
|
// example, the imx219 does; the ov5647 doesn't). This allows us to know for
|
||||||
// sure the exposure and gain of the frame we're looking at. CamHelper
|
// sure the exposure and gain of the frame we're looking at. CamHelper
|
||||||
// provides methods for converting analogue gains to and from the sensor's
|
// provides functions for converting analogue gains to and from the sensor's
|
||||||
// native gain codes.
|
// native gain codes.
|
||||||
//
|
//
|
||||||
// Finally, a set of methods that determine how to handle the vagaries of
|
// Finally, a set of functions that determine how to handle the vagaries of
|
||||||
// different camera modules on start-up or when switching modes. Some
|
// different camera modules on start-up or when switching modes. Some
|
||||||
// modules may produce one or more frames that are not yet correctly exposed,
|
// modules may produce one or more frames that are not yet correctly exposed,
|
||||||
// or where the metadata may be suspect. We have the following methods:
|
// or where the metadata may be suspect. We have the following functions:
|
||||||
// HideFramesStartup(): Tell the pipeline handler not to return this many
|
// HideFramesStartup(): Tell the pipeline handler not to return this many
|
||||||
// frames at start-up. This can also be used to hide initial frames
|
// frames at start-up. This can also be used to hide initial frames
|
||||||
// while the AGC and other algorithms are sorting themselves out.
|
// while the AGC and other algorithms are sorting themselves out.
|
||||||
|
|
|
@ -27,8 +27,8 @@ typedef std::shared_ptr<bcm2835_isp_stats> StatisticsPtr;
|
||||||
|
|
||||||
// The Controller holds a pointer to some global_metadata, which is how
|
// The Controller holds a pointer to some global_metadata, which is how
|
||||||
// different controllers and control algorithms within them can exchange
|
// different controllers and control algorithms within them can exchange
|
||||||
// information. The Prepare method returns a pointer to metadata for this
|
// information. The Prepare function returns a pointer to metadata for this
|
||||||
// specific image, and which should be passed on to the Process method.
|
// specific image, and which should be passed on to the Process function.
|
||||||
|
|
||||||
class Controller
|
class Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,7 +82,7 @@ private:
|
||||||
int frame_phase_;
|
int frame_phase_;
|
||||||
// counts up to startup_frames
|
// counts up to startup_frames
|
||||||
int frame_count_;
|
int frame_count_;
|
||||||
// counts up to startup_frames for Process method
|
// counts up to startup_frames for Process function
|
||||||
int frame_count2_;
|
int frame_count2_;
|
||||||
double sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];
|
double sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];
|
||||||
double prev_sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];
|
double prev_sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];
|
||||||
|
|
|
@ -50,7 +50,7 @@ void Sharpen::Read(boost::property_tree::ptree const ¶ms)
|
||||||
|
|
||||||
void Sharpen::SetStrength(double strength)
|
void Sharpen::SetStrength(double strength)
|
||||||
{
|
{
|
||||||
// Note that this method is how an application sets the overall
|
// Note that this function is how an application sets the overall
|
||||||
// sharpening "strength". We call this the "user strength" field
|
// sharpening "strength". We call this the "user strength" field
|
||||||
// as there already is a strength_ field - being an internal gain
|
// as there already is a strength_ field - being an internal gain
|
||||||
// parameter that gets passed to the ISP control code. Negative
|
// parameter that gets passed to the ISP control code. Negative
|
||||||
|
|
|
@ -113,8 +113,8 @@ protected:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This isn't a full implementation of a metadata parser for SMIA sensors,
|
* This isn't a full implementation of a metadata parser for SMIA sensors,
|
||||||
* however, it does provide the findRegs method which will prove useful and make
|
* however, it does provide the findRegs function which will prove useful and
|
||||||
* it easier to implement parsers for other SMIA-like sensors (see
|
* make it easier to implement parsers for other SMIA-like sensors (see
|
||||||
* md_parser_imx219.cpp for an example).
|
* md_parser_imx219.cpp for an example).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,7 @@ void IPARPi::queueRequest(const ControlList &controls)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The SetEv() method takes in a direct exposure multiplier.
|
* The SetEv() function takes in a direct exposure multiplier.
|
||||||
* So convert to 2^EV
|
* So convert to 2^EV
|
||||||
*/
|
*/
|
||||||
double ev = pow(2.0, ctrl.second.get<float>());
|
double ev = pow(2.0, ctrl.second.get<float>());
|
||||||
|
|
|
@ -101,7 +101,7 @@ void EventDispatcherPoll::unregisterEventNotifier(EventNotifier *notifier)
|
||||||
set.notifiers[type] = nullptr;
|
set.notifiers[type] = nullptr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't race with event processing if this method is called from an
|
* Don't race with event processing if this function is called from an
|
||||||
* event notifier. The notifiers_ entry will be erased by
|
* event notifier. The notifiers_ entry will be erased by
|
||||||
* processEvents().
|
* processEvents().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -423,7 +423,7 @@ void Logger::backtrace()
|
||||||
msg << "Backtrace:" << std::endl;
|
msg << "Backtrace:" << std::endl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip the first two entries that correspond to this method and
|
* Skip the first two entries that correspond to this function and
|
||||||
* ~LogMessage().
|
* ~LogMessage().
|
||||||
*/
|
*/
|
||||||
for (int i = 2; i < num_entries; ++i)
|
for (int i = 2; i < num_entries; ++i)
|
||||||
|
@ -865,9 +865,9 @@ LogMessage::~LogMessage()
|
||||||
*
|
*
|
||||||
* The Loggable class allows classes to extend log messages without any change
|
* The Loggable class allows classes to extend log messages without any change
|
||||||
* to the way the LOG() macro is invoked. By inheriting from Loggable and
|
* to the way the LOG() macro is invoked. By inheriting from Loggable and
|
||||||
* implementing the logPrefix() virtual method, a class can specify extra
|
* implementing the logPrefix() virtual function, a class can specify extra
|
||||||
* information to be automatically added to messages logged from class member
|
* information to be automatically added to messages logged from class member
|
||||||
* methods.
|
* function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Loggable::~Loggable()
|
Loggable::~Loggable()
|
||||||
|
@ -878,7 +878,7 @@ Loggable::~Loggable()
|
||||||
* \fn Loggable::logPrefix()
|
* \fn Loggable::logPrefix()
|
||||||
* \brief Retrieve a string to be prefixed to the log message
|
* \brief Retrieve a string to be prefixed to the log message
|
||||||
*
|
*
|
||||||
* This method allows classes inheriting from the Loggable class to extend the
|
* This function allows classes inheriting from the Loggable class to extend the
|
||||||
* logger with an object-specific prefix output right before the log message
|
* logger with an object-specific prefix output right before the log message
|
||||||
* contents.
|
* contents.
|
||||||
*
|
*
|
||||||
|
@ -892,7 +892,7 @@ Loggable::~Loggable()
|
||||||
* \param[in] fileName The file name where the message is logged from
|
* \param[in] fileName The file name where the message is logged from
|
||||||
* \param[in] line The line number where the message is logged from
|
* \param[in] line The line number where the message is logged from
|
||||||
*
|
*
|
||||||
* This method is used as a backeng by the LOG() macro to create a log message
|
* This function is used as a backend by the LOG() macro to create a log message
|
||||||
* for locations inheriting from the Loggable class.
|
* for locations inheriting from the Loggable class.
|
||||||
*
|
*
|
||||||
* \return A log message
|
* \return A log message
|
||||||
|
@ -915,7 +915,7 @@ LogMessage Loggable::_log(const LogCategory *category, LogSeverity severity,
|
||||||
* \param[in] fileName The file name where the message is logged from
|
* \param[in] fileName The file name where the message is logged from
|
||||||
* \param[in] line The line number where the message is logged from
|
* \param[in] line The line number where the message is logged from
|
||||||
*
|
*
|
||||||
* This function is used as a backeng by the LOG() macro to create a log
|
* This function is used as a backend by the LOG() macro to create a log
|
||||||
* message for locations not inheriting from the Loggable class.
|
* message for locations not inheriting from the Loggable class.
|
||||||
*
|
*
|
||||||
* \return A log message
|
* \return A log message
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* thus the message shall not store any temporary data.
|
* thus the message shall not store any temporary data.
|
||||||
*
|
*
|
||||||
* The message is delivered in the context of the object's thread, through the
|
* The message is delivered in the context of the object's thread, through the
|
||||||
* Object::message() virtual method. After delivery the message is
|
* Object::message() virtual function. After delivery the message is
|
||||||
* automatically deleted.
|
* automatically deleted.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -84,10 +84,10 @@ Message::~Message()
|
||||||
*
|
*
|
||||||
* Custom message types use values starting at Message::UserMessage. Assigning
|
* Custom message types use values starting at Message::UserMessage. Assigning
|
||||||
* custom types manually may lead to accidental duplicated types. To avoid this
|
* custom types manually may lead to accidental duplicated types. To avoid this
|
||||||
* problem, this method reserves and returns the next available user-defined
|
* problem, this function reserves and returns the next available user-defined
|
||||||
* message type.
|
* message type.
|
||||||
*
|
*
|
||||||
* The recommended way to use this method is to subclass Message and provide a
|
* The recommended way to use this function is to subclass Message and provide a
|
||||||
* static accessor for the custom message type.
|
* static accessor for the custom message type.
|
||||||
*
|
*
|
||||||
* \code{.cpp}
|
* \code{.cpp}
|
||||||
|
|
|
@ -145,8 +145,8 @@ void Object::deleteLater()
|
||||||
* \brief Post a message to the object's thread
|
* \brief Post a message to the object's thread
|
||||||
* \param[in] msg The message
|
* \param[in] msg The message
|
||||||
*
|
*
|
||||||
* This method posts the message \a msg to the message queue of the object's
|
* This function posts the message \a msg to the message queue of the object's
|
||||||
* thread, to be delivered to the object through the message() method in the
|
* thread, to be delivered to the object through the message() function in the
|
||||||
* context of its thread. Message ownership is passed to the thread, and the
|
* context of its thread. Message ownership is passed to the thread, and the
|
||||||
* message will be deleted after being delivered.
|
* message will be deleted after being delivered.
|
||||||
*
|
*
|
||||||
|
@ -169,13 +169,13 @@ void Object::postMessage(std::unique_ptr<Message> msg)
|
||||||
* \brief Message handler for the object
|
* \brief Message handler for the object
|
||||||
* \param[in] msg The message
|
* \param[in] msg The message
|
||||||
*
|
*
|
||||||
* This virtual method receives messages for the object. It is called in the
|
* This virtual function receives messages for the object. It is called in the
|
||||||
* context of the object's thread, and can be overridden to process custom
|
* context of the object's thread, and can be overridden to process custom
|
||||||
* messages. The parent Object::message() method shall be called for any
|
* messages. The parent Object::message() function shall be called for any
|
||||||
* message not handled by the override method.
|
* message not handled by the override function.
|
||||||
*
|
*
|
||||||
* The message \a msg is valid only for the duration of the call, no reference
|
* The message \a msg is valid only for the duration of the call, no reference
|
||||||
* to it shall be kept after this method returns.
|
* to it shall be kept after this function returns.
|
||||||
*/
|
*/
|
||||||
void Object::message(Message *msg)
|
void Object::message(Message *msg)
|
||||||
{
|
{
|
||||||
|
@ -207,7 +207,7 @@ void Object::message(Message *msg)
|
||||||
* \param[in] type Connection type for method invocation
|
* \param[in] type Connection type for method invocation
|
||||||
* \param[in] args The method arguments
|
* \param[in] args The method arguments
|
||||||
*
|
*
|
||||||
* This method invokes the member method \a func with arguments \a args, based
|
* This function invokes the member method \a func with arguments \a args, based
|
||||||
* on the connection \a type. Depending on the type, the method will be called
|
* on the connection \a type. Depending on the type, the method will be called
|
||||||
* synchronously in the same thread or asynchronously in the object's thread.
|
* synchronously in the same thread or asynchronously in the object's thread.
|
||||||
*
|
*
|
||||||
|
@ -237,12 +237,12 @@ void Object::message(Message *msg)
|
||||||
* \brief Move the object and all its children to a different thread
|
* \brief Move the object and all its children to a different thread
|
||||||
* \param[in] thread The target thread
|
* \param[in] thread The target thread
|
||||||
*
|
*
|
||||||
* This method moves the object and all its children from the current thread to
|
* This function moves the object and all its children from the current thread
|
||||||
* the new \a thread.
|
* to the new \a thread.
|
||||||
*
|
*
|
||||||
* Before the object is moved, a Message::ThreadMoveMessage message is sent to
|
* Before the object is moved, a Message::ThreadMoveMessage message is sent to
|
||||||
* it. The message() method can be reimplement in derived classes to be notified
|
* it. The message() function can be reimplement in derived classes to be
|
||||||
* of the upcoming thread move and perform any required processing.
|
* notified of the upcoming thread move and perform any required processing.
|
||||||
*
|
*
|
||||||
* Moving an object that has a parent is not allowed, and causes undefined
|
* Moving an object that has a parent is not allowed, and causes undefined
|
||||||
* behaviour.
|
* behaviour.
|
||||||
|
|
|
@ -21,10 +21,10 @@ namespace libcamera {
|
||||||
*
|
*
|
||||||
* A semaphore is a locking primitive that protects resources. It is created
|
* A semaphore is a locking primitive that protects resources. It is created
|
||||||
* with an initial number of resources (which may be 0), and offers two
|
* with an initial number of resources (which may be 0), and offers two
|
||||||
* primitives to acquire and release resources. The acquire() method tries to
|
* primitives to acquire and release resources. The acquire() function tries to
|
||||||
* acquire a number of resources, and blocks if not enough resources are
|
* acquire a number of resources, and blocks if not enough resources are
|
||||||
* available until they get released. The release() method releases a number of
|
* available until they get released. The release() function releases a number
|
||||||
* resources, waking up any consumer blocked on an acquire() call.
|
* of resources, waking up any consumer blocked on an acquire() call.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +50,7 @@ unsigned int Semaphore::available()
|
||||||
* \brief Acquire \a n resources
|
* \brief Acquire \a n resources
|
||||||
* \param[in] n The resource count
|
* \param[in] n The resource count
|
||||||
*
|
*
|
||||||
* This method attempts to acquire \a n resources. If \a n is higher than the
|
* This function attempts to acquire \a n resources. If \a n is higher than the
|
||||||
* number of available resources, the call will block until enough resources
|
* number of available resources, the call will block until enough resources
|
||||||
* become available.
|
* become available.
|
||||||
*/
|
*/
|
||||||
|
@ -65,7 +65,7 @@ void Semaphore::acquire(unsigned int n)
|
||||||
* \brief Try to acquire \a n resources without blocking
|
* \brief Try to acquire \a n resources without blocking
|
||||||
* \param[in] n The resource count
|
* \param[in] n The resource count
|
||||||
*
|
*
|
||||||
* This method attempts to acquire \a n resources. If \a n is higher than the
|
* This function attempts to acquire \a n resources. If \a n is higher than the
|
||||||
* number of available resources, it returns false immediately without
|
* number of available resources, it returns false immediately without
|
||||||
* acquiring any resource. Otherwise it acquires the resources and returns
|
* acquiring any resource. Otherwise it acquires the resources and returns
|
||||||
* true.
|
* true.
|
||||||
|
@ -86,9 +86,9 @@ bool Semaphore::tryAcquire(unsigned int n)
|
||||||
* \brief Release \a n resources
|
* \brief Release \a n resources
|
||||||
* \param[in] n The resource count
|
* \param[in] n The resource count
|
||||||
*
|
*
|
||||||
* This method releases \a n resources, increasing the available resource count
|
* This function releases \a n resources, increasing the available resource
|
||||||
* by \a n. If the number of available resources becomes large enough for any
|
* count by \a n. If the number of available resources becomes large enough for
|
||||||
* consumer blocked on an acquire() call, those consumers get woken up.
|
* any consumer blocked on an acquire() call, those consumers get woken up.
|
||||||
*/
|
*/
|
||||||
void Semaphore::release(unsigned int n)
|
void Semaphore::release(unsigned int n)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,7 +102,7 @@ SignalBase::SlotList SignalBase::slots()
|
||||||
* emitted from the same thread, the slot will be called synchronously, before
|
* emitted from the same thread, the slot will be called synchronously, before
|
||||||
* Signal::emit() returns. If the signal is emitted from a different thread,
|
* Signal::emit() returns. If the signal is emitted from a different thread,
|
||||||
* the slot will be called asynchronously from the object's thread's event
|
* the slot will be called asynchronously from the object's thread's event
|
||||||
* loop, after the Signal::emit() method returns, with a copy of the signal's
|
* loop, after the Signal::emit() function returns, with a copy of the signal's
|
||||||
* arguments. The emitter shall thus ensure that any pointer or reference
|
* arguments. The emitter shall thus ensure that any pointer or reference
|
||||||
* passed through the signal will remain valid after the signal is emitted.
|
* passed through the signal will remain valid after the signal is emitted.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -222,7 +222,7 @@ ThreadData *ThreadData::current()
|
||||||
* The Thread class is a wrapper around std::thread that handles integration
|
* The Thread class is a wrapper around std::thread that handles integration
|
||||||
* with the Object, Signal and EventDispatcher classes.
|
* with the Object, Signal and EventDispatcher classes.
|
||||||
*
|
*
|
||||||
* Thread instances by default run an event loop until the exit() method is
|
* Thread instances by default run an event loop until the exit() function is
|
||||||
* called. The event loop dispatches events (messages, notifiers and timers)
|
* called. The event loop dispatches events (messages, notifiers and timers)
|
||||||
* sent to the objects living in the thread. This behaviour can be modified by
|
* sent to the objects living in the thread. This behaviour can be modified by
|
||||||
* overriding the run() function.
|
* overriding the run() function.
|
||||||
|
@ -318,7 +318,7 @@ void Thread::startThread()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure the thread is cleaned up even if the run method exits
|
* Make sure the thread is cleaned up even if the run() function exits
|
||||||
* abnormally (for instance via a direct call to pthread_cancel()).
|
* abnormally (for instance via a direct call to pthread_cancel()).
|
||||||
*/
|
*/
|
||||||
thread_local ThreadCleaner cleaner(this, &Thread::finishThread);
|
thread_local ThreadCleaner cleaner(this, &Thread::finishThread);
|
||||||
|
@ -332,12 +332,12 @@ void Thread::startThread()
|
||||||
/**
|
/**
|
||||||
* \brief Enter the event loop
|
* \brief Enter the event loop
|
||||||
*
|
*
|
||||||
* This method enters an event loop based on the event dispatcher instance for
|
* This function enters an event loop based on the event dispatcher instance for
|
||||||
* the thread, and blocks until the exit() method is called. It is meant to be
|
* the thread, and blocks until the exit() function is called. It is meant to be
|
||||||
* called within the thread from the run() method and shall not be called
|
* called within the thread from the run() function and shall not be called
|
||||||
* outside of the thread.
|
* outside of the thread.
|
||||||
*
|
*
|
||||||
* \return The exit code passed to the exit() method
|
* \return The exit code passed to the exit() function
|
||||||
*/
|
*/
|
||||||
int Thread::exec()
|
int Thread::exec()
|
||||||
{
|
{
|
||||||
|
@ -356,14 +356,14 @@ int Thread::exec()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Main method of the thread
|
* \brief Main function of the thread
|
||||||
*
|
*
|
||||||
* When the thread is started with start(), it calls this method in the context
|
* When the thread is started with start(), it calls this function in the
|
||||||
* of the new thread. The run() method can be overridden to perform custom
|
* context of the new thread. The run() function can be overridden to perform
|
||||||
* work, either custom initialization and cleanup before and after calling the
|
* custom work, either custom initialization and cleanup before and after
|
||||||
* Thread::exec() function, or a custom thread loop altogether. When this
|
* calling the Thread::exec() function, or a custom thread loop altogether. When
|
||||||
* method returns the thread execution is stopped, and the \ref finished signal
|
* this function returns the thread execution is stopped, and the \ref finished
|
||||||
* is emitted.
|
* signal is emitted.
|
||||||
*
|
*
|
||||||
* Note that if this function is overridden and doesn't call Thread::exec(), no
|
* Note that if this function is overridden and doesn't call Thread::exec(), no
|
||||||
* events will be dispatched to the objects living in the thread. These objects
|
* events will be dispatched to the objects living in the thread. These objects
|
||||||
|
@ -392,10 +392,10 @@ void Thread::finishThread()
|
||||||
* \brief Stop the thread's event loop
|
* \brief Stop the thread's event loop
|
||||||
* \param[in] code The exit code
|
* \param[in] code The exit code
|
||||||
*
|
*
|
||||||
* This method interrupts the event loop started by the exec() method, causing
|
* This function interrupts the event loop started by the exec() function,
|
||||||
* exec() to return \a code.
|
* causing exec() to return \a code.
|
||||||
*
|
*
|
||||||
* Calling exit() on a thread that reimplements the run() method and doesn't
|
* Calling exit() on a thread that reimplements the run() function and doesn't
|
||||||
* call exec() will likely have no effect.
|
* call exec() will likely have no effect.
|
||||||
*
|
*
|
||||||
* \context This function is \threadsafe.
|
* \context This function is \threadsafe.
|
||||||
|
@ -449,8 +449,8 @@ bool Thread::wait(utils::duration duration)
|
||||||
* \brief Check if the thread is running
|
* \brief Check if the thread is running
|
||||||
*
|
*
|
||||||
* A Thread instance is considered as running once the underlying thread has
|
* A Thread instance is considered as running once the underlying thread has
|
||||||
* started. This method guarantees that it returns true after the start()
|
* started. This function guarantees that it returns true after the start()
|
||||||
* method returns, and false after the wait() method returns.
|
* function returns, and false after the wait() function returns.
|
||||||
*
|
*
|
||||||
* \context This function is \threadsafe.
|
* \context This function is \threadsafe.
|
||||||
*
|
*
|
||||||
|
@ -518,8 +518,8 @@ EventDispatcher *Thread::eventDispatcher()
|
||||||
* \param[in] msg The message
|
* \param[in] msg The message
|
||||||
* \param[in] receiver The receiver
|
* \param[in] receiver The receiver
|
||||||
*
|
*
|
||||||
* This method stores the message \a msg in the message queue of the thread for
|
* This function stores the message \a msg in the message queue of the thread
|
||||||
* the \a receiver and wake up the thread's event loop. Message ownership is
|
* for the \a receiver and wake up the thread's event loop. Message ownership is
|
||||||
* passed to the thread, and the message will be deleted after being delivered.
|
* passed to the thread, and the message will be deleted after being delivered.
|
||||||
*
|
*
|
||||||
* Messages are delivered through the thread's event loop. If the thread is not
|
* Messages are delivered through the thread's event loop. If the thread is not
|
||||||
|
|
|
@ -40,7 +40,8 @@ LOG_DEFINE_CATEGORY(Serialization)
|
||||||
* respectively. Access is strictly sequential, the buffer keeps track of the
|
* respectively. Access is strictly sequential, the buffer keeps track of the
|
||||||
* current access location and advances it automatically. Reading or writing
|
* current access location and advances it automatically. Reading or writing
|
||||||
* the same location multiple times is thus not possible. Bytes may also be
|
* the same location multiple times is thus not possible. Bytes may also be
|
||||||
* skipped with the skip() method.
|
* skipped with the skip() function.
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* The ByteStreamBuffer also supports carving out pieces of memory into other
|
* The ByteStreamBuffer also supports carving out pieces of memory into other
|
||||||
* ByteStreamBuffer instances. Like a read or write operation, a carveOut()
|
* ByteStreamBuffer instances. Like a read or write operation, a carveOut()
|
||||||
|
@ -52,7 +53,7 @@ LOG_DEFINE_CATEGORY(Serialization)
|
||||||
* the buffer being marked as having overflown. If the buffer has been carved
|
* the buffer being marked as having overflown. If the buffer has been carved
|
||||||
* out from a parent buffer, the parent buffer is also marked as having
|
* out from a parent buffer, the parent buffer is also marked as having
|
||||||
* overflown. Any later access on an overflown buffer is blocked. The buffer
|
* overflown. Any later access on an overflown buffer is blocked. The buffer
|
||||||
* overflow status can be checked with the overflow() method.
|
* overflow status can be checked with the overflow() function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +156,7 @@ void ByteStreamBuffer::setOverflow()
|
||||||
* \brief Carve out an area of \a size bytes into a new ByteStreamBuffer
|
* \brief Carve out an area of \a size bytes into a new ByteStreamBuffer
|
||||||
* \param[in] size The size of the newly created memory buffer
|
* \param[in] size The size of the newly created memory buffer
|
||||||
*
|
*
|
||||||
* This method carves out an area of \a size bytes from the buffer into a new
|
* This function carves out an area of \a size bytes from the buffer into a new
|
||||||
* ByteStreamBuffer, and returns the new buffer. It operates identically to a
|
* ByteStreamBuffer, and returns the new buffer. It operates identically to a
|
||||||
* read or write access from the point of view of the current buffer, but allows
|
* read or write access from the point of view of the current buffer, but allows
|
||||||
* the new buffer to be read or written at a later time after other read or
|
* the new buffer to be read or written at a later time after other read or
|
||||||
|
@ -194,7 +195,7 @@ ByteStreamBuffer ByteStreamBuffer::carveOut(size_t size)
|
||||||
* \brief Skip \a size bytes from the buffer
|
* \brief Skip \a size bytes from the buffer
|
||||||
* \param[in] size The number of bytes to skip
|
* \param[in] size The number of bytes to skip
|
||||||
*
|
*
|
||||||
* This method skips the next \a size bytes from the buffer.
|
* This function skips the next \a size bytes from the buffer.
|
||||||
*
|
*
|
||||||
* \return 0 on success, a negative error code otherwise
|
* \return 0 on success, a negative error code otherwise
|
||||||
* \retval -ENOSPC no more space is available in the managed memory buffer
|
* \retval -ENOSPC no more space is available in the managed memory buffer
|
||||||
|
|
|
@ -177,7 +177,7 @@ void CameraConfiguration::addConfiguration(const StreamConfiguration &cfg)
|
||||||
* \fn CameraConfiguration::validate()
|
* \fn CameraConfiguration::validate()
|
||||||
* \brief Validate and possibly adjust the camera configuration
|
* \brief Validate and possibly adjust the camera configuration
|
||||||
*
|
*
|
||||||
* This method adjusts the camera configuration to the closest valid
|
* This function adjusts the camera configuration to the closest valid
|
||||||
* configuration and returns the validation status.
|
* configuration and returns the validation status.
|
||||||
*
|
*
|
||||||
* \todo: Define exactly when to return each status code. Should stream
|
* \todo: Define exactly when to return each status code. Should stream
|
||||||
|
@ -206,7 +206,7 @@ void CameraConfiguration::addConfiguration(const StreamConfiguration &cfg)
|
||||||
*
|
*
|
||||||
* The \a index represents the zero based insertion order of stream
|
* The \a index represents the zero based insertion order of stream
|
||||||
* configuration into the camera configuration with addConfiguration(). Calling
|
* configuration into the camera configuration with addConfiguration(). Calling
|
||||||
* this method with an invalid index results in undefined behaviour.
|
* this function with an invalid index results in undefined behaviour.
|
||||||
*
|
*
|
||||||
* \return The stream configuration
|
* \return The stream configuration
|
||||||
*/
|
*/
|
||||||
|
@ -221,7 +221,7 @@ StreamConfiguration &CameraConfiguration::at(unsigned int index)
|
||||||
*
|
*
|
||||||
* The \a index represents the zero based insertion order of stream
|
* The \a index represents the zero based insertion order of stream
|
||||||
* configuration into the camera configuration with addConfiguration(). Calling
|
* configuration into the camera configuration with addConfiguration(). Calling
|
||||||
* this method with an invalid index results in undefined behaviour.
|
* this function with an invalid index results in undefined behaviour.
|
||||||
*
|
*
|
||||||
* \return The stream configuration
|
* \return The stream configuration
|
||||||
*/
|
*/
|
||||||
|
@ -237,7 +237,7 @@ const StreamConfiguration &CameraConfiguration::at(unsigned int index) const
|
||||||
*
|
*
|
||||||
* The \a index represents the zero based insertion order of stream
|
* The \a index represents the zero based insertion order of stream
|
||||||
* configuration into the camera configuration with addConfiguration(). Calling
|
* configuration into the camera configuration with addConfiguration(). Calling
|
||||||
* this method with an invalid index results in undefined behaviour.
|
* this function with an invalid index results in undefined behaviour.
|
||||||
*
|
*
|
||||||
* \return The stream configuration
|
* \return The stream configuration
|
||||||
*/
|
*/
|
||||||
|
@ -249,7 +249,7 @@ const StreamConfiguration &CameraConfiguration::at(unsigned int index) const
|
||||||
*
|
*
|
||||||
* The \a index represents the zero based insertion order of stream
|
* The \a index represents the zero based insertion order of stream
|
||||||
* configuration into the camera configuration with addConfiguration(). Calling
|
* configuration into the camera configuration with addConfiguration(). Calling
|
||||||
* this method with an invalid index results in undefined behaviour.
|
* this function with an invalid index results in undefined behaviour.
|
||||||
*
|
*
|
||||||
* \return The stream configuration
|
* \return The stream configuration
|
||||||
*/
|
*/
|
||||||
|
@ -607,7 +607,7 @@ Camera::~Camera()
|
||||||
/**
|
/**
|
||||||
* \brief Notify camera disconnection
|
* \brief Notify camera disconnection
|
||||||
*
|
*
|
||||||
* This method is used to notify the camera instance that the underlying
|
* This function is used to notify the camera instance that the underlying
|
||||||
* hardware has been unplugged. In response to the disconnection the camera
|
* hardware has been unplugged. In response to the disconnection the camera
|
||||||
* instance notifies the application by emitting the #disconnected signal, and
|
* instance notifies the application by emitting the #disconnected signal, and
|
||||||
* ensures that all new calls to the application-facing Camera API return an
|
* ensures that all new calls to the application-facing Camera API return an
|
||||||
|
@ -823,7 +823,7 @@ std::unique_ptr<CameraConfiguration> Camera::generateConfiguration(const StreamR
|
||||||
* by populating \a config.
|
* by populating \a config.
|
||||||
*
|
*
|
||||||
* The configuration is created by generateConfiguration(), and adjusted by the
|
* The configuration is created by generateConfiguration(), and adjusted by the
|
||||||
* caller with CameraConfiguration::validate(). This method only accepts fully
|
* caller with CameraConfiguration::validate(). This function only accepts fully
|
||||||
* valid configurations and returns an error if \a config is not valid.
|
* valid configurations and returns an error if \a config is not valid.
|
||||||
*
|
*
|
||||||
* 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
|
||||||
|
@ -897,11 +897,11 @@ int Camera::configure(CameraConfiguration *config)
|
||||||
* \brief Create a request object for the camera
|
* \brief Create a request object for the camera
|
||||||
* \param[in] cookie Opaque cookie for application use
|
* \param[in] cookie Opaque cookie for application use
|
||||||
*
|
*
|
||||||
* This method creates an empty request for the application to fill with
|
* This function creates an empty request for the application to fill with
|
||||||
* buffers and parameters, and queue for capture.
|
* buffers and parameters, and queue for capture.
|
||||||
*
|
*
|
||||||
* The \a cookie is stored in the request and is accessible through the
|
* The \a cookie is stored in the request and is accessible through the
|
||||||
* Request::cookie() method at any time. It is typically used by applications
|
* Request::cookie() function at any time. It is typically used by applications
|
||||||
* to map the request to an external resource in the request completion
|
* to map the request to an external resource in the request completion
|
||||||
* handler, and is completely opaque to libcamera.
|
* handler, and is completely opaque to libcamera.
|
||||||
*
|
*
|
||||||
|
@ -928,7 +928,7 @@ std::unique_ptr<Request> Camera::createRequest(uint64_t cookie)
|
||||||
* \brief Queue a request to the camera
|
* \brief Queue a request to the camera
|
||||||
* \param[in] request The request to queue to the camera
|
* \param[in] request The request to queue to the camera
|
||||||
*
|
*
|
||||||
* This method queues a \a request to the camera for capture.
|
* This function queues a \a request to the camera for capture.
|
||||||
*
|
*
|
||||||
* After allocating the request with createRequest(), the application shall
|
* After allocating the request with createRequest(), the application shall
|
||||||
* fill it with at least one capture buffer before queuing it. Requests that
|
* fill it with at least one capture buffer before queuing it. Requests that
|
||||||
|
@ -1021,8 +1021,8 @@ int Camera::start(const ControlList *controls)
|
||||||
/**
|
/**
|
||||||
* \brief Stop capture from camera
|
* \brief Stop capture from camera
|
||||||
*
|
*
|
||||||
* This method stops capturing and processing requests immediately. All pending
|
* This function stops capturing and processing requests immediately. All
|
||||||
* requests are cancelled and complete synchronously in an error state.
|
* pending requests are cancelled and complete synchronously in an error state.
|
||||||
*
|
*
|
||||||
* \context This function may be called in any camera state as defined in \ref
|
* \context This function may be called in any camera state as defined in \ref
|
||||||
* camera_operation, and shall be synchronized by the caller with other
|
* camera_operation, and shall be synchronized by the caller with other
|
||||||
|
|
|
@ -367,7 +367,7 @@ std::shared_ptr<Camera> CameraManager::get(const std::string &id)
|
||||||
* \brief Retrieve a camera based on device number
|
* \brief Retrieve a camera based on device number
|
||||||
* \param[in] devnum Device number of camera to get
|
* \param[in] devnum Device number of camera to get
|
||||||
*
|
*
|
||||||
* This method is meant solely for the use of the V4L2 compatibility
|
* This function is meant solely for the use of the V4L2 compatibility
|
||||||
* layer, to map device nodes to Camera instances. Applications shall
|
* layer, to map device nodes to Camera instances. Applications shall
|
||||||
* not use it and shall instead retrieve cameras by name.
|
* not use it and shall instead retrieve cameras by name.
|
||||||
*
|
*
|
||||||
|
|
|
@ -69,7 +69,7 @@ CameraSensor::~CameraSensor()
|
||||||
/**
|
/**
|
||||||
* \brief Initialize the camera sensor instance
|
* \brief Initialize the camera sensor instance
|
||||||
*
|
*
|
||||||
* This method performs the initialisation steps of the CameraSensor that may
|
* This function performs the initialisation steps of the CameraSensor that may
|
||||||
* fail. It shall be called once and only once after constructing the instance.
|
* fail. It shall be called once and only once after constructing the instance.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
|
@ -490,7 +490,7 @@ int CameraSensor::initProperties()
|
||||||
*
|
*
|
||||||
* \todo Consider if it desirable to distinguish between the maximum resolution
|
* \todo Consider if it desirable to distinguish between the maximum resolution
|
||||||
* the sensor can produce (also including upscaled ones) and the actual pixel
|
* the sensor can produce (also including upscaled ones) and the actual pixel
|
||||||
* array size by splitting this method in two.
|
* array size by splitting this function in two.
|
||||||
*
|
*
|
||||||
* \return The camera sensor resolution in pixels
|
* \return The camera sensor resolution in pixels
|
||||||
*/
|
*/
|
||||||
|
@ -517,7 +517,7 @@ Size CameraSensor::resolution() const
|
||||||
* sensor but not listed in \a mbusCodes are ignored. If none of the desired
|
* sensor but not listed in \a mbusCodes are ignored. If none of the desired
|
||||||
* codes is supported, it returns an error.
|
* codes is supported, it returns an error.
|
||||||
*
|
*
|
||||||
* \a size indicates the desired size at the output of the sensor. This method
|
* \a size indicates the desired size at the output of the sensor. This function
|
||||||
* selects the best media bus code and size supported by the sensor according
|
* selects the best media bus code and size supported by the sensor according
|
||||||
* to the following criteria.
|
* to the following criteria.
|
||||||
*
|
*
|
||||||
|
@ -533,12 +533,12 @@ Size CameraSensor::resolution() const
|
||||||
* When multiple media bus codes can produce the same size, the code at the
|
* When multiple media bus codes can produce the same size, the code at the
|
||||||
* lowest position in \a mbusCodes is selected.
|
* lowest position in \a mbusCodes is selected.
|
||||||
*
|
*
|
||||||
* The use of this method is optional, as the above criteria may not match the
|
* The use of this function is optional, as the above criteria may not match the
|
||||||
* needs of all pipeline handlers. Pipeline handlers may implement custom
|
* needs of all pipeline handlers. Pipeline handlers may implement custom
|
||||||
* sensor format selection when needed.
|
* sensor format selection when needed.
|
||||||
*
|
*
|
||||||
* The returned sensor output format is guaranteed to be acceptable by the
|
* The returned sensor output format is guaranteed to be acceptable by the
|
||||||
* setFormat() method without any modification.
|
* setFormat() function without any modification.
|
||||||
*
|
*
|
||||||
* \return The best sensor output format matching the desired media bus codes
|
* \return The best sensor output format matching the desired media bus codes
|
||||||
* and size on success, or an empty format otherwise.
|
* and size on success, or an empty format otherwise.
|
||||||
|
@ -632,14 +632,14 @@ const ControlInfoMap &CameraSensor::controls() const
|
||||||
* \brief Read V4L2 controls from the sensor
|
* \brief Read V4L2 controls from the sensor
|
||||||
* \param[in] ids The list of controls to read, specified by their ID
|
* \param[in] ids The list of controls to read, specified by their ID
|
||||||
*
|
*
|
||||||
* This method reads the value of all controls contained in \a ids, and returns
|
* This function reads the value of all controls contained in \a ids, and
|
||||||
* their values as a ControlList. The control identifiers are defined by the
|
* returns their values as a ControlList. The control identifiers are defined by
|
||||||
* V4L2 specification (V4L2_CID_*).
|
* the V4L2 specification (V4L2_CID_*).
|
||||||
*
|
*
|
||||||
* If any control in \a ids is not supported by the device, is disabled (i.e.
|
* If any control in \a ids is not supported by the device, is disabled (i.e.
|
||||||
* has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
|
* has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
|
||||||
* during validation of the requested controls, no control is read and this
|
* during validation of the requested controls, no control is read and this
|
||||||
* method returns an empty control list.
|
* function returns an empty control list.
|
||||||
*
|
*
|
||||||
* \sa V4L2Device::getControls()
|
* \sa V4L2Device::getControls()
|
||||||
*
|
*
|
||||||
|
@ -655,7 +655,7 @@ ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
|
||||||
* \brief Write V4L2 controls to the sensor
|
* \brief Write V4L2 controls to the sensor
|
||||||
* \param[in] ctrls The list of controls to write
|
* \param[in] ctrls The list of controls to write
|
||||||
*
|
*
|
||||||
* This method writes the value of all controls contained in \a ctrls, and
|
* This function writes the value of all controls contained in \a ctrls, and
|
||||||
* stores the values actually applied to the device in the corresponding \a
|
* stores the values actually applied to the device in the corresponding \a
|
||||||
* ctrls entry. The control identifiers are defined by the V4L2 specification
|
* ctrls entry. The control identifiers are defined by the V4L2 specification
|
||||||
* (V4L2_CID_*).
|
* (V4L2_CID_*).
|
||||||
|
@ -663,7 +663,7 @@ ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
|
||||||
* If any control in \a ctrls is not supported by the device, is disabled (i.e.
|
* If any control in \a ctrls is not supported by the device, is disabled (i.e.
|
||||||
* has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, or if any other
|
* has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, or if any other
|
||||||
* error occurs during validation of the requested controls, no control is
|
* error occurs during validation of the requested controls, no control is
|
||||||
* written and this method returns -EINVAL.
|
* written and this function returns -EINVAL.
|
||||||
*
|
*
|
||||||
* If an error occurs while writing the controls, the index of the first
|
* If an error occurs while writing the controls, the index of the first
|
||||||
* control that couldn't be written is returned. All controls below that index
|
* control that couldn't be written is returned. All controls below that index
|
||||||
|
@ -707,7 +707,7 @@ int CameraSensor::setControls(ControlList *ctrls)
|
||||||
* sensor, this function returns -EINVAL.
|
* sensor, this function returns -EINVAL.
|
||||||
*
|
*
|
||||||
* Pipeline handlers that do not change the sensor format using the setFormat()
|
* Pipeline handlers that do not change the sensor format using the setFormat()
|
||||||
* method may need to call updateControlInfo() beforehand, to ensure all the
|
* function may need to call updateControlInfo() beforehand, to ensure all the
|
||||||
* control ranges are up to date.
|
* control ranges are up to date.
|
||||||
*
|
*
|
||||||
* \return 0 on success, a negative error code otherwise
|
* \return 0 on success, a negative error code otherwise
|
||||||
|
|
|
@ -332,7 +332,7 @@ ControlInfo ControlSerializer::loadControlInfo(ControlType type,
|
||||||
* \brief Deserialize an object from a binary buffer
|
* \brief Deserialize an object from a binary buffer
|
||||||
* \param[in] buffer The memory buffer that contains the object
|
* \param[in] buffer The memory buffer that contains the object
|
||||||
*
|
*
|
||||||
* This method is only valid when specialized for ControlInfoMap or
|
* This function is only valid when specialized for ControlInfoMap or
|
||||||
* ControlList. Any other typename \a T is not supported.
|
* ControlList. Any other typename \a T is not supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ ControlInfo ControlSerializer::loadControlInfo(ControlType type,
|
||||||
* \param[in] buffer The memory buffer that contains the serialized map
|
* \param[in] buffer The memory buffer that contains the serialized map
|
||||||
*
|
*
|
||||||
* Re-construct a ControlInfoMap from a binary \a buffer containing data
|
* Re-construct a ControlInfoMap from a binary \a buffer containing data
|
||||||
* serialized using the serialize() method.
|
* serialized using the serialize() function.
|
||||||
*
|
*
|
||||||
* \return The deserialized ControlInfoMap
|
* \return The deserialized ControlInfoMap
|
||||||
*/
|
*/
|
||||||
|
@ -420,7 +420,7 @@ ControlInfoMap ControlSerializer::deserialize<ControlInfoMap>(ByteStreamBuffer &
|
||||||
* \param[in] buffer The memory buffer that contains the serialized list
|
* \param[in] buffer The memory buffer that contains the serialized list
|
||||||
*
|
*
|
||||||
* Re-construct a ControlList from a binary \a buffer containing data
|
* Re-construct a ControlList from a binary \a buffer containing data
|
||||||
* serialized using the serialize() method.
|
* serialized using the serialize() function.
|
||||||
*
|
*
|
||||||
* \return The deserialized ControlList
|
* \return The deserialized ControlList
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace libcamera {
|
||||||
* \brief Validate a control
|
* \brief Validate a control
|
||||||
* \param[in] id The control ID
|
* \param[in] id The control ID
|
||||||
*
|
*
|
||||||
* This method validates the control \a id against the object corresponding to
|
* This function validates the control \a id against the object corresponding to
|
||||||
* the validator. It shall at least validate that the control is applicable to
|
* the validator. It shall at least validate that the control is applicable to
|
||||||
* the object instance, and may perform additional checks.
|
* the object instance, and may perform additional checks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
* int32_t exposure = controls->get(controls::ManualExposure);
|
* int32_t exposure = controls->get(controls::ManualExposure);
|
||||||
* \endcode
|
* \endcode
|
||||||
*
|
*
|
||||||
* The ControlList::get() and ControlList::set() methods automatically deduce
|
* The ControlList::get() and ControlList::set() functions automatically deduce
|
||||||
* the data type based on the control.
|
* the data type based on the control.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -433,9 +433,9 @@ void ControlValue::reserve(ControlType type, bool isArray, std::size_t numElemen
|
||||||
* \brief Describe a control and its intrinsic properties
|
* \brief Describe a control and its intrinsic properties
|
||||||
*
|
*
|
||||||
* The Control class models a control exposed by an object. Its template type
|
* The Control class models a control exposed by an object. Its template type
|
||||||
* name T refers to the control data type, and allows methods that operate on
|
* name T refers to the control data type, and allows functions that operate on
|
||||||
* control values to be defined as template methods using the same type T for
|
* control values to be defined as template functions using the same type T for
|
||||||
* the control value. See for instance how the ControlList::get() method
|
* the control value. See for instance how the ControlList::get() function
|
||||||
* returns a value corresponding to the type of the requested control.
|
* returns a value corresponding to the type of the requested control.
|
||||||
*
|
*
|
||||||
* While this class is the main means to refer to a control, the control
|
* While this class is the main means to refer to a control, the control
|
||||||
|
@ -577,7 +577,7 @@ ControlInfo::ControlInfo(bool value)
|
||||||
*
|
*
|
||||||
* For controls that support a pre-defined number of values, the enumeration of
|
* For controls that support a pre-defined number of values, the enumeration of
|
||||||
* those is reported through a vector of ControlValue instances accessible with
|
* those is reported through a vector of ControlValue instances accessible with
|
||||||
* this method.
|
* this function.
|
||||||
*
|
*
|
||||||
* \return A vector of ControlValue representing the control valid values
|
* \return A vector of ControlValue representing the control valid values
|
||||||
*/
|
*/
|
||||||
|
@ -628,7 +628,7 @@ std::string ControlInfo::toString() const
|
||||||
* In addition to the features of the standard unsorted map, this class also
|
* In addition to the features of the standard unsorted map, this class also
|
||||||
* provides access to the mapped elements using numerical ID keys. It maintains
|
* provides access to the mapped elements using numerical ID keys. It maintains
|
||||||
* an internal map of numerical ID to ControlId for this purpose, and exposes it
|
* an internal map of numerical ID to ControlId for this purpose, and exposes it
|
||||||
* through the idmap() method to help construction of ControlList instances.
|
* through the idmap() function to help construction of ControlList instances.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -770,7 +770,7 @@ ControlInfoMap::const_iterator ControlInfoMap::find(unsigned int id) const
|
||||||
* \brief Retrieve the ControlId map
|
* \brief Retrieve the ControlId map
|
||||||
*
|
*
|
||||||
* Constructing ControlList instances for V4L2 controls requires a ControlIdMap
|
* Constructing ControlList instances for V4L2 controls requires a ControlIdMap
|
||||||
* for the V4L2 device that the control list targets. This helper method
|
* for the V4L2 device that the control list targets. This helper function
|
||||||
* returns a suitable idmap for that purpose.
|
* returns a suitable idmap for that purpose.
|
||||||
*
|
*
|
||||||
* \return The ControlId map
|
* \return The ControlId map
|
||||||
|
@ -808,7 +808,7 @@ void ControlInfoMap::generateIdmap()
|
||||||
* \brief Associate a list of ControlId with their values for an object
|
* \brief Associate a list of ControlId with their values for an object
|
||||||
*
|
*
|
||||||
* The ControlList class stores values of controls exposed by an object. The
|
* The ControlList class stores values of controls exposed by an object. The
|
||||||
* lists returned by the Request::controls() and Request::metadata() methods
|
* lists returned by the Request::controls() and Request::metadata() functions
|
||||||
* refer to the camera that the request belongs to.
|
* refer to the camera that the request belongs to.
|
||||||
*
|
*
|
||||||
* Control lists are constructed with a map of all the controls supported by
|
* Control lists are constructed with a map of all the controls supported by
|
||||||
|
@ -987,7 +987,7 @@ bool ControlList::contains(unsigned int id) const
|
||||||
* \param[in] ctrl The control
|
* \param[in] ctrl The control
|
||||||
* \param[in] value The control value
|
* \param[in] value The control value
|
||||||
*
|
*
|
||||||
* This method sets the value of a control in the control list. If the control
|
* This function sets the value of a control in the control list. If the control
|
||||||
* is already present in the list, its value is updated, otherwise it is added
|
* is already present in the list, its value is updated, otherwise it is added
|
||||||
* to the list.
|
* to the list.
|
||||||
*
|
*
|
||||||
|
@ -1027,7 +1027,7 @@ const ControlValue &ControlList::get(unsigned int id) const
|
||||||
* \param[in] id The control ID
|
* \param[in] id The control ID
|
||||||
* \param[in] value The control value
|
* \param[in] value The control value
|
||||||
*
|
*
|
||||||
* This method sets the value of a control in the control list. If the control
|
* This function sets the value of a control in the control list. If the control
|
||||||
* is already present in the list, its value is updated, otherwise it is added
|
* is already present in the list, its value is updated, otherwise it is added
|
||||||
* to the list.
|
* to the list.
|
||||||
*
|
*
|
||||||
|
|
|
@ -244,7 +244,7 @@ std::unique_ptr<MediaDevice> DeviceEnumerator::createDevice(const std::string &d
|
||||||
*
|
*
|
||||||
* Store the media device in the internal list for later matching with
|
* Store the media device in the internal list for later matching with
|
||||||
* pipeline handlers. \a media shall be created with createDevice() first.
|
* pipeline handlers. \a media shall be created with createDevice() first.
|
||||||
* This method shall be called after all members of the entities of the
|
* This function shall be called after all members of the entities of the
|
||||||
* media graph have been confirmed to be initialized.
|
* media graph have been confirmed to be initialized.
|
||||||
*/
|
*/
|
||||||
void DeviceEnumerator::addDevice(std::unique_ptr<MediaDevice> media)
|
void DeviceEnumerator::addDevice(std::unique_ptr<MediaDevice> media)
|
||||||
|
|
|
@ -47,11 +47,11 @@ LOG_DEFINE_CATEGORY(FileDescriptor)
|
||||||
* by fd() will be identical to the value passed to the constructor.
|
* by fd() will be identical to the value passed to the constructor.
|
||||||
*
|
*
|
||||||
* The copy constructor and assignment operator create copies that share the
|
* The copy constructor and assignment operator create copies that share the
|
||||||
* Descriptor, while the move versions of those methods additionally make the
|
* Descriptor, while the move versions of those functions additionally make the
|
||||||
* other FileDescriptor invalid. When the last FileDescriptor that references a
|
* other FileDescriptor invalid. When the last FileDescriptor that references a
|
||||||
* Descriptor is destroyed, the file descriptor is closed.
|
* Descriptor is destroyed, the file descriptor is closed.
|
||||||
*
|
*
|
||||||
* The numerical file descriptor is available through the fd() method. All
|
* The numerical file descriptor is available through the fd() function. All
|
||||||
* FileDescriptor instances created as copies of a FileDescriptor will report
|
* FileDescriptor instances created as copies of a FileDescriptor will report
|
||||||
* the same fd() value. Callers can perform operations on the fd(), but shall
|
* the same fd() value. Callers can perform operations on the fd(), but shall
|
||||||
* never close it manually.
|
* never close it manually.
|
||||||
|
@ -68,7 +68,7 @@ LOG_DEFINE_CATEGORY(FileDescriptor)
|
||||||
* FileDescriptor instances that reference it are destroyed.
|
* FileDescriptor instances that reference it are destroyed.
|
||||||
*
|
*
|
||||||
* If the \a fd is negative, the FileDescriptor is constructed as invalid and
|
* If the \a fd is negative, the FileDescriptor is constructed as invalid and
|
||||||
* the fd() method will return -1.
|
* the fd() function will return -1.
|
||||||
*/
|
*/
|
||||||
FileDescriptor::FileDescriptor(const int &fd)
|
FileDescriptor::FileDescriptor(const int &fd)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ FileDescriptor::FileDescriptor(const int &fd)
|
||||||
* destroyed.
|
* destroyed.
|
||||||
*
|
*
|
||||||
* If the \a fd is negative, the FileDescriptor is constructed as invalid and
|
* If the \a fd is negative, the FileDescriptor is constructed as invalid and
|
||||||
* the fd() method will return -1.
|
* the fd() function will return -1.
|
||||||
*/
|
*/
|
||||||
FileDescriptor::FileDescriptor(int &&fd)
|
FileDescriptor::FileDescriptor(int &&fd)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +129,7 @@ FileDescriptor::FileDescriptor(const FileDescriptor &other)
|
||||||
*
|
*
|
||||||
* Moving a FileDescriptor moves the reference to the wrapped descriptor owned
|
* Moving a FileDescriptor moves the reference to the wrapped descriptor owned
|
||||||
* by \a other to the new FileDescriptor. The \a other FileDescriptor is
|
* by \a other to the new FileDescriptor. The \a other FileDescriptor is
|
||||||
* invalidated and its fd() method will return -1. The wrapped file descriptor
|
* invalidated and its fd() function will return -1. The wrapped file descriptor
|
||||||
* will be closed automatically when all FileDescriptor instances that
|
* will be closed automatically when all FileDescriptor instances that
|
||||||
* reference it are destroyed.
|
* reference it are destroyed.
|
||||||
*/
|
*/
|
||||||
|
@ -178,7 +178,7 @@ FileDescriptor &FileDescriptor::operator=(const FileDescriptor &other)
|
||||||
* Moving a FileDescriptor moves the reference to the wrapped descriptor owned
|
* Moving a FileDescriptor moves the reference to the wrapped descriptor owned
|
||||||
* by \a other to the new FileDescriptor. If \a other is invalid, *this will
|
* by \a other to the new FileDescriptor. If \a other is invalid, *this will
|
||||||
* also be invalid. The \a other FileDescriptor is invalidated and its fd()
|
* also be invalid. The \a other FileDescriptor is invalidated and its fd()
|
||||||
* method will return -1. The wrapped file descriptor will be closed
|
* function will return -1. The wrapped file descriptor will be closed
|
||||||
* automatically when all FileDescriptor instances that reference it are
|
* automatically when all FileDescriptor instances that reference it are
|
||||||
* destroyed.
|
* destroyed.
|
||||||
*
|
*
|
||||||
|
@ -209,7 +209,7 @@ FileDescriptor &FileDescriptor::operator=(FileDescriptor &&other)
|
||||||
*
|
*
|
||||||
* Duplicating a FileDescriptor creates a duplicate of the wrapped file
|
* Duplicating a FileDescriptor creates a duplicate of the wrapped file
|
||||||
* descriptor and returns a new FileDescriptor instance that wraps the
|
* descriptor and returns a new FileDescriptor instance that wraps the
|
||||||
* duplicate. The fd() method of the original and duplicate instances will
|
* duplicate. The fd() function of the original and duplicate instances will
|
||||||
* return different values. The duplicate instance will not be affected by
|
* return different values. The duplicate instance will not be affected by
|
||||||
* destruction of the original instance or its copies.
|
* destruction of the original instance or its copies.
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file internal/formats.h
|
* \file internal/formats.h
|
||||||
* \brief Types and helper methods to handle libcamera image formats
|
* \brief Types and helper functions to handle libcamera image formats
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace libcamera {
|
namespace libcamera {
|
||||||
|
|
|
@ -120,7 +120,7 @@ FrameBuffer::Private::Private()
|
||||||
* \brief Set the request this buffer belongs to
|
* \brief Set the request this buffer belongs to
|
||||||
* \param[in] request Request to set
|
* \param[in] request Request to set
|
||||||
*
|
*
|
||||||
* For buffers added to requests by applications, this method is called by
|
* For buffers added to requests by applications, this function is called by
|
||||||
* Request::addBuffer() or Request::reuse(). For buffers internal to pipeline
|
* Request::addBuffer() or Request::reuse(). For buffers internal to pipeline
|
||||||
* handlers, it is called by the pipeline handlers themselves.
|
* handlers, it is called by the pipeline handlers themselves.
|
||||||
*/
|
*/
|
||||||
|
@ -199,7 +199,7 @@ FrameBuffer::FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie)
|
||||||
/**
|
/**
|
||||||
* \brief Retrieve the request this buffer belongs to
|
* \brief Retrieve the request this buffer belongs to
|
||||||
*
|
*
|
||||||
* The intended callers of this method are buffer completion handlers that
|
* The intended callers of this function are buffer completion handlers that
|
||||||
* need to associate a buffer to the request it belongs to.
|
* need to associate a buffer to the request it belongs to.
|
||||||
*
|
*
|
||||||
* A FrameBuffer is associated to a request by Request::addBuffer() and the
|
* A FrameBuffer is associated to a request by Request::addBuffer() and the
|
||||||
|
@ -238,9 +238,9 @@ Request *FrameBuffer::request() const
|
||||||
* \param[in] cookie Cookie to set
|
* \param[in] cookie Cookie to set
|
||||||
*
|
*
|
||||||
* The cookie belongs to the creator of the FrameBuffer. Its value may be
|
* The cookie belongs to the creator of the FrameBuffer. Its value may be
|
||||||
* modified at any time with this method. Applications and IPAs shall not modify
|
* modified at any time with this function. Applications and IPAs shall not
|
||||||
* the cookie value of buffers they haven't created themselves. The libcamera
|
* modify the cookie value of buffers they haven't created themselves. The
|
||||||
* core never modifies the buffer cookie.
|
* libcamera core never modifies the buffer cookie.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -77,7 +77,7 @@ FrameBufferAllocator::~FrameBufferAllocator()
|
||||||
* stopped, and the stream shall be part of the active camera configuration.
|
* stopped, and the stream shall be part of the active camera configuration.
|
||||||
*
|
*
|
||||||
* Upon successful allocation, the allocated buffers can be retrieved with the
|
* Upon successful allocation, the allocated buffers can be retrieved with the
|
||||||
* buffers() method.
|
* buffers() function.
|
||||||
*
|
*
|
||||||
* \return The number of allocated buffers on success or a negative error code
|
* \return The number of allocated buffers on success or a negative error code
|
||||||
* otherwise
|
* otherwise
|
||||||
|
@ -137,7 +137,7 @@ int FrameBufferAllocator::free(Stream *stream)
|
||||||
* \brief Retrieve the buffers allocated for a \a stream
|
* \brief Retrieve the buffers allocated for a \a stream
|
||||||
* \param[in] stream The stream to retrieve buffers for
|
* \param[in] stream The stream to retrieve buffers for
|
||||||
*
|
*
|
||||||
* This method shall only be called after successfully allocating buffers for
|
* This function shall only be called after successfully allocating buffers for
|
||||||
* \a stream with allocate(). The returned buffers are valid until free() is
|
* \a stream with allocate(). The returned buffers are valid until free() is
|
||||||
* called for the same stream or the FrameBufferAllocator instance is destroyed.
|
* called for the same stream or the FrameBufferAllocator instance is destroyed.
|
||||||
*
|
*
|
||||||
|
|
|
@ -651,7 +651,7 @@ Rectangle &Rectangle::translateBy(const Point &point)
|
||||||
* \brief Calculate the intersection of this Rectangle with another
|
* \brief Calculate the intersection of this Rectangle with another
|
||||||
* \param[in] bound The Rectangle that is intersected with this Rectangle
|
* \param[in] bound The Rectangle that is intersected with this Rectangle
|
||||||
*
|
*
|
||||||
* This method calculates the standard intersection of two rectangles. If the
|
* This function calculates the standard intersection of two rectangles. If the
|
||||||
* rectangles do not overlap in either the x or y direction, then the size
|
* rectangles do not overlap in either the x or y direction, then the size
|
||||||
* of that dimension in the result (its width or height) is set to zero. Even
|
* of that dimension in the result (its width or height) is set to zero. Even
|
||||||
* when one dimension is set to zero, note that the other dimension may still
|
* when one dimension is set to zero, note that the other dimension may still
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
* Due to IPC, synchronous communication between pipeline handlers and IPAs can
|
* Due to IPC, synchronous communication between pipeline handlers and IPAs can
|
||||||
* be costly. For that reason, functions that cannot afford the high cost
|
* be costly. For that reason, functions that cannot afford the high cost
|
||||||
* should be marked as [async] in the mojom file, and they will operate
|
* should be marked as [async] in the mojom file, and they will operate
|
||||||
* asynchronously. This implies that these methods don't return a status, and
|
* asynchronously. This implies that these functions don't return a status, and
|
||||||
* that all methods may copy their arguments. Synchronous functions are still
|
* that all functions may copy their arguments. Synchronous functions are still
|
||||||
* allowed, but should be used with caution.
|
* allowed, but should be used with caution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -84,11 +84,11 @@ namespace libcamera {
|
||||||
* include/libcamera/ipa/ (see the IPA Writers Guide for details
|
* include/libcamera/ipa/ (see the IPA Writers Guide for details
|
||||||
* on how to do so).
|
* on how to do so).
|
||||||
*
|
*
|
||||||
* Due to process isolation all arguments to the IPAInterface methods and
|
* Due to process isolation all arguments to the IPAInterface member functions
|
||||||
* signals may need to be transferred over IPC. The class thus uses serializable
|
* and signals may need to be transferred over IPC. The class thus uses
|
||||||
* data types only. The IPA C++ interface defines custom data structures that
|
* serializable data types only. The IPA C++ interface defines custom data
|
||||||
* mirror core libcamera structures when the latter are not suitable, such as
|
* structures that mirror core libcamera structures when the latter are not
|
||||||
* IPAStream to carry StreamConfiguration data.
|
* suitable, such as IPAStream to carry StreamConfiguration data.
|
||||||
*
|
*
|
||||||
* Custom data structures may also be defined in the mojom file, in which case
|
* Custom data structures may also be defined in the mojom file, in which case
|
||||||
* the (de)serialization will automatically be generated. If any other libcamera
|
* the (de)serialization will automatically be generated. If any other libcamera
|
||||||
|
|
|
@ -45,7 +45,7 @@ LOG_DEFINE_CATEGORY(IPAManager)
|
||||||
* ever run in the libcamera process.
|
* ever run in the libcamera process.
|
||||||
*
|
*
|
||||||
* To create an IPA context, pipeline handlers call the IPAManager::createIPA()
|
* To create an IPA context, pipeline handlers call the IPAManager::createIPA()
|
||||||
* method. For a directly loaded module, the manager calls the module's
|
* function. For a directly loaded module, the manager calls the module's
|
||||||
* ipaCreate() function directly and wraps the returned context in an
|
* ipaCreate() function directly and wraps the returned context in an
|
||||||
* IPAContextWrapper that exposes an IPAInterface.
|
* IPAContextWrapper that exposes an IPAInterface.
|
||||||
*
|
*
|
||||||
|
@ -89,9 +89,10 @@ LOG_DEFINE_CATEGORY(IPAManager)
|
||||||
* returned to the pipeline handler, and all interactions with the IPA context
|
* returned to the pipeline handler, and all interactions with the IPA context
|
||||||
* go the same interface regardless of process isolation.
|
* go the same interface regardless of process isolation.
|
||||||
*
|
*
|
||||||
* In all cases the data passed to the IPAInterface methods is serialized to
|
* In all cases the data passed to the IPAInterface member functions is
|
||||||
* Plain Old Data, either for the purpose of passing it to the IPA context
|
* serialized to Plain Old Data, either for the purpose of passing it to the IPA
|
||||||
* plain C API, or to transmit the data to the isolated process through IPC.
|
* context plain C API, or to transmit the data to the isolated process through
|
||||||
|
* IPC.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
IPAManager *IPAManager::self_ = nullptr;
|
IPAManager *IPAManager::self_ = nullptr;
|
||||||
|
@ -211,7 +212,7 @@ void IPAManager::parseDir(const char *libDir, unsigned int maxDepth,
|
||||||
* \param[in] libDir The directory to search for IPA modules
|
* \param[in] libDir The directory to search for IPA modules
|
||||||
* \param[in] maxDepth The maximum depth of sub-directories to search
|
* \param[in] maxDepth The maximum depth of sub-directories to search
|
||||||
*
|
*
|
||||||
* This method tries to create an IPAModule instance for every shared object
|
* This function tries to create an IPAModule instance for every shared object
|
||||||
* found in \a libDir, and skips invalid IPA modules.
|
* found in \a libDir, and skips invalid IPA modules.
|
||||||
*
|
*
|
||||||
* Sub-directories are searched up to a depth of \a maxDepth. A \a maxDepth
|
* Sub-directories are searched up to a depth of \a maxDepth. A \a maxDepth
|
||||||
|
|
|
@ -253,7 +253,7 @@ Span<const uint8_t> elfLoadSymbol(Span<const uint8_t> elf, const char *symbol)
|
||||||
* The IPA module shared object file must be of the same endianness and
|
* The IPA module shared object file must be of the same endianness and
|
||||||
* bitness as libcamera.
|
* bitness as libcamera.
|
||||||
*
|
*
|
||||||
* The caller shall call the isValid() method after constructing an
|
* The caller shall call the isValid() function after constructing an
|
||||||
* IPAModule instance to verify the validity of the IPAModule.
|
* IPAModule instance to verify the validity of the IPAModule.
|
||||||
*/
|
*/
|
||||||
IPAModule::IPAModule(const std::string &libPath)
|
IPAModule::IPAModule(const std::string &libPath)
|
||||||
|
@ -392,11 +392,11 @@ const std::string &IPAModule::path() const
|
||||||
* \brief Load the IPA implementation factory from the shared object
|
* \brief Load the IPA implementation factory from the shared object
|
||||||
*
|
*
|
||||||
* The IPA module shared object implements an IPAInterface object to be used
|
* The IPA module shared object implements an IPAInterface object to be used
|
||||||
* by pipeline handlers. This method loads the factory function from the
|
* by pipeline handlers. This function loads the factory function from the
|
||||||
* shared object. Later, createInterface() can be called to instantiate the
|
* shared object. Later, createInterface() can be called to instantiate the
|
||||||
* IPAInterface.
|
* IPAInterface.
|
||||||
*
|
*
|
||||||
* This method only needs to be called successfully once, after which
|
* This function only needs to be called successfully once, after which
|
||||||
* createInterface() can be called as many times as IPAInterface instances are
|
* createInterface() can be called as many times as IPAInterface instances are
|
||||||
* needed.
|
* needed.
|
||||||
*
|
*
|
||||||
|
@ -441,8 +441,8 @@ bool IPAModule::load()
|
||||||
/**
|
/**
|
||||||
* \brief Instantiate an IPA interface
|
* \brief Instantiate an IPA interface
|
||||||
*
|
*
|
||||||
* After loading the IPA module with load(), this method creates an instance of
|
* After loading the IPA module with load(), this function creates an instance
|
||||||
* the IPA module interface.
|
* of the IPA module interface.
|
||||||
*
|
*
|
||||||
* Calling this function on a module that has not yet been loaded, or an
|
* Calling this function on a module that has not yet been loaded, or an
|
||||||
* invalid module (as returned by load() and isValid(), respectively) is
|
* invalid module (as returned by load() and isValid(), respectively) is
|
||||||
|
@ -464,7 +464,7 @@ IPAInterface *IPAModule::createInterface()
|
||||||
* \param[in] minVersion Minimum acceptable version of IPA module
|
* \param[in] minVersion Minimum acceptable version of IPA module
|
||||||
* \param[in] maxVersion Maximum acceptable version of IPA module
|
* \param[in] maxVersion Maximum acceptable version of IPA module
|
||||||
*
|
*
|
||||||
* This method checks if this IPA module matches the \a pipe pipeline handler,
|
* This function checks if this IPA module matches the \a pipe pipeline handler,
|
||||||
* and the input version range.
|
* and the input version range.
|
||||||
*
|
*
|
||||||
* \return True if the pipeline handler matches the IPA module, or false otherwise
|
* \return True if the pipeline handler matches the IPA module, or false otherwise
|
||||||
|
|
|
@ -159,7 +159,7 @@ std::string IPAProxy::configurationFile(const std::string &name) const
|
||||||
*
|
*
|
||||||
* A proxy worker's executable could be found in either the global installation
|
* A proxy worker's executable could be found in either the global installation
|
||||||
* directory, or in the paths specified by the environment variable
|
* directory, or in the paths specified by the environment variable
|
||||||
* LIBCAMERA_IPA_PROXY_PATH. This method checks the global install directory
|
* LIBCAMERA_IPA_PROXY_PATH. This function checks the global install directory
|
||||||
* first, then LIBCAMERA_IPA_PROXY_PATH in order, and returns the full path to
|
* first, then LIBCAMERA_IPA_PROXY_PATH in order, and returns the full path to
|
||||||
* the proxy worker executable that is specified by file. The proxy worker
|
* the proxy worker executable that is specified by file. The proxy worker
|
||||||
* executable shall have exec permission.
|
* executable shall have exec permission.
|
||||||
|
@ -233,7 +233,7 @@ std::string IPAProxy::resolvePath(const std::string &file) const
|
||||||
*
|
*
|
||||||
* The IPAProxy can be Running, Stopped, or Stopping.
|
* The IPAProxy can be Running, Stopped, or Stopping.
|
||||||
*
|
*
|
||||||
* This state provides a means to ensure that asynchronous methods are only
|
* This state provides a means to ensure that asynchronous functions are only
|
||||||
* called while the proxy is running, and prevent new tasks being submitted
|
* called while the proxy is running, and prevent new tasks being submitted
|
||||||
* while still enabling events to complete when the IPAProxy is stopping.
|
* while still enabling events to complete when the IPAProxy is stopping.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -58,7 +58,7 @@ LOG_DEFINE_CATEGORY(IPCUnixSocket)
|
||||||
*
|
*
|
||||||
* Establishment of an IPC channel is asymmetrical. The side that initiates
|
* Establishment of an IPC channel is asymmetrical. The side that initiates
|
||||||
* communication first instantiates a local side socket and creates the channel
|
* communication first instantiates a local side socket and creates the channel
|
||||||
* with create(). The method returns a file descriptor for the remote side of
|
* with create(). The function returns a file descriptor for the remote side of
|
||||||
* the channel, which is passed to the remote process through an out-of-band
|
* the channel, which is passed to the remote process through an out-of-band
|
||||||
* communication method. The remote side then instantiates a socket, and binds
|
* communication method. The remote side then instantiates a socket, and binds
|
||||||
* it to the other side by passing the file descriptor to bind(). At that point
|
* it to the other side by passing the file descriptor to bind(). At that point
|
||||||
|
@ -80,11 +80,11 @@ IPCUnixSocket::~IPCUnixSocket()
|
||||||
/**
|
/**
|
||||||
* \brief Create an new IPC channel
|
* \brief Create an new IPC channel
|
||||||
*
|
*
|
||||||
* This method creates a new IPC channel. The socket instance is bound to the
|
* This function creates a new IPC channel. The socket instance is bound to the
|
||||||
* local side of the channel, and the method returns a file descriptor bound to
|
* local side of the channel, and the function returns a file descriptor bound
|
||||||
* the remote side. The caller is responsible for passing the file descriptor to
|
* to the remote side. The caller is responsible for passing the file descriptor
|
||||||
* the remote process, where it can be used with IPCUnixSocket::bind() to bind
|
* to the remote process, where it can be used with IPCUnixSocket::bind() to
|
||||||
* the remote side socket.
|
* bind the remote side socket.
|
||||||
*
|
*
|
||||||
* \return A file descriptor on success, negative error code on failure
|
* \return A file descriptor on success, negative error code on failure
|
||||||
*/
|
*/
|
||||||
|
@ -112,9 +112,9 @@ int IPCUnixSocket::create()
|
||||||
* \brief Bind to an existing IPC channel
|
* \brief Bind to an existing IPC channel
|
||||||
* \param[in] fd File descriptor
|
* \param[in] fd File descriptor
|
||||||
*
|
*
|
||||||
* This method binds the socket instance to an existing IPC channel identified
|
* This function binds the socket instance to an existing IPC channel identified
|
||||||
* by the file descriptor \a fd. The file descriptor is obtained from the
|
* by the file descriptor \a fd. The file descriptor is obtained from the
|
||||||
* IPCUnixSocket::create() method.
|
* IPCUnixSocket::create() function.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -162,7 +162,7 @@ bool IPCUnixSocket::isBound() const
|
||||||
* \brief Send a message payload
|
* \brief Send a message payload
|
||||||
* \param[in] payload Message payload to send
|
* \param[in] payload Message payload to send
|
||||||
*
|
*
|
||||||
* This method queues the message payload for transmission to the other end of
|
* This function queues the message payload for transmission to the other end of
|
||||||
* the IPC channel. It returns immediately, before the message is delivered to
|
* the IPC channel. It returns immediately, before the message is delivered to
|
||||||
* the remote side.
|
* the remote side.
|
||||||
*
|
*
|
||||||
|
@ -197,7 +197,7 @@ int IPCUnixSocket::send(const Payload &payload)
|
||||||
* \brief Receive a message payload
|
* \brief Receive a message payload
|
||||||
* \param[out] payload Payload where to write the received message
|
* \param[out] payload Payload where to write the received message
|
||||||
*
|
*
|
||||||
* This method receives the message payload from the IPC channel and writes it
|
* This function receives the message payload from the IPC channel and writes it
|
||||||
* to the \a payload. If no message payload is available, it returns
|
* to the \a payload. If no message payload is available, it returns
|
||||||
* immediately with -EAGAIN. The \ref readyRead signal shall be used to receive
|
* immediately with -EAGAIN. The \ref readyRead signal shall be used to receive
|
||||||
* notification of message availability.
|
* notification of message availability.
|
||||||
|
@ -329,7 +329,7 @@ void IPCUnixSocket::dataNotifier([[maybe_unused]] EventNotifier *notifier)
|
||||||
/*
|
/*
|
||||||
* If the payload has arrived, disable the notifier and emit the
|
* If the payload has arrived, disable the notifier and emit the
|
||||||
* readyRead signal. The notifier will be reenabled by the receive()
|
* readyRead signal. The notifier will be reenabled by the receive()
|
||||||
* method.
|
* function.
|
||||||
*/
|
*/
|
||||||
struct pollfd fds = { fd_, POLLIN, 0 };
|
struct pollfd fds = { fd_, POLLIN, 0 };
|
||||||
ret = poll(&fds, 1, 0);
|
ret = poll(&fds, 1, 0);
|
||||||
|
|
|
@ -134,7 +134,7 @@ void MediaDevice::release()
|
||||||
* they provide at all times, while still allowing an instance to lock a
|
* they provide at all times, while still allowing an instance to lock a
|
||||||
* resource while it prepares to actively use a camera from the resource.
|
* resource while it prepares to actively use a camera from the resource.
|
||||||
*
|
*
|
||||||
* This method shall not be called from a pipeline handler implementation
|
* This function shall not be called from a pipeline handler implementation
|
||||||
* directly, as the base PipelineHandler implementation handles this on the
|
* directly, as the base PipelineHandler implementation handles this on the
|
||||||
* behalf of the specified implementation.
|
* behalf of the specified implementation.
|
||||||
*
|
*
|
||||||
|
@ -161,7 +161,7 @@ bool MediaDevice::lock()
|
||||||
/**
|
/**
|
||||||
* \brief Unlock the device and free it for use for libcamera instances
|
* \brief Unlock the device and free it for use for libcamera instances
|
||||||
*
|
*
|
||||||
* This method shall not be called from a pipeline handler implementation
|
* This function shall not be called from a pipeline handler implementation
|
||||||
* directly, as the base PipelineHandler implementation handles this on the
|
* directly, as the base PipelineHandler implementation handles this on the
|
||||||
* behalf of the specified implementation.
|
* behalf of the specified implementation.
|
||||||
*
|
*
|
||||||
|
|
|
@ -724,7 +724,7 @@ int ImgUDevice::stop()
|
||||||
/**
|
/**
|
||||||
* \brief Enable or disable a single link on the ImgU instance
|
* \brief Enable or disable a single link on the ImgU instance
|
||||||
*
|
*
|
||||||
* This method assumes the media device associated with the ImgU instance
|
* This function assumes the media device associated with the ImgU instance
|
||||||
* is open.
|
* is open.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
|
@ -748,7 +748,7 @@ int ImgUDevice::linkSetup(const std::string &source, unsigned int sourcePad,
|
||||||
* \brief Enable or disable all media links in the ImgU instance to prepare
|
* \brief Enable or disable all media links in the ImgU instance to prepare
|
||||||
* for capture operations
|
* for capture operations
|
||||||
*
|
*
|
||||||
* \todo This method will probably be removed or changed once links will be
|
* \todo This function will probably be removed or changed once links will be
|
||||||
* enabled or disabled selectively.
|
* enabled or disabled selectively.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
|
|
|
@ -48,7 +48,7 @@ LOG_DEFINE_CATEGORY(Pipeline)
|
||||||
*
|
*
|
||||||
* Pipeline handlers are expected to extend this base class with platform
|
* Pipeline handlers are expected to extend this base class with platform
|
||||||
* specific implementation, associate instances of the derived classes
|
* specific implementation, associate instances of the derived classes
|
||||||
* using the registerCamera() method, and access them at a later time
|
* using the registerCamera() function, and access them at a later time
|
||||||
* with cameraData().
|
* with cameraData().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ LOG_DEFINE_CATEGORY(Pipeline)
|
||||||
*
|
*
|
||||||
* In order to honour the std::enable_shared_from_this<> contract,
|
* In order to honour the std::enable_shared_from_this<> contract,
|
||||||
* PipelineHandler instances shall never be constructed manually, but always
|
* PipelineHandler instances shall never be constructed manually, but always
|
||||||
* through the PipelineHandlerFactory::create() method implemented by the
|
* through the PipelineHandlerFactory::create() function implemented by the
|
||||||
* respective factories.
|
* respective factories.
|
||||||
*/
|
*/
|
||||||
PipelineHandler::PipelineHandler(CameraManager *manager)
|
PipelineHandler::PipelineHandler(CameraManager *manager)
|
||||||
|
@ -209,8 +209,8 @@ MediaDevice *PipelineHandler::acquireMediaDevice(DeviceEnumerator *enumerator,
|
||||||
/**
|
/**
|
||||||
* \brief Lock all media devices acquired by the pipeline
|
* \brief Lock all media devices acquired by the pipeline
|
||||||
*
|
*
|
||||||
* This method shall not be called from pipeline handler implementation, as the
|
* This function shall not be called from pipeline handler implementation, as
|
||||||
* Camera class handles locking directly.
|
* the Camera class handles locking directly.
|
||||||
*
|
*
|
||||||
* \context This function is \threadsafe.
|
* \context This function is \threadsafe.
|
||||||
*
|
*
|
||||||
|
@ -233,8 +233,8 @@ bool PipelineHandler::lock()
|
||||||
/**
|
/**
|
||||||
* \brief Unlock all media devices acquired by the pipeline
|
* \brief Unlock all media devices acquired by the pipeline
|
||||||
*
|
*
|
||||||
* This method shall not be called from pipeline handler implementation, as the
|
* This function shall not be called from pipeline handler implementation, as
|
||||||
* Camera class handles locking directly.
|
* the Camera class handles locking directly.
|
||||||
*
|
*
|
||||||
* \context This function is \threadsafe.
|
* \context This function is \threadsafe.
|
||||||
*
|
*
|
||||||
|
@ -311,7 +311,7 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
|
||||||
*
|
*
|
||||||
* When configuring the camera the pipeline handler shall associate a Stream
|
* When configuring the camera the pipeline handler shall associate a Stream
|
||||||
* instance to each StreamConfiguration entry in the CameraConfiguration using
|
* instance to each StreamConfiguration entry in the CameraConfiguration using
|
||||||
* the StreamConfiguration::setStream() method.
|
* the StreamConfiguration::setStream() function.
|
||||||
*
|
*
|
||||||
* \context This function is called from the CameraManager thread.
|
* \context This function is called from the CameraManager thread.
|
||||||
*
|
*
|
||||||
|
@ -325,13 +325,13 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
|
||||||
* \param[in] stream The stream to allocate buffers for
|
* \param[in] stream The stream to allocate buffers for
|
||||||
* \param[out] buffers Array of buffers successfully allocated
|
* \param[out] buffers Array of buffers successfully allocated
|
||||||
*
|
*
|
||||||
* This method allocates buffers for the \a stream from the devices associated
|
* This function allocates buffers for the \a stream from the devices associated
|
||||||
* with the stream in the corresponding pipeline handler. Those buffers shall be
|
* with the stream in the corresponding pipeline handler. Those buffers shall be
|
||||||
* suitable to be added to a Request for the stream, and shall be mappable to
|
* suitable to be added to a Request for the stream, and shall be mappable to
|
||||||
* the CPU through their associated dmabufs with mmap().
|
* the CPU through their associated dmabufs with mmap().
|
||||||
*
|
*
|
||||||
* The method may only be called after the Camera has been configured and before
|
* The function may only be called after the Camera has been configured and
|
||||||
* it gets started, or after it gets stopped. It shall be called only for
|
* before it gets started, or after it gets stopped. It shall be called only for
|
||||||
* streams that are part of the active camera configuration.
|
* streams that are part of the active camera configuration.
|
||||||
*
|
*
|
||||||
* The only intended caller is Camera::exportFrameBuffers().
|
* The only intended caller is Camera::exportFrameBuffers().
|
||||||
|
@ -349,8 +349,8 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
|
||||||
* \param[in] controls Controls to be applied before starting the Camera
|
* \param[in] controls Controls to be applied before starting the Camera
|
||||||
*
|
*
|
||||||
* Start the group of streams that have been configured for capture by
|
* Start the group of streams that have been configured for capture by
|
||||||
* \a configure(). The intended caller of this method is the Camera class which
|
* \a configure(). The intended caller of this function is the Camera class
|
||||||
* will in turn be called from the application to indicate that it has
|
* which will in turn be called from the application to indicate that it has
|
||||||
* configured the streams and is ready to capture.
|
* configured the streams and is ready to capture.
|
||||||
*
|
*
|
||||||
* \context This function is called from the CameraManager thread.
|
* \context This function is called from the CameraManager thread.
|
||||||
|
@ -363,8 +363,8 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
|
||||||
* \brief Stop capturing from all running streams
|
* \brief Stop capturing from all running streams
|
||||||
* \param[in] camera The camera to stop
|
* \param[in] camera The camera to stop
|
||||||
*
|
*
|
||||||
* This method stops capturing and processing requests immediately. All pending
|
* This function stops capturing and processing requests immediately. All
|
||||||
* requests are cancelled and complete immediately in an error state.
|
* pending requests are cancelled and complete immediately in an error state.
|
||||||
*
|
*
|
||||||
* \context This function is called from the CameraManager thread.
|
* \context This function is called from the CameraManager thread.
|
||||||
*/
|
*/
|
||||||
|
@ -373,7 +373,7 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
|
||||||
* \brief Determine if the camera has any requests pending
|
* \brief Determine if the camera has any requests pending
|
||||||
* \param[in] camera The camera to check
|
* \param[in] camera The camera to check
|
||||||
*
|
*
|
||||||
* This method determines if there are any requests queued to the pipeline
|
* This function determines if there are any requests queued to the pipeline
|
||||||
* awaiting processing.
|
* awaiting processing.
|
||||||
*
|
*
|
||||||
* \return True if there are pending requests, or false otherwise
|
* \return True if there are pending requests, or false otherwise
|
||||||
|
@ -389,15 +389,15 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const
|
||||||
* \brief Queue a request
|
* \brief Queue a request
|
||||||
* \param[in] request The request to queue
|
* \param[in] request The request to queue
|
||||||
*
|
*
|
||||||
* This method queues a capture request to the pipeline handler for processing.
|
* This function queues a capture request to the pipeline handler for
|
||||||
* The request is first added to the internal list of queued requests, and
|
* processing. The request is first added to the internal list of queued
|
||||||
* then passed to the pipeline handler with a call to queueRequestDevice().
|
* requests, and then passed to the pipeline handler with a call to
|
||||||
* If the pipeline handler fails in queuing the request to the hardware the
|
* queueRequestDevice(). If the pipeline handler fails in queuing the request
|
||||||
* request is cancelled.
|
* to the hardware the request is cancelled.
|
||||||
*
|
*
|
||||||
* Keeping track of queued requests ensures automatic completion of all requests
|
* Keeping track of queued requests ensures automatic completion of all requests
|
||||||
* when the pipeline handler is stopped with stop(). Request completion shall be
|
* when the pipeline handler is stopped with stop(). Request completion shall be
|
||||||
* signalled by the pipeline handler using the completeRequest() method.
|
* signalled by the pipeline handler using the completeRequest() function.
|
||||||
*
|
*
|
||||||
* \context This function is called from the CameraManager thread.
|
* \context This function is called from the CameraManager thread.
|
||||||
*/
|
*/
|
||||||
|
@ -424,7 +424,7 @@ void PipelineHandler::queueRequest(Request *request)
|
||||||
* \param[in] camera The camera to queue the request to
|
* \param[in] camera The camera to queue the request to
|
||||||
* \param[in] request The request to queue
|
* \param[in] request The request to queue
|
||||||
*
|
*
|
||||||
* This method queues a capture request to the device for processing. The
|
* This function queues a capture request to the device for processing. The
|
||||||
* request contains a set of buffers associated with streams and a set of
|
* request contains a set of buffers associated with streams and a set of
|
||||||
* parameters. The pipeline handler shall program the device to ensure that the
|
* parameters. The pipeline handler shall program the device to ensure that the
|
||||||
* 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
|
||||||
|
@ -440,8 +440,8 @@ void PipelineHandler::queueRequest(Request *request)
|
||||||
* \param[in] request The request the buffer belongs to
|
* \param[in] request The request the buffer belongs to
|
||||||
* \param[in] buffer The buffer that has completed
|
* \param[in] buffer The buffer that has completed
|
||||||
*
|
*
|
||||||
* This method shall be called by pipeline handlers to signal completion of the
|
* This function shall be called by pipeline handlers to signal completion of
|
||||||
* \a buffer part of the \a request. It notifies applications of buffer
|
* the \a buffer part of the \a request. It notifies applications of buffer
|
||||||
* completion and updates the request's internal buffer tracking. The request
|
* completion and updates the request's internal buffer tracking. The request
|
||||||
* is not completed automatically when the last buffer completes to give
|
* is not completed automatically when the last buffer completes to give
|
||||||
* pipeline handlers a chance to perform any operation that may still be
|
* pipeline handlers a chance to perform any operation that may still be
|
||||||
|
@ -463,11 +463,11 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
|
||||||
* \brief Signal request completion
|
* \brief Signal request completion
|
||||||
* \param[in] request The request that has completed
|
* \param[in] request The request that has completed
|
||||||
*
|
*
|
||||||
* The pipeline handler shall call this method to notify the \a camera that the
|
* The pipeline handler shall call this function to notify the \a camera that
|
||||||
* request has completed. The request is no longer managed by the pipeline
|
* the request has completed. The request is no longer managed by the pipeline
|
||||||
* handler and shall not be accessed once this method returns.
|
* handler and shall not be accessed once this function returns.
|
||||||
*
|
*
|
||||||
* This method ensures that requests will be returned to the application in
|
* This function ensures that requests will be returned to the application in
|
||||||
* submission order, the pipeline handler may call it on any complete request
|
* submission order, the pipeline handler may call it on any complete request
|
||||||
* without any ordering constraint.
|
* without any ordering constraint.
|
||||||
*
|
*
|
||||||
|
@ -497,7 +497,7 @@ void PipelineHandler::completeRequest(Request *request)
|
||||||
* \param[in] camera The camera to be added
|
* \param[in] camera The camera to be added
|
||||||
* \param[in] data Pipeline-specific data for the camera
|
* \param[in] data Pipeline-specific data for the camera
|
||||||
*
|
*
|
||||||
* This method is called by pipeline handlers to register the cameras they
|
* This function is called by pipeline handlers to register the cameras they
|
||||||
* handle with the camera manager. It associates the pipeline-specific \a data
|
* handle with the camera manager. It associates the pipeline-specific \a data
|
||||||
* with the camera, for later retrieval with cameraData(). Ownership of \a data
|
* with the camera, for later retrieval with cameraData(). Ownership of \a data
|
||||||
* is transferred to the PipelineHandler.
|
* is transferred to the PipelineHandler.
|
||||||
|
|
|
@ -95,7 +95,7 @@ void ProcessManager::sighandler([[maybe_unused]] EventNotifier *notifier)
|
||||||
* \brief Register process with process manager
|
* \brief Register process with process manager
|
||||||
* \param[in] proc Process to register
|
* \param[in] proc Process to register
|
||||||
*
|
*
|
||||||
* This method registers the \a proc with the process manager. It
|
* This function registers the \a proc with the process manager. It
|
||||||
* shall be called by the parent process after successfully forking, in
|
* shall be called by the parent process after successfully forking, in
|
||||||
* order to let the parent signal process termination.
|
* order to let the parent signal process termination.
|
||||||
*/
|
*/
|
||||||
|
@ -164,7 +164,7 @@ ProcessManager *ProcessManager::instance()
|
||||||
/**
|
/**
|
||||||
* \brief Retrieve the Process manager's write pipe
|
* \brief Retrieve the Process manager's write pipe
|
||||||
*
|
*
|
||||||
* This method is meant only to be used by the static signal handler.
|
* This function is meant only to be used by the static signal handler.
|
||||||
*
|
*
|
||||||
* \return Pipe for writing
|
* \return Pipe for writing
|
||||||
*/
|
*/
|
||||||
|
@ -176,7 +176,7 @@ int ProcessManager::writePipe() const
|
||||||
/**
|
/**
|
||||||
* \brief Retrive the old signal action data
|
* \brief Retrive the old signal action data
|
||||||
*
|
*
|
||||||
* This method is meant only to be used by the static signal handler.
|
* This function is meant only to be used by the static signal handler.
|
||||||
*
|
*
|
||||||
* \return The old signal action data
|
* \return The old signal action data
|
||||||
*/
|
*/
|
||||||
|
@ -317,7 +317,7 @@ int Process::isolate()
|
||||||
* \brief SIGCHLD handler
|
* \brief SIGCHLD handler
|
||||||
* \param[in] wstatus The status as output by waitpid()
|
* \param[in] wstatus The status as output by waitpid()
|
||||||
*
|
*
|
||||||
* This method is called when the process associated with Process terminates.
|
* This function is called when the process associated with Process terminates.
|
||||||
* It emits the Process::finished signal.
|
* It emits the Process::finished signal.
|
||||||
*/
|
*/
|
||||||
void Process::died(int wstatus)
|
void Process::died(int wstatus)
|
||||||
|
@ -346,7 +346,7 @@ void Process::died(int wstatus)
|
||||||
* \fn Process::exitCode()
|
* \fn Process::exitCode()
|
||||||
* \brief Retrieve the exit code of the process
|
* \brief Retrieve the exit code of the process
|
||||||
*
|
*
|
||||||
* This method is only valid if exitStatus() returned NormalExit.
|
* This function is only valid if exitStatus() returned NormalExit.
|
||||||
*
|
*
|
||||||
* \return Exit code
|
* \return Exit code
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -69,10 +69,9 @@ LOG_DEFINE_CATEGORY(Request)
|
||||||
* \param[in] cookie Opaque cookie for application use
|
* \param[in] cookie Opaque cookie for application use
|
||||||
*
|
*
|
||||||
* The \a cookie is stored in the request and is accessible through the
|
* The \a cookie is stored in the request and is accessible through the
|
||||||
* cookie() method at any time. It is typically used by applications to map the
|
* cookie() function at any time. It is typically used by applications to map
|
||||||
* request to an external resource in the request completion handler, and is
|
* the request to an external resource in the request completion handler, and is
|
||||||
* completely opaque to libcamera.
|
* completely opaque to libcamera.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
Request::Request(Camera *camera, uint64_t cookie)
|
Request::Request(Camera *camera, uint64_t cookie)
|
||||||
: camera_(camera), sequence_(0), cookie_(cookie),
|
: camera_(camera), sequence_(0), cookie_(cookie),
|
||||||
|
@ -143,7 +142,7 @@ void Request::reuse(ReuseFlag flags)
|
||||||
*
|
*
|
||||||
* Requests store a list of controls to be applied to all frames captured for
|
* Requests store a list of controls to be applied to all frames captured for
|
||||||
* the request. They are created with an empty list of controls that can be
|
* the request. They are created with an empty list of controls that can be
|
||||||
* accessed through this method. Control values can be retrieved using
|
* accessed through this function. Control values can be retrieved using
|
||||||
* ControlList::get() and updated using ControlList::set().
|
* ControlList::get() and updated using ControlList::set().
|
||||||
*
|
*
|
||||||
* Only controls supported by the camera to which this request will be
|
* Only controls supported by the camera to which this request will be
|
||||||
|
@ -173,7 +172,7 @@ void Request::reuse(ReuseFlag flags)
|
||||||
* callback is called.
|
* callback is called.
|
||||||
*
|
*
|
||||||
* A request can only contain one buffer per stream. If a buffer has already
|
* A request can only contain one buffer per stream. If a buffer has already
|
||||||
* been added to the request for the same stream, this method returns -EEXIST.
|
* been added to the request for the same stream, this function returns -EEXIST.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
* \retval -EEXIST The request already contains a buffer for the stream
|
* \retval -EEXIST The request already contains a buffer for the stream
|
||||||
|
@ -325,7 +324,7 @@ void Request::cancel()
|
||||||
* pending buffers. This function removes the \a buffer from the set to mark it
|
* pending buffers. This function removes the \a buffer from the set to mark it
|
||||||
* as complete. All buffers associate with the request shall be marked as
|
* as complete. All buffers associate with the request shall be marked as
|
||||||
* complete by calling this function once and once only before reporting the
|
* complete by calling this function once and once only before reporting the
|
||||||
* request as complete with the complete() method.
|
* request as complete with the complete() function.
|
||||||
*
|
*
|
||||||
* \return True if all buffers contained in the request have completed, false
|
* \return True if all buffers contained in the request have completed, false
|
||||||
* otherwise
|
* otherwise
|
||||||
|
|
|
@ -276,7 +276,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \todo This method is deprecated and should be removed once all pipeline
|
* \todo This function is deprecated and should be removed once all pipeline
|
||||||
* handlers provide StreamFormats.
|
* handlers provide StreamFormats.
|
||||||
*/
|
*/
|
||||||
StreamConfiguration::StreamConfiguration()
|
StreamConfiguration::StreamConfiguration()
|
||||||
|
@ -334,7 +334,7 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
|
||||||
* \brief Retrieve the stream associated with the configuration
|
* \brief Retrieve the stream associated with the configuration
|
||||||
*
|
*
|
||||||
* When a camera is configured with Camera::configure() Stream instances are
|
* When a camera is configured with Camera::configure() Stream instances are
|
||||||
* associated with each stream configuration entry. This method retrieves the
|
* associated with each stream configuration entry. This function retrieves the
|
||||||
* associated Stream, which remains valid until the next call to
|
* associated Stream, which remains valid until the next call to
|
||||||
* Camera::configure() or Camera::release().
|
* Camera::configure() or Camera::release().
|
||||||
*
|
*
|
||||||
|
@ -345,8 +345,8 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
|
||||||
* \fn StreamConfiguration::setStream()
|
* \fn StreamConfiguration::setStream()
|
||||||
* \brief Associate a stream with a configuration
|
* \brief Associate a stream with a configuration
|
||||||
*
|
*
|
||||||
* This method is meant for the PipelineHandler::configure() method and shall
|
* This function is meant for the PipelineHandler::configure() function and
|
||||||
* not be called by applications.
|
* shall not be called by applications.
|
||||||
*
|
*
|
||||||
* \param[in] stream The stream
|
* \param[in] stream The stream
|
||||||
*/
|
*/
|
||||||
|
@ -355,10 +355,11 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
|
||||||
* \fn StreamConfiguration::formats()
|
* \fn StreamConfiguration::formats()
|
||||||
* \brief Retrieve advisory stream format information
|
* \brief Retrieve advisory stream format information
|
||||||
*
|
*
|
||||||
* This method retrieves information about the pixel formats and sizes supported
|
* This function retrieves information about the pixel formats and sizes
|
||||||
* by the stream configuration. The sizes are advisory and not all of them are
|
* supported by the stream configuration. The sizes are advisory and not all of
|
||||||
* guaranteed to be supported by the stream. Users shall always inspect the size
|
* them are guaranteed to be supported by the stream. Users shall always inspect
|
||||||
* in the stream configuration after calling CameraConfiguration::validate().
|
* the size in the stream configuration after calling
|
||||||
|
* CameraConfiguration::validate().
|
||||||
*
|
*
|
||||||
* \return Stream formats information
|
* \return Stream formats information
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,9 +35,9 @@ LOG_DEFINE_CATEGORY(V4L2)
|
||||||
* \class V4L2Device
|
* \class V4L2Device
|
||||||
* \brief Base class for V4L2VideoDevice and V4L2Subdevice
|
* \brief Base class for V4L2VideoDevice and V4L2Subdevice
|
||||||
*
|
*
|
||||||
* The V4L2Device class groups together the methods and fields common to
|
* The V4L2Device class groups together the functions and fields common to
|
||||||
* both the V4L2VideoDevice and V4L2Subdevice classes, and provides a base
|
* both the V4L2VideoDevice and V4L2Subdevice classes, and provides a base
|
||||||
* class with methods to open and close the device node associated with the
|
* class with functions to open and close the device node associated with the
|
||||||
* device and to perform IOCTL system calls on it.
|
* device and to perform IOCTL system calls on it.
|
||||||
*
|
*
|
||||||
* The V4L2Device class cannot be instantiated directly, as its constructor
|
* The V4L2Device class cannot be instantiated directly, as its constructor
|
||||||
|
@ -100,15 +100,15 @@ int V4L2Device::open(unsigned int flags)
|
||||||
* \brief Set the file descriptor of a V4L2 device
|
* \brief Set the file descriptor of a V4L2 device
|
||||||
* \param[in] fd The file descriptor handle
|
* \param[in] fd The file descriptor handle
|
||||||
*
|
*
|
||||||
* This method allows a device to provide an already opened file descriptor
|
* This function allows a device to provide an already opened file descriptor
|
||||||
* referring to the V4L2 device node, instead of opening it with open(). This
|
* referring to the V4L2 device node, instead of opening it with open(). This
|
||||||
* can be used for V4L2 M2M devices where a single video device node is used for
|
* can be used for V4L2 M2M devices where a single video device node is used for
|
||||||
* both the output and capture devices, or when receiving an open file
|
* both the output and capture devices, or when receiving an open file
|
||||||
* descriptor in a context that doesn't have permission to open the device node
|
* descriptor in a context that doesn't have permission to open the device node
|
||||||
* itself.
|
* itself.
|
||||||
*
|
*
|
||||||
* This method and the open() method are mutually exclusive, only one of the two
|
* This function and the open() function are mutually exclusive, only one of the
|
||||||
* shall be used for a V4L2Device instance.
|
* two shall be used for a V4L2Device instance.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -160,13 +160,13 @@ void V4L2Device::close()
|
||||||
* \brief Read controls from the device
|
* \brief Read controls from the device
|
||||||
* \param[in] ids The list of controls to read, specified by their ID
|
* \param[in] ids The list of controls to read, specified by their ID
|
||||||
*
|
*
|
||||||
* This method reads the value of all controls contained in \a ids, and returns
|
* This function reads the value of all controls contained in \a ids, and
|
||||||
* their values as a ControlList.
|
* returns their values as a ControlList.
|
||||||
*
|
*
|
||||||
* If any control in \a ids is not supported by the device, is disabled (i.e.
|
* If any control in \a ids is not supported by the device, is disabled (i.e.
|
||||||
* has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
|
* has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
|
||||||
* during validation of the requested controls, no control is read and this
|
* during validation of the requested controls, no control is read and this
|
||||||
* method returns an empty control list.
|
* function returns an empty control list.
|
||||||
*
|
*
|
||||||
* \return The control values in a ControlList on success, or an empty list on
|
* \return The control values in a ControlList on success, or an empty list on
|
||||||
* error
|
* error
|
||||||
|
@ -256,14 +256,14 @@ ControlList V4L2Device::getControls(const std::vector<uint32_t> &ids)
|
||||||
* \brief Write controls to the device
|
* \brief Write controls to the device
|
||||||
* \param[in] ctrls The list of controls to write
|
* \param[in] ctrls The list of controls to write
|
||||||
*
|
*
|
||||||
* This method writes the value of all controls contained in \a ctrls, and
|
* This function writes the value of all controls contained in \a ctrls, and
|
||||||
* stores the values actually applied to the device in the corresponding
|
* stores the values actually applied to the device in the corresponding
|
||||||
* \a ctrls entry.
|
* \a ctrls entry.
|
||||||
*
|
*
|
||||||
* If any control in \a ctrls is not supported by the device, is disabled (i.e.
|
* If any control in \a ctrls is not supported by the device, is disabled (i.e.
|
||||||
* has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, if any other error
|
* has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, if any other error
|
||||||
* occurs during validation of the requested controls, no control is written and
|
* occurs during validation of the requested controls, no control is written and
|
||||||
* this method returns -EINVAL.
|
* this function returns -EINVAL.
|
||||||
*
|
*
|
||||||
* If an error occurs while writing the controls, the index of the first
|
* If an error occurs while writing the controls, the index of the first
|
||||||
* control that couldn't be written is returned. All controls below that index
|
* control that couldn't be written is returned. All controls below that index
|
||||||
|
|
|
@ -589,15 +589,15 @@ int V4L2VideoDevice::open()
|
||||||
* \param[in] handle The file descriptor to set
|
* \param[in] handle The file descriptor to set
|
||||||
* \param[in] type The device type to operate on
|
* \param[in] type The device type to operate on
|
||||||
*
|
*
|
||||||
* This methods opens a video device from the existing file descriptor \a
|
* This function opens a video device from the existing file descriptor \a
|
||||||
* handle. Like open(), this method queries the capabilities of the device, but
|
* handle. Like open(), this function queries the capabilities of the device,
|
||||||
* handles it according to the given device \a type instead of determining its
|
* but handles it according to the given device \a type instead of determining
|
||||||
* type from the capabilities. This can be used to force a given device type for
|
* its type from the capabilities. This can be used to force a given device type
|
||||||
* memory-to-memory devices.
|
* for memory-to-memory devices.
|
||||||
*
|
*
|
||||||
* The file descriptor \a handle is duplicated, and the caller is responsible
|
* The file descriptor \a handle is duplicated, and the caller is responsible
|
||||||
* for closing the \a handle when it has no further use for it. The close()
|
* for closing the \a handle when it has no further use for it. The close()
|
||||||
* method will close the duplicated file descriptor, leaving \a handle
|
* function will close the duplicated file descriptor, leaving \a handle
|
||||||
* untouched.
|
* untouched.
|
||||||
*
|
*
|
||||||
* \return 0 on success or a negative error code otherwise
|
* \return 0 on success or a negative error code otherwise
|
||||||
|
@ -1489,8 +1489,8 @@ void V4L2VideoDevice::bufferAvailable([[maybe_unused]] EventNotifier *notifier)
|
||||||
/**
|
/**
|
||||||
* \brief Dequeue the next available buffer from the video device
|
* \brief Dequeue the next available buffer from the video device
|
||||||
*
|
*
|
||||||
* This method dequeues the next available buffer from the device. If no buffer
|
* This function dequeues the next available buffer from the device. If no
|
||||||
* is available to be dequeued it will return nullptr immediately.
|
* buffer is available to be dequeued it will return nullptr immediately.
|
||||||
*
|
*
|
||||||
* \return A pointer to the dequeued buffer on success, or nullptr otherwise
|
* \return A pointer to the dequeued buffer on success, or nullptr otherwise
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -56,7 +56,7 @@ class MediaDeviceLinkTest : public MediaDeviceTest
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test if link can be consistently retrieved through the
|
* Test if link can be consistently retrieved through the
|
||||||
* different methods the media device offers.
|
* different functions the media device offers.
|
||||||
*/
|
*/
|
||||||
string linkName("'Debayer A':[1] -> 'Scaler':[0]'");
|
string linkName("'Debayer A':[1] -> 'Scaler':[0]'");
|
||||||
MediaLink *link = media_->link("Debayer A", 1, "Scaler", 0);
|
MediaLink *link = media_->link("Debayer A", 1, "Scaler", 0);
|
||||||
|
|
|
@ -41,8 +41,8 @@ class BaseClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
* A virtual method is required in the base class, otherwise the compiler
|
* A virtual function is required in the base class, otherwise the
|
||||||
* will always store Object before BaseClass in memory.
|
* compiler will always store Object before BaseClass in memory.
|
||||||
*/
|
*/
|
||||||
virtual ~BaseClass()
|
virtual ~BaseClass()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue