|
发表于 2016-11-20 21:34:23
17115 浏览 3 回复
4412关于移植usb摄像头在qt5虚拟机下呈像出现问题求助
错误:Starting /opt/Qtworkspace/build-qtcamera-Desktop_Qt_5_3_GCC_64bit-Debug/qtcamera...
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QString::arg: Argument missing: VIDIOC_S_FMT, Invalid argument
paintEngine代码
void ProcessImage::paintEvent(QPaintEvent *)
{
rs = vd->get_frame((void **)&p,(size_t*)&len);
convert_yuv_to_rgb_buffer(p,pp,320,240/*QWidget::width(),QWidget::height()*/);
frame->loadFromData((uchar *)pp,/*len*/320 * 240 * 3 * sizeof(char));
// painter->begin(this);
// painter->drawImage(0,0,*frame);
// painter->end();
// rs = vd->unget_frame();
// frame->load("./img3.jpg");
label->setPixmap(QPixmap::fromImage(*frame,Qt::AutoColor));
// label->show();
rs = vd->unget_frame();
// label->drawFrame();
// QPixmap *pixImage = new QPixmap();
// pixImage->loadFromData((uchar *)pp,sizeof(pp),0,Qt::AutoColor);
// QPainter painter(this);
// painter.begin(this);
// painter.drawPixmap(0,0,QWidget::width(),QWidget::height(),*pixImage);
// painter.end();
}
fmt设置
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 320;
fmt.fmt.pix.height = 240;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
file:///C:\Users\zhang\AppData\Roaming\Tencent\Users\1291588113\QQ\WinTemp\RichOle\55S_O{X$DORJVF}JV8WB7YP.png
file:///C:\Users\zhang\AppData\Roaming\Tencent\Users\1291588113\QQ\WinTemp\RichOle\55S_O{X$DORJVF}JV8WB7YP.png
|
|
|
|
|
|
|
|
楼主|
发表于 2016-11-21 15:17:41
VIDIOC_S_FMT
Starting /opt/Qtworkspace/build-qtcamera-Desktop_Qt_5_3_GCC_64bit-Debug/qtcamera...
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QString::arg: Argument missing: VIDIOC_S_FMT, Invalid argument
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|
|
|
|
|
|
|
楼主|
发表于 2016-11-21 20:13:41
|
|
|
|
|
|
登录或注册
扫一扫关注迅为公众号
|