You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2017/11/08 20:32:59 UTC

[4/9] nifi-minifi-cpp git commit: MINIFICPP-283 Created a USB camera sensor processor

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/include/libuvc/libuvc.h
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/include/libuvc/libuvc.h b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc.h
new file mode 100644
index 0000000..fa0aea0
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc.h
@@ -0,0 +1,741 @@
+#ifndef LIBUVC_H
+#define LIBUVC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h> // FILE
+#include <stdint.h>
+#include <sys/time.h>
+#include <libuvc/libuvc_config.h>
+
+struct libusb_context;
+struct libusb_device_handle;
+
+/** UVC error types, based on libusb errors
+ * @ingroup diag
+ */
+typedef enum uvc_error {
+  /** Success (no error) */
+  UVC_SUCCESS = 0,
+  /** Input/output error */
+  UVC_ERROR_IO = -1,
+  /** Invalid parameter */
+  UVC_ERROR_INVALID_PARAM = -2,
+  /** Access denied */
+  UVC_ERROR_ACCESS = -3,
+  /** No such device */
+  UVC_ERROR_NO_DEVICE = -4,
+  /** Entity not found */
+  UVC_ERROR_NOT_FOUND = -5,
+  /** Resource busy */
+  UVC_ERROR_BUSY = -6,
+  /** Operation timed out */
+  UVC_ERROR_TIMEOUT = -7,
+  /** Overflow */
+  UVC_ERROR_OVERFLOW = -8,
+  /** Pipe error */
+  UVC_ERROR_PIPE = -9,
+  /** System call interrupted */
+  UVC_ERROR_INTERRUPTED = -10,
+  /** Insufficient memory */
+  UVC_ERROR_NO_MEM = -11,
+  /** Operation not supported */
+  UVC_ERROR_NOT_SUPPORTED = -12,
+  /** Device is not UVC-compliant */
+  UVC_ERROR_INVALID_DEVICE = -50,
+  /** Mode not supported */
+  UVC_ERROR_INVALID_MODE = -51,
+  /** Resource has a callback (can't use polling and async) */
+  UVC_ERROR_CALLBACK_EXISTS = -52,
+  /** Undefined error */
+  UVC_ERROR_OTHER = -99
+} uvc_error_t;
+
+/** Color coding of stream, transport-independent
+ * @ingroup streaming
+ */
+enum uvc_frame_format {
+  UVC_FRAME_FORMAT_UNKNOWN = 0,
+  /** Any supported format */
+  UVC_FRAME_FORMAT_ANY = 0,
+  UVC_FRAME_FORMAT_UNCOMPRESSED,
+  UVC_FRAME_FORMAT_COMPRESSED,
+  /** YUYV/YUV2/YUV422: YUV encoding with one luminance value per pixel and
+   * one UV (chrominance) pair for every two pixels.
+   */
+  UVC_FRAME_FORMAT_YUYV,
+  UVC_FRAME_FORMAT_UYVY,
+  /** 24-bit RGB */
+  UVC_FRAME_FORMAT_RGB,
+  UVC_FRAME_FORMAT_BGR,
+  /** Motion-JPEG (or JPEG) encoded images */
+  UVC_FRAME_FORMAT_MJPEG,
+  /** Greyscale images */
+  UVC_FRAME_FORMAT_GRAY8,
+  UVC_FRAME_FORMAT_GRAY16,
+  /* Raw colour mosaic images */
+  UVC_FRAME_FORMAT_BY8,
+  UVC_FRAME_FORMAT_BA81,
+  UVC_FRAME_FORMAT_SGRBG8,
+  UVC_FRAME_FORMAT_SGBRG8,
+  UVC_FRAME_FORMAT_SRGGB8,
+  UVC_FRAME_FORMAT_SBGGR8,
+  /** Number of formats understood */
+  UVC_FRAME_FORMAT_COUNT,
+};
+
+/* UVC_COLOR_FORMAT_* have been replaced with UVC_FRAME_FORMAT_*. Please use
+ * UVC_FRAME_FORMAT_* instead of using these. */
+#define UVC_COLOR_FORMAT_UNKNOWN UVC_FRAME_FORMAT_UNKNOWN
+#define UVC_COLOR_FORMAT_UNCOMPRESSED UVC_FRAME_FORMAT_UNCOMPRESSED
+#define UVC_COLOR_FORMAT_COMPRESSED UVC_FRAME_FORMAT_COMPRESSED
+#define UVC_COLOR_FORMAT_YUYV UVC_FRAME_FORMAT_YUYV
+#define UVC_COLOR_FORMAT_UYVY UVC_FRAME_FORMAT_UYVY
+#define UVC_COLOR_FORMAT_RGB UVC_FRAME_FORMAT_RGB
+#define UVC_COLOR_FORMAT_BGR UVC_FRAME_FORMAT_BGR
+#define UVC_COLOR_FORMAT_MJPEG UVC_FRAME_FORMAT_MJPEG
+#define UVC_COLOR_FORMAT_GRAY8 UVC_FRAME_FORMAT_GRAY8
+#define UVC_COLOR_FORMAT_GRAY16 UVC_FRAME_FORMAT_GRAY16
+
+/** VideoStreaming interface descriptor subtype (A.6) */
+enum uvc_vs_desc_subtype {
+  UVC_VS_UNDEFINED = 0x00,
+  UVC_VS_INPUT_HEADER = 0x01,
+  UVC_VS_OUTPUT_HEADER = 0x02,
+  UVC_VS_STILL_IMAGE_FRAME = 0x03,
+  UVC_VS_FORMAT_UNCOMPRESSED = 0x04,
+  UVC_VS_FRAME_UNCOMPRESSED = 0x05,
+  UVC_VS_FORMAT_MJPEG = 0x06,
+  UVC_VS_FRAME_MJPEG = 0x07,
+  UVC_VS_FORMAT_MPEG2TS = 0x0a,
+  UVC_VS_FORMAT_DV = 0x0c,
+  UVC_VS_COLORFORMAT = 0x0d,
+  UVC_VS_FORMAT_FRAME_BASED = 0x10,
+  UVC_VS_FRAME_FRAME_BASED = 0x11,
+  UVC_VS_FORMAT_STREAM_BASED = 0x12
+};
+
+struct uvc_format_desc;
+struct uvc_frame_desc;
+
+/** Frame descriptor
+ *
+ * A "frame" is a configuration of a streaming format
+ * for a particular image size at one of possibly several
+ * available frame rates.
+ */
+typedef struct uvc_frame_desc {
+  struct uvc_format_desc *parent;
+  struct uvc_frame_desc *prev, *next;
+  /** Type of frame, such as JPEG frame or uncompressed frme */
+  enum uvc_vs_desc_subtype bDescriptorSubtype;
+  /** Index of the frame within the list of specs available for this format */
+  uint8_t bFrameIndex;
+  uint8_t bmCapabilities;
+  /** Image width */
+  uint16_t wWidth;
+  /** Image height */
+  uint16_t wHeight;
+  /** Bitrate of corresponding stream at minimal frame rate */
+  uint32_t dwMinBitRate;
+  /** Bitrate of corresponding stream at maximal frame rate */
+  uint32_t dwMaxBitRate;
+  /** Maximum number of bytes for a video frame */
+  uint32_t dwMaxVideoFrameBufferSize;
+  /** Default frame interval (in 100ns units) */
+  uint32_t dwDefaultFrameInterval;
+  /** Minimum frame interval for continuous mode (100ns units) */
+  uint32_t dwMinFrameInterval;
+  /** Maximum frame interval for continuous mode (100ns units) */
+  uint32_t dwMaxFrameInterval;
+  /** Granularity of frame interval range for continuous mode (100ns) */
+  uint32_t dwFrameIntervalStep;
+  /** Frame intervals */
+  uint8_t bFrameIntervalType;
+  /** number of bytes per line */
+  uint32_t dwBytesPerLine;
+  /** Available frame rates, zero-terminated (in 100ns units) */
+  uint32_t *intervals;
+} uvc_frame_desc_t;
+
+/** Format descriptor
+ *
+ * A "format" determines a stream's image type (e.g., raw YUYV or JPEG)
+ * and includes many "frame" configurations.
+ */
+typedef struct uvc_format_desc {
+  struct uvc_streaming_interface *parent;
+  struct uvc_format_desc *prev, *next;
+  /** Type of image stream, such as JPEG or uncompressed. */
+  enum uvc_vs_desc_subtype bDescriptorSubtype;
+  /** Identifier of this format within the VS interface's format list */
+  uint8_t bFormatIndex;
+  uint8_t bNumFrameDescriptors;
+  /** Format specifier */
+  union {
+    uint8_t guidFormat[16];
+    uint8_t fourccFormat[4];
+  };
+  /** Format-specific data */
+  union {
+    /** BPP for uncompressed stream */
+    uint8_t bBitsPerPixel;
+    /** Flags for JPEG stream */
+    uint8_t bmFlags;
+  };
+  /** Default {uvc_frame_desc} to choose given this format */
+  uint8_t bDefaultFrameIndex;
+  uint8_t bAspectRatioX;
+  uint8_t bAspectRatioY;
+  uint8_t bmInterlaceFlags;
+  uint8_t bCopyProtect;
+  uint8_t bVariableSize;
+  /** Available frame specifications for this format */
+  struct uvc_frame_desc *frame_descs;
+} uvc_format_desc_t;
+
+/** UVC request code (A.8) */
+enum uvc_req_code {
+  UVC_RC_UNDEFINED = 0x00,
+  UVC_SET_CUR = 0x01,
+  UVC_GET_CUR = 0x81,
+  UVC_GET_MIN = 0x82,
+  UVC_GET_MAX = 0x83,
+  UVC_GET_RES = 0x84,
+  UVC_GET_LEN = 0x85,
+  UVC_GET_INFO = 0x86,
+  UVC_GET_DEF = 0x87
+};
+
+enum uvc_device_power_mode {
+  UVC_VC_VIDEO_POWER_MODE_FULL = 0x000b,
+  UVC_VC_VIDEO_POWER_MODE_DEVICE_DEPENDENT = 0x001b,
+};
+
+/** Camera terminal control selector (A.9.4) */
+enum uvc_ct_ctrl_selector {
+  UVC_CT_CONTROL_UNDEFINED = 0x00,
+  UVC_CT_SCANNING_MODE_CONTROL = 0x01,
+  UVC_CT_AE_MODE_CONTROL = 0x02,
+  UVC_CT_AE_PRIORITY_CONTROL = 0x03,
+  UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,
+  UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,
+  UVC_CT_FOCUS_ABSOLUTE_CONTROL = 0x06,
+  UVC_CT_FOCUS_RELATIVE_CONTROL = 0x07,
+  UVC_CT_FOCUS_AUTO_CONTROL = 0x08,
+  UVC_CT_IRIS_ABSOLUTE_CONTROL = 0x09,
+  UVC_CT_IRIS_RELATIVE_CONTROL = 0x0a,
+  UVC_CT_ZOOM_ABSOLUTE_CONTROL = 0x0b,
+  UVC_CT_ZOOM_RELATIVE_CONTROL = 0x0c,
+  UVC_CT_PANTILT_ABSOLUTE_CONTROL = 0x0d,
+  UVC_CT_PANTILT_RELATIVE_CONTROL = 0x0e,
+  UVC_CT_ROLL_ABSOLUTE_CONTROL = 0x0f,
+  UVC_CT_ROLL_RELATIVE_CONTROL = 0x10,
+  UVC_CT_PRIVACY_CONTROL = 0x11,
+  UVC_CT_FOCUS_SIMPLE_CONTROL = 0x12,
+  UVC_CT_DIGITAL_WINDOW_CONTROL = 0x13,
+  UVC_CT_REGION_OF_INTEREST_CONTROL = 0x14
+};
+
+/** Processing unit control selector (A.9.5) */
+enum uvc_pu_ctrl_selector {
+  UVC_PU_CONTROL_UNDEFINED = 0x00,
+  UVC_PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,
+  UVC_PU_BRIGHTNESS_CONTROL = 0x02,
+  UVC_PU_CONTRAST_CONTROL = 0x03,
+  UVC_PU_GAIN_CONTROL = 0x04,
+  UVC_PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,
+  UVC_PU_HUE_CONTROL = 0x06,
+  UVC_PU_SATURATION_CONTROL = 0x07,
+  UVC_PU_SHARPNESS_CONTROL = 0x08,
+  UVC_PU_GAMMA_CONTROL = 0x09,
+  UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0a,
+  UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0b,
+  UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0c,
+  UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0d,
+  UVC_PU_DIGITAL_MULTIPLIER_CONTROL = 0x0e,
+  UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0f,
+  UVC_PU_HUE_AUTO_CONTROL = 0x10,
+  UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL = 0x11,
+  UVC_PU_ANALOG_LOCK_STATUS_CONTROL = 0x12,
+  UVC_PU_CONTRAST_AUTO_CONTROL = 0x13
+};
+
+/** USB terminal type (B.1) */
+enum uvc_term_type {
+  UVC_TT_VENDOR_SPECIFIC = 0x0100,
+  UVC_TT_STREAMING = 0x0101
+};
+
+/** Input terminal type (B.2) */
+enum uvc_it_type {
+  UVC_ITT_VENDOR_SPECIFIC = 0x0200,
+  UVC_ITT_CAMERA = 0x0201,
+  UVC_ITT_MEDIA_TRANSPORT_INPUT = 0x0202
+};
+
+/** Output terminal type (B.3) */
+enum uvc_ot_type {
+  UVC_OTT_VENDOR_SPECIFIC = 0x0300,
+  UVC_OTT_DISPLAY = 0x0301,
+  UVC_OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302
+};
+
+/** External terminal type (B.4) */
+enum uvc_et_type {
+  UVC_EXTERNAL_VENDOR_SPECIFIC = 0x0400,
+  UVC_COMPOSITE_CONNECTOR = 0x0401,
+  UVC_SVIDEO_CONNECTOR = 0x0402,
+  UVC_COMPONENT_CONNECTOR = 0x0403
+};
+
+/** Context, equivalent to libusb's contexts.
+ *
+ * May either own a libusb context or use one that's already made.
+ *
+ * Always create these with uvc_get_context.
+ */
+struct uvc_context;
+typedef struct uvc_context uvc_context_t;
+
+/** UVC device.
+ *
+ * Get this from uvc_get_device_list() or uvc_find_device().
+ */
+struct uvc_device;
+typedef struct uvc_device uvc_device_t;
+
+/** Handle on an open UVC device.
+ *
+ * Get one of these from uvc_open(). Once you uvc_close()
+ * it, it's no longer valid.
+ */
+struct uvc_device_handle;
+typedef struct uvc_device_handle uvc_device_handle_t;
+
+/** Handle on an open UVC stream.
+ *
+ * Get one of these from uvc_stream_open*().
+ * Once you uvc_stream_close() it, it will no longer be valid.
+ */
+struct uvc_stream_handle;
+typedef struct uvc_stream_handle uvc_stream_handle_t;
+
+/** Representation of the interface that brings data into the UVC device */
+typedef struct uvc_input_terminal {
+  struct uvc_input_terminal *prev, *next;
+  /** Index of the terminal within the device */
+  uint8_t bTerminalID;
+  /** Type of terminal (e.g., camera) */
+  enum uvc_it_type wTerminalType;
+  uint16_t wObjectiveFocalLengthMin;
+  uint16_t wObjectiveFocalLengthMax;
+  uint16_t wOcularFocalLength;
+  /** Camera controls (meaning of bits given in {uvc_ct_ctrl_selector}) */
+  uint64_t bmControls;
+} uvc_input_terminal_t;
+
+typedef struct uvc_output_terminal {
+  struct uvc_output_terminal *prev, *next;
+  /** @todo */
+} uvc_output_terminal_t;
+
+/** Represents post-capture processing functions */
+typedef struct uvc_processing_unit {
+  struct uvc_processing_unit *prev, *next;
+  /** Index of the processing unit within the device */
+  uint8_t bUnitID;
+  /** Index of the terminal from which the device accepts images */
+  uint8_t bSourceID;
+  /** Processing controls (meaning of bits given in {uvc_pu_ctrl_selector}) */
+  uint64_t bmControls;
+} uvc_processing_unit_t;
+
+/** Represents selector unit to connect other units */
+typedef struct uvc_selector_unit {
+  struct uvc_selector_unit *prev, *next;
+  /** Index of the selector unit within the device */
+  uint8_t bUnitID;
+} uvc_selector_unit_t;
+
+/** Custom processing or camera-control functions */
+typedef struct uvc_extension_unit {
+  struct uvc_extension_unit *prev, *next;
+  /** Index of the extension unit within the device */
+  uint8_t bUnitID;
+  /** GUID identifying the extension unit */
+  uint8_t guidExtensionCode[16];
+  /** Bitmap of available controls (manufacturer-dependent) */
+  uint64_t bmControls;
+} uvc_extension_unit_t;
+
+enum uvc_status_class {
+  UVC_STATUS_CLASS_CONTROL = 0x10,
+  UVC_STATUS_CLASS_CONTROL_CAMERA = 0x11,
+  UVC_STATUS_CLASS_CONTROL_PROCESSING = 0x12,
+};
+
+enum uvc_status_attribute {
+  UVC_STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00,
+  UVC_STATUS_ATTRIBUTE_INFO_CHANGE = 0x01,
+  UVC_STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02,
+  UVC_STATUS_ATTRIBUTE_UNKNOWN = 0xff
+};
+
+/** A callback function to accept status updates
+ * @ingroup device
+ */
+typedef void(uvc_status_callback_t)(enum uvc_status_class status_class,
+                                    int event,
+                                    int selector,
+                                    enum uvc_status_attribute status_attribute,
+                                    void *data, size_t data_len,
+                                    void *user_ptr);
+
+/** A callback function to accept button events
+ * @ingroup device
+ */
+typedef void(uvc_button_callback_t)(int button,
+                                    int state,
+                                    void *user_ptr);
+
+/** Structure representing a UVC device descriptor.
+ *
+ * (This isn't a standard structure.)
+ */
+typedef struct uvc_device_descriptor {
+  /** Vendor ID */
+  uint16_t idVendor;
+  /** Product ID */
+  uint16_t idProduct;
+  /** UVC compliance level, e.g. 0x0100 (1.0), 0x0110 */
+  uint16_t bcdUVC;
+  /** Serial number (null if unavailable) */
+  const char *serialNumber;
+  /** Device-reported manufacturer name (or null) */
+  const char *manufacturer;
+  /** Device-reporter product name (or null) */
+  const char *product;
+} uvc_device_descriptor_t;
+
+/** An image frame received from the UVC device
+ * @ingroup streaming
+ */
+typedef struct uvc_frame {
+  /** Image data for this frame */
+  void *data;
+  /** Size of image data buffer */
+  size_t data_bytes;
+  /** Width of image in pixels */
+  uint32_t width;
+  /** Height of image in pixels */
+  uint32_t height;
+  /** Pixel data format */
+  enum uvc_frame_format frame_format;
+  /** Number of bytes per horizontal line (undefined for compressed format) */
+  size_t step;
+  /** Frame number (may skip, but is strictly monotonically increasing) */
+  uint32_t sequence;
+  /** Estimate of system time when the device started capturing the image */
+  struct timeval capture_time;
+  /** Handle on the device that produced the image.
+   * @warning You must not call any uvc_* functions during a callback. */
+  uvc_device_handle_t *source;
+  /** Is the data buffer owned by the library?
+   * If 1, the data buffer can be arbitrarily reallocated by frame conversion
+   * functions.
+   * If 0, the data buffer will not be reallocated or freed by the library.
+   * Set this field to zero if you are supplying the buffer.
+   */
+  uint8_t library_owns_data;
+} uvc_frame_t;
+
+/** A callback function to handle incoming assembled UVC frames
+ * @ingroup streaming
+ */
+typedef void(uvc_frame_callback_t)(struct uvc_frame *frame, void *user_ptr);
+
+/** Streaming mode, includes all information needed to select stream
+ * @ingroup streaming
+ */
+typedef struct uvc_stream_ctrl {
+  uint16_t bmHint;
+  uint8_t bFormatIndex;
+  uint8_t bFrameIndex;
+  uint32_t dwFrameInterval;
+  uint16_t wKeyFrameRate;
+  uint16_t wPFrameRate;
+  uint16_t wCompQuality;
+  uint16_t wCompWindowSize;
+  uint16_t wDelay;
+  uint32_t dwMaxVideoFrameSize;
+  uint32_t dwMaxPayloadTransferSize;
+  uint32_t dwClockFrequency;
+  uint8_t bmFramingInfo;
+  uint8_t bPreferredVersion;
+  uint8_t bMinVersion;
+  uint8_t bMaxVersion;
+  uint8_t bInterfaceNumber;
+} uvc_stream_ctrl_t;
+
+uvc_error_t uvc_init(uvc_context_t **ctx, struct libusb_context *usb_ctx);
+void uvc_exit(uvc_context_t *ctx);
+
+uvc_error_t uvc_get_device_list(
+    uvc_context_t *ctx,
+    uvc_device_t ***list);
+void uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices);
+
+uvc_error_t uvc_get_device_descriptor(
+    uvc_device_t *dev,
+    uvc_device_descriptor_t **desc);
+void uvc_free_device_descriptor(
+    uvc_device_descriptor_t *desc);
+
+uint8_t uvc_get_bus_number(uvc_device_t *dev);
+uint8_t uvc_get_device_address(uvc_device_t *dev);
+
+uvc_error_t uvc_find_device(
+    uvc_context_t *ctx,
+    uvc_device_t **dev,
+    int vid, int pid, const char *sn);
+
+uvc_error_t uvc_find_devices(
+    uvc_context_t *ctx,
+    uvc_device_t ***devs,
+    int vid, int pid, const char *sn);
+
+uvc_error_t uvc_open(
+    uvc_device_t *dev,
+    uvc_device_handle_t **devh);
+void uvc_close(uvc_device_handle_t *devh);
+
+uvc_device_t *uvc_get_device(uvc_device_handle_t *devh);
+struct libusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh);
+
+void uvc_ref_device(uvc_device_t *dev);
+void uvc_unref_device(uvc_device_t *dev);
+
+void uvc_set_status_callback(uvc_device_handle_t *devh,
+                             uvc_status_callback_t cb,
+                             void *user_ptr);
+
+void uvc_set_button_callback(uvc_device_handle_t *devh,
+                             uvc_button_callback_t cb,
+                             void *user_ptr);
+
+const uvc_input_terminal_t *uvc_get_camera_terminal(uvc_device_handle_t *devh);
+const uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh);
+const uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh);
+const uvc_selector_unit_t *uvc_get_selector_units(uvc_device_handle_t *devh);
+const uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh);
+const uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh);
+
+uvc_error_t uvc_get_stream_ctrl_format_size(
+    uvc_device_handle_t *devh,
+    uvc_stream_ctrl_t *ctrl,
+    enum uvc_frame_format format,
+    int width, int height,
+    int fps
+    );
+
+const uvc_format_desc_t *uvc_get_format_descs(uvc_device_handle_t* );
+
+uvc_error_t uvc_probe_stream_ctrl(
+    uvc_device_handle_t *devh,
+    uvc_stream_ctrl_t *ctrl);
+
+uvc_error_t uvc_start_streaming(
+    uvc_device_handle_t *devh,
+    uvc_stream_ctrl_t *ctrl,
+    uvc_frame_callback_t *cb,
+    void *user_ptr,
+    uint8_t flags);
+
+uvc_error_t uvc_start_iso_streaming(
+    uvc_device_handle_t *devh,
+    uvc_stream_ctrl_t *ctrl,
+    uvc_frame_callback_t *cb,
+    void *user_ptr);
+
+void uvc_stop_streaming(uvc_device_handle_t *devh);
+
+uvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh, uvc_stream_handle_t **strmh, uvc_stream_ctrl_t *ctrl);
+uvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl);
+uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
+    uvc_frame_callback_t *cb,
+    void *user_ptr,
+    uint8_t flags);
+uvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,
+    uvc_frame_callback_t *cb,
+    void *user_ptr);
+uvc_error_t uvc_stream_get_frame(
+    uvc_stream_handle_t *strmh,
+    uvc_frame_t **frame,
+    int32_t timeout_us
+);
+uvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh);
+void uvc_stream_close(uvc_stream_handle_t *strmh);
+
+int uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl);
+int uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len, enum uvc_req_code req_code);
+int uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len);
+
+uvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode *mode, enum uvc_req_code req_code);
+uvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode mode);
+
+/* AUTO-GENERATED control accessors! Update them with the output of `ctrl-gen.py decl`. */
+uvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
+uvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, uint8_t mode);
+
+uvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
+uvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, uint8_t mode);
+
+uvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t* priority, enum uvc_req_code req_code);
+uvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority);
+
+uvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, uint32_t* time, enum uvc_req_code req_code);
+uvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, uint32_t time);
+
+uvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int8_t* step, enum uvc_req_code req_code);
+uvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int8_t step);
+
+uvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, uint16_t* focus, enum uvc_req_code req_code);
+uvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, uint16_t focus);
+
+uvc_error_t uvc_get_focus_rel(uvc_device_handle_t *devh, int8_t* focus_rel, uint8_t* speed, enum uvc_req_code req_code);
+uvc_error_t uvc_set_focus_rel(uvc_device_handle_t *devh, int8_t focus_rel, uint8_t speed);
+
+uvc_error_t uvc_get_focus_simple_range(uvc_device_handle_t *devh, uint8_t* focus, enum uvc_req_code req_code);
+uvc_error_t uvc_set_focus_simple_range(uvc_device_handle_t *devh, uint8_t focus);
+
+uvc_error_t uvc_get_focus_auto(uvc_device_handle_t *devh, uint8_t* state, enum uvc_req_code req_code);
+uvc_error_t uvc_set_focus_auto(uvc_device_handle_t *devh, uint8_t state);
+
+uvc_error_t uvc_get_iris_abs(uvc_device_handle_t *devh, uint16_t* iris, enum uvc_req_code req_code);
+uvc_error_t uvc_set_iris_abs(uvc_device_handle_t *devh, uint16_t iris);
+
+uvc_error_t uvc_get_iris_rel(uvc_device_handle_t *devh, uint8_t* iris_rel, enum uvc_req_code req_code);
+uvc_error_t uvc_set_iris_rel(uvc_device_handle_t *devh, uint8_t iris_rel);
+
+uvc_error_t uvc_get_zoom_abs(uvc_device_handle_t *devh, uint16_t* focal_length, enum uvc_req_code req_code);
+uvc_error_t uvc_set_zoom_abs(uvc_device_handle_t *devh, uint16_t focal_length);
+
+uvc_error_t uvc_get_zoom_rel(uvc_device_handle_t *devh, int8_t* zoom_rel, uint8_t* digital_zoom, uint8_t* speed, enum uvc_req_code req_code);
+uvc_error_t uvc_set_zoom_rel(uvc_device_handle_t *devh, int8_t zoom_rel, uint8_t digital_zoom, uint8_t speed);
+
+uvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int32_t* pan, int32_t* tilt, enum uvc_req_code req_code);
+uvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int32_t pan, int32_t tilt);
+
+uvc_error_t uvc_get_pantilt_rel(uvc_device_handle_t *devh, int8_t* pan_rel, uint8_t* pan_speed, int8_t* tilt_rel, uint8_t* tilt_speed, enum uvc_req_code req_code);
+uvc_error_t uvc_set_pantilt_rel(uvc_device_handle_t *devh, int8_t pan_rel, uint8_t pan_speed, int8_t tilt_rel, uint8_t tilt_speed);
+
+uvc_error_t uvc_get_roll_abs(uvc_device_handle_t *devh, int16_t* roll, enum uvc_req_code req_code);
+uvc_error_t uvc_set_roll_abs(uvc_device_handle_t *devh, int16_t roll);
+
+uvc_error_t uvc_get_roll_rel(uvc_device_handle_t *devh, int8_t* roll_rel, uint8_t* speed, enum uvc_req_code req_code);
+uvc_error_t uvc_set_roll_rel(uvc_device_handle_t *devh, int8_t roll_rel, uint8_t speed);
+
+uvc_error_t uvc_get_privacy(uvc_device_handle_t *devh, uint8_t* privacy, enum uvc_req_code req_code);
+uvc_error_t uvc_set_privacy(uvc_device_handle_t *devh, uint8_t privacy);
+
+uvc_error_t uvc_get_digital_window(uvc_device_handle_t *devh, uint16_t* window_top, uint16_t* window_left, uint16_t* window_bottom, uint16_t* window_right, uint16_t* num_steps, uint16_t* num_steps_units, enum uvc_req_code req_code);
+uvc_error_t uvc_set_digital_window(uvc_device_handle_t *devh, uint16_t window_top, uint16_t window_left, uint16_t window_bottom, uint16_t window_right, uint16_t num_steps, uint16_t num_steps_units);
+
+uvc_error_t uvc_get_digital_roi(uvc_device_handle_t *devh, uint16_t* roi_top, uint16_t* roi_left, uint16_t* roi_bottom, uint16_t* roi_right, uint16_t* auto_controls, enum uvc_req_code req_code);
+uvc_error_t uvc_set_digital_roi(uvc_device_handle_t *devh, uint16_t roi_top, uint16_t roi_left, uint16_t roi_bottom, uint16_t roi_right, uint16_t auto_controls);
+
+uvc_error_t uvc_get_backlight_compensation(uvc_device_handle_t *devh, uint16_t* backlight_compensation, enum uvc_req_code req_code);
+uvc_error_t uvc_set_backlight_compensation(uvc_device_handle_t *devh, uint16_t backlight_compensation);
+
+uvc_error_t uvc_get_brightness(uvc_device_handle_t *devh, int16_t* brightness, enum uvc_req_code req_code);
+uvc_error_t uvc_set_brightness(uvc_device_handle_t *devh, int16_t brightness);
+
+uvc_error_t uvc_get_contrast(uvc_device_handle_t *devh, uint16_t* contrast, enum uvc_req_code req_code);
+uvc_error_t uvc_set_contrast(uvc_device_handle_t *devh, uint16_t contrast);
+
+uvc_error_t uvc_get_contrast_auto(uvc_device_handle_t *devh, uint8_t* contrast_auto, enum uvc_req_code req_code);
+uvc_error_t uvc_set_contrast_auto(uvc_device_handle_t *devh, uint8_t contrast_auto);
+
+uvc_error_t uvc_get_gain(uvc_device_handle_t *devh, uint16_t* gain, enum uvc_req_code req_code);
+uvc_error_t uvc_set_gain(uvc_device_handle_t *devh, uint16_t gain);
+
+uvc_error_t uvc_get_power_line_frequency(uvc_device_handle_t *devh, uint8_t* power_line_frequency, enum uvc_req_code req_code);
+uvc_error_t uvc_set_power_line_frequency(uvc_device_handle_t *devh, uint8_t power_line_frequency);
+
+uvc_error_t uvc_get_hue(uvc_device_handle_t *devh, int16_t* hue, enum uvc_req_code req_code);
+uvc_error_t uvc_set_hue(uvc_device_handle_t *devh, int16_t hue);
+
+uvc_error_t uvc_get_hue_auto(uvc_device_handle_t *devh, uint8_t* hue_auto, enum uvc_req_code req_code);
+uvc_error_t uvc_set_hue_auto(uvc_device_handle_t *devh, uint8_t hue_auto);
+
+uvc_error_t uvc_get_saturation(uvc_device_handle_t *devh, uint16_t* saturation, enum uvc_req_code req_code);
+uvc_error_t uvc_set_saturation(uvc_device_handle_t *devh, uint16_t saturation);
+
+uvc_error_t uvc_get_sharpness(uvc_device_handle_t *devh, uint16_t* sharpness, enum uvc_req_code req_code);
+uvc_error_t uvc_set_sharpness(uvc_device_handle_t *devh, uint16_t sharpness);
+
+uvc_error_t uvc_get_gamma(uvc_device_handle_t *devh, uint16_t* gamma, enum uvc_req_code req_code);
+uvc_error_t uvc_set_gamma(uvc_device_handle_t *devh, uint16_t gamma);
+
+uvc_error_t uvc_get_white_balance_temperature(uvc_device_handle_t *devh, uint16_t* temperature, enum uvc_req_code req_code);
+uvc_error_t uvc_set_white_balance_temperature(uvc_device_handle_t *devh, uint16_t temperature);
+
+uvc_error_t uvc_get_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t* temperature_auto, enum uvc_req_code req_code);
+uvc_error_t uvc_set_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t temperature_auto);
+
+uvc_error_t uvc_get_white_balance_component(uvc_device_handle_t *devh, uint16_t* blue, uint16_t* red, enum uvc_req_code req_code);
+uvc_error_t uvc_set_white_balance_component(uvc_device_handle_t *devh, uint16_t blue, uint16_t red);
+
+uvc_error_t uvc_get_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t* white_balance_component_auto, enum uvc_req_code req_code);
+uvc_error_t uvc_set_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t white_balance_component_auto);
+
+uvc_error_t uvc_get_digital_multiplier(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
+uvc_error_t uvc_set_digital_multiplier(uvc_device_handle_t *devh, uint16_t multiplier_step);
+
+uvc_error_t uvc_get_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
+uvc_error_t uvc_set_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t multiplier_step);
+
+uvc_error_t uvc_get_analog_video_standard(uvc_device_handle_t *devh, uint8_t* video_standard, enum uvc_req_code req_code);
+uvc_error_t uvc_set_analog_video_standard(uvc_device_handle_t *devh, uint8_t video_standard);
+
+uvc_error_t uvc_get_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t* status, enum uvc_req_code req_code);
+uvc_error_t uvc_set_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t status);
+
+uvc_error_t uvc_get_input_select(uvc_device_handle_t *devh, uint8_t* selector, enum uvc_req_code req_code);
+uvc_error_t uvc_set_input_select(uvc_device_handle_t *devh, uint8_t selector);
+/* end AUTO-GENERATED control accessors */
+
+void uvc_perror(uvc_error_t err, const char *msg);
+const char* uvc_strerror(uvc_error_t err);
+void uvc_print_diag(uvc_device_handle_t *devh, FILE *stream);
+void uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream);
+
+uvc_frame_t *uvc_allocate_frame(size_t data_bytes);
+void uvc_free_frame(uvc_frame_t *frame);
+
+uvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out);
+
+uvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out);
+uvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out);
+uvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out);
+
+uvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out);
+uvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out);
+uvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out);
+
+uvc_error_t uvc_yuyv2y(uvc_frame_t *in, uvc_frame_t *out);
+uvc_error_t uvc_yuyv2uv(uvc_frame_t *in, uvc_frame_t *out);
+
+#ifdef LIBUVC_HAS_JPEG
+uvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !def(LIBUVC_H)
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h
new file mode 100644
index 0000000..9ab0ac9
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h
@@ -0,0 +1,22 @@
+#ifndef LIBUVC_CONFIG_H
+#define LIBUVC_CONFIG_H
+
+#define LIBUVC_VERSION_MAJOR 0
+#define LIBUVC_VERSION_MINOR 0
+#define LIBUVC_VERSION_PATCH 6
+#define LIBUVC_VERSION_STR "0.0.6"
+#define LIBUVC_VERSION_INT                      \
+  ((0 << 16) |             \
+   (0 << 8) |              \
+   (6))
+
+/** @brief Test whether libuvc is new enough
+ * This macro evaluates true iff the current version is
+ * at least as new as the version specified.
+ */
+#define LIBUVC_VERSION_GTE(major, minor, patch)                         \
+  (LIBUVC_VERSION_INT >= (((major) << 16) | ((minor) << 8) | (patch)))
+
+/* #define LIBUVC_HAS_JPEG 1 */
+
+#endif // !def(LIBUVC_CONFIG_H)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h.in
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h.in b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h.in
new file mode 100644
index 0000000..3bbd653
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_config.h.in
@@ -0,0 +1,22 @@
+#ifndef LIBUVC_CONFIG_H
+#define LIBUVC_CONFIG_H
+
+#define LIBUVC_VERSION_MAJOR @libuvc_VERSION_MAJOR@
+#define LIBUVC_VERSION_MINOR @libuvc_VERSION_MINOR@
+#define LIBUVC_VERSION_PATCH @libuvc_VERSION_PATCH@
+#define LIBUVC_VERSION_STR "@libuvc_VERSION@"
+#define LIBUVC_VERSION_INT                      \
+  ((@libuvc_VERSION_MAJOR@ << 16) |             \
+   (@libuvc_VERSION_MINOR@ << 8) |              \
+   (@libuvc_VERSION_PATCH@))
+
+/** @brief Test whether libuvc is new enough
+ * This macro evaluates true iff the current version is
+ * at least as new as the version specified.
+ */
+#define LIBUVC_VERSION_GTE(major, minor, patch)                         \
+  (LIBUVC_VERSION_INT >= (((major) << 16) | ((minor) << 8) | (patch)))
+
+#cmakedefine LIBUVC_HAS_JPEG 1
+
+#endif // !def(LIBUVC_CONFIG_H)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_internal.h
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_internal.h b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_internal.h
new file mode 100644
index 0000000..829b294
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/include/libuvc/libuvc_internal.h
@@ -0,0 +1,300 @@
+/** @file libuvc_internal.h
+  * @brief Implementation-specific UVC constants and structures.
+  * @cond include_hidden
+  */
+#ifndef LIBUVC_INTERNAL_H
+#define LIBUVC_INTERNAL_H
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <signal.h>
+#include <libusb.h>
+#include "utlist.h"
+
+/** Converts an unaligned four-byte little-endian integer into an int32 */
+#define DW_TO_INT(p) ((p)[0] | ((p)[1] << 8) | ((p)[2] << 16) | ((p)[3] << 24))
+/** Converts an unaligned two-byte little-endian integer into an int16 */
+#define SW_TO_SHORT(p) ((p)[0] | ((p)[1] << 8))
+/** Converts an int16 into an unaligned two-byte little-endian integer */
+#define SHORT_TO_SW(s, p) \
+  (p)[0] = (s); \
+  (p)[1] = (s) >> 8;
+/** Converts an int32 into an unaligned four-byte little-endian integer */
+#define INT_TO_DW(i, p) \
+  (p)[0] = (i); \
+  (p)[1] = (i) >> 8; \
+  (p)[2] = (i) >> 16; \
+  (p)[3] = (i) >> 24;
+
+/** Selects the nth item in a doubly linked list. n=-1 selects the last item. */
+#define DL_NTH(head, out, n) \
+  do { \
+    int dl_nth_i = 0; \
+    LDECLTYPE(head) dl_nth_p = (head); \
+    if ((n) < 0) { \
+      while (dl_nth_p && dl_nth_i > (n)) { \
+        dl_nth_p = dl_nth_p->prev; \
+        dl_nth_i--; \
+      } \
+    } else { \
+      while (dl_nth_p && dl_nth_i < (n)) { \
+        dl_nth_p = dl_nth_p->next; \
+        dl_nth_i++; \
+      } \
+    } \
+    (out) = dl_nth_p; \
+  } while (0);
+
+#ifdef UVC_DEBUGGING
+#include <libgen.h>
+#define UVC_DEBUG(format, ...) fprintf(stderr, "[%s:%d/%s] " format "\n", basename(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__)
+#define UVC_ENTER() fprintf(stderr, "[%s:%d] begin %s\n", basename(__FILE__), __LINE__, __FUNCTION__)
+#define UVC_EXIT(code) fprintf(stderr, "[%s:%d] end %s (%d)\n", basename(__FILE__), __LINE__, __FUNCTION__, code)
+#define UVC_EXIT_VOID() fprintf(stderr, "[%s:%d] end %s\n", basename(__FILE__), __LINE__, __FUNCTION__)
+#else
+#define UVC_DEBUG(format, ...)
+#define UVC_ENTER()
+#define UVC_EXIT_VOID()
+#define UVC_EXIT(code)
+#endif
+
+/* http://stackoverflow.com/questions/19452971/array-size-macro-that-rejects-pointers */
+#define IS_INDEXABLE(arg) (sizeof(arg[0]))
+#define IS_ARRAY(arg) (IS_INDEXABLE(arg) && (((void *) &arg) == ((void *) arg)))
+#define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))
+
+/** Video interface subclass code (A.2) */
+enum uvc_int_subclass_code {
+  UVC_SC_UNDEFINED = 0x00,
+  UVC_SC_VIDEOCONTROL = 0x01,
+  UVC_SC_VIDEOSTREAMING = 0x02,
+  UVC_SC_VIDEO_INTERFACE_COLLECTION = 0x03
+};
+
+/** Video interface protocol code (A.3) */
+enum uvc_int_proto_code {
+  UVC_PC_PROTOCOL_UNDEFINED = 0x00
+};
+
+/** VideoControl interface descriptor subtype (A.5) */
+enum uvc_vc_desc_subtype {
+  UVC_VC_DESCRIPTOR_UNDEFINED = 0x00,
+  UVC_VC_HEADER = 0x01,
+  UVC_VC_INPUT_TERMINAL = 0x02,
+  UVC_VC_OUTPUT_TERMINAL = 0x03,
+  UVC_VC_SELECTOR_UNIT = 0x04,
+  UVC_VC_PROCESSING_UNIT = 0x05,
+  UVC_VC_EXTENSION_UNIT = 0x06
+};
+
+/** UVC endpoint descriptor subtype (A.7) */
+enum uvc_ep_desc_subtype {
+  UVC_EP_UNDEFINED = 0x00,
+  UVC_EP_GENERAL = 0x01,
+  UVC_EP_ENDPOINT = 0x02,
+  UVC_EP_INTERRUPT = 0x03
+};
+
+/** VideoControl interface control selector (A.9.1) */
+enum uvc_vc_ctrl_selector {
+  UVC_VC_CONTROL_UNDEFINED = 0x00,
+  UVC_VC_VIDEO_POWER_MODE_CONTROL = 0x01,
+  UVC_VC_REQUEST_ERROR_CODE_CONTROL = 0x02
+};
+
+/** Terminal control selector (A.9.2) */
+enum uvc_term_ctrl_selector {
+  UVC_TE_CONTROL_UNDEFINED = 0x00
+};
+
+/** Selector unit control selector (A.9.3) */
+enum uvc_su_ctrl_selector {
+  UVC_SU_CONTROL_UNDEFINED = 0x00,
+  UVC_SU_INPUT_SELECT_CONTROL = 0x01
+};
+
+/** Extension unit control selector (A.9.6) */
+enum uvc_xu_ctrl_selector {
+  UVC_XU_CONTROL_UNDEFINED = 0x00
+};
+
+/** VideoStreaming interface control selector (A.9.7) */
+enum uvc_vs_ctrl_selector {
+  UVC_VS_CONTROL_UNDEFINED = 0x00,
+  UVC_VS_PROBE_CONTROL = 0x01,
+  UVC_VS_COMMIT_CONTROL = 0x02,
+  UVC_VS_STILL_PROBE_CONTROL = 0x03,
+  UVC_VS_STILL_COMMIT_CONTROL = 0x04,
+  UVC_VS_STILL_IMAGE_TRIGGER_CONTROL = 0x05,
+  UVC_VS_STREAM_ERROR_CODE_CONTROL = 0x06,
+  UVC_VS_GENERATE_KEY_FRAME_CONTROL = 0x07,
+  UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL = 0x08,
+  UVC_VS_SYNC_DELAY_CONTROL = 0x09
+};
+
+/** Status packet type (2.4.2.2) */
+enum uvc_status_type {
+  UVC_STATUS_TYPE_CONTROL = 1,
+  UVC_STATUS_TYPE_STREAMING = 2
+};
+
+/** Payload header flags (2.4.3.3) */
+#define UVC_STREAM_EOH (1 << 7)
+#define UVC_STREAM_ERR (1 << 6)
+#define UVC_STREAM_STI (1 << 5)
+#define UVC_STREAM_RES (1 << 4)
+#define UVC_STREAM_SCR (1 << 3)
+#define UVC_STREAM_PTS (1 << 2)
+#define UVC_STREAM_EOF (1 << 1)
+#define UVC_STREAM_FID (1 << 0)
+
+/** Control capabilities (4.1.2) */
+#define UVC_CONTROL_CAP_GET (1 << 0)
+#define UVC_CONTROL_CAP_SET (1 << 1)
+#define UVC_CONTROL_CAP_DISABLED (1 << 2)
+#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
+#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
+
+struct uvc_streaming_interface;
+struct uvc_device_info;
+
+/** VideoStream interface */
+typedef struct uvc_streaming_interface {
+  struct uvc_device_info *parent;
+  struct uvc_streaming_interface *prev, *next;
+  /** Interface number */
+  uint8_t bInterfaceNumber;
+  /** Video formats that this interface provides */
+  struct uvc_format_desc *format_descs;
+  /** USB endpoint to use when communicating with this interface */
+  uint8_t bEndpointAddress;
+  uint8_t bTerminalLink;
+} uvc_streaming_interface_t;
+
+/** VideoControl interface */
+typedef struct uvc_control_interface {
+  struct uvc_device_info *parent;
+  struct uvc_input_terminal *input_term_descs;
+  // struct uvc_output_terminal *output_term_descs;
+  struct uvc_selector_unit *selector_unit_descs;
+  struct uvc_processing_unit *processing_unit_descs;
+  struct uvc_extension_unit *extension_unit_descs;
+  uint16_t bcdUVC;
+  uint32_t dwClockFrequency;
+  uint8_t bEndpointAddress;
+  /** Interface number */
+  uint8_t bInterfaceNumber;
+} uvc_control_interface_t;
+
+struct uvc_stream_ctrl;
+
+struct uvc_device {
+  struct uvc_context *ctx;
+  int ref;
+  libusb_device *usb_dev;
+};
+
+typedef struct uvc_device_info {
+  /** Configuration descriptor for USB device */
+  struct libusb_config_descriptor *config;
+  /** VideoControl interface provided by device */
+  uvc_control_interface_t ctrl_if;
+  /** VideoStreaming interfaces on the device */
+  uvc_streaming_interface_t *stream_ifs;
+} uvc_device_info_t;
+
+/*
+  set a high number of transfer buffers. This uses a lot of ram, but
+  avoids problems with scheduling delays on slow boards causing missed
+  transfers. A better approach may be to make the transfer thread FIFO
+  scheduled (if we have root).
+  We could/should change this to allow reduce it to, say, 5 by default
+  and then allow the user to change the number of buffers as required.
+ */
+#define LIBUVC_NUM_TRANSFER_BUFS 100
+
+#define LIBUVC_XFER_BUF_SIZE	( 16 * 1024 * 1024 )
+
+struct uvc_stream_handle {
+  struct uvc_device_handle *devh;
+  struct uvc_stream_handle *prev, *next;
+  struct uvc_streaming_interface *stream_if;
+
+  /** if true, stream is running (streaming video to host) */
+  uint8_t running;
+  /** Current control block */
+  struct uvc_stream_ctrl cur_ctrl;
+
+  /* listeners may only access hold*, and only when holding a
+   * lock on cb_mutex (probably signaled with cb_cond) */
+  uint8_t fid;
+  uint32_t seq, hold_seq;
+  uint32_t pts, hold_pts;
+  uint32_t last_scr, hold_last_scr;
+  size_t got_bytes, hold_bytes;
+  uint8_t *outbuf, *holdbuf;
+  pthread_mutex_t cb_mutex;
+  pthread_cond_t cb_cond;
+  pthread_t cb_thread;
+  uint32_t last_polled_seq;
+  uvc_frame_callback_t *user_cb;
+  void *user_ptr;
+  struct libusb_transfer *transfers[LIBUVC_NUM_TRANSFER_BUFS];
+  uint8_t *transfer_bufs[LIBUVC_NUM_TRANSFER_BUFS];
+  struct uvc_frame frame;
+  enum uvc_frame_format frame_format;
+};
+
+/** Handle on an open UVC device
+ *
+ * @todo move most of this into a uvc_device struct?
+ */
+struct uvc_device_handle {
+  struct uvc_device *dev;
+  struct uvc_device_handle *prev, *next;
+  /** Underlying USB device handle */
+  libusb_device_handle *usb_devh;
+  struct uvc_device_info *info;
+  struct libusb_transfer *status_xfer;
+  uint8_t status_buf[32];
+  /** Function to call when we receive status updates from the camera */
+  uvc_status_callback_t *status_cb;
+  void *status_user_ptr;
+  /** Function to call when we receive button events from the camera */
+  uvc_button_callback_t *button_cb;
+  void *button_user_ptr;
+
+  uvc_stream_handle_t *streams;
+  /** Whether the camera is an iSight that sends one header per frame */
+  uint8_t is_isight;
+  uint32_t claimed;
+};
+
+/** Context within which we communicate with devices */
+struct uvc_context {
+  /** Underlying context for USB communication */
+  struct libusb_context *usb_ctx;
+  /** True iff libuvc initialized the underlying USB context */
+  uint8_t own_usb_ctx;
+  /** List of open devices in this context */
+  uvc_device_handle_t *open_devices;
+  pthread_t handler_thread;
+  int kill_handler_thread;
+};
+
+uvc_error_t uvc_query_stream_ctrl(
+    uvc_device_handle_t *devh,
+    uvc_stream_ctrl_t *ctrl,
+    uint8_t probe,
+    enum uvc_req_code req);
+
+void uvc_start_handler_thread(uvc_context_t *ctx);
+uvc_error_t uvc_claim_if(uvc_device_handle_t *devh, int idx);
+uvc_error_t uvc_release_if(uvc_device_handle_t *devh, int idx);
+
+#endif // !def(LIBUVC_INTERNAL_H)
+/** @endcond */
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/include/utlist.h
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/include/utlist.h b/thirdparty/libuvc-0.0.6/include/utlist.h
new file mode 100644
index 0000000..34c725b
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/include/utlist.h
@@ -0,0 +1,490 @@
+/*
+Copyright (c) 2007-2010, Troy D. Hanson   http://uthash.sourceforge.net
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef UTLIST_H
+#define UTLIST_H
+
+#define UTLIST_VERSION 1.9.1
+
+/* 
+ * This file contains macros to manipulate singly and doubly-linked lists.
+ *
+ * 1. LL_ macros:  singly-linked lists.
+ * 2. DL_ macros:  doubly-linked lists.
+ * 3. CDL_ macros: circular doubly-linked lists.
+ *
+ * To use singly-linked lists, your structure must have a "next" pointer.
+ * To use doubly-linked lists, your structure must "prev" and "next" pointers.
+ * Either way, the pointer to the head of the list must be initialized to NULL.
+ * 
+ * ----------------.EXAMPLE -------------------------
+ * struct item {
+ *      int id;
+ *      struct item *prev, *next;
+ * }
+ *
+ * struct item *list = NULL:
+ *
+ * int main() {
+ *      struct item *item;
+ *      ... allocate and populate item ...
+ *      DL_APPEND(list, item);
+ * }
+ * --------------------------------------------------
+ *
+ * For doubly-linked lists, the append and delete macros are O(1)
+ * For singly-linked lists, append and delete are O(n) but prepend is O(1)
+ * The sort macro is O(n log(n)) for all types of single/double/circular lists.
+ */
+
+/* These macros use decltype or the earlier __typeof GNU extension.
+   As decltype is only available in newer compilers (VS2010 or gcc 4.3+
+   when compiling c++ code), this code uses whatever method is needed
+   or, for VS2008 where neither is available, uses casting workarounds. */
+#ifdef _MSC_VER            /* MS compiler */
+#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */
+#define LDECLTYPE(x) decltype(x)
+#else                     /* VS2008 or older (or VS2010 in C mode) */
+#define NO_DECLTYPE
+#define LDECLTYPE(x) char*
+#endif
+#else                      /* GNU, Sun and other compilers */
+#define LDECLTYPE(x) __typeof(x)
+#endif
+
+/* for VS2008 we use some workarounds to get around the lack of decltype,
+ * namely, we always reassign our tmp variable to the list head if we need
+ * to dereference its prev/next pointers, and save/restore the real head.*/
+#ifdef NO_DECLTYPE
+#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); }
+#define _NEXT(elt,list) ((char*)((list)->next))
+#define _NEXTASGN(elt,list,to) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); }
+#define _PREV(elt,list) ((char*)((list)->prev))
+#define _PREVASGN(elt,list,to) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); }
+#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; }
+#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); }
+#else 
+#define _SV(elt,list)
+#define _NEXT(elt,list) ((elt)->next)
+#define _NEXTASGN(elt,list,to) ((elt)->next)=(to)
+#define _PREV(elt,list) ((elt)->prev)
+#define _PREVASGN(elt,list,to) ((elt)->prev)=(to)
+#define _RS(list)
+#define _CASTASGN(a,b) (a)=(b)
+#endif
+
+/******************************************************************************
+ * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort    *
+ * Unwieldy variable names used here to avoid shadowing passed-in variables.  *
+ *****************************************************************************/
+#define LL_SORT(list, cmp)                                                                     \
+do {                                                                                           \
+  LDECLTYPE(list) _ls_p;                                                                       \
+  LDECLTYPE(list) _ls_q;                                                                       \
+  LDECLTYPE(list) _ls_e;                                                                       \
+  LDECLTYPE(list) _ls_tail;                                                                    \
+  LDECLTYPE(list) _ls_oldhead;                                                                 \
+  LDECLTYPE(list) _tmp;                                                                        \
+  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \
+  if (list) {                                                                                  \
+    _ls_insize = 1;                                                                            \
+    _ls_looping = 1;                                                                           \
+    while (_ls_looping) {                                                                      \
+      _CASTASGN(_ls_p,list);                                                                   \
+      _CASTASGN(_ls_oldhead,list);                                                             \
+      list = NULL;                                                                             \
+      _ls_tail = NULL;                                                                         \
+      _ls_nmerges = 0;                                                                         \
+      while (_ls_p) {                                                                          \
+        _ls_nmerges++;                                                                         \
+        _ls_q = _ls_p;                                                                         \
+        _ls_psize = 0;                                                                         \
+        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \
+          _ls_psize++;                                                                         \
+          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list);                               \
+          if (!_ls_q) break;                                                                   \
+        }                                                                                      \
+        _ls_qsize = _ls_insize;                                                                \
+        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \
+          if (_ls_psize == 0) {                                                                \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+          } else if (_ls_qsize == 0 || !_ls_q) {                                               \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+          } else {                                                                             \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+          }                                                                                    \
+          if (_ls_tail) {                                                                      \
+            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \
+          } else {                                                                             \
+            _CASTASGN(list,_ls_e);                                                             \
+          }                                                                                    \
+          _ls_tail = _ls_e;                                                                    \
+        }                                                                                      \
+        _ls_p = _ls_q;                                                                         \
+      }                                                                                        \
+      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list);                            \
+      if (_ls_nmerges <= 1) {                                                                  \
+        _ls_looping=0;                                                                         \
+      }                                                                                        \
+      _ls_insize *= 2;                                                                         \
+    }                                                                                          \
+  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \
+} while (0)
+
+#define DL_SORT(list, cmp)                                                                     \
+do {                                                                                           \
+  LDECLTYPE(list) _ls_p;                                                                       \
+  LDECLTYPE(list) _ls_q;                                                                       \
+  LDECLTYPE(list) _ls_e;                                                                       \
+  LDECLTYPE(list) _ls_tail;                                                                    \
+  LDECLTYPE(list) _ls_oldhead;                                                                 \
+  LDECLTYPE(list) _tmp;                                                                        \
+  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \
+  if (list) {                                                                                  \
+    _ls_insize = 1;                                                                            \
+    _ls_looping = 1;                                                                           \
+    while (_ls_looping) {                                                                      \
+      _CASTASGN(_ls_p,list);                                                                   \
+      _CASTASGN(_ls_oldhead,list);                                                             \
+      list = NULL;                                                                             \
+      _ls_tail = NULL;                                                                         \
+      _ls_nmerges = 0;                                                                         \
+      while (_ls_p) {                                                                          \
+        _ls_nmerges++;                                                                         \
+        _ls_q = _ls_p;                                                                         \
+        _ls_psize = 0;                                                                         \
+        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \
+          _ls_psize++;                                                                         \
+          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list);                               \
+          if (!_ls_q) break;                                                                   \
+        }                                                                                      \
+        _ls_qsize = _ls_insize;                                                                \
+        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \
+          if (_ls_psize == 0) {                                                                \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+          } else if (_ls_qsize == 0 || !_ls_q) {                                               \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+          } else {                                                                             \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+          }                                                                                    \
+          if (_ls_tail) {                                                                      \
+            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \
+          } else {                                                                             \
+            _CASTASGN(list,_ls_e);                                                             \
+          }                                                                                    \
+          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list);                          \
+          _ls_tail = _ls_e;                                                                    \
+        }                                                                                      \
+        _ls_p = _ls_q;                                                                         \
+      }                                                                                        \
+      _CASTASGN(list->prev, _ls_tail);                                                         \
+      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list);                            \
+      if (_ls_nmerges <= 1) {                                                                  \
+        _ls_looping=0;                                                                         \
+      }                                                                                        \
+      _ls_insize *= 2;                                                                         \
+    }                                                                                          \
+  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \
+} while (0)
+
+#define CDL_SORT(list, cmp)                                                                    \
+do {                                                                                           \
+  LDECLTYPE(list) _ls_p;                                                                       \
+  LDECLTYPE(list) _ls_q;                                                                       \
+  LDECLTYPE(list) _ls_e;                                                                       \
+  LDECLTYPE(list) _ls_tail;                                                                    \
+  LDECLTYPE(list) _ls_oldhead;                                                                 \
+  LDECLTYPE(list) _tmp;                                                                        \
+  LDECLTYPE(list) _tmp2;                                                                       \
+  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \
+  if (list) {                                                                                  \
+    _ls_insize = 1;                                                                            \
+    _ls_looping = 1;                                                                           \
+    while (_ls_looping) {                                                                      \
+      _CASTASGN(_ls_p,list);                                                                   \
+      _CASTASGN(_ls_oldhead,list);                                                             \
+      list = NULL;                                                                             \
+      _ls_tail = NULL;                                                                         \
+      _ls_nmerges = 0;                                                                         \
+      while (_ls_p) {                                                                          \
+        _ls_nmerges++;                                                                         \
+        _ls_q = _ls_p;                                                                         \
+        _ls_psize = 0;                                                                         \
+        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \
+          _ls_psize++;                                                                         \
+          _SV(_ls_q,list);                                                                     \
+          if (_NEXT(_ls_q,list) == _ls_oldhead) {                                              \
+            _ls_q = NULL;                                                                      \
+          } else {                                                                             \
+            _ls_q = _NEXT(_ls_q,list);                                                         \
+          }                                                                                    \
+          _RS(list);                                                                           \
+          if (!_ls_q) break;                                                                   \
+        }                                                                                      \
+        _ls_qsize = _ls_insize;                                                                \
+        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \
+          if (_ls_psize == 0) {                                                                \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \
+          } else if (_ls_qsize == 0 || !_ls_q) {                                               \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \
+          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \
+            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \
+            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \
+          } else {                                                                             \
+            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \
+            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \
+          }                                                                                    \
+          if (_ls_tail) {                                                                      \
+            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \
+          } else {                                                                             \
+            _CASTASGN(list,_ls_e);                                                             \
+          }                                                                                    \
+          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list);                          \
+          _ls_tail = _ls_e;                                                                    \
+        }                                                                                      \
+        _ls_p = _ls_q;                                                                         \
+      }                                                                                        \
+      _CASTASGN(list->prev,_ls_tail);                                                          \
+      _CASTASGN(_tmp2,list);                                                                   \
+      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp2); _RS(list);                           \
+      if (_ls_nmerges <= 1) {                                                                  \
+        _ls_looping=0;                                                                         \
+      }                                                                                        \
+      _ls_insize *= 2;                                                                         \
+    }                                                                                          \
+  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \
+} while (0)
+
+/******************************************************************************
+ * singly linked list macros (non-circular)                                   *
+ *****************************************************************************/
+#define LL_PREPEND(head,add)                                                                   \
+do {                                                                                           \
+  (add)->next = head;                                                                          \
+  head = add;                                                                                  \
+} while (0)
+
+#define LL_APPEND(head,add)                                                                    \
+do {                                                                                           \
+  LDECLTYPE(head) _tmp;                                                                        \
+  (add)->next=NULL;                                                                            \
+  if (head) {                                                                                  \
+    _tmp = head;                                                                               \
+    while (_tmp->next) { _tmp = _tmp->next; }                                                  \
+    _tmp->next=(add);                                                                          \
+  } else {                                                                                     \
+    (head)=(add);                                                                              \
+  }                                                                                            \
+} while (0)
+
+#define LL_DELETE(head,del)                                                                    \
+do {                                                                                           \
+  LDECLTYPE(head) _tmp;                                                                        \
+  if ((head) == (del)) {                                                                       \
+    (head)=(head)->next;                                                                       \
+  } else {                                                                                     \
+    _tmp = head;                                                                               \
+    while (_tmp->next && (_tmp->next != (del))) {                                              \
+      _tmp = _tmp->next;                                                                       \
+    }                                                                                          \
+    if (_tmp->next) {                                                                          \
+      _tmp->next = ((del)->next);                                                              \
+    }                                                                                          \
+  }                                                                                            \
+} while (0)
+
+/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */
+#define LL_APPEND_VS2008(head,add)                                                             \
+do {                                                                                           \
+  if (head) {                                                                                  \
+    (add)->next = head;     /* use add->next as a temp variable */                             \
+    while ((add)->next->next) { (add)->next = (add)->next->next; }                             \
+    (add)->next->next=(add);                                                                   \
+  } else {                                                                                     \
+    (head)=(add);                                                                              \
+  }                                                                                            \
+  (add)->next=NULL;                                                                            \
+} while (0)
+
+#define LL_DELETE_VS2008(head,del)                                                             \
+do {                                                                                           \
+  if ((head) == (del)) {                                                                       \
+    (head)=(head)->next;                                                                       \
+  } else {                                                                                     \
+    char *_tmp = (char*)(head);                                                                \
+    while (head->next && (head->next != (del))) {                                              \
+      head = head->next;                                                                       \
+    }                                                                                          \
+    if (head->next) {                                                                          \
+      head->next = ((del)->next);                                                              \
+    }                                                                                          \
+    {                                                                                          \
+      char **_head_alias = (char**)&(head);                                                    \
+      *_head_alias = _tmp;                                                                     \
+    }                                                                                          \
+  }                                                                                            \
+} while (0)
+#ifdef NO_DECLTYPE
+#undef LL_APPEND
+#define LL_APPEND LL_APPEND_VS2008
+#undef LL_DELETE
+#define LL_DELETE LL_DELETE_VS2008
+#endif
+/* end VS2008 replacements */
+
+#define LL_FOREACH(head,el)                                                                    \
+    for(el=head;el;el=el->next)
+
+#define LL_FOREACH_SAFE(head,el,tmp)                                                           \
+  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
+
+#define LL_SEARCH_SCALAR(head,out,field,val)                                                   \
+do {                                                                                           \
+    LL_FOREACH(head,out) {                                                                     \
+      if ((out)->field == (val)) break;                                                        \
+    }                                                                                          \
+} while(0) 
+
+#define LL_SEARCH(head,out,elt,cmp)                                                            \
+do {                                                                                           \
+    LL_FOREACH(head,out) {                                                                     \
+      if ((cmp(out,elt))==0) break;                                                            \
+    }                                                                                          \
+} while(0) 
+
+/******************************************************************************
+ * doubly linked list macros (non-circular)                                   *
+ *****************************************************************************/
+#define DL_PREPEND(head,add)                                                                   \
+do {                                                                                           \
+ (add)->next = head;                                                                           \
+ if (head) {                                                                                   \
+   (add)->prev = (head)->prev;                                                                 \
+   (head)->prev = (add);                                                                       \
+ } else {                                                                                      \
+   (add)->prev = (add);                                                                        \
+ }                                                                                             \
+ (head) = (add);                                                                               \
+} while (0)
+
+#define DL_APPEND(head,add)                                                                    \
+do {                                                                                           \
+  if (head) {                                                                                  \
+      (add)->prev = (head)->prev;                                                              \
+      (head)->prev->next = (add);                                                              \
+      (head)->prev = (add);                                                                    \
+      (add)->next = NULL;                                                                      \
+  } else {                                                                                     \
+      (head)=(add);                                                                            \
+      (head)->prev = (head);                                                                   \
+      (head)->next = NULL;                                                                     \
+  }                                                                                            \
+} while (0);
+
+#define DL_DELETE(head,del)                                                                    \
+do {                                                                                           \
+  if ((del)->prev == (del)) {                                                                  \
+      (head)=NULL;                                                                             \
+  } else if ((del)==(head)) {                                                                  \
+      (del)->next->prev = (del)->prev;                                                         \
+      (head) = (del)->next;                                                                    \
+  } else {                                                                                     \
+      (del)->prev->next = (del)->next;                                                         \
+      if ((del)->next) {                                                                       \
+          (del)->next->prev = (del)->prev;                                                     \
+      } else {                                                                                 \
+          (head)->prev = (del)->prev;                                                          \
+      }                                                                                        \
+  }                                                                                            \
+} while (0);
+
+
+#define DL_FOREACH(head,el)                                                                    \
+    for(el=head;el;el=el->next)
+
+/* this version is safe for deleting the elements during iteration */
+#define DL_FOREACH_SAFE(head,el,tmp)                                                           \
+  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
+
+/* these are identical to their singly-linked list counterparts */
+#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR
+#define DL_SEARCH LL_SEARCH
+
+/******************************************************************************
+ * circular doubly linked list macros                                         *
+ *****************************************************************************/
+#define CDL_PREPEND(head,add)                                                                  \
+do {                                                                                           \
+ if (head) {                                                                                   \
+   (add)->prev = (head)->prev;                                                                 \
+   (add)->next = (head);                                                                       \
+   (head)->prev = (add);                                                                       \
+   (add)->prev->next = (add);                                                                  \
+ } else {                                                                                      \
+   (add)->prev = (add);                                                                        \
+   (add)->next = (add);                                                                        \
+ }                                                                                             \
+(head)=(add);                                                                                  \
+} while (0)
+
+#define CDL_DELETE(head,del)                                                                   \
+do {                                                                                           \
+  if ( ((head)==(del)) && ((head)->next == (head))) {                                          \
+      (head) = 0L;                                                                             \
+  } else {                                                                                     \
+     (del)->next->prev = (del)->prev;                                                          \
+     (del)->prev->next = (del)->next;                                                          \
+     if ((del) == (head)) (head)=(del)->next;                                                  \
+  }                                                                                            \
+} while (0);
+
+#define CDL_FOREACH(head,el)                                                                   \
+    for(el=head;el;el=(el->next==head ? 0L : el->next)) 
+
+#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2)                                                    \
+  for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL);                                        \
+      (el) && ((tmp2)=(el)->next, 1);                                                          \
+      ((el) = (((el)==(tmp1)) ? 0L : (tmp2))))
+
+#define CDL_SEARCH_SCALAR(head,out,field,val)                                                  \
+do {                                                                                           \
+    CDL_FOREACH(head,out) {                                                                    \
+      if ((out)->field == (val)) break;                                                        \
+    }                                                                                          \
+} while(0) 
+
+#define CDL_SEARCH(head,out,elt,cmp)                                                           \
+do {                                                                                           \
+    CDL_FOREACH(head,out) {                                                                    \
+      if ((cmp(out,elt))==0) break;                                                            \
+    }                                                                                          \
+} while(0) 
+
+#endif /* UTLIST_H */
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/libuvc.pc.in
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/libuvc.pc.in b/thirdparty/libuvc-0.0.6/libuvc.pc.in
new file mode 100644
index 0000000..4f7adb8
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/libuvc.pc.in
@@ -0,0 +1,11 @@
+libdir=@CONF_LIBRARY_DIR@
+includedir=@CONF_INCLUDE_DIR@
+
+Name: libuvc
+Description: @libuvc_DESCRIPTION@
+URL: @libuvc_URL@
+Version: @libuvc_VERSION@
+Libs: -L${libdir} -luvc
+Libs.private: -lusb-1.0
+Cflags: -I${includedir}
+Requires: libusb-1.0

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/libuvcConfig.cmake.in
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/libuvcConfig.cmake.in b/thirdparty/libuvc-0.0.6/libuvcConfig.cmake.in
new file mode 100644
index 0000000..e5b0cae
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/libuvcConfig.cmake.in
@@ -0,0 +1,3 @@
+# - Config file for the libuvc package
+set(libuvc_INCLUDE_DIRS "@CONF_INCLUDE_DIR@")
+set(libuvc_LIBRARIES "@CONF_LIBRARY@")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/2d9e5719/thirdparty/libuvc-0.0.6/libuvcConfigVersion.cmake.in
----------------------------------------------------------------------
diff --git a/thirdparty/libuvc-0.0.6/libuvcConfigVersion.cmake.in b/thirdparty/libuvc-0.0.6/libuvcConfigVersion.cmake.in
new file mode 100644
index 0000000..00ff766
--- /dev/null
+++ b/thirdparty/libuvc-0.0.6/libuvcConfigVersion.cmake.in
@@ -0,0 +1,11 @@
+set(PACKAGE_VERSION "@libuvc_VERSION@")
+
+# Check whether the requested PACKAGE_FIND_VERSION is compatible
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
+  set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+  set(PACKAGE_VERSION_COMPATIBLE TRUE)
+  if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
+    set(PACKAGE_VERSION_EXACT TRUE)
+  endif()
+endif()