10 #include <initializer_list> 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>,
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);
157 Camera(std::unique_ptr<Private> d,
const std::string &
id,
158 const std::set<Stream *> &streams);
163 void requestComplete(
Request *request);
166 int exportFrameBuffers(
Stream *stream,
167 std::vector<std::unique_ptr<FrameBuffer>> *buffers);
Utilities to help constructing class interfaces.
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:75
Image orientation definition.
Top-level libcamera namespace.
Definition: backtrace.h:17
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:366
unsigned int yOddInc
Vertical increment for odd columns. Default to 1.
Definition: camera.h:50
#define LIBCAMERA_DECLARE_PRIVATE()
Declare private data for a public class.
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
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
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
Create and manage cameras based on a set of media devices.
Definition: pipeline_handler.h:33
Camera device.
Definition: camera.h:113
Base class to manage private data through a d-pointer.
Definition: class.h:61
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
Base object to support automatic signal disconnection.
Orientation orientation
The desired orientation of the images produced by the camera.
Definition: camera.h:96
Generic signal and slot communication mechanism.
Definition: object.h:20
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:1985
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:410
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
Base object to support automatic signal disconnection.
Definition: object.h:24
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