Commit a1140503 authored by Thiago Santini's avatar Thiago Santini

Uses frame info for resolution

parent cdc634a1
...@@ -43,7 +43,7 @@ void UVCCameraSession::callback(uvc_frame_t *frame) ...@@ -43,7 +43,7 @@ void UVCCameraSession::callback(uvc_frame_t *frame)
QVideoFrame qFrame; QVideoFrame qFrame;
switch(frame->frame_format) { switch(frame->frame_format) {
case UVC_FRAME_FORMAT_MJPEG: 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); qFrame.map(QAbstractVideoBuffer::WriteOnly);
memcpy( qFrame.bits(), frame->data, frame->data_bytes); // copied; safe to retun from callback now memcpy( qFrame.bits(), frame->data, frame->data_bytes); // copied; safe to retun from callback now
qFrame.unmap(); qFrame.unmap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment