#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include "freenect_internal.h"
#include "registration.h"
#include "cameras.h"
#include "loader.h"
Go to the source code of this file.
|
FN_INTERNAL void | fn_log (freenect_context *ctx, freenect_loglevel level, const char *fmt,...) |
|
FREENECTAPI int | freenect_close_device (freenect_device *dev) |
|
FREENECTAPI freenect_device_flags | freenect_enabled_subdevices (freenect_context *ctx) |
|
FREENECTAPI void | freenect_free_device_attributes (struct freenect_device_attributes *attribute_list) |
|
FREENECTAPI void * | freenect_get_user (freenect_device *dev) |
|
FREENECTAPI int | freenect_init (freenect_context **ctx, freenect_usb_context *usb_ctx) |
|
FREENECTAPI int | freenect_list_device_attributes (freenect_context *ctx, struct freenect_device_attributes **attribute_list) |
|
FREENECTAPI int | freenect_num_devices (freenect_context *ctx) |
|
FREENECTAPI int | freenect_open_device (freenect_context *ctx, freenect_device **dev, int index) |
|
FREENECTAPI int | freenect_open_device_by_camera_serial (freenect_context *ctx, freenect_device **dev, const char *camera_serial) |
|
FREENECTAPI int | freenect_process_events (freenect_context *ctx) |
|
FREENECTAPI int | freenect_process_events_timeout (freenect_context *ctx, struct timeval *timeout) |
|
FREENECTAPI void | freenect_select_subdevices (freenect_context *ctx, freenect_device_flags subdevs) |
|
FREENECTAPI void | freenect_set_fw_address_k4w (freenect_context *ctx, unsigned char *fw_ptr, unsigned int num_bytes) |
|
FREENECTAPI void | freenect_set_fw_address_nui (freenect_context *ctx, unsigned char *fw_ptr, unsigned int num_bytes) |
|
FREENECTAPI void | freenect_set_log_callback (freenect_context *ctx, freenect_log_cb cb) |
|
FREENECTAPI void | freenect_set_log_level (freenect_context *ctx, freenect_loglevel level) |
|
FREENECTAPI void | freenect_set_user (freenect_device *dev, void *user) |
|
FREENECTAPI int | freenect_shutdown (freenect_context *ctx) |
|
FREENECTAPI int | freenect_supported_subdevices (void) |
|
Closes a device that is currently open
- Parameters
-
- Returns
- 0 on success
Definition at line 205 of file core.c.
Returns the devices that are enabled after calls to freenect_open_device() On newer kinects the motor and audio are automatically disabled for now
- Parameters
-
ctx | Context to set future subdevice selection for |
- Returns
- Flags representing the subdevices that were actually opened (see freenect_device_flags)
Definition at line 138 of file core.c.
Retrieve the pointer to user data from the device struct
- Parameters
-
dev | Device from which to get user data |
- Returns
- Pointer to user data
Definition at line 247 of file core.c.
Initialize a freenect context and do any setup required for platform specific USB libraries.
- Parameters
-
ctx | Address of pointer to freenect context struct to allocate and initialize |
usb_ctx | USB context to initialize. Can be NULL if not using multiple contexts. |
- Returns
- 0 on success, < 0 on error
Definition at line 40 of file core.c.
Scans for kinect devices and produces a linked list of their attributes (namely, serial numbers), returning the number of devices.
- Parameters
-
ctx | Context to scan for kinect devices with |
attribute_list | Pointer to where this function will store the resultant linked list |
- Returns
- Number of devices connected, < 0 on error
Definition at line 107 of file core.c.
Return the number of kinect devices currently connected to the system
- Parameters
-
ctx | Context to access device count through |
- Returns
- Number of devices connected, < 0 on error
Definition at line 102 of file core.c.
Opens a kinect device via a context. Index specifies the index of the device on the current state of the bus. Bus resets may cause indexes to shift.
- Parameters
-
ctx | Context to open device through |
dev | Device structure to assign opened device to |
index | Index of the device on the bus |
- Returns
- 0 on success, < 0 on error
Definition at line 143 of file core.c.
Opens a kinect device (via a context) associated with a particular camera subdevice serial number. This function will fail if no device with a matching serial number is found.
- Parameters
-
ctx | Context to open device through |
dev | Device structure to assign opened device to |
camera_serial | Null-terminated ASCII string containing the serial number of the camera subdevice in the device to open |
- Returns
- 0 on success, < 0 on error
Definition at line 181 of file core.c.
Calls the platform specific usb event processor
- Parameters
-
ctx | context to process events for |
- Returns
- 0 on success, other values on error, platform/library dependant
Definition at line 72 of file core.c.
Calls the platform specific usb event processor until either an event occurs or the timeout parameter time has passed. If a zero timeval is passed, this function will handle any already-pending events, then return immediately.
- Parameters
-
ctx | Context to process events for |
timeout | Pointer to a timeval containing the maximum amount of time to block waiting for events, or zero for nonblocking mode |
- Returns
- 0 on success, other values on error, platform/library dependant
Definition at line 80 of file core.c.
Set which subdevices any subsequent calls to freenect_open_device() should open. This will not affect devices which have already been opened. The default behavior, should you choose not to call this function at all, is to open all supported subdevices - motor, cameras, and audio, if supported on the platform.
- Parameters
-
ctx | Context to set future subdevice selection for |
subdevs | Flags representing the subdevices to select |
Definition at line 133 of file core.c.
Allows the user to specify a pointer to the audio firmware in memory for the K4W Kinect
- Parameters
-
ctx | Context to open device through |
fw_ptr | Pointer to audio firmware loaded in memory |
num_bytes | The size of the firmware in bytes |
Definition at line 292 of file core.c.
Allows the user to specify a pointer to the audio firmware in memory for the Xbox 360 Kinect
- Parameters
-
ctx | Context to open device through |
fw_ptr | Pointer to audio firmware loaded in memory |
num_bytes | The size of the firmware in bytes |
Definition at line 286 of file core.c.
Callback for log messages (i.e. for rerouting to a file instead of stdout)
- Parameters
-
ctx | context to set log callback for |
cb | callback function pointer |
Definition at line 257 of file core.c.
Set the log level for the specified freenect context
- Parameters
-
ctx | context to set log level for |
level | log level to use (see freenect_loglevel enum) |
Definition at line 252 of file core.c.
Set the device user data, for passing generic information into callbacks
- Parameters
-
dev | Device to attach user data to |
user | User data to attach |
Definition at line 242 of file core.c.
Closes the device if it is open, and frees the context
- Parameters
-
ctx | freenect context to close/free |
- Returns
- 0 on success
Definition at line 60 of file core.c.
Answer which subdevices this library supports. This is most useful for wrappers trying to determine whether the underlying library was built with audio support or not, so the wrapper can avoid calling functions that do not exist.
- Returns
- Flags representing the subdevices that the library supports opening (see freenect_device_flags)
Definition at line 128 of file core.c.