-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVideoThread.h
More file actions
140 lines (109 loc) · 3.38 KB
/
Copy pathVideoThread.h
File metadata and controls
140 lines (109 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
Vidiot id a VIDeo Input Output Transformer With a Touch of Functionality
Copyright (C) 2016 Delicode Ltd
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VIDEOTHREAD_H
#define VIDEOTHREAD_H
#include "VideoPlayer.h"
#include "TextureUploader.h"
#include "TextureDownloader.h"
#include "FeedInput.h"
#include "VideoRecorder.h"
#include "VideoView.h"
#include "predefines.h"
class CaptureProcessor : public QObject
{
Q_OBJECT
public:
CaptureProcessor();
virtual ~CaptureProcessor();
void setVideoView(VideoView *vv);
void setMainView(QQuickView *mv);
void setPingRequired(bool required) {ping_required = required;}
static QStringList listDevices();
QOpenGLWidget *gl;
VideoPlayer *player;
TextureUploader *uploader;
TextureDownloader *downloader;
FeedInput *feed_input;
VideoRecorder *recorder;
VideoView *video_view;
QQuickView *main_view;
bool recording;
QString current_sourcename;
QString prev_sourcename;
QStringList current_sourcelist;
QStringList current_qualitylist;
QStringList current_resolutionlist;
QString record_filename;
QElapsedTimer ping_time;
QElapsedTimer record_time;
QElapsedTimer t;
QList<float> fps;
public slots:
void process();
void updateSourceList(bool reset = false);
void setSource(QString sourcename);
void stop();
void setResolution(QString resolution_str);
void record(bool enable);
void record(QString filename);
void play(bool enable);
void seek(bool enable, float pos);
void rewind();
void action(QString action_str);
void updateResolutionList(int w = 0, int h = 0);
void ping();
void setDuration(qint64 duration_ms);
void setPosition(qint64 position_ms);
void cameraPropertiesRequested() {emit showCameraProperties();}
signals:
void sourceError(QString reason);
void pos(float time_s);
void updateFPS(float fps);
void updateSleeptime(float time_ms);
void updateRecordtime(float time_s);
void playVideo(QString filename);
void sendFeed(unsigned int, int, int, bool);
void sendFeedFbo(unsigned int, int, int, bool);
void sendResolution(int,int);
void error(QString error_str);
void showCameraProperties();
void quit();
void stopRecording();
void newRecorderFrame(RecorderFrame fr);
void sourcesListUpdate(QStringList);
void resolutionsChanged(QStringList);
private:
QString resolution;
bool ping_required;
};
class CaptureThread : public QThread
{
Q_OBJECT
public:
CaptureThread();
void run();
CaptureProcessor processor;
QTimer runtimer;
};
class RecordThread : public QThread
{
Q_OBJECT
public:
RecordThread();
void run();
RecorderController controller;
QTimer runtimer;
};
#endif //VIDEOTHREAD_H