diff options
Diffstat (limited to 'src/libcamera/v4l2_device.cpp')
-rw-r--r-- | src/libcamera/v4l2_device.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 889c63b3..93d81517 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -6,6 +6,8 @@ */ #include <fcntl.h> +#include <iomanip> +#include <sstream> #include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> @@ -224,6 +226,22 @@ LOG_DEFINE_CATEGORY(V4L2) */ /** + * \brief Assemble and return a string describing the format + * + * \return A string describing the V4L2DeviceFormat + */ +const std::string V4L2DeviceFormat::toString() const +{ + std::stringstream ss; + + ss.fill(0); + ss << width << "x" << height << "-0x" << std::hex + << std::setw(8) << fourcc; + + return ss.str(); +} + +/** * \class V4L2Device * \brief V4L2Device object and API * |