summaryrefslogtreecommitdiffhomepage
path: root/cv/camera-dialog.hpp.OO4364
blob: e99b5f6e5a834edbd75f7ae2fbd111d2e44b4040 (plain)
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
/* Copyright (c) 2015, Stanislaw Halik <sthalik@misaki.pl>

 * Permission to use, copy, modify, and/or distribute this
 * software for any purpose with or without fee is hereby granted,
 * provided that the above copyright notice and this permission
 * notice appear in all copies.
 */

#pragma once

#include "export.hpp"
#include "opentrack-compat/camera-names.hpp"
#include "opentrack-compat/sleep.hpp"

#ifdef __linux
#   include <QProcess>
#endif

#ifdef _WIN32
#   include <objbase.h>
#   include <winerror.h>
#   include <windows.h>
#   include <opencv2/videoio.hpp>
#   include <QTimer>
#endif

#include <QMutex>

class OPENTRACK_CV_EXPORT camera_dialog
{
    static void maybe_grab_frame(cv::VideoCapture& cap);
#ifdef _WIN32
    static void init_com_threading();
#endif

public:
    virtual ~camera_dialog();
    void open_camera_settings(cv::VideoCapture*, const QString&, QMutex*);
#if defined(_WIN32)
    cv::VideoCapture fake_capture;
    QTimer t;
    void delete_capture();
#endif
};