我用QT5做的摄像头视频采集,v4l2架构,可是label什么也不显示。能帮忙看看吗?谢谢啊!代码也是从网上找的。
ProcessImage::ProcessImage(QWidget *parent):QWidget(parent)
{
pp = (unsigned char *)malloc(640 * 480/*QWidget::width()*QWidget::height()*/* 3 * sizeof(char));
painter = new QPainter(this);
frame = new QImage(pp,640,480,QImage::Format_RGB888);
// frame = new QPixmap(640,320);
label = new QLabel();
vd = new VideoDevice(tr("/dev/video0"));
connect(vd, SIGNAL(display_error(QString)), this,SLOT(display_error(QString)));
rs = vd->open_device();
if(-1==rs)
{
QMessageBox::warning(this,tr("error"),tr("open /dev/dsp error"),QMessageBox::Yes);
vd->close_device();
}
rs = vd->init_device();
if(-1==rs)
{
QMessageBox: