summaryrefslogtreecommitdiffhomepage
path: root/faceapi
diff options
context:
space:
mode:
Diffstat (limited to 'faceapi')
-rw-r--r--faceapi/ftnoir-faceapi-wrapper.exe.manifest15
-rw-r--r--faceapi/ftnoir-faceapi-wrapper.rc2
-rw-r--r--faceapi/main.cpp11
-rw-r--r--faceapi/mutex.h4
-rw-r--r--faceapi/stdafx.h27
-rw-r--r--faceapi/utils.h5
6 files changed, 48 insertions, 16 deletions
diff --git a/faceapi/ftnoir-faceapi-wrapper.exe.manifest b/faceapi/ftnoir-faceapi-wrapper.exe.manifest
new file mode 100644
index 00000000..b6c98376
--- /dev/null
+++ b/faceapi/ftnoir-faceapi-wrapper.exe.manifest
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
+ </assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
+ </assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+</assembly> \ No newline at end of file
diff --git a/faceapi/ftnoir-faceapi-wrapper.rc b/faceapi/ftnoir-faceapi-wrapper.rc
new file mode 100644
index 00000000..54cbb863
--- /dev/null
+++ b/faceapi/ftnoir-faceapi-wrapper.rc
@@ -0,0 +1,2 @@
+#include "winuser.h"
+2 RT_MANIFEST ftnoir-faceapi-wrapper.exe.manifest \ No newline at end of file
diff --git a/faceapi/main.cpp b/faceapi/main.cpp
index 46732cb3..64e721f4 100644
--- a/faceapi/main.cpp
+++ b/faceapi/main.cpp
@@ -36,8 +36,9 @@
//FaceAPI headers
#include <sm_api.h>
-#include "ftnoir_tracker_sm_types.h"
+#include "ftnoir_tracker_base/ftnoir_tracker_sm_types.h"
#include "utils.h"
+#include <exception>
//local headers
#include "build_options.h"
@@ -171,7 +172,7 @@ smCameraHandle createFirstCamera()
if (info_list.num_cameras == 0)
{
- throw runtime_error("No cameras were detected");
+ throw std::exception();
}
else
{
@@ -211,7 +212,6 @@ smCameraHandle createFirstCamera()
// The main function: setup a tracking engine and show a video window, then loop on the keyboard.
void run()
{
- char msg[100];
int state;
// Capture control-C
@@ -377,11 +377,6 @@ void run()
//
if (ftnoirConnected && (pMemData != 0)) {
- sprintf_s(msg, "Command: %d, \n", pMemData->command, pMemData->par_val_int);
- OutputDebugStringA(msg);
- std::cout << msg;
-
- //
//
// Determine the trackers' state and send it to FaceTrackNoIR.
//
diff --git a/faceapi/mutex.h b/faceapi/mutex.h
index 11aabafc..a4f84705 100644
--- a/faceapi/mutex.h
+++ b/faceapi/mutex.h
@@ -1,6 +1,8 @@
#ifndef SM_API_TESTAPPCONSOLE_MUTEX_H
#define SM_API_TESTAPPCONSOLE_MUTEX_H
+#include <exception>
+
namespace sm
{
namespace faceapi
@@ -16,7 +18,7 @@ namespace sm
{
if (!InitializeCriticalSectionAndSpinCount(&_cs,0x80000400))
{
- throw std::runtime_error("Failed to initialize Mutex");
+ throw std::exception();
}
}
~Mutex()
diff --git a/faceapi/stdafx.h b/faceapi/stdafx.h
index d97c9353..1fdab0b1 100644
--- a/faceapi/stdafx.h
+++ b/faceapi/stdafx.h
@@ -1,8 +1,3 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
#pragma once
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
@@ -12,10 +7,30 @@
#include <stdio.h>
#include <tchar.h>
-// TODO: reference additional headers your program requires here
+#ifndef _MSC_VER
+
+#include <inttypes.h>
+
+typedef uint64_t u_int64_t;
+typedef uint32_t u_int32_t;
+typedef uint16_t u_int16_t;
+typedef uint8_t u_int8_t;
+#endif
+
#include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <conio.h>
+#include <sm_api_configure.h>
+#ifdef SM_API
+# undef SM_API
+#endif
+#ifdef STDCALL
+# undef STDCALL
+#endif
+
+#define SM_API(type) type __declspec(dllimport) __stdcall
+#define STDCALL __stdcall
+
#include <sm_api.h>
diff --git a/faceapi/utils.h b/faceapi/utils.h
index 1fdb35b5..5d25e9a7 100644
--- a/faceapi/utils.h
+++ b/faceapi/utils.h
@@ -2,6 +2,8 @@
#define SM_API_TESTAPPCONSOLE_UTILS_H
#include "lock.h"
+#include <exception>
+#include <iostream>
#define THROW_ON_ERROR(x) \
{ \
@@ -10,7 +12,8 @@
{ \
std::stringstream s; \
s << "API error code: " << result; \
- throw std::runtime_error(s.str()); \
+ std::cerr << s; \
+ throw std::exception(); \
} \
}