41 using Formats = std::map<unsigned int, std::vector<SizeRange>>;
67 const std::string &
model();
69 static std::unique_ptr<V4L2Subdevice>
78 std::vector<unsigned int> enumPadCodes(
unsigned int pad);
79 std::vector<SizeRange> enumPadSizes(
unsigned int pad,
Utilities to help constructing class interfaces.
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
Describe a rectangle's position and dimensions.
Definition: geometry.h:236
Describe a two-dimensional size.
Definition: geometry.h:50
Base class for V4L2VideoDevice and V4L2Subdevice.
Definition: v4l2_device.h:30
A V4L2 subdevice as exposed by the Linux kernel.
Definition: v4l2_subdevice.h:39
static std::unique_ptr< V4L2Subdevice > fromEntityName(const MediaDevice *media, const std::string &entity)
Create a new video subdevice instance from entity in media device media.
Definition: v4l2_subdevice.cpp:525
int open()
Open a V4L2 subdevice.
Definition: v4l2_subdevice.cpp:269
int setSelection(unsigned int pad, unsigned int target, Rectangle *rect)
Set selection rectangle rect for target.
Definition: v4l2_subdevice.cpp:326
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition: v4l2_subdevice.cpp:535
int getSelection(unsigned int pad, unsigned int target, Rectangle *rect)
Get selection rectangle rect for target.
Definition: v4l2_subdevice.cpp:290
Formats formats(unsigned int pad)
Enumerate all media bus codes and frame sizes on a pad.
Definition: v4l2_subdevice.cpp:365
std::map< unsigned int, std::vector< SizeRange > > Formats
A map of supported media bus formats to frame sizes.
Definition: v4l2_subdevice.h:41
Whence
Specify the type of format for getFormat() and setFormat() operations.
Definition: v4l2_subdevice.h:43
@ ActiveFormat
The format operation applies to ACTIVE formats.
Definition: v4l2_subdevice.h:44
@ TryFormat
The format operation applies to TRY formats.
Definition: v4l2_subdevice.h:45
int setFormat(unsigned int pad, V4L2SubdeviceFormat *format, Whence whence=ActiveFormat)
Set an image format on one of the V4L2 subdevice pads.
Definition: v4l2_subdevice.cpp:435
const std::string & model()
Retrieve the model name of the device.
Definition: v4l2_subdevice.cpp:479
V4L2Subdevice(const MediaEntity *entity)
Create a V4L2 subdevice from a MediaEntity using its device node path.
Definition: v4l2_subdevice.cpp:255
int getFormat(unsigned int pad, V4L2SubdeviceFormat *format, Whence whence=ActiveFormat)
Retrieve the image format set on one of the V4L2 subdevice pads.
Definition: v4l2_subdevice.cpp:399
const MediaEntity * entity() const
Retrieve the media entity associated with the subdevice.
Definition: v4l2_subdevice.h:53
Class and enums to represent color spaces.
Data structures related to geometric objects.
Top-level libcamera namespace.
Definition: backtrace.h:17
Common base for V4L2 devices and subdevices.