-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvirtualcamera.h
More file actions
72 lines (66 loc) · 1.56 KB
/
virtualcamera.h
File metadata and controls
72 lines (66 loc) · 1.56 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
#ifndef MATRIX_VIRTUALCAMERA_H
#define MATRIX_VIRTUALCAMERA_H
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <regex>
#include <algorithm>
#include <cctype>
#include <string>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <cstdlib>
#include <fcntl.h>
#include <sys/mman.h>
#include <QImage>
#include <QApplication>
#include <QMessageBox>
#include <QProcess>
#include <QStandardPaths>
#include <QThread>
#include <iostream>
#include <fstream>
#include <string>
#include <string_view>
#include <cstdlib>
#include <signal.h>
#include <cstring>
#include <opencv2/opencv.hpp>
#include "mainwindow.h"
#include "videoprocesssing.h"
class VirtualCamera : public QObject
{
Q_OBJECT
public:
VirtualCamera(QObject *parent = nullptr);
QProcess process;
QProcess processPipeline;
public slots:
void setup();
bool isV4l2LoopbackInstalled();
bool isV4l2Enabled();
void updateVirtualFrame(const QImage& image);
void configureVirtualCamera();
void enableV4l2();
void stop();
private:
bool detectDummyVideoDevice();
std::string devicePath;
bool installed;
bool enabled;
bool cameraDetected;
QString pidFileName;
cv::Mat QImageToCvMat(const QImage &image);
QProcess processActivateVirtCam;
QProcess checkProcess;
QString outputFileName;
std::filesystem::path tempFile;
void killProcessByPath();
void createScript(const std::string& scriptPath);
void handleProcessOutput();
QIcon iconMatrix;
};
#endif // VIRTUALCAMERA_H