1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

renamed SelfCamView to VideoSurface

This commit is contained in:
krepa098 2014-10-08 16:42:09 +02:00
parent de1445cdd8
commit 88ece1b213
8 changed files with 21 additions and 25 deletions

View File

@ -107,7 +107,6 @@ HEADERS += widget/form/addfriendform.h \
friendlist.h \
misc/cdata.h \
misc/cstring.h \
widget/selfcamview.h \
widget/camera.h \
widget/netcamview.h \
misc/smileypack.h \
@ -130,7 +129,8 @@ HEADERS += widget/form/addfriendform.h \
widget/tool/chatactions/actionaction.h \
widget/maskablepixmapwidget.h \
videosource.h \
cameraworker.h
cameraworker.h \
widget/videosurface.h
SOURCES += \
widget/form/addfriendform.cpp \
@ -156,7 +156,6 @@ SOURCES += \
misc/settings.cpp \
misc/cdata.cpp \
misc/cstring.cpp \
widget/selfcamview.cpp \
widget/camera.cpp \
widget/netcamview.cpp \
misc/smileypack.cpp \
@ -177,4 +176,5 @@ SOURCES += \
widget/tool/chatactions/systemmessageaction.cpp \
widget/tool/chatactions/actionaction.cpp \
widget/maskablepixmapwidget.cpp \
cameraworker.cpp
cameraworker.cpp \
widget/videosurface.cpp

View File

@ -19,9 +19,7 @@
#include <QImage>
#include <QList>
#include <QQueue>
#include <QMutex>
#include <QMap>
#include "vpx/vpx_image.h"
#include "opencv2/opencv.hpp"
#include "videosource.h"

View File

@ -25,7 +25,7 @@ AVForm::AVForm() :
bodyUI->setupUi(this);
//cam->setVideoMode(cam->getBestVideoMode());
camView = new SelfCamView(Camera::getInstance(), this);
camView = new VideoSurface(Camera::getInstance(), this);
bodyUI->CamViewLayout->addWidget(camView);
}

View File

@ -18,7 +18,7 @@
#define AVFORM_H
#include "genericsettings.h"
#include "widget/selfcamview.h"
#include "widget/videosurface.h"
#include <QGroupBox>
#include <QVBoxLayout>
#include <QPushButton>
@ -47,7 +47,7 @@ private slots:
private:
Ui::AVSettings *bodyUI;
SelfCamView* camView;
VideoSurface* camView;
};
#endif

View File

@ -14,7 +14,7 @@
See the COPYING file for more details.
*/
#include "selfcamview.h"
#include "videosurface.h"
#include "camera.h"
#include <QTimer>
#include <opencv2/opencv.hpp>
@ -22,7 +22,7 @@
#include <QOpenGLShaderProgram>
#include <QDebug>
SelfCamView::SelfCamView(VideoSource *Source, QWidget* parent)
VideoSurface::VideoSurface(VideoSource *Source, QWidget* parent)
: QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
, source(Source)
, pbo(nullptr)
@ -32,11 +32,10 @@ SelfCamView::SelfCamView(VideoSource *Source, QWidget* parent)
, uploadFrame(false)
, hasSubscribed(false)
{
qDebug()<<"NEW VideoSurface:"<<source->resolution();
setFixedSize(source->resolution());
}
SelfCamView::~SelfCamView()
VideoSurface::~VideoSurface()
{
if (pbo)
delete pbo;
@ -47,36 +46,36 @@ SelfCamView::~SelfCamView()
source->unsubscribe();
}
void SelfCamView::hideEvent(QHideEvent *ev)
void VideoSurface::hideEvent(QHideEvent *ev)
{
if (hasSubscribed)
{
source->unsubscribe();
hasSubscribed = false;
disconnect(source, &VideoSource::frameAvailable, this, &SelfCamView::updateGL);
disconnect(source, &VideoSource::frameAvailable, this, &VideoSurface::updateGL);
}
QGLWidget::hideEvent(ev);
}
void SelfCamView::showEvent(QShowEvent *ev)
void VideoSurface::showEvent(QShowEvent *ev)
{
if (!hasSubscribed)
{
source->subscribe();
hasSubscribed = true;
connect(source, &VideoSource::frameAvailable, this, &SelfCamView::updateGL);
connect(source, &VideoSource::frameAvailable, this, &VideoSurface::updateGL);
}
QGLWidget::showEvent(ev);
}
void SelfCamView::initializeGL()
void VideoSurface::initializeGL()
{
}
void SelfCamView::paintGL()
void VideoSurface::paintGL()
{
if (!pbo)
{
@ -189,7 +188,7 @@ void SelfCamView::paintGL()
program->release();
}
void SelfCamView::updateGL()
void VideoSurface::updateGL()
{
uploadFrame = true;
QGLWidget::updateGL();

View File

@ -24,13 +24,13 @@ class QOpenGLShaderProgram;
class QTimer;
class VideoSource;
class SelfCamView : public QGLWidget
class VideoSurface : public QGLWidget
{
Q_OBJECT
public:
SelfCamView(VideoSource* source, QWidget* parent=0);
~SelfCamView();
VideoSurface(VideoSource* source, QWidget* parent=0);
~VideoSurface();
virtual void hideEvent(QHideEvent* ev);
virtual void showEvent(QShowEvent* ev);

View File

@ -27,7 +27,6 @@
#include "widget/groupwidget.h"
#include "widget/form/groupchatform.h"
#include "misc/style.h"
#include "selfcamview.h"
#include "widget/friendlistwidget.h"
#include "camera.h"
#include "widget/form/chatform.h"

View File

@ -34,7 +34,7 @@ class GenericChatroomWidget;
class Group;
struct Friend;
class QSplitter;
class SelfCamView;
class VideoSurface;
class QMenu;
class Core;
class Camera;