Skip to content

Commit cdeb079

Browse files
committed
Merge pull request #435 from fran6co/fix-apple
Fixes missing subpackets in OS X
2 parents b8aaef1 + 8e2b1eb commit cdeb079

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/libfreenect2.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
#include <libfreenect2/protocol/command_transaction.h>
4646
#include <libfreenect2/logging.h>
4747

48+
#ifdef __APPLE__
49+
#define PKTS_PER_XFER 128
50+
#define NUM_XFERS 4
51+
#else
52+
#define PKTS_PER_XFER 8
53+
#define NUM_XFERS 60
54+
#endif
55+
4856
namespace libfreenect2
4957
{
5058
using namespace libfreenect2;
@@ -634,8 +642,8 @@ bool Freenect2DeviceImpl::open()
634642
return false;
635643
}
636644

637-
rgb_transfer_pool_.allocate(50, 0x4000);
638-
ir_transfer_pool_.allocate(80, 8, max_iso_packet_size);
645+
rgb_transfer_pool_.allocate(20, 0x4000);
646+
ir_transfer_pool_.allocate(NUM_XFERS, PKTS_PER_XFER, max_iso_packet_size);
639647

640648
state_ = Open;
641649

@@ -759,7 +767,7 @@ void Freenect2DeviceImpl::start()
759767

760768
LOG_INFO << "submitting usb transfers...";
761769
rgb_transfer_pool_.submit(20);
762-
ir_transfer_pool_.submit(60);
770+
ir_transfer_pool_.submit(NUM_XFERS);
763771

764772
state_ = Streaming;
765773
LOG_INFO << "started";

0 commit comments

Comments
 (0)