|
|
@ -22,7 +22,7 @@ |
|
|
|
#include <QDebug> |
|
|
|
#include <QDebug> |
|
|
|
|
|
|
|
|
|
|
|
VideoSurface::VideoSurface(QWidget* parent) |
|
|
|
VideoSurface::VideoSurface(QWidget* parent) |
|
|
|
: QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::SingleBuffer), parent) |
|
|
|
: QGLWidget(QGLFormat(QGL::SingleBuffer), parent) |
|
|
|
, source(nullptr) |
|
|
|
, source(nullptr) |
|
|
|
, pbo{nullptr, nullptr} |
|
|
|
, pbo{nullptr, nullptr} |
|
|
|
, textureId(0) |
|
|
|
, textureId(0) |
|
|
@ -30,7 +30,7 @@ VideoSurface::VideoSurface(QWidget* parent) |
|
|
|
, hasSubscribed(false) |
|
|
|
, hasSubscribed(false) |
|
|
|
, pboIndex(0) |
|
|
|
, pboIndex(0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setAutoBufferSwap(true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
VideoSurface::VideoSurface(VideoSource *source, QWidget* parent) |
|
|
|
VideoSurface::VideoSurface(VideoSource *source, QWidget* parent) |
|
|
@ -65,8 +65,8 @@ void VideoSurface::setSource(VideoSource *src) |
|
|
|
|
|
|
|
|
|
|
|
void VideoSurface::initializeGL() |
|
|
|
void VideoSurface::initializeGL() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
QGLWidget::initializeGL(); |
|
|
|
qDebug() << "VideoSurface: Init"; |
|
|
|
qDebug() << "VideoSurface: Init"; |
|
|
|
|
|
|
|
|
|
|
|
// pbo
|
|
|
|
// pbo
|
|
|
|
pbo[0] = new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer); |
|
|
|
pbo[0] = new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer); |
|
|
|
pbo[0]->setUsagePattern(QOpenGLBuffer::StreamDraw); |
|
|
|
pbo[0]->setUsagePattern(QOpenGLBuffer::StreamDraw); |
|
|
|