3 * Copyright (C) 2013 Miguel Casas-Sanchez <miguelecasassanchez@gmail.com>
5 * This library is free software; you can
6 * redistribute it and/or modify it under the terms of the GNU Library
7 * General Public License as published by the Free Software Foundation;
8 * either version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
12 * General Public License for more details. You should have received a copy
13 * of the GNU Library General Public License along with this library; if
14 * not, write to the Free Software Foundation, Inc., 51 Franklin St,
15 * Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef __GST_OPENNI2_SRC_H__
19 #define __GST_OPENNI2_SRC_H__
25 #include <gst/base/gstbasesrc.h>
26 #include <gst/base/gstpushsrc.h>
27 #include <gst/video/video.h>
30 #define GST_TYPE_OPENNI2_SRC \
31 (gst_openni2_src_get_type())
32 #define GST_OPENNI2_SRC(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENNI2_SRC,GstOpenni2Src))
34 #define GST_OPENNI2_SRC_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENNI2_SRC,GstOpenni2SrcClass))
36 #define GST_IS_OPENNI2_SRC(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENNI2_SRC))
38 #define GST_IS_OPENNI2_SRC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENNI2_SRC))
40 typedef struct _GstOpenni2Src GstOpenni2Src;
41 typedef struct _GstOpenni2SrcClass GstOpenni2SrcClass;
45 GST_OPENNI2_SRC_FILE_TRANSFER,
46 GST_OPENNI2_SRC_NEXT_PROGRAM_CHAIN,
47 GST_OPENNI2_SRC_INVALID_DATA
54 GstOpenni2State state;
60 /* Timestamp of the first frame */
61 GstClockTime oni_start_ts;
63 /* OpenNI2 variables */
64 openni::Device *device;
65 openni::VideoStream *depth, *color;
66 openni::VideoMode depthVideoMode, colorVideoMode;
67 openni::PixelFormat depthpixfmt, colorpixfmt;
68 int width, height, fps;
69 openni::VideoFrameRef *depthFrame, *colorFrame;
72 struct _GstOpenni2SrcClass
74 GstPushSrcClass parent_class;
77 GType gst_openni2_src_get_type (void);
79 GST_ELEMENT_REGISTER_DECLARE (openni2src);
82 #endif /* __GST_OPENNI2_SRC_H__ */