aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2018-11-20 15:46:28 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2018-11-20 15:46:28 +0100
commit7a98cfff67c41b82864a953d606270fbedb151dc (patch)
tree6b504aa739a3531eb29468b7f90bc1fe0617d759
parent12c07930cfd4a0cb4ca2bcce0ee2d4f6143065ac (diff)
qvidcap: rename CaptureGLWin to CaptureWin
The GL in the name is rather pointless. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--utils/qvidcap/capture.cpp92
-rw-r--r--utils/qvidcap/capture.h6
-rw-r--r--utils/qvidcap/paint.cpp38
-rw-r--r--utils/qvidcap/qvidcap.cpp2
4 files changed, 69 insertions, 69 deletions
diff --git a/utils/qvidcap/capture.cpp b/utils/qvidcap/capture.cpp
index 2e1265d4..8c11ac53 100644
--- a/utils/qvidcap/capture.cpp
+++ b/utils/qvidcap/capture.cpp
@@ -187,7 +187,7 @@ static QAction *addSubMenuItem(QActionGroup *grp, QMenu *menu, const QString &te
return a;
}
-CaptureGLWin::CaptureGLWin(QScrollArea *sa, QWidget *parent) :
+CaptureWin::CaptureWin(QScrollArea *sa, QWidget *parent) :
QOpenGLWidget(parent),
m_fd(0),
m_sock(0),
@@ -295,13 +295,13 @@ CaptureGLWin::CaptureGLWin(QScrollArea *sa, QWidget *parent) :
this, SLOT(toggleFullScreen(bool)));
}
-CaptureGLWin::~CaptureGLWin()
+CaptureWin::~CaptureWin()
{
makeCurrent();
delete m_program;
}
-void CaptureGLWin::resizeEvent(QResizeEvent *event)
+void CaptureWin::resizeEvent(QResizeEvent *event)
{
QSize origSize = correctAspect(QSize(m_origWidth, m_origHeight));
QSize window = size();
@@ -318,7 +318,7 @@ void CaptureGLWin::resizeEvent(QResizeEvent *event)
QOpenGLWidget::resizeEvent(event);
}
-void CaptureGLWin::updateShader()
+void CaptureWin::updateShader()
{
setV4LFormat(m_v4l_fmt);
if (m_mode == AppModeTest || m_mode == AppModeTPG || m_mode == AppModeFile) {
@@ -329,7 +329,7 @@ void CaptureGLWin::updateShader()
m_updateShader = true;
}
-void CaptureGLWin::showCurrentOverrides()
+void CaptureWin::showCurrentOverrides()
{
static bool firstTime = true;
const char *prefix = firstTime ? "" : "New ";
@@ -353,7 +353,7 @@ void CaptureGLWin::showCurrentOverrides()
firstTime = false;
}
-void CaptureGLWin::restoreAll(bool checked)
+void CaptureWin::restoreAll(bool checked)
{
m_overridePixelFormat = m_origPixelFormat;
m_overrideField = m_origField;
@@ -367,7 +367,7 @@ void CaptureGLWin::restoreAll(bool checked)
restoreSize();
}
-void CaptureGLWin::fmtChanged(QAction *a)
+void CaptureWin::fmtChanged(QAction *a)
{
m_overridePixelFormat = a->data().toInt();
if (m_overridePixelFormat == 0)
@@ -378,7 +378,7 @@ void CaptureGLWin::fmtChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::fieldChanged(QAction *a)
+void CaptureWin::fieldChanged(QAction *a)
{
m_overrideField = a->data().toInt();
if (m_overrideField == 0xffffffff)
@@ -387,7 +387,7 @@ void CaptureGLWin::fieldChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::colorspaceChanged(QAction *a)
+void CaptureWin::colorspaceChanged(QAction *a)
{
m_overrideColorspace = a->data().toInt();
if (m_overrideColorspace == 0xffffffff)
@@ -396,7 +396,7 @@ void CaptureGLWin::colorspaceChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::xferFuncChanged(QAction *a)
+void CaptureWin::xferFuncChanged(QAction *a)
{
m_overrideXferFunc = a->data().toInt();
if (m_overrideXferFunc == 0xffffffff)
@@ -405,7 +405,7 @@ void CaptureGLWin::xferFuncChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::ycbcrEncChanged(QAction *a)
+void CaptureWin::ycbcrEncChanged(QAction *a)
{
m_overrideYCbCrEnc = a->data().toInt();
if (m_overrideYCbCrEnc == 0xffffffff)
@@ -414,7 +414,7 @@ void CaptureGLWin::ycbcrEncChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::hsvEncChanged(QAction *a)
+void CaptureWin::hsvEncChanged(QAction *a)
{
m_overrideHSVEnc = a->data().toInt();
if (m_overrideHSVEnc == 0xffffffff)
@@ -423,7 +423,7 @@ void CaptureGLWin::hsvEncChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::quantChanged(QAction *a)
+void CaptureWin::quantChanged(QAction *a)
{
m_overrideQuantization = a->data().toInt();
if (m_overrideQuantization == 0xffffffff)
@@ -432,7 +432,7 @@ void CaptureGLWin::quantChanged(QAction *a)
updateShader();
}
-void CaptureGLWin::restoreSize(bool)
+void CaptureWin::restoreSize(bool)
{
QSize s = correctAspect(QSize(m_origWidth, m_origHeight));
@@ -441,7 +441,7 @@ void CaptureGLWin::restoreSize(bool)
updateShader();
}
-QSize CaptureGLWin::correctAspect(const QSize &s) const
+QSize CaptureWin::correctAspect(const QSize &s) const
{
qreal aspect
= (qreal)m_pixelaspect.denominator
@@ -457,14 +457,14 @@ QSize CaptureGLWin::correctAspect(const QSize &s) const
return QSize(qFloor(w), qFloor(h));
}
-void CaptureGLWin::windowScalingChanged(QAction *a)
+void CaptureWin::windowScalingChanged(QAction *a)
{
m_scrollArea->setWidgetResizable(a->data().toInt() == CAPTURE_GL_WIN_RESIZE);
resize(correctAspect(QSize(m_origWidth, m_origHeight)));
updateShader();
}
-void CaptureGLWin::resolutionOverrideChanged(bool checked)
+void CaptureWin::resolutionOverrideChanged(bool checked)
{
if (m_overrideWidth)
m_origWidth = m_overrideWidth;
@@ -474,7 +474,7 @@ void CaptureGLWin::resolutionOverrideChanged(bool checked)
restoreSize();
}
-void CaptureGLWin::toggleFullScreen(bool)
+void CaptureWin::toggleFullScreen(bool)
{
if (m_scrollArea->isFullScreen())
m_scrollArea->showNormal();
@@ -482,7 +482,7 @@ void CaptureGLWin::toggleFullScreen(bool)
m_scrollArea->showFullScreen();
}
-void CaptureGLWin::contextMenuEvent(QContextMenuEvent *event)
+void CaptureWin::contextMenuEvent(QContextMenuEvent *event)
{
QMenu menu(this);
@@ -514,7 +514,7 @@ void CaptureGLWin::contextMenuEvent(QContextMenuEvent *event)
menu.exec(event->globalPos());
}
-void CaptureGLWin::mouseDoubleClickEvent(QMouseEvent * e)
+void CaptureWin::mouseDoubleClickEvent(QMouseEvent * e)
{
if (e->button() != Qt::LeftButton)
return;
@@ -522,7 +522,7 @@ void CaptureGLWin::mouseDoubleClickEvent(QMouseEvent * e)
toggleFullScreen();
}
-void CaptureGLWin::cycleMenu(__u32 &overrideVal, __u32 &origVal,
+void CaptureWin::cycleMenu(__u32 &overrideVal, __u32 &origVal,
const __u32 values[], bool hasShift, bool hasCtrl)
{
unsigned i;
@@ -547,7 +547,7 @@ void CaptureGLWin::cycleMenu(__u32 &overrideVal, __u32 &origVal,
}
}
-void CaptureGLWin::keyPressEvent(QKeyEvent *event)
+void CaptureWin::keyPressEvent(QKeyEvent *event)
{
unsigned w = m_v4l_fmt.g_width();
unsigned h = m_v4l_fmt.g_frame_height();
@@ -658,7 +658,7 @@ void CaptureGLWin::keyPressEvent(QKeyEvent *event)
}
}
-bool CaptureGLWin::supportedFmt(__u32 fmt)
+bool CaptureWin::supportedFmt(__u32 fmt)
{
switch (fmt) {
case V4L2_PIX_FMT_RGB565X:
@@ -684,7 +684,7 @@ bool CaptureGLWin::supportedFmt(__u32 fmt)
return true;
}
-void CaptureGLWin::checkError(const char *msg)
+void CaptureWin::checkError(const char *msg)
{
int err;
unsigned errNo = 0;
@@ -696,7 +696,7 @@ void CaptureGLWin::checkError(const char *msg)
exit(errNo);
}
-void CaptureGLWin::configureTexture(size_t idx)
+void CaptureWin::configureTexture(size_t idx)
{
glBindTexture(GL_TEXTURE_2D, m_screenTexture[idx]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@@ -705,7 +705,7 @@ void CaptureGLWin::configureTexture(size_t idx)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
-void CaptureGLWin::setOverrideWidth(__u32 w)
+void CaptureWin::setOverrideWidth(__u32 w)
{
m_overrideWidth = w;
@@ -713,7 +713,7 @@ void CaptureGLWin::setOverrideWidth(__u32 w)
m_resolutionOverride->setChecked(true);
}
-void CaptureGLWin::setOverrideHeight(__u32 h)
+void CaptureWin::setOverrideHeight(__u32 h)
{
m_overrideHeight = h;
@@ -721,7 +721,7 @@ void CaptureGLWin::setOverrideHeight(__u32 h)
m_resolutionOverride->setChecked(true);
}
-void CaptureGLWin::setModeV4L2(cv4l_fd *fd)
+void CaptureWin::setModeV4L2(cv4l_fd *fd)
{
m_mode = AppModeV4L2;
m_fd = fd;
@@ -741,7 +741,7 @@ void CaptureGLWin::setModeV4L2(cv4l_fd *fd)
printf("using libv4l2\n");
}
-void CaptureGLWin::setModeSocket(int socket, int port)
+void CaptureWin::setModeSocket(int socket, int port)
{
m_mode = AppModeSocket;
m_sock = socket;
@@ -758,7 +758,7 @@ void CaptureGLWin::setModeSocket(int socket, int port)
connect(readSock, SIGNAL(activated(int)), this, SLOT(sockReadEvent()));
}
-void CaptureGLWin::setModeFile(const QString &filename)
+void CaptureWin::setModeFile(const QString &filename)
{
m_mode = AppModeFile;
m_file.setFileName(filename);
@@ -769,25 +769,25 @@ void CaptureGLWin::setModeFile(const QString &filename)
m_canOverrideResolution = true;
}
-void CaptureGLWin::setModeTPG()
+void CaptureWin::setModeTPG()
{
m_mode = AppModeTPG;
}
-void CaptureGLWin::setModeTest(unsigned cnt)
+void CaptureWin::setModeTest(unsigned cnt)
{
m_mode = AppModeTest;
m_test = cnt;
}
-void CaptureGLWin::setQueue(cv4l_queue *q)
+void CaptureWin::setQueue(cv4l_queue *q)
{
m_v4l_queue = q;
if (m_origPixelFormat == 0)
updateOrigValues();
}
-bool CaptureGLWin::updateV4LFormat(const cv4l_fmt &fmt)
+bool CaptureWin::updateV4LFormat(const cv4l_fmt &fmt)
{
m_is_rgb = true;
m_is_hsv = false;
@@ -890,7 +890,7 @@ bool CaptureGLWin::updateV4LFormat(const cv4l_fmt &fmt)
return true;
}
-bool CaptureGLWin::setV4LFormat(cv4l_fmt &fmt)
+bool CaptureWin::setV4LFormat(cv4l_fmt &fmt)
{
m_is_sdtv = false;
@@ -1031,12 +1031,12 @@ bool CaptureGLWin::setV4LFormat(cv4l_fmt &fmt)
return true;
}
-void CaptureGLWin::setPixelAspect(v4l2_fract &pixelaspect)
+void CaptureWin::setPixelAspect(v4l2_fract &pixelaspect)
{
m_pixelaspect = pixelaspect;
}
-void CaptureGLWin::v4l2ReadEvent()
+void CaptureWin::v4l2ReadEvent()
{
cv4l_buffer buf(m_fd->g_type());
@@ -1065,7 +1065,7 @@ void CaptureGLWin::v4l2ReadEvent()
exit(0);
}
-void CaptureGLWin::v4l2ExceptionEvent()
+void CaptureWin::v4l2ExceptionEvent()
{
v4l2_event ev;
cv4l_fmt fmt;
@@ -1087,7 +1087,7 @@ void CaptureGLWin::v4l2ExceptionEvent()
}
}
-void CaptureGLWin::listenForNewConnection()
+void CaptureWin::listenForNewConnection()
{
cv4l_fmt fmt;
v4l2_fract pixelaspect = { 1, 1 };
@@ -1122,7 +1122,7 @@ void CaptureGLWin::listenForNewConnection()
restoreSize();
}
-int CaptureGLWin::read_u32(__u32 &v)
+int CaptureWin::read_u32(__u32 &v)
{
int n;
@@ -1136,7 +1136,7 @@ int CaptureGLWin::read_u32(__u32 &v)
return 0;
}
-void CaptureGLWin::sockReadEvent()
+void CaptureWin::sockReadEvent()
{
int n;
@@ -1251,7 +1251,7 @@ new_conn:
listenForNewConnection();
}
-void CaptureGLWin::resizeGL(int w, int h)
+void CaptureWin::resizeGL(int w, int h)
{
if (!m_canOverrideResolution || !m_resolutionOverride->isChecked())
return;
@@ -1264,7 +1264,7 @@ void CaptureGLWin::resizeGL(int w, int h)
printf("New resolution: %ux%u\n", w, h);
}
-void CaptureGLWin::updateOrigValues()
+void CaptureWin::updateOrigValues()
{
m_origWidth = m_v4l_fmt.g_width();
m_origHeight = m_v4l_fmt.g_frame_height();
@@ -1284,7 +1284,7 @@ void CaptureGLWin::updateOrigValues()
m_viewSize = QSize(m_origWidth, m_origHeight);
}
-void CaptureGLWin::initImageFormat()
+void CaptureWin::initImageFormat()
{
updateV4LFormat(m_v4l_fmt);
tpg_s_fourcc(&m_tpg, m_v4l_fmt.g_pixelformat());
@@ -1316,7 +1316,7 @@ void CaptureGLWin::initImageFormat()
tpg_log_status(&m_tpg);
}
-void CaptureGLWin::startTimer()
+void CaptureWin::startTimer()
{
if (m_origPixelFormat == 0)
updateOrigValues();
@@ -1378,7 +1378,7 @@ void CaptureGLWin::startTimer()
}
}
-void CaptureGLWin::tpgUpdateFrame()
+void CaptureWin::tpgUpdateFrame()
{
bool is_alt = m_v4l_fmt.g_field() == V4L2_FIELD_ALTERNATE;
diff --git a/utils/qvidcap/capture.h b/utils/qvidcap/capture.h
index 8967c1f0..175c3ccd 100644
--- a/utils/qvidcap/capture.h
+++ b/utils/qvidcap/capture.h
@@ -64,12 +64,12 @@ struct TestState {
// This must be equal to the max number of textures that any shader uses
#define MAX_TEXTURES_NEEDED 3
-class CaptureGLWin : public QOpenGLWidget, protected QOpenGLFunctions
+class CaptureWin : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
public:
- explicit CaptureGLWin(QScrollArea *sa, QWidget *parent = 0);
- ~CaptureGLWin();
+ explicit CaptureWin(QScrollArea *sa, QWidget *parent = 0);
+ ~CaptureWin();
void setModeV4L2(cv4l_fd *fd);
void setModeSocket(int sock, int port);
diff --git a/utils/qvidcap/paint.cpp b/utils/qvidcap/paint.cpp
index cd92e807..61c2a73e 100644
--- a/utils/qvidcap/paint.cpp
+++ b/utils/qvidcap/paint.cpp
@@ -24,7 +24,7 @@
#include "v4l2-info.h"
-void CaptureGLWin::initializeGL()
+void CaptureWin::initializeGL()
{
initializeOpenGLFunctions();
glDisable(GL_BLEND);
@@ -63,7 +63,7 @@ void CaptureGLWin::initializeGL()
}
-void CaptureGLWin::paintGL()
+void CaptureWin::paintGL()
{
if (m_v4l_fmt.g_width() < 16 || m_v4l_fmt.g_frame_height() < 16)
return;
@@ -426,7 +426,7 @@ static const struct define defines[] = {
{ NULL, 0 }
};
-void CaptureGLWin::changeShader()
+void CaptureWin::changeShader()
{
if (m_screenTextureCount)
glDeleteTextures(m_screenTextureCount, m_screenTexture);
@@ -620,7 +620,7 @@ void CaptureGLWin::changeShader()
}
}
-void CaptureGLWin::shader_YUV()
+void CaptureWin::shader_YUV()
{
unsigned vdiv = 2, hdiv = 2;
@@ -658,7 +658,7 @@ void CaptureGLWin::shader_YUV()
checkError("YUV shader texture 2");
}
-void CaptureGLWin::shader_NV12()
+void CaptureWin::shader_NV12()
{
m_screenTextureCount = 2;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -676,7 +676,7 @@ void CaptureGLWin::shader_NV12()
checkError("NV12 shader texture 1");
}
-void CaptureGLWin::shader_NV24()
+void CaptureWin::shader_NV24()
{
m_screenTextureCount = 2;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -694,7 +694,7 @@ void CaptureGLWin::shader_NV24()
checkError("NV24 shader texture 1");
}
-void CaptureGLWin::shader_NV16()
+void CaptureWin::shader_NV16()
{
m_screenTextureCount = 2;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -712,7 +712,7 @@ void CaptureGLWin::shader_NV16()
checkError("NV16 shader texture 1");
}
-void CaptureGLWin::shader_YUY2()
+void CaptureWin::shader_YUY2()
{
m_screenTextureCount = 1;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -723,7 +723,7 @@ void CaptureGLWin::shader_YUY2()
checkError("YUY2 shader");
}
-void CaptureGLWin::shader_RGB()
+void CaptureWin::shader_RGB()
{
m_screenTextureCount = 1;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -806,7 +806,7 @@ void CaptureGLWin::shader_RGB()
checkError("RGB shader");
}
-void CaptureGLWin::shader_Bayer()
+void CaptureWin::shader_Bayer()
{
m_screenTextureCount = 1;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -841,7 +841,7 @@ void CaptureGLWin::shader_Bayer()
checkError("Bayer shader");
}
-void CaptureGLWin::shader_YUV_packed()
+void CaptureWin::shader_YUV_packed()
{
m_screenTextureCount = 1;
glGenTextures(m_screenTextureCount, m_screenTexture);
@@ -872,7 +872,7 @@ void CaptureGLWin::shader_YUV_packed()
checkError("Packed YUV shader");
}
-void CaptureGLWin::render_YUV(__u32 format)
+void CaptureWin::render_YUV(__u32 format)
{
unsigned vdiv = 2, hdiv = 2;
int idxU = 0;
@@ -957,7 +957,7 @@ void CaptureGLWin::render_YUV(__u32 format)
checkError("YUV paint vtex");
}
-void CaptureGLWin::render_NV12(__u32 format)
+void CaptureWin::render_NV12(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -983,7 +983,7 @@ void CaptureGLWin::render_NV12(__u32 format)
checkError("NV12 paint uvtex");
}
-void CaptureGLWin::render_NV24(__u32 format)
+void CaptureWin::render_NV24(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -1001,7 +1001,7 @@ void CaptureGLWin::render_NV24(__u32 format)
checkError("NV24 paint uvtex");
}
-void CaptureGLWin::render_NV16(__u32 format)
+void CaptureWin::render_NV16(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -1029,7 +1029,7 @@ void CaptureGLWin::render_NV16(__u32 format)
checkError("NV16 paint uvtex");
}
-void CaptureGLWin::render_YUY2(__u32 format)
+void CaptureWin::render_YUY2(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -1040,7 +1040,7 @@ void CaptureGLWin::render_YUY2(__u32 format)
checkError("YUY2 paint");
}
-void CaptureGLWin::render_RGB(__u32 format)
+void CaptureWin::render_RGB(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -1151,7 +1151,7 @@ void CaptureGLWin::render_RGB(__u32 format)
checkError("RGB paint");
}
-void CaptureGLWin::render_Bayer(__u32 format)
+void CaptureWin::render_Bayer(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
@@ -1183,7 +1183,7 @@ void CaptureGLWin::render_Bayer(__u32 format)
checkError("Bayer paint");
}
-void CaptureGLWin::render_YUV_packed(__u32 format)
+void CaptureWin::render_YUV_packed(__u32 format)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_screenTexture[0]);
diff --git a/utils/qvidcap/qvidcap.cpp b/utils/qvidcap/qvidcap.cpp
index 4c18080d..17c7e927 100644
--- a/utils/qvidcap/qvidcap.cpp
+++ b/utils/qvidcap/qvidcap.cpp
@@ -723,7 +723,7 @@ int main(int argc, char **argv)
format.setVersion(3, 3);
QSurfaceFormat::setDefaultFormat(format);
- CaptureGLWin win(sa);
+ CaptureWin win(sa);
win.setVerbose(verbose);
if (mode == AppModeFile) {
win.setModeFile(filename);

Privacy Policy