├── .cproject
├── .gitignore
├── .project
├── Makefile
├── addons.make
├── bin
└── data
│ └── settings.xml
├── config.make
├── kinectStream.cbp
├── kinectStream.workspace
├── src
├── main.cpp
├── testApp.cpp
└── testApp.h
└── web
├── js
├── DAT.GUI.min.js
├── Detector.js
├── RequestAnimationFrame.js
├── Stats.js
└── Three.js
├── live.html
├── live_3D.html
├── load-balance.php
├── servers.txt
└── stream_proxy.php
/.cproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/cc
2 | bin/classes
3 | bin/libs
4 | bin/kinectStream
5 | bin/kinectStream_debug
6 | obj
7 | gen
8 | local.properties
9 | .settings
10 | .externalToolBuilders
11 | libOFAndroidApp.so
12 | *.apk
13 | *.ap_
14 | *.dex
15 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | kinectStream
4 |
5 |
6 | libs
7 | openFrameworks
8 |
9 |
10 |
11 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
12 | clean,full,incremental,
13 |
14 |
15 | ?name?
16 |
17 |
18 |
19 | org.eclipse.cdt.make.core.append_environment
20 | true
21 |
22 |
23 | org.eclipse.cdt.make.core.autoBuildTarget
24 | all
25 |
26 |
27 | org.eclipse.cdt.make.core.buildArguments
28 |
29 |
30 |
31 | org.eclipse.cdt.make.core.buildCommand
32 | make
33 |
34 |
35 | org.eclipse.cdt.make.core.cleanBuildTarget
36 | clean
37 |
38 |
39 | org.eclipse.cdt.make.core.contents
40 | org.eclipse.cdt.make.core.activeConfigSettings
41 |
42 |
43 | org.eclipse.cdt.make.core.enableAutoBuild
44 | false
45 |
46 |
47 | org.eclipse.cdt.make.core.enableCleanBuild
48 | true
49 |
50 |
51 | org.eclipse.cdt.make.core.enableFullBuild
52 | true
53 |
54 |
55 | org.eclipse.cdt.make.core.fullBuildTarget
56 | all
57 |
58 |
59 | org.eclipse.cdt.make.core.stopOnError
60 | true
61 |
62 |
63 | org.eclipse.cdt.make.core.useDefaultBuildCmd
64 | true
65 |
66 |
67 |
68 |
69 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
70 | full,incremental,
71 |
72 |
73 |
74 |
75 |
76 | org.eclipse.cdt.core.cnature
77 | org.eclipse.cdt.core.ccnature
78 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
79 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
80 |
81 |
82 |
83 | ofxKinect
84 | 2
85 | /home/arturo/Escritorio/openFrameworks/addons/ofxKinect
86 |
87 |
88 | ofxXmlSettings
89 | 2
90 | /home/arturo/Escritorio/openFrameworks/addons/ofxXmlSettings
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # openFrameworks universal makefile
2 | #
3 | # make help : shows this message
4 | # make Debug: makes the application with debug symbols
5 | # make Release: makes the app with optimizations
6 | # make: the same as make Release
7 | # make CleanDebug: cleans the Debug target
8 | # make CleanRelease: cleans the Release target
9 | # make clean: cleans everything
10 | #
11 | #
12 | # this should work with any OF app, just copy any example
13 | # change the name of the folder and it should compile
14 | # only .cpp support, don't use .c files
15 | # it will look for files in any folder inside the application
16 | # folder except that in the EXCLUDE_FROM_SOURCE variable
17 | # it doesn't autodetect include paths yet
18 | # add the include paths in the USER_CFLAGS variable
19 | # using the gcc syntax: -Ipath
20 | #
21 | # to add addons to your application, edit the addons.make file
22 | # in this directory and add the names of the addons you want to
23 | # include
24 | #
25 | # edit the following vars to customize the makefile
26 |
27 | include config.make
28 |
29 | ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
30 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/android/paths.make
31 | ARCH = android
32 | ifeq ($(shell uname),Darwin)
33 | HOST_PLATFORM = darwin-x86
34 | else
35 | HOST_PLATFORM = linux-x86
36 | endif
37 | endif
38 |
39 | ifeq ($(ARCH),android)
40 | COMPILER_OPTIMIZATION = $(ANDROID_COMPILER_OPTIMIZATION)
41 | NDK_PLATFORM = android-8
42 | else
43 | COMPILER_OPTIMIZATION = $(USER_COMPILER_OPTIMIZATION)
44 | endif
45 |
46 |
47 |
48 |
49 | # you shouldn't modify anything below this line
50 |
51 |
52 | SHELL = /bin/sh
53 | ifneq ($(ARCH),android)
54 | CXX = g++
55 | ARCH = $(shell uname -m)
56 | ifeq ($(ARCH),x86_64)
57 | LIBSPATH=linux64
58 | else
59 | LIBSPATH=linux
60 | endif
61 | else
62 | ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
63 | LIBSPATH =android/armeabi-v7a
64 | else
65 | LIBSPATH =android/armeabi
66 | endif
67 | #NDK_ROOT = $(shell cat $(OF_ROOT)/libs/openFrameworksCompiled/project/android/ndk_path.make)
68 | #SDK_ROOT = $(shell cat $(OF_ROOT)/libs/openFrameworksCompiled/project/android/sdk_path.make)
69 | TOOLCHAIN=arm-linux-androideabi-4.4.3
70 | TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
71 | ANDROID_PREFIX=arm-linux-androideabi-
72 | CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
73 | CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
74 | AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
75 | SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
76 | CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
77 | CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
78 | CFLAGS += -DANDROID
79 | endif
80 |
81 | NODEPS = clean
82 | SED_EXCLUDE_FROM_SRC = $(shell echo $(EXCLUDE_FROM_SOURCE) | sed s/\,/\\\\\|/g)
83 | SOURCE_DIRS = $(shell find . -maxdepth 1 -mindepth 1 -type d | grep -v $(SED_EXCLUDE_FROM_SRC) | sed s/.\\///)
84 | SOURCES = $(shell find $(SOURCE_DIRS) -name "*.cpp" -or -name "*.c" -or -name "*.cc")
85 | OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(SOURCES))))
86 |
87 | ifneq (,$(USER_SOURCE_DIR))
88 | USER_SOURCES = $(shell find $(USER_SOURCE_DIR) -name "*.cpp" -or -name "*.c" -or -name "*.cc")
89 | USER_OBJFILES = $(subst $(USER_SOURCE_DIR)/, ,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(USER_SOURCES)))))
90 | endif
91 |
92 | APPNAME = $(shell basename `pwd`)
93 | CORE_INCLUDES = $(shell find $(OF_ROOT)/libs/openFrameworks/ -type d)
94 | CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
95 | INCLUDES = $(shell find $(OF_ROOT)/libs/*/include -type d | grep -v glu | grep -v quicktime | grep -v poco)
96 | INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
97 | INCLUDES_FLAGS += -I$(OF_ROOT)/libs/poco/include
98 | ifeq ($(ARCH),android)
99 | INCLUDES_FLAGS += -I$(OF_ROOT)/libs/glu/include_android
100 | else
101 | INCLUDES_FLAGS += -I$(OF_ROOT)/libs/glu/include
102 | INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
103 | #check if gtk exists and add it
104 | GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
105 | ifeq ($(GTK),0)
106 | CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
107 | SYSTEMLIBS += $(shell pkg-config gtk+-2.0 --libs)
108 | endif
109 |
110 | #check if mpg123 exists and add it
111 | MPG123 = $(shell pkg-config libmpg123 --exists; echo $$?)
112 | ifeq ($(MPG123),0)
113 | CFLAGS += -DOF_USING_MPG123
114 | SYSTEMLIBS += -lmpg123
115 | endif
116 | endif
117 | LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a 2> /dev/null | grep -v openFrameworksCompiled | grep -v Poco)
118 | LIB_SHARED = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.so 2> /dev/null | grep -v openFrameworksCompiled | sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
119 | LIB_STATIC += $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
120 | LIB_PATHS_FLAGS = $(shell ls -d $(OF_ROOT)/libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
121 |
122 | CFLAGS += -Wall -fexceptions
123 | CFLAGS += -I.
124 | CFLAGS += $(INCLUDES_FLAGS)
125 | CFLAGS += $(CORE_INCLUDE_FLAGS)
126 |
127 |
128 |
129 | ifeq ($(ARCH),android)
130 | LDFLAGS = --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
131 | SYSTEMLIBS += -lstdc++ -lsupc++ -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
132 | else
133 | LDFLAGS = -Wl,-rpath=./libs
134 | SYSTEMLIBS += $(shell pkg-config jack glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 gstreamer-app-0.10 libudev --libs)
135 | SYSTEMLIBS += -lglut -lGL -lasound -lopenal -lsndfile -lvorbis -lFLAC -logg -lfreeimage
136 | endif
137 |
138 |
139 | ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
140 | ifneq ($(ARCH),android)
141 | ADDONS = $(shell cat addons.make | grep -v ofxAndroid)
142 | else
143 | ADDONS = $(shell cat addons.make)
144 | endif
145 |
146 | ifneq ($(strip $(ADDONS)),)
147 | ADDONS_REL_DIRS = $(addsuffix /src, $(ADDONS))
148 | ADDONS_LIBS_REL_DIRS = $(addsuffix /libs, $(ADDONS))
149 | ADDONS_DIRS = $(addprefix $(OF_ROOT)/addons/, $(ADDONS_REL_DIRS) )
150 | ADDONS_LIBS_DIRS = $(addprefix $(OF_ROOT)/addons/, $(ADDONS_LIBS_REL_DIRS) )
151 | ADDONS_BIN_LIBS_DIRS = $(addsuffix /*/lib/$(LIBSPATH), $(ADDONS_LIBS_DIRS) )
152 |
153 | ADDONS_INCLUDES = $(ADDONS_DIRS)
154 | ADDONS_INCLUDES = $(ADDONS_LIBS_DIRS)
155 | ADDONS_INCLUDES += $(shell find $(ADDONS_DIRS) -type d 2> /dev/null)
156 | ADDONS_INCLUDES += $(shell find $(ADDONS_LIBS_DIRS) -type d 2> /dev/null)
157 | ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
158 |
159 | ifeq ($(findstring libsorder.make,$(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null)),libsorder.make)
160 | ADDONS_LIBS_W_ORDER = $(shell cat $(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null))
161 | EXCLUDE_LIBS_FILTER = $(addprefix %,$(addsuffix .a,$(ADDONS_LIBS_W_ORDER)))
162 | ADDONS_LIBS_STATICS = $(filter-out $(EXCLUDE_LIBS_FILTER), $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.a))
163 | ADDONS_LIBS_STATICS += $(addprefix -l, $(ADDONS_LIBS_W_ORDER))
164 | ADDONS_LIBS_STATICS += $(addprefix -L, $(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null | sed s/libsorder.make//g))
165 | else
166 | ADDONS_LIBS_STATICS = $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.a 2> /dev/null)
167 | endif
168 |
169 | ADDONS_LIBS_SHARED = $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.so 2> /dev/null)
170 | ADDONSLIBS = $(ADDONS_LIBS_STATICS)
171 | ADDONSLIBS += $(ADDONS_LIBS_SHARED)
172 |
173 |
174 | ADDONS_SOURCES = $(shell find $(ADDONS_DIRS) -name "*.cpp" -or -name "*.c" 2> /dev/null)
175 | ADDONS_SOURCES += $(shell find $(ADDONS_LIBS_DIRS) -name "*.cpp" -or -name "*.c" -or -name "*.cc" 2>/dev/null)
176 | ADDONS_OBJFILES = $(subst $(OF_ROOT)/, ,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(ADDONS_SOURCES)))))
177 | endif
178 | endif
179 |
180 |
181 | ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
182 | TARGET_CFLAGS = -g
183 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(LIBSPATH)/libopenFrameworksDebug.a
184 | TARGET_NAME = Debug
185 | endif
186 |
187 | ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
188 | TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
189 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(LIBSPATH)/libopenFrameworks.a
190 | TARGET_NAME = Release
191 | endif
192 |
193 | ifeq ($(ARCH),android)
194 | ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
195 | TARGET = libs/armeabi/libOFAndroidApp.so
196 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(ARCH)/libopenFrameworksDebug.a
197 | LDFLAGS += -Wl,--fix-cortex-a8 -shared
198 | USER_LIBS = $(USER_LIBS_ARM)
199 | endif
200 |
201 | ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
202 | TARGET = libs/armeabi/libOFAndroidApp.so
203 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(ARCH)/libopenFrameworks.a
204 | LDFLAGS += -Wl,--fix-cortex-a8 -shared
205 | USER_LIBS = $(USER_LIBS_ARM)
206 | endif
207 |
208 | ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
209 | TARGET_NAME = Release_arm7
210 | TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mthumb
211 | TARGET = libs/armeabi-v7a/libOFAndroidApp.so
212 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(ARCH)/libopenFrameworks_arm7.a
213 | USER_LIBS = $(USER_LIBS_ARM7)
214 | endif
215 |
216 | ifeq ($(findstring Release_neon,$(MAKECMDGOALS)),Release_neon)
217 | TARGET_NAME = Release_neon
218 | TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
219 | TARGET = libs/armeabi-v7a/libOFAndroidApp_neon.so
220 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(ARCH)/libopenFrameworks_neon.a
221 | USER_LIBS = $(USER_LIBS_NEON)
222 | endif
223 |
224 | ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
225 | TARGET_NAME = Debug
226 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(ARCH)/libopenFrameworksDebug.a
227 | LDFLAGS += -Wl,--entry=main,--fix-cortex-a8
228 | BIN_NAME = $(APPNAME)
229 | TARGET = obj/$(BIN_NAME)
230 | USER_LIBS = $(USER_LIBS_ARM)
231 | endif
232 | else
233 | ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
234 | BIN_NAME = $(APPNAME)_debug
235 | TARGET = bin/$(BIN_NAME)
236 | endif
237 |
238 | ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
239 | BIN_NAME = $(APPNAME)
240 | TARGET = bin/$(BIN_NAME)
241 | endif
242 |
243 | ifeq ($(MAKECMDGOALS),)
244 | TARGET_NAME = Release
245 | BIN_NAME = $(APPNAME)
246 | TARGET = bin/$(BIN_NAME)
247 | TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/$(LIBSPATH)/libopenFrameworks.a
248 | endif
249 | endif
250 |
251 | ifeq ($(MAKECMDGOALS),clean)
252 | TARGET = bin/$(APPNAME)_debug bin/$(APPNAME)
253 | TARGET_NAME = Release
254 | endif
255 |
256 | ifeq ($(MAKECMDGOALS),AndroidInstall)
257 | TARGET_NAME = Install
258 | endif
259 |
260 | OBJ_OUTPUT = obj/$(ARCH)$(TARGET_NAME)/
261 | CLEANTARGET = clean$(TARGET_NAME)
262 |
263 | OBJS = $(addprefix $(OBJ_OUTPUT), $(OBJFILES))
264 | DEPFILES = $(patsubst %.o,%.d,$(OBJS))
265 |
266 | USER_OBJS = $(addprefix $(OBJ_OUTPUT), $(USER_OBJFILES))
267 | DEPFILES += $(patsubst %.o,%.d,$(USER_OBJS))
268 |
269 | ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
270 | ADDONS_OBJS = $(addprefix $(OBJ_OUTPUT), $(ADDONS_OBJFILES))
271 | DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
272 | endif
273 |
274 | .PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
275 |
276 | Release: $(TARGET) after
277 |
278 | Debug: $(TARGET) after
279 |
280 | all:
281 | $(MAKE) Release
282 |
283 | DebugAndroid: $(TARGET)
284 |
285 | ReleaseAndroid: $(TARGET)
286 |
287 | Release_arm7Android: $(TARGET)
288 |
289 | Release_neonAndroid: $(TARGET) afterReleaseAndroid
290 |
291 | TestLinkAndroid: $(TARGET) afterDebugAndroid
292 |
293 | AndroidDebug:
294 | $(MAKE) DebugAndroid
295 | $(MAKE) TestLinkAndroid
296 |
297 | AndroidRelease:
298 | $(MAKE) ReleaseAndroid
299 | $(MAKE) Release_arm7Android
300 | $(MAKE) Release_neonAndroid
301 |
302 |
303 | #This rule does the compilation
304 | #$(OBJS): $(SOURCES)
305 | $(OBJ_OUTPUT)%.o: %.cpp
306 | @echo "compiling object for: " $<
307 | mkdir -p $(@D)
308 | $(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
309 |
310 | $(OBJ_OUTPUT)%.o: %.c
311 | @echo "compiling object for: " $<
312 | mkdir -p $(@D)
313 | $(CC) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
314 |
315 | $(OBJ_OUTPUT)%.o: %.cc
316 | @echo "compiling object for: " $<
317 | mkdir -p $(@D)
318 | $(CC) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
319 |
320 | $(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.cpp
321 | @echo "compiling addon object for" $<
322 | mkdir -p $(@D)
323 | $(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
324 |
325 | $(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.c
326 | @echo "compiling addon object for" $<
327 | mkdir -p $(@D)
328 | $(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
329 |
330 | $(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.cc
331 | @echo "compiling addon object for" $<
332 | mkdir -p $(@D)
333 | $(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
334 |
335 | $(OBJ_OUTPUT)%.o: $(USER_SOURCE_DIR)/%.c
336 | @echo "compiling object for: " $<
337 | mkdir -p $(@D)
338 | $(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
339 |
340 | $(OBJ_OUTPUT)%.o: $(USER_SOURCE_DIR)/%.cc
341 | @echo "compiling object for: " $<
342 | mkdir -p $(@D)
343 | $(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
344 |
345 | $(OBJ_OUTPUT)%.o: $(USER_SOURCE_DIR)/%.cpp
346 | @echo "compiling object for: " $<
347 | mkdir -p $(@D)
348 | $(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<
349 |
350 | $(TARGET): $(OBJS) $(ADDONS_OBJS) $(USER_OBJS) $(TARGET_LIBS) $(LIB_STATIC)
351 | @echo 'linking $(TARGET)'
352 | mkdir -p $(@D)
353 | $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(USER_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIB_STATIC) $(LIB_PATHS_FLAGS) $(LIB_SHARED) $(SYSTEMLIBS)
354 |
355 | -include $(DEPFILES)
356 |
357 | .PHONY: clean cleanDebug cleanRelease CleanAndroid
358 | clean:
359 | rm -rf $(OBJ_OUTPUT)
360 | rm -f $(TARGET)
361 | rm -r bin/libs
362 |
363 | $(CLEANTARGET):
364 | rm -rf $(OBJ_OUTPUT)
365 | rm -f $(TARGET)
366 | rm -rf bin/libs
367 |
368 | CleanAndroid:
369 | rm -Rf obj
370 | rm -f libs/armeabi-v7a/libOFAndroidApp.so
371 | rm -f libs/armeabi/libOFAndroidApp.so
372 | rm -f obj/$(APPNAME)
373 |
374 |
375 | afterDebugAndroid:$(TARGET)
376 | @if [ -d libs/armeabi-v7a ]; then rm -r libs/armeabi-v7a; fi
377 |
378 | @cp $(NDK_ROOT)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver libs/armeabi
379 |
380 | #create gdb.setup for armeabi
381 | @echo "set solib-search-path $(PWD)/obj/local/armeabi:$(PWD)/libs/armeabi" > libs/armeabi/gdb.setup
382 | @echo "directory $(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" >> libs/armeabi/gdb.setup
383 | @echo "directory $(PWD)/src" >> libs/armeabi/gdb.setup
384 | @echo "directory $(NDK_ROOT)/sources/cxx-stl/system" >> libs/armeabi/gdb.setup
385 | @echo "directory $(PWD)/libs/armeabi" >> libs/armeabi/gdb.setup
386 | @echo "" >> libs/armeabi/gdb.setup
387 |
388 | @if [ ! -d jni ]; then mkdir jni; fi
389 | @echo "APP_ABI := armeabi" > jni/Application.mk
390 | @echo "#LOCAL_MODULE := OFAndroidApp" > jni/Android.mk
391 |
392 | afterReleaseAndroid:$(TARGET)
393 | @if [ -f obj/$(BIN_NAME) ]; then rm obj/$(BIN_NAME); fi
394 |
395 | @cp $(OF_ROOT)/libs/openFrameworksCompiled/project/android/libneondetection.so libs/armeabi-v7a/
396 | @cp $(NDK_ROOT)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver libs/armeabi-v7a
397 |
398 | #create gdb.setup for armeabi-v7a
399 | @echo "set solib-search-path $(PWD)/obj/local/armeabi-v7a:$(PWD)/libs/armeabi-v7a" > libs/armeabi-v7a/gdb.setup
400 | @echo "directory $(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" >> libs/armeabi-v7a/gdb.setup
401 | @echo "directory $(PWD)/src" >> libs/armeabi-v7a/gdb.setup
402 | @echo "directory $(NDK_ROOT)/sources/cxx-stl/system" >> libs/armeabi-v7a/gdb.setup
403 | @echo "directory $(PWD)/libs/armeabi-v7a" >> libs/armeabi-v7a/gdb.setup
404 | @echo "" >> libs/armeabi-v7a/gdb.setup
405 |
406 | @if [ ! -d jni ]; then mkdir jni; fi
407 | @echo "APP_ABI := armeabi armeabi-v7a" > jni/Application.mk
408 | @echo "#LOCAL_MODULE := OFAndroidApp" > jni/Android.mk
409 |
410 | RESNAME=$(shell echo $(APPNAME)Resources | tr '[A-Z]' '[a-z]')
411 |
412 | AndroidInstall:
413 | if [ -d "bin/data" ]; then \
414 | mkdir -p res/raw; \
415 | rm res/raw/$(RESNAME).zip; \
416 | cd bin/data; \
417 | zip -r ../../res/raw/$(RESNAME).zip *; \
418 | cd ../..; \
419 | fi
420 | if [ -f obj/$(BIN_NAME) ]; then rm obj/$(BIN_NAME); fi
421 | #touch AndroidManifest.xml
422 | $(SDK_ROOT)/tools/android update project --target $(NDK_PLATFORM) --path $(PROJECT_PATH)
423 | if [ -d bin/classes ]; then rm -r bin/classes; fi
424 | if [ -d bin/classes.dex ]; then rm bin/classes.dex; fi
425 | if [ -d bin/OFActivity.ap_ ]; then rm bin/OFActivity.ap_; fi
426 | if [ -d bin/OFActivity-debug.apk ]; then rm bin/OFActivity-debug.apk; fi
427 | if [ -d bin/OFActivity-debug-unaligned.apk ]; then rm bin/OFActivity-debug-unaligned.apk; fi
428 | if [ -d bin/$(APPNAME).apk ]; then rm bin/$(APPNAME).apk; fi
429 | ant debug
430 | cp bin/OFActivity-debug.apk bin/$(APPNAME).apk
431 | #if [ "$(shell $(SDK_ROOT)/platform-tools/adb get-state)" = "device" ]; then
432 | $(SDK_ROOT)/platform-tools/adb install -r bin/$(APPNAME).apk;
433 | #fi
434 | $(SDK_ROOT)/platform-tools/adb shell am start -a android.intent.action.MAIN -n cc.openframeworks.$(APPNAME)/cc.openframeworks.$(APPNAME).OFActivity
435 |
436 |
437 | after:$(TARGET)
438 | cp -r $(OF_ROOT)/export/$(LIBSPATH)/libs bin/
439 | @echo
440 | @echo " compiling done"
441 | @echo " to launch the application"
442 | @echo
443 | @echo " cd bin"
444 | @echo " ./$(BIN_NAME)"
445 | @echo
446 |
447 |
448 | .PHONY: help
449 | help:
450 | @echo
451 | @echo openFrameworks universal makefile
452 | @echo
453 | @echo targets:
454 | @echo "make Debug: builds the application with debug symbols"
455 | @echo "make Release: builds the app with optimizations"
456 | @echo "make: = make Release"
457 | @echo "make all: = make Release"
458 | @echo "make CleanDebug: cleans the Debug target"
459 | @echo "make CleanRelease: cleans the Release target"
460 | @echo "make clean: cleans everything"
461 | @echo
462 | @echo this should work with any OF app, just copy any example
463 | @echo change the name of the folder and it should compile
464 | @echo "only .cpp support, don't use .c files"
465 | @echo it will look for files in any folder inside the application
466 | @echo folder except that in the EXCLUDE_FROM_SOURCE variable.
467 | @echo "it doesn't autodetect include paths yet"
468 | @echo "add the include paths editing the var USER_CFLAGS"
469 | @echo at the beginning of the makefile using the gcc syntax:
470 | @echo -Ipath
471 | @echo
472 | @echo to add addons to your application, edit the addons.make file
473 | @echo in this directory and add the names of the addons you want to
474 | @echo include
475 | @echo
476 |
--------------------------------------------------------------------------------
/addons.make:
--------------------------------------------------------------------------------
1 | ofxKinect
2 | ofxXmlSettings
3 |
4 |
--------------------------------------------------------------------------------
/bin/data/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 48
4 | 64
5 | 1
6 | 91.121.134.23
7 | 8002
8 | kinect.ogg
9 | myd9v
10 | 256
11 | 256
12 | 1
13 | 1
14 |
--------------------------------------------------------------------------------
/config.make:
--------------------------------------------------------------------------------
1 | # add custom variables to this file
2 |
3 | # OF_ROOT allows to move projects outside apps/* just set this variable to the
4 | # absoulte path to the OF root folder
5 |
6 | OF_ROOT = ../../..
7 |
8 |
9 | # USER_CFLAGS allows to pass custom flags to the compiler
10 | # for example search paths like:
11 | # USER_CFLAGS = -I src/objects
12 |
13 | USER_CFLAGS =
14 |
15 |
16 | # USER_LDFLAGS allows to pass custom flags to the linker
17 | # for example libraries like:
18 | # USER_LD_FLAGS = libs/libawesomelib.a
19 |
20 | USER_LDFLAGS =
21 |
22 |
23 | # use this to add system libraries for example:
24 | # USER_LIBS = -lpango
25 |
26 | USER_LIBS = -lusb-1.0
27 |
28 |
29 | # change this to add different compiler optimizations to your project
30 |
31 | USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os
32 |
33 |
34 | EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj,.git"
35 |
--------------------------------------------------------------------------------
/kinectStream.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/kinectStream.workspace:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "ofMain.h"
2 | #include "testApp.h"
3 | #include "ofAppGlutWindow.h"
4 |
5 | //========================================================================
6 | int main( ){
7 |
8 | ofAppGlutWindow window;
9 | ofSetupOpenGL(&window, 640,480, OF_WINDOW); // <-------- setup the GL context
10 |
11 | // this kicks off the running of my app
12 | // can be OF_WINDOW or OF_FULLSCREEN
13 | // pass in width and height too:
14 | ofRunApp( new testApp());
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/testApp.cpp:
--------------------------------------------------------------------------------
1 | #include "testApp.h"
2 | #include
3 | #include
4 |
5 | //--------------------------------------------------------------
6 | void testApp::setup(){
7 | ofSetVerticalSync(true);
8 | ofSetLogLevel(OF_LOG_VERBOSE);
9 |
10 | if(settings.loadFile("settings.xml")){
11 | ofLogVerbose() << "settings loaded ok";
12 | }else{
13 | ofLogError() << "error loading settings";
14 | }
15 |
16 | int quality = settings.getValue("settings:quality",48);
17 | int keyframe_freq = settings.getValue("settings:keyframe-freq",64);
18 | bool keyframe_auto = settings.getValue("settings:keyframe-auto",true);
19 | string server = settings.getValue("settings:server","91.121.134.23");
20 | int port = settings.getValue("settings:port",8002);
21 | string mount = settings.getValue("settings:mount","kinect.ogg");
22 | string passwd = settings.getValue("settings:passwd","myd9v");
23 | int width = settings.getValue("settings:width",320);
24 | int height = settings.getValue("settings:height",240);
25 |
26 | sendBrightness=settings.getValue("settings:sendBrightness",true);
27 | sendRaw=settings.getValue("settings:sendRaw",true);
28 |
29 | /*"v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 ! "
30 | "queue ! videorate ! video/x-raw-yuv,framerate=25/2 ! "
31 | "videoscale ! video/x-raw-yuv,width=320,height=240 ! "
32 | "ffmpegcolorspace ! tee name=tscreen ! queue ! "
33 | "autovideosink tscreen. ! queue ! "
34 | "theoraenc quality=16 ! queue ! "
35 | "oggmux name=mux pulsesrc ! audio/x-raw-int,rate=22050,channels=1 ! queue ! audioconvert ! vorbisenc quality=0.2 ! queue ! mux. mux. ! queue ! "
36 | "shout2send ip=www.giss.tv port=8000 mount=mountpoint.ogg password=xxxxx streamname= description= genre= url=";*/
37 |
38 | string appsrc;
39 | string videorate;
40 | string videoscale;
41 | if(sendBrightness || sendRaw){
42 | appsrc = "appsrc name=video_src is-live=true do-timestamp=true ! "
43 | "video/x-raw-rgb,width=640,height=480,depth=24,bpp=24,framerate=30/1,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! queue ! ";
44 | videorate = "videorate ! video/x-raw-rgb,depth=24,bpp=24,framerate=25/2,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! ";
45 | videoscale = "videoscale ! video/x-raw-rgb,width=" + ofToString(width) + ",height=" + ofToString(height) + ",depth=24,bpp=24,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! ";
46 | }else{
47 | appsrc = "appsrc name=video_src is-live=true do-timestamp=true ! "
48 | "video/x-raw-gray,width=640,height=480,depth=8,bpp=8,framerate=30/1 ! queue ! ";
49 | videorate = "videorate ! video/x-raw-gray,depth=8,bpp=8,framerate=25/2 ! ";
50 | videoscale = "videoscale ! video/x-raw-gray,width=" + ofToString(width) + ",height=" + ofToString(height) + ",depth=8,bpp=8 ! ";
51 | }
52 |
53 |
54 | string colorspace = " ffmpegcolorspace ! video/x-raw-yuv,width=" + ofToString(width) + ",height=" + ofToString(height) + " ! ";
55 | string theoraenc = ofVAArgsToString("theoraenc quality=%d keyframe-auto=%s keyframe-freq=%d ! queue ! ",quality,keyframe_auto?"true":"false",keyframe_freq);
56 | string audio = "oggmux name=mux pulsesrc ! audio/x-raw-int,rate=22050,channels=1 ! queue ! audioconvert ! vorbisenc quality=0.2 ! queue ! mux. mux. ! queue ! ";
57 | string shoutcast = ofVAArgsToString("shout2send name=shoutsink ip=%s port=%d mount=%s password=%s streamname= description= genre= url=",server.c_str(),port,mount.c_str(),passwd.c_str());
58 |
59 |
60 | string pipeline = appsrc + videorate + videoscale + colorspace + theoraenc + audio + shoutcast;
61 |
62 |
63 | /*ofVAArgsToString("appsrc name=video_src is-live=true do-timestamp=true ! "
64 | "video/x-raw-rgb,width=640,height=480,depth=24,bpp=24,framerate=30/1,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! queue ! "
65 | "videorate ! video/x-raw-rgb,depth=24,bpp=24,framerate=25/2,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! videoscale ! "
66 | "video/x-raw-rgb,width=%d,height=%d,depth=24,bpp=24,endianness=4321,red_mask=16711680, green_mask=65280, blue_mask=255 ! ffmpegcolorspace ! "
67 | "video/x-raw-yuv,width=%d,height=%d ! theoraenc quality=%d keyframe-auto=%s keyframe-freq=%d ! "
68 | "oggmux ! shout2send name=shoutsink ip=%s port=%d mount=%s password=%s streamname= description= genre= url="
69 | ,width,height,width,height,quality,keyframe_auto?"true":"false",keyframe_freq,server.c_str(),port,mount.c_str(),passwd.c_str());*/
70 |
71 |
72 | gst.setPipelineWithSink(pipeline,"shoutsink",false);
73 | gstSrc = (GstAppSrc*)gst_bin_get_by_name(GST_BIN(gst.getPipeline()),"video_src");
74 | if(gstSrc){
75 | gst_app_src_set_stream_type (gstSrc,GST_APP_STREAM_TYPE_STREAM);
76 | g_object_set (G_OBJECT(gstSrc), "format", GST_FORMAT_TIME, NULL);
77 | }
78 |
79 | pixels.allocate(640,480,OF_IMAGE_COLOR);
80 | if(sendBrightness){
81 | ofLogVerbose() << "sending brightness";
82 | tex.allocate(640,480,GL_RGB);
83 | }
84 |
85 |
86 | kinect.init();
87 | kinect.setUseRegistration(true);
88 | kinect.setClippingInMillimeters(500, 1500);
89 | kinect.open();
90 | gst.play();
91 | }
92 |
93 | #ifdef DO_RGB565
94 |
95 | unsigned char Red24 = lpBits24[nPos24+2]; // 8-bit red
96 | unsigned char Green24 = lpBits24[nPos24+1]; // 8-bit green
97 | unsigned char Blue24 = lpBits24[nPos24+0]; // 8-bit blue
98 |
99 | unsigned char Red16 = Red24 >> 3; // 5-bit red
100 | unsigned char Green16 = Green24 >> 2; // 6-bit green
101 | unsigned char Blue16 = Blue24 >> 3; // 5-bit blue
102 |
103 | unsigned short RGB2Bytes = Blue16 + (Green16<<5) + (Red16<<(5+6));
104 | pixels[i*3+1] = *((unsigned char*)(&RGB2Bytes));
105 | pixels[i*3+2] = *((unsigned char*)((&RGB2Bytes)+1));
106 | #endif
107 |
108 | //--------------------------------------------------------------
109 | void testApp::update(){
110 | kinect.update();
111 | if(kinect.isFrameNew()){
112 | GstBuffer * buffer;
113 | if(sendBrightness || sendRaw){
114 | unsigned char * lpBits24 = kinect.getPixels();
115 | for(int i=0;i<640*480;i++){
116 | int nPos24 = i*3;
117 | if(sendRaw){
118 | pixels[nPos24] = kinect.getRawDepthPixels()[i] >> 8;
119 | pixels[nPos24+1] = (kinect.getRawDepthPixels()[i] << 8) >> 8;
120 | if(sendBrightness) pixels[nPos24+2] = (lpBits24[i*3]+lpBits24[i*3+1]+lpBits24[i*3+2])*.3333;
121 | else pixels[nPos24+2] = 0;
122 | }else{
123 | pixels[nPos24] = kinect.getDepthPixels()[i];
124 | pixels[nPos24+1] = (lpBits24[i*3]+lpBits24[i*3+1]+lpBits24[i*3+2])*.3333;
125 | pixels[nPos24+2] = 0;
126 | }
127 | }
128 | buffer = gst_app_buffer_new (pixels.getPixels(), 640*480*3, NULL, pixels.getPixels());
129 | }else{
130 | buffer = gst_app_buffer_new (kinect.getDepthPixels(), 640*480, NULL, kinect.getDepthPixels());
131 | }
132 |
133 | GstFlowReturn flow_return = gst_app_src_push_buffer(gstSrc, buffer);
134 | if (flow_return != GST_FLOW_OK) {
135 | ofLog(OF_LOG_WARNING,"error pushing buffer");
136 | }
137 | gst.update();
138 | }
139 | }
140 |
141 | //--------------------------------------------------------------
142 | void testApp::draw(){
143 | if(sendBrightness){
144 | tex.loadData(pixels);
145 | tex.draw(0,0);
146 | }else{
147 | kinect.drawDepth(0,0);
148 | }
149 | }
150 |
151 | //--------------------------------------------------------------
152 | void testApp::keyPressed(int key){
153 |
154 | }
155 |
156 | //--------------------------------------------------------------
157 | void testApp::keyReleased(int key){
158 |
159 | }
160 |
161 | //--------------------------------------------------------------
162 | void testApp::mouseMoved(int x, int y ){
163 |
164 | }
165 |
166 | //--------------------------------------------------------------
167 | void testApp::mouseDragged(int x, int y, int button){
168 |
169 | }
170 |
171 | //--------------------------------------------------------------
172 | void testApp::mousePressed(int x, int y, int button){
173 |
174 | }
175 |
176 | //--------------------------------------------------------------
177 | void testApp::mouseReleased(int x, int y, int button){
178 |
179 | }
180 |
181 | //--------------------------------------------------------------
182 | void testApp::windowResized(int w, int h){
183 |
184 | }
185 |
186 | //--------------------------------------------------------------
187 | void testApp::gotMessage(ofMessage msg){
188 |
189 | }
190 |
191 | //--------------------------------------------------------------
192 | void testApp::dragEvent(ofDragInfo dragInfo){
193 |
194 | }
195 |
--------------------------------------------------------------------------------
/src/testApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ofMain.h"
4 | #include "ofxKinect.h"
5 | #include "ofxXmlSettings.h"
6 | #include
7 |
8 | class testApp : public ofBaseApp{
9 |
10 | public:
11 | void setup();
12 | void update();
13 | void draw();
14 |
15 | void keyPressed (int key);
16 | void keyReleased(int key);
17 | void mouseMoved(int x, int y );
18 | void mouseDragged(int x, int y, int button);
19 | void mousePressed(int x, int y, int button);
20 | void mouseReleased(int x, int y, int button);
21 | void windowResized(int w, int h);
22 | void dragEvent(ofDragInfo dragInfo);
23 | void gotMessage(ofMessage msg);
24 |
25 | ofxKinect kinect;
26 | ofGstVideoUtils gst;
27 | GstAppSrc * gstSrc;
28 |
29 | ofxXmlSettings settings;
30 | ofPixels pixels;
31 | ofPixels depthPixels;
32 | ofTexture tex;
33 |
34 | bool sendBrightness;
35 | bool sendRaw;
36 |
37 | };
38 |
--------------------------------------------------------------------------------
/web/js/DAT.GUI.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * dat.gui Javascript Controller Library
3 | * http://dataarts.github.com/dat.gui
4 | *
5 | * Copyright 2011 Data Arts Team, Google Creative Lab
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | */
13 | var DAT=DAT||{};
14 | DAT.GUI=function(a){a==void 0&&(a={});var b=!1;a.height==void 0?a.height=300:b=!0;var d=[],c=[],i=!0,f,h,j=this,g=!0,e=280;if(a.width!=void 0)e=a.width;var q=!1,k,p,n=0,r;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat");this.domElement.style.width=e+"px";var l=a.height,m=document.createElement("div");m.setAttribute("class","guidat-controllers");m.style.height=l+"px";m.addEventListener("DOMMouseScroll",function(a){var b=this.scrollTop;a.wheelDelta?b+=a.wheelDelta:
15 | a.detail&&(b+=a.detail);a.preventDefault&&a.preventDefault();a.returnValue=!1;m.scrollTop=b},!1);var o=document.createElement("a");o.setAttribute("class","guidat-toggle");o.setAttribute("href","#");o.innerHTML=g?"Close Controls":"Open Controls";var t=!1,C=0,x=0,u=!1,v,y,w,z,D=function(a){y=v;z=w;v=a.pageY;w=a.pageX;a=v-y;if(!g)if(a>0)g=!0,l=k=1,o.innerHTML=p||"Close Controls";else return;var b=z-w;if(a>0&&l>h){var d=DAT.GUI.map(l,h,h+100,1,0);a*=d}t=!0;C+=a;k+=a;l+=a;m.style.height=k+"px";x+=b;e+=
16 | b;e=DAT.GUI.constrain(e,240,500);j.domElement.style.width=e+"px";A()};o.addEventListener("mousedown",function(a){y=v=a.pageY;z=w=a.pageX;u=!0;a.preventDefault();C=x=0;document.addEventListener("mousemove",D,!1);return!1},!1);o.addEventListener("click",function(a){a.preventDefault();return!1},!1);document.addEventListener("mouseup",function(a){u&&!t&&j.toggle();if(u&&t)if(x==0&&B(),k>h)clearTimeout(r),k=n=h,s();else if(m.children.length>=1){var b=m.children[0].offsetHeight;clearTimeout(r);n=Math.round(l/
17 | b)*b-1;n<=0?(j.close(),k=b*2):(k=n,s())}document.removeEventListener("mousemove",D,!1);a.preventDefault();return u=t=!1},!1);this.domElement.appendChild(m);this.domElement.appendChild(o);if(a.domElement)a.domElement.appendChild(this.domElement);else if(DAT.GUI.autoPlace){if(DAT.GUI.autoPlaceContainer==null)DAT.GUI.autoPlaceContainer=document.createElement("div"),DAT.GUI.autoPlaceContainer.setAttribute("id","guidat"),document.body.appendChild(DAT.GUI.autoPlaceContainer);DAT.GUI.autoPlaceContainer.appendChild(this.domElement)}this.autoListenIntervalTime=
18 | 1E3/60;var E=function(){f=setInterval(function(){j.listen()},this.autoListenIntervalTime)};this.__defineSetter__("autoListen",function(a){(i=a)?c.length>0&&E():clearInterval(f)});this.__defineGetter__("autoListen",function(){return i});this.listenTo=function(a){c.length==0&&E();c.push(a)};this.unlistenTo=function(a){for(var b=0;bk?"auto":"hidden"},G={number:DAT.GUI.ControllerNumber,string:DAT.GUI.ControllerString,"boolean":DAT.GUI.ControllerBoolean,"function":DAT.GUI.ControllerFunction};this.reset=function(){for(var a=0,b=DAT.GUI.allControllers.length;a-1)document.body.scrollTop=DAT.GUI.scrollTop;n=k;this.open()}DAT.GUI.guiIndex++}DAT.GUI.allGuis.push(this);if(DAT.GUI.allGuis.length==1&&(window.addEventListener("keyup",function(a){!DAT.GUI.supressHotKeys&&a.keyCode==72&&DAT.GUI.toggleHide()},!1),
24 | DAT.GUI.inlineCSS))a=document.createElement("style"),a.setAttribute("type","text/css"),a.innerHTML=DAT.GUI.inlineCSS,document.head.insertBefore(a,document.head.firstChild)};DAT.GUI.hidden=!1;DAT.GUI.autoPlace=!0;DAT.GUI.autoPlaceContainer=null;DAT.GUI.allControllers=[];DAT.GUI.allGuis=[];DAT.GUI.supressHotKeys=!1;DAT.GUI.toggleHide=function(){DAT.GUI.hidden?DAT.GUI.open():DAT.GUI.close()};
25 | DAT.GUI.open=function(){DAT.GUI.hidden=!1;for(var a in DAT.GUI.allGuis)DAT.GUI.allGuis[a].domElement.style.display="block"};DAT.GUI.close=function(){DAT.GUI.hidden=!0;for(var a in DAT.GUI.allGuis)DAT.GUI.allGuis[a].domElement.style.display="none"};DAT.GUI.saveURL=function(){var a=DAT.GUI.replaceGetVar("saveString",DAT.GUI.getSaveString());window.location=a};DAT.GUI.scrollTop=-1;
26 | DAT.GUI.load=function(a){var a=a.split(","),b=parseInt(a[0]);DAT.GUI.scrollTop=parseInt(a[1]);for(var d=0;dd&&(a=d);return a};DAT.GUI.error=function(a){typeof console.error=="function"&&console.error("[DAT.GUI ERROR] "+a)};DAT.GUI.roundToDecimal=function(a,b){var d=Math.pow(10,b);return Math.round(a*d)/d};DAT.GUI.extendController=function(a){a.prototype=new DAT.GUI.Controller;a.prototype.constructor=a};DAT.GUI.addClass=function(a,b){DAT.GUI.hasClass(a,b)||(a.className+=" "+b)};
32 | DAT.GUI.hasClass=function(a,b){return a.className.indexOf(b)!=-1};DAT.GUI.removeClass=function(a,b){a.className=a.className.replace(RegExp(" "+b,"g"),"")};DAT.GUI.getVarFromURL("saveString")!=null&&DAT.GUI.load(DAT.GUI.getVarFromURL("saveString"));
33 | DAT.GUI.Controller=function(){this.parent=arguments[0];this.object=arguments[1];this.propertyName=arguments[2];if(arguments.length>0)this.initialValue=this.object[this.propertyName];this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat-controller "+this.type);this.propertyNameElement=document.createElement("span");this.propertyNameElement.setAttribute("class","guidat-propertyname");this.name(this.propertyName);this.domElement.appendChild(this.propertyNameElement);
34 | DAT.GUI.makeUnselectable(this.domElement)};DAT.GUI.Controller.prototype.changeFunction=null;DAT.GUI.Controller.prototype.finishChangeFunction=null;DAT.GUI.Controller.prototype.name=function(a){this.propertyNameElement.innerHTML=a;return this};DAT.GUI.Controller.prototype.reset=function(){this.setValue(this.initialValue);return this};DAT.GUI.Controller.prototype.listen=function(){this.parent.listenTo(this);return this};DAT.GUI.Controller.prototype.unlisten=function(){this.parent.unlistenTo(this);return this};
35 | DAT.GUI.Controller.prototype.setValue=function(a){if(this.object[this.propertyName]!=void 0)this.object[this.propertyName]=a;else{var b={};b[this.propertyName]=a;this.object.set(b)}this.changeFunction!=null&&this.changeFunction.call(this,a);this.updateDisplay();return this};DAT.GUI.Controller.prototype.getValue=function(){var a=this.object[this.propertyName];a==void 0&&(a=this.object.get(this.propertyName));return a};DAT.GUI.Controller.prototype.updateDisplay=function(){};
36 | DAT.GUI.Controller.prototype.onChange=function(a){this.changeFunction=a;return this};DAT.GUI.Controller.prototype.onFinishChange=function(a){this.finishChangeFunction=a;return this};
37 | DAT.GUI.Controller.prototype.options=function(){var a=this,b=document.createElement("select");if(arguments.length==1){var d=arguments[0],c;for(c in d){var i=document.createElement("option");i.innerHTML=c;i.setAttribute("value",d[c]);if(arguments[c]==this.getValue())i.selected=!0;b.appendChild(i)}}else for(c=0;c=h&&(a=h);return DAT.GUI.Controller.prototype.setValue.call(this,
47 | a)};this.updateDisplay=function(){g.value=DAT.GUI.roundToDecimal(a.getValue(),4);if(e)e.value=a.getValue()}};DAT.GUI.extendController(DAT.GUI.ControllerNumber);
48 | DAT.GUI.ControllerNumberSlider=function(a,b,d,c,i){var f=!1,h=this;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat-slider-bg");this.fg=document.createElement("div");this.fg.setAttribute("class","guidat-slider-fg");this.domElement.appendChild(this.fg);var j=function(b){if(f){var c;c=h.domElement;var d=0,g=0;if(c.offsetParent){do d+=c.offsetLeft,g+=c.offsetTop;while(c=c.offsetParent);c=[d,g]}else c=void 0;b=DAT.GUI.map(b.pageX,c[0],c[0]+h.domElement.offsetWidth,
49 | a.getMin(),a.getMax());b=Math.round(b/a.getStep())*a.getStep();a.setValue(b)}};this.domElement.addEventListener("mousedown",function(b){f=!0;DAT.GUI.addClass(a.domElement,"active");j(b);document.addEventListener("mouseup",g,!1)},!1);var g=function(){DAT.GUI.removeClass(a.domElement,"active");f=!1;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",g,!1)};this.__defineSetter__("value",function(b){this.fg.style.width=DAT.GUI.map(b,a.getMin(),
50 | a.getMax(),0,100)+"%"});document.addEventListener("mousemove",j,!1);this.value=i};
51 | DAT.GUI.ControllerString=function(){this.type="string";var a=this;DAT.GUI.Controller.apply(this,arguments);var b=document.createElement("input"),d=this.getValue();b.setAttribute("value",d);b.setAttribute("spellcheck","false");this.domElement.addEventListener("mouseup",function(){b.focus();b.select()},!1);b.addEventListener("keyup",function(c){c.keyCode==13&&a.finishChangeFunction!=null&&(a.finishChangeFunction.call(this,a.getValue()),b.blur());a.setValue(b.value)},!1);b.addEventListener("mousedown",
52 | function(){DAT.GUI.makeSelectable(b)},!1);b.addEventListener("blur",function(){DAT.GUI.supressHotKeys=!1;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue())},!1);b.addEventListener("focus",function(){DAT.GUI.supressHotKeys=!0},!1);this.updateDisplay=function(){b.value=a.getValue()};this.options=function(){a.domElement.removeChild(b);return DAT.GUI.Controller.prototype.options.apply(this,arguments)};this.domElement.appendChild(b)};DAT.GUI.extendController(DAT.GUI.ControllerString);
53 | DAT.GUI.inlineCSS="#guidat { position: fixed; top: 0; right: 0; width: auto; z-index: 1001; text-align: right; } .guidat { color: #fff; opacity: 0.97; text-align: left; float: right; margin-right: 20px; margin-bottom: 20px; background-color: #fff; } .guidat, .guidat input { font: 9.5px Lucida Grande, sans-serif; } .guidat-controllers { height: 300px; overflow-y: auto; overflow-x: hidden; background-color: rgba(0, 0, 0, 0.1); } a.guidat-toggle:link, a.guidat-toggle:visited, a.guidat-toggle:active { text-decoration: none; cursor: pointer; color: #fff; background-color: #222; text-align: center; display: block; padding: 5px; } a.guidat-toggle:hover { background-color: #000; } .guidat-controller { padding: 3px; height: 25px; clear: left; border-bottom: 1px solid #222; background-color: #111; } .guidat-controller, .guidat-controller input, .guidat-slider-bg, .guidat-slider-fg { -moz-transition: background-color 0.15s linear; -webkit-transition: background-color 0.15s linear; transition: background-color 0.15s linear; } .guidat-controller.boolean:hover, .guidat-controller.function:hover { background-color: #000; } .guidat-controller input { float: right; outline: none; border: 0; padding: 4px; margin-top: 2px; background-color: #222; } .guidat-controller select { margin-top: 4px; float: right; } .guidat-controller input:hover { background-color: #444; } .guidat-controller input:focus, .guidat-controller.active input { background-color: #555; color: #fff; } .guidat-controller.number { border-left: 5px solid #00aeff; } .guidat-controller.string { border-left: 5px solid #1ed36f; } .guidat-controller.string input { border: 0; color: #1ed36f; margin-right: 2px; width: 148px; } .guidat-controller.boolean { border-left: 5px solid #54396e; } .guidat-controller.function { border-left: 5px solid #e61d5f; } .guidat-controller.number input[type=text] { width: 35px; margin-left: 5px; margin-right: 2px; color: #00aeff; } .guidat .guidat-controller.boolean input { margin-top: 6px; margin-right: 2px; font-size: 20px; } .guidat-controller:last-child { border-bottom: none; -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5); box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5); } .guidat-propertyname { padding: 5px; padding-top: 7px; cursor: default; display: inline-block; } .guidat-controller .guidat-slider-bg:hover, .guidat-controller.active .guidat-slider-bg { background-color: #444; } .guidat-controller .guidat-slider-bg .guidat-slider-fg:hover, .guidat-controller.active .guidat-slider-bg .guidat-slider-fg { background-color: #52c8ff; } .guidat-slider-bg { background-color: #222; cursor: ew-resize; width: 40%; margin-top: 2px; float: right; height: 21px; } .guidat-slider-fg { cursor: ew-resize; background-color: #00aeff; height: 21px; } ";
54 |
--------------------------------------------------------------------------------
/web/js/Detector.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | * @author mr.doob / http://mrdoob.com/
4 | */
5 |
6 | Detector = {
7 |
8 | canvas : !! window.CanvasRenderingContext2D,
9 | webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
10 | workers : !! window.Worker,
11 | fileapi : window.File && window.FileReader && window.FileList && window.Blob,
12 |
13 | getWebGLErrorMessage : function () {
14 |
15 | var domElement = document.createElement( 'div' );
16 |
17 | domElement.style.fontFamily = 'monospace';
18 | domElement.style.fontSize = '13px';
19 | domElement.style.textAlign = 'center';
20 | domElement.style.background = '#eee';
21 | domElement.style.color = '#000';
22 | domElement.style.padding = '1em';
23 | domElement.style.width = '475px';
24 | domElement.style.margin = '5em auto 0';
25 |
26 | if ( ! this.webgl ) {
27 |
28 | domElement.innerHTML = window.WebGLRenderingContext ? [
29 | 'Your graphics card does not seem to support WebGL.
',
30 | 'Find out how to get it here.'
31 | ].join( '\n' ) : [
32 | 'Your browser does not seem to support WebGL.
',
33 | 'Find out how to get it here.'
34 | ].join( '\n' );
35 |
36 | }
37 |
38 | return domElement;
39 |
40 | },
41 |
42 | addGetWebGLMessage : function ( parameters ) {
43 |
44 | var parent, id, domElement;
45 |
46 | parameters = parameters || {};
47 |
48 | parent = parameters.parent !== undefined ? parameters.parent : document.body;
49 | id = parameters.id !== undefined ? parameters.id : 'oldie';
50 |
51 | domElement = Detector.getWebGLErrorMessage();
52 | domElement.id = id;
53 |
54 | parent.appendChild( domElement );
55 |
56 | }
57 |
58 | };
59 |
60 |
61 |
--------------------------------------------------------------------------------
/web/js/RequestAnimationFrame.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides requestAnimationFrame in a cross browser way.
3 | * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
4 | */
5 |
6 | if ( !window.requestAnimationFrame ) {
7 |
8 | window.requestAnimationFrame = ( function() {
9 |
10 | return window.webkitRequestAnimationFrame ||
11 | window.mozRequestAnimationFrame ||
12 | window.oRequestAnimationFrame ||
13 | window.msRequestAnimationFrame ||
14 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
15 |
16 | window.setTimeout( callback, 1000 / 60 );
17 |
18 | };
19 |
20 | } )();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/web/js/Stats.js:
--------------------------------------------------------------------------------
1 | // stats.js r8 - http://github.com/mrdoob/stats.js
2 | var Stats=function(){var h,a,n=0,o=0,i=Date.now(),u=i,p=i,l=0,q=1E3,r=0,e,j,f,b=[[16,16,48],[0,255,255]],m=0,s=1E3,t=0,d,k,g,c=[[16,48,16],[0,255,0]];h=document.createElement("div");h.style.cursor="pointer";h.style.width="80px";h.style.opacity="0.9";h.style.zIndex="10001";h.addEventListener("mousedown",function(a){a.preventDefault();n=(n+1)%2;n==0?(e.style.display="block",d.style.display="none"):(e.style.display="none",d.style.display="block")},!1);e=document.createElement("div");e.style.textAlign=
3 | "left";e.style.lineHeight="1.2em";e.style.backgroundColor="rgb("+Math.floor(b[0][0]/2)+","+Math.floor(b[0][1]/2)+","+Math.floor(b[0][2]/2)+")";e.style.padding="0 0 3px 3px";h.appendChild(e);j=document.createElement("div");j.style.fontFamily="Helvetica, Arial, sans-serif";j.style.fontSize="9px";j.style.color="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";j.style.fontWeight="bold";j.innerHTML="FPS";e.appendChild(j);f=document.createElement("div");f.style.position="relative";f.style.width="74px";f.style.height=
4 | "30px";f.style.backgroundColor="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";for(e.appendChild(f);f.children.length<74;)a=document.createElement("span"),a.style.width="1px",a.style.height="30px",a.style.cssFloat="left",a.style.backgroundColor="rgb("+b[0][0]+","+b[0][1]+","+b[0][2]+")",f.appendChild(a);d=document.createElement("div");d.style.textAlign="left";d.style.lineHeight="1.2em";d.style.backgroundColor="rgb("+Math.floor(c[0][0]/2)+","+Math.floor(c[0][1]/2)+","+Math.floor(c[0][2]/2)+")";d.style.padding=
5 | "0 0 3px 3px";d.style.display="none";h.appendChild(d);k=document.createElement("div");k.style.fontFamily="Helvetica, Arial, sans-serif";k.style.fontSize="9px";k.style.color="rgb("+c[1][0]+","+c[1][1]+","+c[1][2]+")";k.style.fontWeight="bold";k.innerHTML="MS";d.appendChild(k);g=document.createElement("div");g.style.position="relative";g.style.width="74px";g.style.height="30px";g.style.backgroundColor="rgb("+c[1][0]+","+c[1][1]+","+c[1][2]+")";for(d.appendChild(g);g.children.length<74;)a=document.createElement("span"),
6 | a.style.width="1px",a.style.height=Math.random()*30+"px",a.style.cssFloat="left",a.style.backgroundColor="rgb("+c[0][0]+","+c[0][1]+","+c[0][2]+")",g.appendChild(a);return{domElement:h,update:function(){i=Date.now();m=i-u;s=Math.min(s,m);t=Math.max(t,m);k.textContent=m+" MS ("+s+"-"+t+")";var a=Math.min(30,30-m/200*30);g.appendChild(g.firstChild).style.height=a+"px";u=i;o++;if(i>p+1E3)l=Math.round(o*1E3/(i-p)),q=Math.min(q,l),r=Math.max(r,l),j.textContent=l+" FPS ("+q+"-"+r+")",a=Math.min(30,30-l/
7 | 100*30),f.appendChild(f.firstChild).style.height=a+"px",p=i,o=0}}};
8 |
9 |
--------------------------------------------------------------------------------
/web/live.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Live 3D Stream for Art and Code 3D, thanks to Golan Levin, arturoc, mr.doob, roxlu, binx, joelgethinlewis, all the Art+Code 3D Labbers, openFrameworks Community, Microsoft Research and Microsoft Kinect Team
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
73 |
74 |
95 |
96 |
260 |
261 |
--------------------------------------------------------------------------------
/web/live_3D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Live 3D Stream for Art and Code 3D, thanks to Golan Levin, arturoc, mr.doob, roxlu, binx, joelgethinlewis, all the Art+Code 3D Labbers, openFrameworks Community, Microsoft Research and Microsoft Kinect Team
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
73 |
74 |
95 |
96 |
261 |
262 |
--------------------------------------------------------------------------------
/web/load-balance.php:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/web/servers.txt:
--------------------------------------------------------------------------------
1 | http://128.2.103.219/
2 |
3 |
--------------------------------------------------------------------------------
/web/stream_proxy.php:
--------------------------------------------------------------------------------
1 |