From 8303597a865400a363ae574ccde819302495f498 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik <sthalik@misaki.pl> Date: Tue, 2 Apr 2013 18:41:01 +0200 Subject: Just put everything new in. Conflict resolution will be later --- faceapi/ftnoir-faceapi-wrapper.exe.manifest | 15 +++++++++++++++ faceapi/ftnoir-faceapi-wrapper.rc | 2 ++ faceapi/main.cpp | 11 +++-------- faceapi/mutex.h | 4 +++- faceapi/stdafx.h | 27 +++++++++++++++++++++------ faceapi/utils.h | 5 ++++- 6 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 faceapi/ftnoir-faceapi-wrapper.exe.manifest create mode 100644 faceapi/ftnoir-faceapi-wrapper.rc (limited to 'faceapi') 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(); \ } \ } -- cgit v1.2.3