10 #include <initializer_list> 17 #include <libcamera/base/class.h> 19 #include <libcamera/base/object.h> 31 class FrameBufferAllocator;
32 class PipelineHandler;
68 using iterator = std::vector<StreamConfiguration>::iterator;
74 virtual Status validate() = 0;
93 std::size_t size()
const;
103 StreamsShareColorSpace,
113 class Camera final :
public Object,
public std::enable_shared_from_this<Camera>,
116 LIBCAMERA_DECLARE_PRIVATE()
119 static std::shared_ptr<Camera> create(std::unique_ptr<Private> d,
120 const std::string &
id,
121 const std::set<Stream *> &streams);
123 const std::string &id()
const;
135 const std::set<Stream *> &streams()
const;
137 std::unique_ptr<CameraConfiguration>
138 generateConfiguration(Span<const StreamRole> roles = {});
140 std::unique_ptr<CameraConfiguration>
143 return generateConfiguration(Span(roles.begin(), roles.end()));
148 std::unique_ptr<Request> createRequest(uint64_t cookie = 0);
149 int queueRequest(
Request *request);
155 LIBCAMERA_DISABLE_COPY(
Camera)
157 Camera(std::unique_ptr<Private> d,
const std::string &
id,
158 const std::set<Stream *> &streams);
161 friend class PipelineHandler;
163 void requestComplete(
Request *request);
166 int exportFrameBuffers(
Stream *stream,
167 std::vector<std::unique_ptr<FrameBuffer>> *buffers);
std::unique_ptr< CameraConfiguration > generateConfiguration(std::initializer_list< StreamRole > roles)
Definition: camera.h:141
struct libcamera::SensorConfiguration::@0 binning
Sensor binning configuration.
unsigned int yEvenInc
Vertical increment for even columns. Default to 1.
Definition: camera.h:51
Rectangle analogCrop
The analog crop rectangle.
Definition: camera.h:40
FrameBuffer allocator for applications.
Definition: framebuffer_allocator.h:22
unsigned int binX
Horizontal binning factor.
Definition: camera.h:43
Video stream for a camera.
Definition: stream.h:73
Image orientation definition.
Top-level libcamera namespace.
Definition: bound_method.h:15
std::vector< StreamConfiguration >::iterator iterator
Iterator for the stream configurations in the camera configuration.
Definition: camera.h:68
Status
Validity of a camera configuration.
Definition: camera.h:62
Describe a two-dimensional size.
Definition: geometry.h:52
Video stream for a Camera.
Hold configuration for streams of the camera.
Definition: camera.h:59
const StreamConfiguration & operator[](unsigned int index) const
Retrieve a const reference to a stream configuration.
Definition: camera.h:82
Orientation
The image orientation in a memory buffer.
Definition: orientation.h:14
Size outputSize
The frame output (visible) size.
Definition: camera.h:54
A map of ControlId to ControlInfo.
Definition: controls.h:336
unsigned int yOddInc
Vertical increment for odd columns. Default to 1.
Definition: camera.h:50
unsigned int xEvenInc
Horizontal increment for even rows. Default to 1.
Definition: camera.h:49
struct libcamera::SensorConfiguration::@1 skipping
The sensor skipping configuration.
A frame capture request.
Definition: request.h:29
Signal & slot implementation.
Describe a rectangle's position and dimensions.
Definition: geometry.h:242
bool isValid() const
Check if the sensor configuration is valid.
Definition: camera.cpp:243
ColorSpaceFlag
Specify the behaviour of validateColorSpaces.
Definition: camera.h:101
Camera device.
Definition: camera.h:113
std::optional< SensorConfiguration > sensorConfig
The camera sensor configuration.
Definition: camera.h:95
const ControlIdMap properties
List of all supported libcamera properties.
Definition: property_ids.cpp:844
Signal< Request *, FrameBuffer * > bufferCompleted
Signal emitted when a buffer for a request queued to the camera has completed.
Definition: camera.h:125
unsigned int binY
Vertical binning factor.
Definition: camera.h:44
Orientation orientation
The desired orientation of the images produced by the camera.
Definition: camera.h:96
Generic signal and slot communication mechanism.
Definition: signal.h:38
unsigned int bitDepth
The sensor image format bit depth.
Definition: camera.h:38
const ControlIdMap controls
List of all supported libcamera controls.
Definition: control_ids.cpp:1952
Describes a frame capture request to be processed by a camera.
Signal disconnected
Signal emitted when the camera is disconnected from the system.
Definition: camera.h:127
Associate a list of ControlId with their values for an object.
Definition: controls.h:380
Framework to manage controls related to an object.
Signal< Request * > requestCompleted
Signal emitted when a request queued to the camera has completed.
Definition: camera.h:126
Type-safe container for enum-based bitfields.
Definition: flags.h:15
Data structures related to geometric objects.
Camera sensor configuration.
Definition: camera.h:35
unsigned int xOddInc
Horizontal increment for odd rows. Default to 1.
Definition: camera.h:48
StreamConfiguration & operator[](unsigned int index)
Retrieve a reference to a stream configuration.
Definition: camera.h:78
std::vector< StreamConfiguration > config_
The vector of stream configurations.
Definition: camera.h:110
Configuration parameters for a stream.
Definition: stream.h:40
std::vector< StreamConfiguration >::const_iterator const_iterator
Const iterator for the stream configuration in the camera configuration.
Definition: camera.h:69