3030#define PACKET_PIPELINE_H_
3131
3232#include < libfreenect2/config.h>
33- #include < libfreenect2/depth_packet_processor.h>
34- #include < libfreenect2/rgb_packet_processor.h>
3533
3634namespace libfreenect2
3735{
3836
3937class DataCallback ;
38+ class RgbPacketProcessor ;
39+ class DepthPacketProcessor ;
40+ class PacketPipelineComponents ;
4041
41- /* * Packet pipeline for data processing of the device. */
42+ class ConfigPacketProcessor ;
43+ #ifndef LIBFREENECT2_SETCONFIGURATION_COMPAT_INTERNAL
44+ #define DepthPacketProcessor ConfigPacketProcessor
45+ #endif
46+
47+ /* * Front of the pipeline, RGB and Depth parsing and processing. */
4248class LIBFREENECT2_API PacketPipeline
4349{
4450public:
4551 typedef DataCallback PacketParser;
46- virtual ~PacketPipeline ();
47-
48- virtual PacketParser *getRgbPacketParser () const = 0;
49- virtual PacketParser *getIrPacketParser () const = 0;
50-
51- virtual RgbPacketProcessor *getRgbPacketProcessor () const = 0;
52- virtual DepthPacketProcessor *getDepthPacketProcessor () const = 0;
53- };
54-
55- class RgbPacketStreamParser ;
56- class DepthPacketStreamParser ;
57-
58- /* * Front of the pipeline, RGB and Depth parsing and processing. */
59- class LIBFREENECT2_API BasePacketPipeline : public PacketPipeline
60- {
61- protected:
62- RgbPacketStreamParser *rgb_parser_;
63- DepthPacketStreamParser *depth_parser_;
64-
65- RgbPacketProcessor *rgb_processor_;
66- BaseRgbPacketProcessor *async_rgb_processor_;
67- DepthPacketProcessor *depth_processor_;
68- BaseDepthPacketProcessor *async_depth_processor_;
6952
70- virtual void initialize ();
71- virtual DepthPacketProcessor *createDepthPacketProcessor () = 0;
72- public:
73- virtual ~BasePacketPipeline ();
53+ PacketPipeline ();
54+ virtual ~PacketPipeline ();
7455
7556 virtual PacketParser *getRgbPacketParser () const ;
7657 virtual PacketParser *getIrPacketParser () const ;
7758
7859 virtual RgbPacketProcessor *getRgbPacketProcessor () const ;
7960 virtual DepthPacketProcessor *getDepthPacketProcessor () const ;
61+ protected:
62+ PacketPipelineComponents *comp_;
8063};
8164
8265/* * Complete pipe line with depth processing by the CPU. */
83- class LIBFREENECT2_API CpuPacketPipeline : public BasePacketPipeline
66+ class LIBFREENECT2_API CpuPacketPipeline : public PacketPipeline
8467{
85- protected:
86- virtual DepthPacketProcessor *createDepthPacketProcessor ();
8768public:
8869 CpuPacketPipeline ();
8970 virtual ~CpuPacketPipeline ();
9071};
9172
9273#ifdef LIBFREENECT2_WITH_OPENGL_SUPPORT
9374/* * Complete pipe line with depth processing with OpenGL. */
94- class LIBFREENECT2_API OpenGLPacketPipeline : public BasePacketPipeline
75+ class LIBFREENECT2_API OpenGLPacketPipeline : public PacketPipeline
9576{
9677protected:
9778 void *parent_opengl_context_;
9879 bool debug_;
99- virtual DepthPacketProcessor *createDepthPacketProcessor ();
10080public:
10181 OpenGLPacketPipeline (void *parent_opengl_context = 0 , bool debug = false );
10282 virtual ~OpenGLPacketPipeline ();
@@ -105,11 +85,10 @@ class LIBFREENECT2_API OpenGLPacketPipeline : public BasePacketPipeline
10585
10686#ifdef LIBFREENECT2_WITH_OPENCL_SUPPORT
10787/* * Complete pipe line with depth processing with OpenCL. */
108- class LIBFREENECT2_API OpenCLPacketPipeline : public BasePacketPipeline
88+ class LIBFREENECT2_API OpenCLPacketPipeline : public PacketPipeline
10989{
11090protected:
11191 const int deviceId;
112- virtual DepthPacketProcessor *createDepthPacketProcessor ();
11392public:
11493 OpenCLPacketPipeline (const int deviceId = -1 );
11594 virtual ~OpenCLPacketPipeline ();
0 commit comments