libcamera: camera: Implement the threading model
Document the threading model of the Camera class and implement it. Selected functions become thread-safe, and require a few functions of the PipelineHandler class to be called through cross-thread invocation as the pipeline handlers live in the camera manager thread, while the Camera class is mostly accessed from the application thread. The PipelineHandler is made to inherit from the Object class to support this. Disconnection is currently left out as it is not implemented in pipeline handlers, and isn't fully supported in the Camera class either. This will be revisited when implementing proper hotplug support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <ipa/ipa_interface.h>
|
||||
#include <libcamera/controls.h>
|
||||
#include <libcamera/object.h>
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
namespace libcamera {
|
||||
@@ -51,7 +52,8 @@ private:
|
||||
CameraData &operator=(const CameraData &) = delete;
|
||||
};
|
||||
|
||||
class PipelineHandler : public std::enable_shared_from_this<PipelineHandler>
|
||||
class PipelineHandler : public std::enable_shared_from_this<PipelineHandler>,
|
||||
public Object
|
||||
{
|
||||
public:
|
||||
PipelineHandler(CameraManager *manager);
|
||||
|
||||
Reference in New Issue
Block a user