提交 a602f93f 编写于 作者: T Tianyi Zhao 提交者: Gines

Alpha Unity plugin version (#805)

上级 d9ea6786
......@@ -366,7 +366,7 @@ int openPoseDemo()
(float)FLAGS_hand_alpha_heatmap, (float)FLAGS_hand_render_threshold};
// Producer (use default to disable any input)
const op::WrapperStructInput wrapperStructInput{
producerSharedPtr, FLAGS_frame_first, FLAGS_frame_last, FLAGS_process_real_time, FLAGS_frame_flip,
producerSharedPtr, FLAGS_frame_first, FLAGS_frame_last, FLAGS_process_real_time, FLAGS_frame_flip,
FLAGS_frame_rotate, FLAGS_frames_repeat};
// Extra functionality configuration (use op::WrapperStructExtra{} to disable it)
const op::WrapperStructExtra wrapperStructExtra{
......@@ -388,7 +388,6 @@ int openPoseDemo()
// Start processing
// Two different ways of running the program on multithread environment
op::log("Starting thread(s)...", op::Priority::High);
// Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// Start, run & stop threads - it blocks this thread until all others have finished
opWrapper.exec();
......
......@@ -425,7 +425,6 @@ int openPoseDemo()
// Start processing
// Two different ways of running the program on multithread environment
op::log("Starting thread(s)...", op::Priority::High);
// Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// Start, run & stop threads - it blocks this thread until all others have finished
opWrapper.exec();
......
......@@ -416,7 +416,7 @@ int openPoseDemo()
FLAGS_3d, FLAGS_3d_min_views, FLAGS_identification, FLAGS_tracking, FLAGS_ik_threads};
// Producer (use default to disable any input)
const op::WrapperStructInput wrapperStructInput{
producerSharedPtr, FLAGS_frame_first, FLAGS_frame_last, FLAGS_process_real_time, FLAGS_frame_flip,
producerSharedPtr, FLAGS_frame_first, FLAGS_frame_last, FLAGS_process_real_time, FLAGS_frame_flip,
FLAGS_frame_rotate, FLAGS_frames_repeat};
// Consumer (comment or use default argument to disable any output)
// const op::WrapperStructOutput wrapperStructOutput{op::flagsToDisplayMode(FLAGS_display, FLAGS_3d),
......@@ -440,7 +440,6 @@ int openPoseDemo()
// Start processing
// Two different ways of running the program on multithread environment
op::log("Starting thread(s)...", op::Priority::High);
// Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// Start, run & stop threads - it blocks this thread until all others have finished
opWrapper.exec();
......
......@@ -492,7 +492,6 @@ int openPoseTutorialWrapper2()
op::log("Starting thread(s)...", op::Priority::High);
// Two different ways of running the program on multithread environment
// Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// Start, run & stop threads - it blocks this thread until all others have finished
opWrapper.exec();
......
......@@ -7,6 +7,38 @@
namespace op
{
#ifdef USE_UNITY_SUPPORT
namespace UnityDebugger
{
typedef void(__stdcall * DebugCallback) (const char* const str, int type);
DebugCallback gDebugCallback;
extern "C" void OP_API OP_RegisterDebugCallback(DebugCallback& debugCallback)
{
if (debugCallback)
gDebugCallback = debugCallback;
}
void DebugInUnity(const std::string& message, const int type)
{
if (gDebugCallback)
gDebugCallback(message.c_str(), type);
}
void log(const std::string& message)
{
DebugInUnity(message, 0);
}
void logWarning(const std::string& message)
{
DebugInUnity(message, 1);
}
void logError(const std::string& message)
{
DebugInUnity(message, -1);
}
}
#endif
// Private auxiliar functions
......@@ -147,6 +179,7 @@ namespace op
// Unity logError
#ifdef USE_UNITY_SUPPORT
UnityDebugger::logError(errorMessageToPrint);
#endif
// std::runtime_error
......@@ -171,6 +204,7 @@ namespace op
// Unity log
#ifdef USE_UNITY_SUPPORT
UnityDebugger::log(infoMessage);
#endif
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册