@@ -447,8 +447,19 @@ std::string V4L2DeviceFormat::toString() const
*/
std::ostream &operator<<(std::ostream &out, const V4L2DeviceFormat &f)
{
- out << f.size << "-" << f.fourcc << "/"
- << ColorSpace::toString(f.colorSpace);
+ out << f.size << '-' << f.fourcc << '[';
+
+ for (size_t i = 0; i < f.planesCount; i++) {
+ const auto &p = f.planes[i];
+
+ out << p.size << '/' << p.bpl;
+
+ if (i + 1 < f.planesCount)
+ out << ':';
+ }
+
+ out << "]/" << ColorSpace::toString(f.colorSpace);
+
return out;
}
Currently, only the size, the pixel format, and the color space is included when a `V4L2DeviceFormat` is formatted into a stream. Print the data about the planes as well (size and bytes-per-line), as it can immensely help debugging if it is readily available in the log. Example: 640x480-YUYV[614400/1280]/Rec709/Rec709/Rec601/Limited where the <size>/<bpl> pairs are printed inside the "[]" separated by ':'. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/libcamera/v4l2_videodevice.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)