@@ -511,6 +511,8 @@ class Freenect2Impl
511511 }
512512 return enumerated_devices_.size ();
513513 }
514+
515+ Freenect2Device *openDevice (int idx, const PacketPipeline *factory, bool attempting_reset);
514516};
515517
516518
@@ -912,12 +914,12 @@ Freenect2Device *Freenect2::openDevice(int idx)
912914
913915Freenect2Device *Freenect2::openDevice (int idx, const PacketPipeline *pipeline)
914916{
915- return openDevice (idx, pipeline, true );
917+ return impl_-> openDevice (idx, pipeline, true );
916918}
917919
918- Freenect2Device *Freenect2 ::openDevice (int idx, const PacketPipeline *pipeline, bool attempting_reset)
920+ Freenect2Device *Freenect2Impl ::openDevice (int idx, const PacketPipeline *pipeline, bool attempting_reset)
919921{
920- int num_devices = impl_-> getNumDevices ();
922+ int num_devices = getNumDevices ();
921923 Freenect2DeviceImpl *device = 0 ;
922924
923925 if (idx >= num_devices)
@@ -928,10 +930,10 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
928930 return device;
929931 }
930932
931- Freenect2Impl::UsbDeviceWithSerial &dev = impl_-> enumerated_devices_ [idx];
933+ Freenect2Impl::UsbDeviceWithSerial &dev = enumerated_devices_[idx];
932934 libusb_device_handle *dev_handle;
933935
934- if (impl_-> tryGetDevice (dev.dev , &device))
936+ if (tryGetDevice (dev.dev , &device))
935937 {
936938 LOG_WARNING << " device " << PrintBusAndDevice (dev.dev )
937939 << " is already be open!" ;
@@ -975,8 +977,8 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
975977
976978 // reenumerate devices
977979 LOG_INFO << " re-enumerating devices after reset" ;
978- impl_-> clearDeviceEnumeration ();
979- impl_-> enumerateDevices ();
980+ clearDeviceEnumeration ();
981+ enumerateDevices ();
980982
981983 // re-open without reset
982984 return openDevice (idx, pipeline, false );
@@ -990,8 +992,8 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
990992 }
991993 }
992994
993- device = new Freenect2DeviceImpl (impl_ , pipeline, dev.dev , dev_handle, dev.serial );
994- impl_-> addDevice (device);
995+ device = new Freenect2DeviceImpl (this , pipeline, dev.dev , dev_handle, dev.serial );
996+ addDevice (device);
995997
996998 if (!device->open ())
997999 {
0 commit comments