diff options
Diffstat (limited to 'video/camera.hpp')
-rw-r--r-- | video/camera.hpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/video/camera.hpp b/video/camera.hpp index a0fe0adb..6181dbf3 100644 --- a/video/camera.hpp +++ b/video/camera.hpp @@ -48,11 +48,14 @@ struct OTR_VIDEO_EXPORT camera { struct info final { + enum : unsigned char { channels_gray = 1, channels_bgr = 3 }; // TODO: expose FOV-based focal length for regular webcams int width = 0, height = 0, fps = 0; double fx = 0, fy = 0; // focal length double P_x = 0, P_y = 0; // principal point double dist_c[8] {}; // distortion coefficients + bool use_mjpeg = false; + int num_channels = channels_bgr; }; camera(); @@ -75,12 +78,22 @@ void register_camera(std::unique_ptr<impl::camera_> metadata); static const char init_ ## ctr = \ (::video::impl::register_camera(std::make_unique<type>()), 0); -#define OTR_REGISTER_CAMERA2(type, ctr) \ - OTR_REGISTER_CAMERA3(type, ctr) +#ifdef _MSC_VER + // shared library targets without any symbols break cmake build +# define OTR_REGISTER_CAMERA_IMPL(type) \ + extern "C" [[maybe_unused]] __declspec(dllexport) \ + void _opentrack_module_video_ ##type (void) {} +# define OTR_REGISTER_CAMERA_IMPL2(type) \ + OTR_REGISTER_CAMERA_IMPL(type) +#else +# define OTR_REGISTER_CAMERA_IMPL2(type) +#endif +#define OTR_REGISTER_CAMERA2(type, ctr) \ + OTR_REGISTER_CAMERA3(type, ctr) \ + OTR_REGISTER_CAMERA_IMPL2(type) #define OTR_REGISTER_CAMERA(type) \ OTR_REGISTER_CAMERA2(type, __COUNTER__) - namespace video { using camera_impl = impl::camera; |