Skip to content

Commit 2a92b6d

Browse files
committed
add debug messages
1 parent ca2f2fb commit 2a92b6d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/libcameracamera.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <libcamera/framebuffer_allocator.h>
99
#include <qvideoframe.h>
1010
#include <sys/mman.h>
11-
#include <QColorSpace>
1211

1312
using namespace libcamera;
1413

@@ -494,18 +493,21 @@ QImage LibCameraWorker::convertBufferToImage(
494493
cfg.size.width,
495494
cfg.size.height,
496495
cfg.stride,
497-
QImage::Format_BGR888);
496+
QImage::Format_RGB888);
497+
qDebug() << "[DEBUG] RGB888 conversion complete, image size:" << temp.size();
498498
image = temp.copy();
499499
} else if (cfg.pixelFormat == libcamera::formats::BGR888) {
500500
QImage temp(static_cast<const uchar *>(memory),
501501
cfg.size.width,
502502
cfg.size.height,
503503
cfg.stride,
504504
QImage::Format_BGR888);
505+
qDebug() << "[DEBUG] BGR888 conversion complete, image size:" << temp.size();
505506
image = temp.copy();
506507
} else if (cfg.pixelFormat == libcamera::formats::MJPEG) {
507508
size_t size = buffer->metadata().planes()[0].bytesused;
508509
image.loadFromData(static_cast<const uchar *>(memory), static_cast<int>(size), "JPEG");
510+
qDebug() << "[DEBUG] MJPEG conversion complete, image size:" << image.size();
509511
} else if (cfg.pixelFormat == libcamera::formats::YUYV) {
510512
image = QImage(cfg.size.width, cfg.size.height, QImage::Format_RGB888);
511513
const uint8_t *src = static_cast<const uint8_t *>(memory);
@@ -536,6 +538,7 @@ QImage LibCameraWorker::convertBufferToImage(
536538
image.setPixel(x + 1, y, qRgb(r1, g1, b1));
537539
}
538540
}
541+
qDebug() << "[DEBUG] YUYV conversion complete, image size:" << image.size();
539542
} else if (cfg.pixelFormat == libcamera::formats::YUV420) {
540543
// YUV420 planar format (I420)
541544
unsigned int width = cfg.size.width;

0 commit comments

Comments
 (0)