@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
117117 std::string program_path (argv[0 ]);
118118 std::cerr << " Version: " << LIBFREENECT2_VERSION << std::endl;
119119 std::cerr << " Environment variables: LOGFILE=<protonect.log>" << std::endl;
120- std::cerr << " Usage: " << program_path << " [-gpu=<id>] [gl | cl | cuda | cpu] [<device serial>]" << std::endl;
120+ std::cerr << " Usage: " << program_path << " [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]" << std::endl;
121121 std::cerr << " [-noviewer] [-norgb | -nodepth] [-help] [-version]" << std::endl;
122122 std::cerr << " [-frames <number of frames to process>]" << std::endl;
123123 std::cerr << " To pause and unpause: pkill -USR1 Protonect" << std::endl;
@@ -204,6 +204,15 @@ int main(int argc, char *argv[])
204204 pipeline = new libfreenect2::OpenCLPacketPipeline (deviceId);
205205#else
206206 std::cout << " OpenCL pipeline is not supported!" << std::endl;
207+ #endif
208+ }
209+ else if (arg == " clkde" )
210+ {
211+ #ifdef LIBFREENECT2_WITH_OPENCL_SUPPORT
212+ if (!pipeline)
213+ pipeline = new libfreenect2::OpenCLKdePacketPipeline (deviceId);
214+ #else
215+ std::cout << " OpenCL pipeline is not supported!" << std::endl;
207216#endif
208217 }
209218 else if (arg == " cuda" )
@@ -213,6 +222,15 @@ int main(int argc, char *argv[])
213222 pipeline = new libfreenect2::CudaPacketPipeline (deviceId);
214223#else
215224 std::cout << " CUDA pipeline is not supported!" << std::endl;
225+ #endif
226+ }
227+ else if (arg == " cudakde" )
228+ {
229+ #ifdef LIBFREENECT2_WITH_CUDA_SUPPORT
230+ if (!pipeline)
231+ pipeline = new libfreenect2::CudaKdePacketPipeline (deviceId);
232+ #else
233+ std::cout << " CUDA pipeline is not supported!" << std::endl;
216234#endif
217235 }
218236 else if (arg.find_first_not_of (" 0123456789" ) == std::string::npos) // check if parameter could be a serial number
@@ -357,7 +375,11 @@ if (recorder_enabled)
357375// / [loop start]
358376 while (!protonect_shutdown && (framemax == (size_t )-1 || framecount < framemax))
359377 {
360- listener.waitForNewFrame (frames);
378+ if (!listener.waitForNewFrame (frames, 10 *1000 )) // 10 sconds
379+ {
380+ std::cout << " timeout!" << std::endl;
381+ return -1 ;
382+ }
361383 libfreenect2::Frame *rgb = frames[libfreenect2::Frame::Color];
362384 libfreenect2::Frame *ir = frames[libfreenect2::Frame::Ir];
363385 libfreenect2::Frame *depth = frames[libfreenect2::Frame::Depth];
0 commit comments