Skip to content

Commit cdd4f06

Browse files
committedNov 21, 2015
api: Work around setConfiguration in iai_kinect2
iai_kinect2 used p->getDepthPacketProcessor()->setConfiguration() to configure the device. This is deprecated, but here provides compatibility for such usage.
1 parent c74196b commit cdd4f06

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed
 

‎include/internal/libfreenect2/depth_packet_processor.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <stdint.h>
3434

3535
#include <libfreenect2/config.h>
36+
#define LIBFREENECT2_SETCONFIGURATION_COMPAT_INTERNAL
3637
#include <libfreenect2/libfreenect2.hpp>
3738
#include <libfreenect2/frame_listener.hpp>
3839
#include <libfreenect2/packet_processor.h>
@@ -52,7 +53,7 @@ struct DepthPacket
5253
/** Class for processing depth information. */
5354
typedef PacketProcessor<DepthPacket> BaseDepthPacketProcessor;
5455

55-
class DepthPacketProcessor : public BaseDepthPacketProcessor
56+
class DepthPacketProcessor : public ConfigPacketProcessor, public BaseDepthPacketProcessor
5657
{
5758
public:
5859
typedef Freenect2Device::Config Config;

‎include/libfreenect2/libfreenect2.hpp

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ class LIBFREENECT2_API Freenect2Device
112112
virtual void close() = 0;
113113
};
114114

115+
/** @deprecated Use Freenect2Device::setConfiguration() instead.
116+
*/
117+
class ConfigPacketProcessor
118+
{
119+
public:
120+
typedef Freenect2Device::Config Config;
121+
LIBFREENECT2_DEPRECATED virtual void setConfiguration(const Config &config) = 0;
122+
};
123+
115124
class Freenect2Impl;
116125

117126
/**

‎include/libfreenect2/packet_pipeline.h

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class RgbPacketProcessor;
3939
class DepthPacketProcessor;
4040
class PacketPipelineComponents;
4141

42+
class ConfigPacketProcessor;
43+
#ifndef LIBFREENECT2_SETCONFIGURATION_COMPAT_INTERNAL
44+
#define DepthPacketProcessor ConfigPacketProcessor
45+
#endif
46+
4247
/** Front of the pipeline, RGB and Depth parsing and processing. */
4348
class LIBFREENECT2_API PacketPipeline
4449
{

‎src/libfreenect2.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <cmath>
3535
#define WRITE_LIBUSB_ERROR(__RESULT) libusb_error_name(__RESULT) << " " << libusb_strerror((libusb_error)__RESULT)
3636

37+
#define LIBFREENECT2_SETCONFIGURATION_COMPAT_INTERNAL
3738
#include <libfreenect2/libfreenect2.hpp>
3839

3940
#include <libfreenect2/usb/event_loop.h>

‎src/packet_pipeline.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
/** @file packet_pipeline.cpp Packet pipeline implementation. */
2828

29+
#define LIBFREENECT2_SETCONFIGURATION_COMPAT_INTERNAL
2930
#include <libfreenect2/packet_pipeline.h>
3031
#include <libfreenect2/async_packet_processor.h>
3132
#include <libfreenect2/data_callback.h>

0 commit comments

Comments
 (0)