-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamera.cpp
57 lines (46 loc) · 1.03 KB
/
camera.cpp
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
#include "camera.h"
#ifdef Q_OS_ANDROID
#define CAMERA_EXTERNAL_OES
// #define CAMERA_SUBTEX
#ifdef CAMERA_EXTERNAL_OES
#include "camerabackendandroid.h"
#include "camera2backendandroid.h"
#elif defined(CAMERA_SUBTEX)
#include "camerabackendandroidsw.h"
#endif
#else
#include "camerabackendqt.h"
#endif
Camera::Camera()
{
#ifdef Q_OS_ANDROID
#ifdef CAMERA_EXTERNAL_OES
backend=new CameraBackendAndroid();
#elif defined(CAMERA_SUBTEX)
backend=new CameraBackendAndroidSW();
#endif
//backend=new Camera2BackendAndroid();
#else
backend=new CameraBackendQt();
#endif
connect(backend, SIGNAL(frameAvailable(void)), this, SIGNAL(frameAvailable(void)), Qt::DirectConnection);
}
Camera::~Camera()
{
}
void Camera::start(int width, int height, GLuint textureId)
{
backend->open(width, height, textureId);
}
void Camera::updateFrame()
{
backend->updateFrame();
}
void Camera::stop()
{
backend->close();
}
GLenum Camera::textureType()
{
return backend->textureType();
}