-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamerabackendandroid.h
37 lines (32 loc) · 1.08 KB
/
camerabackendandroid.h
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
#ifndef CAMERABACKENDANDROID_H
#define CAMERABACKENDANDROID_H
#include <QAndroidJniEnvironment>
#include <QAndroidJniObject>
#include <QOpenGLFunctions>
#include "camerabackend.h"
/**
* @brief The CameraBackendAndroid class provides and access to cameras frames with GL_TEXTURE_EXTERNAL_OES.
*/
class CameraBackendAndroid: public CameraBackend
{
Q_OBJECT
public:
CameraBackendAndroid();
~CameraBackendAndroid();
/**
* @brief open Opens the camera. This methos has to be called from thread with active current OpenGL context.
* @param width
* @param height
* @param textureId The OpenGL texture id, the texture must have a type GL_TEXTURE_EXTERNAL_OES. The texture must be associated to current context.
* @return
*/
bool open(int width, int height, GLuint textureId) override;
void close() override;
void updateFrame() override;
GLenum textureType() override;
private:
static void onFrameAvailable(JNIEnv *, jobject);
QAndroidJniObject * java_backend;
static CameraBackendAndroid * self;
};
#endif // CAMERABACKENDANDROID_H