40 #ifndef __OPENNI_DEVICE_ONI__
41 #define __OPENNI_DEVICE_ONI__
46 namespace openni_wrapper
55 class DeviceONI :
public OpenNIDevice
57 friend class OpenNIDriver;
59 DeviceONI (xn::Context& context,
const std::string& file_name,
bool repeat =
false,
bool streaming =
true);
60 virtual ~DeviceONI () throw ();
62 virtual
void startImageStream ();
63 virtual
void stopImageStream ();
65 virtual
void startDepthStream ();
66 virtual
void stopDepthStream ();
68 virtual
void startIRStream ();
69 virtual
void stopIRStream ();
71 virtual
bool isImageStreamRunning () const throw ();
72 virtual
bool isDepthStreamRunning () const throw ();
73 virtual
bool isIRStreamRunning () const throw ();
75 virtual
bool isImageResizeSupported (
unsigned input_width,
unsigned input_height,
unsigned output_width,
unsigned output_height) const throw ();
78 bool isStreaming () const throw ();
80 virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_meta_data) const throw ();
82 void PlayerThreadFunction ();
83 static
void __stdcall NewONIDepthDataAvailable (xn::ProductionNode& node,
void* cookie) throw ();
84 static
void __stdcall NewONIImageDataAvailable (xn::ProductionNode& node,
void* cookie) throw ();
85 static
void __stdcall NewONIIRDataAvailable (xn::ProductionNode& node,
void* cookie) throw ();
88 boost::thread player_thread_;
89 mutable boost::mutex player_mutex_;
90 boost::condition_variable player_condition_;
92 bool depth_stream_running_;
93 bool image_stream_running_;
94 bool ir_stream_running_;
98 #endif //__OPENNI_DEVICE_ONI__