cameras.c: disable depth and IR camera hflip by default

OpenNI sometimes enables the depth camera horizontal flip and leaves
the device in that state on close, so then anything using libfreenect
gets an hflipped image.  This is subpar.

The same thing can happen to the IR camera, so I disabled it too.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
API rework, round 2.

Bindings still probably broken: Python, Java, AS3, C#, Matlab, Ruby

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com> (zarvox)
Fix the AS3 and OpenCV wrappers.

Conveniently, both mostly just rely on the c_sync wrapper, so changes
were minimal.  I took the liberty to do some CMake cleanups so that
this would also build on Fedora.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fix up c_sync after rebase onto unstable

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fix the Python wrappers to support the new API.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Remove the old #defines, and force new API usage throughout.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
CMakeLists.txt: Remove file that no longer exists from CPack install

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
glview.c: Fix one of the causes of the "everything's white" bug.

glColor4f should be passed values between 0 and 1.  Whereas drivers
are also supposed to clamp this value, some ATI drivers and hardware
do not.  We should do this right, though, and pass 1.

Closes #144.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Add option to stream recorded RGB and depth video to ffmpeg for compression.

Defaults to "msmpeg4" codec with a high bitrate, avi format.  Options
to ffmpeg may be overridden.  Note, this does not handle frame rates
very well, and compression may even slow down acquisition rates.

Writes timestamps to an index for each frame, so hopefully the true
framerate can be later recovered.

Signed-off-by: Stephen Sinclair <radarsat1@gmail.com>
1. Make the "record" program go into "bin" instead of "utils" where it was a
2. Install into "bin" when using make install.
Signed-off-by: Brandyn A. White <bwhite@dappervision.com>
1. Updated record to output the mode struct used.  This is informative, will be changed in the future to save as metadata, and is helpful for setting the default struct in Fakenect.
2. Added fakenect functions that correspond to the new ones in the API.  Note that fakenect only works for the previous default resolution/mode at the moment.

Future Change (as a heads up to other devs)
A later update will store the modes in metadata with the dump and just ensure that if you are setting things that they belong to the recorded mode.  The current behavior will be the default for people with datasets made before this.
Signed-off-by: Brandyn A. White <bwhite@dappervision.com>
Fixed a tiny bug in KinectDemo where it wasn't swapping buffers right
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)
Fixed interop call stubs in KinectNative to reflect new API. Motor Class now uses new API calls (C# usage stays the same). None of these changes have been tested on a real kinect yet.
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)
Add resolution and pixel format fields to freenect_frame_mode.

This should make it possible to create a "try all supported modes" program
- without this support, freenect_get_video_mode(int) is rather useless,
since we won't know how to interpret the data itself.

This patch breaks binary compatibility (change of size of non-opaque
struct), but no one cares yet, since I don't think anyone's built much
on the new API yet anyway, and it's better to make these changes before
release.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Add new fields to the Python bindings.

I'm not sure what the correct way to treat enums in Cython is, but it looks like we just cast them to ints before, so I'm continuing with that.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
cameras.c: optimized function to unpack 11-bit pixel data into 16-bit buffers.

Loop-unrolling the unpacking routine makes the bit-shifting code much faster.

Originally authored by Alex Kushleyev <kushlik@gmail.com>

Signed-off-by: Kyle Machulis <kyle@nonpolynomial.com>
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Restructuring enumerations and structures for shorter class names. Eg. VideoFormat instead of VideoCamera.DataFormat. Little bit more work for new API.
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)
Adding in missing Enumerations file and new FrameMode class
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)
Make freenect_frame_mode have well-defined field sizes.

This commit gives explicit sizes to the elements of freenect_frame_mode,
forces the enums contained in freenect_frame_mode to be assigned at least
a 32-bit integer, and for memory packing efficiency, orders the contents
from largest to smallest.

It also adjusts the Python bindings and fakenect/record to take these changes
into account.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fixed a tiny bug in KinectDemo where it wasn't swapping buffers right
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)