libcamera: v4l2_device: Add methods to get/set format

Add methods to set and get the image format programmed on a V4L2Device
for both the single and multi planar use case.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2019-01-29 15:36:38 +01:00
parent 267b91373b
commit ba8da0f2fc
2 changed files with 138 additions and 0 deletions
+10
View File
@@ -86,10 +86,20 @@ public:
const char *deviceName() const { return caps_.card(); }
const char *busName() const { return caps_.bus_info(); }
int format(V4L2DeviceFormat *fmt);
int setFormat(V4L2DeviceFormat *fmt);
private:
int getFormatSingleplane(V4L2DeviceFormat *fmt);
int setFormatSingleplane(V4L2DeviceFormat *fmt);
int getFormatMultiplane(V4L2DeviceFormat *fmt);
int setFormatMultiplane(V4L2DeviceFormat *fmt);
std::string deviceNode_;
int fd_;
V4L2Capability caps_;
enum v4l2_buf_type bufferType_;
};
} /* namespace libcamera */