From: Hans Verkuil Date: Sat, 19 Jul 2014 22:23:46 +0000 (+0200) Subject: qv4l2: QImage could be the wrong size X-Git-Tag: v4l-utils-1.3.90~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06b44024b52a97752b57913068205dfdcabf7844;p=platform%2Fupstream%2Fv4l-utils.git qv4l2: QImage could be the wrong size The QImage should be re-created every time the resolution changes, but sometimes that didn't happen due to bad condition. Updated the condition ensuring a correct QImage. Signed-off-by: Hans Verkuil --- diff --git a/utils/qv4l2/capture-win-qt.cpp b/utils/qv4l2/capture-win-qt.cpp index 7891ed3..db85cd2 100644 --- a/utils/qv4l2/capture-win-qt.cpp +++ b/utils/qv4l2/capture-win-qt.cpp @@ -60,7 +60,9 @@ void CaptureWinQt::setRenderFrame() if (!m_supportedFormat) dstFmt = QImage::Format_RGB888; - if (m_frame.updated || m_image->format() != dstFmt) { + if (m_frame.updated || m_image->format() != dstFmt || + m_image->width() != m_frame.size.width() || + m_image->height() != m_frame.size.height()) { delete m_image; m_image = new QImage(m_frame.size.width(), m_frame.size.height(), @@ -91,7 +93,6 @@ void CaptureWinQt::paintFrame() m_filled = true; m_image->fill(0); QPixmap img = QPixmap::fromImage(*m_image); - printf("%d %d\n", img.width(), img.height()); m_videoSurface->setPixmap(img); } return;