Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/142.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 高性能QImage输出至显示器_C++_Qt_Qimage_Qpixmap - Fatal编程技术网

C++ 高性能QImage输出至显示器

C++ 高性能QImage输出至显示器,c++,qt,qimage,qpixmap,C++,Qt,Qimage,Qpixmap,我正在尝试将视频输出(帧序列)到任何qt可见小部件。一开始我以为QLabel就足够了。。。但我错了。转换为pixmap对于大图像的处理器来说太过过载:例如1080p 还有其他解决办法吗?(不是QLabel?) 一帧的代码示例: QImage m_outputFrameImage(width, height, QImage::Format_RGB888); memcpy(m_outputFrameImage.bits(), m_frameRGB->data[0], height * widt

我正在尝试将视频输出(帧序列)到任何qt可见小部件。一开始我以为QLabel就足够了。。。但我错了。转换为pixmap对于大图像的处理器来说太过过载:例如1080p

还有其他解决办法吗?(不是QLabel?)

一帧的代码示例:

QImage m_outputFrameImage(width, height, QImage::Format_RGB888);
memcpy(m_outputFrameImage.bits(), m_frameRGB->data[0], height * width * 3);
QPixmap pixmap = QPixmap::fromImage(m_outputFrameImage); // BAD, slow and high load
/* Bad too (Same code?)
    QPainter painter;
    painter.begin(&pixmap);
    painter.drawImage(0, 0, m_outputFrameImage);
    painter.end();
*/
labelVideo->setPixmap(pixmap);

是,将帧渲染到
QGLWidget
并让视频卡处理。这就是Qt多媒体套件、Phonon和其他公司的做法

不久前,我分享了一些演示如何完成此任务的代码: