28class CameraConfiguration;
30class DeviceEnumerator;
52 Span<const StreamRole> roles) = 0;
56 std::vector<std::unique_ptr<FrameBuffer>> *buffers) = 0;
69 const std::string &
name)
const;
71 const char *
name()
const {
return name_; }
85 void unlockMediaDevices();
88 virtual void disconnect();
90 void doQueueRequest(
Request *request);
91 void doQueueRequests();
93 std::vector<std::shared_ptr<MediaDevice>> mediaDevices_;
94 std::vector<std::weak_ptr<Camera>> cameras_;
96 std::queue<Request *> waitingRequests_;
101 unsigned int useCount_ LIBCAMERA_TSA_GUARDED_BY(lock_);
114 const std::string &
name()
const {
return name_; }
116 static std::vector<PipelineHandlerFactoryBase *> &
factories();
122 virtual std::unique_ptr<PipelineHandler>
128template<
typename _PipelineHandler>
137 std::unique_ptr<PipelineHandler>
140 return std::make_unique<_PipelineHandler>(manager);
144#define REGISTER_PIPELINE_HANDLER(handler, name) \
145 static PipelineHandlerFactory<handler> global_##handler##Factory(name);
Hold configuration for streams of the camera.
Definition camera.h:60
Provide access and manage all cameras in the system.
Definition camera_manager.h:24
Camera device.
Definition camera.h:115
Associate a list of ControlId with their values for an object.
Definition controls.h:350
Enumerate, store and search media devices.
Definition device_enumerator.h:35
Description of a media device search pattern.
Definition device_enumerator.h:21
Frame buffer data and its associated dynamic metadata.
Definition framebuffer.h:50
std::mutex wrapper with clang thread safety annotation
Definition mutex.h:122
Base object to support automatic signal disconnection.
Definition object.h:25
Base class for pipeline handler factories.
Definition pipeline_handler.h:107
const std::string & name() const
Retrieve the factory name.
Definition pipeline_handler.h:114
static const PipelineHandlerFactoryBase * getFactoryByName(const std::string &name)
Return the factory for the pipeline handler with name name.
Definition pipeline_handler.cpp:802
PipelineHandlerFactoryBase(const char *name)
Construct a pipeline handler factory base.
Definition pipeline_handler.cpp:741
static std::vector< PipelineHandlerFactoryBase * > & factories()
Retrieve the list of all pipeline handler factories.
Definition pipeline_handler.cpp:786
std::shared_ptr< PipelineHandler > create(CameraManager *manager) const
Create an instance of the PipelineHandler corresponding to the factory.
Definition pipeline_handler.cpp:754
Registration of PipelineHandler classes and creation of instances.
Definition pipeline_handler.h:130
PipelineHandlerFactory(const char *name)
Construct a pipeline handler factory.
Definition pipeline_handler.h:132
std::unique_ptr< PipelineHandler > createInstance(CameraManager *manager) const override
Create an instance of the PipelineHandler corresponding to the factory.
Definition pipeline_handler.h:138
Create and manage cameras based on a set of media devices.
Definition pipeline_handler.h:39
virtual void stopDevice(Camera *camera)=0
Stop capturing from all running streams.
bool acquire()
Acquire exclusive access to the pipeline handler for the process.
Definition pipeline_handler.cpp:166
void hotplugMediaDevice(MediaDevice *media)
Enable hotplug handling for a media device.
Definition pipeline_handler.cpp:650
const char * name() const
Retrieve the pipeline handler name.
Definition pipeline_handler.h:71
CameraManager * manager_
The Camera manager associated with the pipeline handler.
Definition pipeline_handler.h:82
PipelineHandler(CameraManager *manager)
Construct a PipelineHandler instance.
Definition pipeline_handler.cpp:71
void completeRequest(Request *request)
Signal request completion.
Definition pipeline_handler.cpp:520
virtual void releaseDevice(Camera *camera)
Release resources associated with this camera.
Definition pipeline_handler.cpp:222
virtual int queueRequestDevice(Camera *camera, Request *request)=0
Queue a request to the device.
std::string configurationFile(const std::string &subdir, const std::string &name) const
Retrieve the absolute path to a platform configuration file.
Definition pipeline_handler.cpp:557
virtual bool match(DeviceEnumerator *enumerator)=0
Match media devices and create camera instances.
MediaDevice * acquireMediaDevice(DeviceEnumerator *enumerator, const DeviceMatch &dm)
Search and acquire a MediaDevice matching a device pattern.
Definition pipeline_handler.cpp:131
void registerCamera(std::shared_ptr< Camera > camera)
Register a camera to the camera manager and pipeline handler.
Definition pipeline_handler.cpp:604
void registerRequest(Request *request)
Register a request for use by the pipeline handler.
Definition pipeline_handler.cpp:381
virtual int start(Camera *camera, const ControlList *controls)=0
Start capturing from a group of streams.
void queueRequest(Request *request)
Queue a request.
Definition pipeline_handler.cpp:413
bool hasPendingRequests(const Camera *camera) const
Determine if the camera has any requests pending.
Definition pipeline_handler.cpp:368
void stop(Camera *camera)
Stop capturing from all running streams and cancel pending requests.
Definition pipeline_handler.cpp:329
virtual int exportFrameBuffers(Camera *camera, Stream *stream, std::vector< std::unique_ptr< FrameBuffer > > *buffers)=0
Allocate and export buffers for stream.
virtual std::unique_ptr< CameraConfiguration > generateConfiguration(Camera *camera, Span< const StreamRole > roles)=0
Generate a camera configuration for a specified camera.
bool completeBuffer(Request *request, FrameBuffer *buffer)
Complete a buffer for a request.
Definition pipeline_handler.cpp:499
virtual int configure(Camera *camera, CameraConfiguration *config)=0
Configure a group of streams for capture.
void release(Camera *camera)
Release exclusive access to the pipeline handler.
Definition pipeline_handler.cpp:202
A frame capture request.
Definition request.h:31
Video stream for a camera.
Definition stream.h:75
Framework to manage controls related to an object.
Mutex classes with clang thread safety annotation.
Top-level libcamera namespace.
Definition backtrace.h:17
Base object to support automatic signal disconnection.
Video stream for a Camera.