- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcamera.cpp
More file actions
Latest commit
57 lines (46 loc) · 1.03 KB
/
Copy pathcamera.cpp
File metadata and controls
57 lines (46 loc) · 1.03 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
#include"camera.h"
#ifdef Q_OS_ANDROID
#defineCAMERA_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=newCameraBackendAndroid();
#elif defined(CAMERA_SUBTEX)
backend=newCameraBackendAndroidSW();
#endif
//backend=new Camera2BackendAndroid();
#else
backend=newCameraBackendQt();
#endif
connect(backend, SIGNAL(frameAvailable(void)), this, SIGNAL(frameAvailable(void)), Qt::DirectConnection);
}
Camera::~Camera()
{
}
voidCamera::start(int width, int height, GLuint textureId)
{
backend->open(width, height, textureId);
}
voidCamera::updateFrame()
{
backend->updateFrame();
}
voidCamera::stop()
{
backend->close();
}
GLenum Camera::textureType()
{
return backend->textureType();
}