From a114050399d7280a76d08bc9361581fd7393dbac Mon Sep 17 00:00:00 2001 From: Thiago Santini Date: Fri, 7 Apr 2017 11:17:21 +0200 Subject: [PATCH] Uses frame info for resolution --- uvcengine/uvccamerasession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvcengine/uvccamerasession.cpp b/uvcengine/uvccamerasession.cpp index 9774f42..d24ea6b 100644 --- a/uvcengine/uvccamerasession.cpp +++ b/uvcengine/uvccamerasession.cpp @@ -43,7 +43,7 @@ void UVCCameraSession::callback(uvc_frame_t *frame) QVideoFrame qFrame; switch(frame->frame_format) { case UVC_FRAME_FORMAT_MJPEG: - qFrame = QVideoFrame( (int) frame->data_bytes, QSize(settings.resolution().width(), settings.resolution().height()), 0, QVideoFrame::Format_Jpeg); + qFrame = QVideoFrame( (int) frame->data_bytes, QSize(frame->width, frame->height), 0, QVideoFrame::Format_Jpeg); qFrame.map(QAbstractVideoBuffer::WriteOnly); memcpy( qFrame.bits(), frame->data, frame->data_bytes); // copied; safe to retun from callback now qFrame.unmap(); -- 2.21.0