-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera.h
More file actions
32 lines (27 loc) · 1.18 KB
/
camera.h
File metadata and controls
32 lines (27 loc) · 1.18 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
#ifndef CAMERA_H
#define CAMERA_H
#include <napi.h>
#include "capture.h"
class Camera : public Napi::ObjectWrap<Camera> {
public:
static Napi::Object Init(Napi::Env env, Napi::Object exports);
Camera(const Napi::CallbackInfo& info);
~Camera();
CCapture* device;
IMFActivate* claimedActivate = nullptr;
// Camera delegates supported-format and format-setting operations to CCapture
Napi::Value EnumerateDevicesAsync(const Napi::CallbackInfo& info);
Napi::Value ClaimDeviceAsync(const Napi::CallbackInfo& info);
Napi::Value ReleaseDeviceAsync(const Napi::CallbackInfo& info);
Napi::Value StartCaptureAsync(const Napi::CallbackInfo& info);
Napi::Value StopCaptureAsync(const Napi::CallbackInfo& info);
Napi::Value GetDimensions(const Napi::CallbackInfo& info);
Napi::Value GetSupportedFormatsAsync(const Napi::CallbackInfo& info);
Napi::Value GetCameraInfoAsync(const Napi::CallbackInfo& info);
Napi::Value SetFormatAsync(const Napi::CallbackInfo& info);
Napi::Value SetOutputFormatAsync(const Napi::CallbackInfo& info);
// Thread-safe function used to deliver frames from native code to JS
Napi::ThreadSafeFunction frameTsfn;
bool isCapturing = false;
};
#endif