| Webcam Library Reference Documentation | ![]() |
Go to the source code of this file.
Data Structures | |
| struct | _CUSBInfo |
| USB specific information about a device. More... | |
| struct | _CDevice |
| Webcam device information. More... | |
| struct | _CControlRawValue |
| A raw control value. More... | |
| struct | _CControlValue |
| A value of a control. More... | |
| struct | _CControlChoice |
| A list of choices for a choice type of control. More... | |
| struct | _CControl |
| A description of a camera control. More... | |
| struct | _CPixelFormat |
| A description of a pixel format. More... | |
| struct | _CFrameSize |
| A description of one or multiple frame sizes. More... | |
| struct | _CFrameInterval |
| A description of one or multiple frame intervals. More... | |
| struct | _CEvent |
| An event descriptor. More... | |
| struct | _CDynctrlMessage |
| Message returned by the dynamic control configuration parser. More... | |
| struct | _CVersionNumber |
| Version number in the "major.minor" format. More... | |
| struct | _CDynctrlInfoListStats |
| Statistics on the number of list elements that were processed. More... | |
| struct | _CDynctrlInfo |
| Input flags and output data used/returned by the control configuration parser. More... | |
Typedefs | |
| typedef unsigned int | CHandle |
| Device handle for libwebcam. | |
| typedef unsigned int | CResult |
| Function return type for libwebcam. | |
| typedef enum _CControlId | CControlId |
| Control identifiers. | |
| typedef enum _CControlFlags | CControlFlags |
| Flags specifying control properties and capabilities. | |
| typedef enum _CControlType | CControlType |
| Types for controls. | |
| typedef enum _CEventId | CEventId |
| Event identifiers. | |
| typedef enum _CEventFlags | CEventFlags |
| Flags specifying properties of events. | |
| typedef enum _CFrameSizeTypes | CFrameSizeTypes |
| Types of frame size specifications. | |
| typedef enum _CFrameIntervalTypes | CFrameIntervalTypes |
| Types of frame interval specification. | |
| typedef enum _CDynctrlFlags | CDynctrlFlags |
| Flags specifying control properties and capabilities. | |
| typedef enum _CDynctrlMessageSeverity | CDynctrlMessageSeverity |
| Severity levels for messages returned by the dynamic control functions. | |
| typedef _CUSBInfo | CUSBInfo |
| USB specific information about a device. | |
| typedef _CDevice | CDevice |
| Webcam device information. | |
| typedef _CControlRawValue | CControlRawValue |
| A raw control value. | |
| typedef _CControlValue | CControlValue |
| A value of a control. | |
| typedef _CControlChoice | CControlChoice |
| A list of choices for a choice type of control. | |
| typedef _CControl | CControl |
| A description of a camera control. | |
| typedef _CPixelFormat | CPixelFormat |
| A description of a pixel format. | |
| typedef _CFrameSize | CFrameSize |
| A description of one or multiple frame sizes. | |
| typedef _CFrameInterval | CFrameInterval |
| A description of one or multiple frame intervals. | |
| typedef _CEvent | CEvent |
| An event descriptor. | |
| typedef _CDynctrlMessage | CDynctrlMessage |
| Message returned by the dynamic control configuration parser. | |
| typedef _CVersionNumber | CVersionNumber |
| Version number in the "major.minor" format. | |
| typedef _CDynctrlInfoListStats | CDynctrlInfoListStats |
| Statistics on the number of list elements that were processed. | |
| typedef _CDynctrlInfo | CDynctrlInfo |
| Input flags and output data used/returned by the control configuration parser. | |
| typedef void(* | CEventHandler )(CHandle hDevice, CEventId event_id, void *context) |
| Prototype for event handlers. | |
Enumerations | |
| enum | _CResults { C_SUCCESS = 0, C_NOT_IMPLEMENTED, C_INIT_ERROR, C_INVALID_ARG, C_INVALID_HANDLE, C_INVALID_DEVICE, C_NOT_EXIST, C_NOT_FOUND, C_BUFFER_TOO_SMALL, C_SYNC_ERROR, C_NO_MEMORY, C_NO_HANDLES, C_V4L2_ERROR, C_SYSFS_ERROR, C_PARSE_ERROR, C_CANNOT_WRITE, C_CANNOT_READ } |
| Return values for libwebcam functions. More... | |
| enum | _CControlId { CC_BRIGHTNESS = 1, CC_CONTRAST, CC_GAIN, CC_SATURATION, CC_HUE, CC_GAMMA, CC_SHARPNESS, CC_WHITE_BALANCE_TEMPERATURE, CC_AUTO_WHITE_BALANCE_TEMPERATURE, CC_WHITE_BALANCE_COMPONENT, CC_AUTO_WHITE_BALANCE_COMPONENT, CC_BACKLIGHT_COMPENSATION, CC_POWER_LINE_FREQUENCY, CC_AUTO_HUE, CC_AUTO_EXPOSURE_MODE, CC_AUTO_EXPOSURE_PRIORITY, CC_EXPOSURE_TIME_ABSOLUTE, CC_EXPOSURE_TIME_RELATIVE, CC_AUTO_FOCUS, CC_FOCUS_ABSOLUTE, CC_FOCUS_RELATIVE, CC_IRIS_ABSOLUTE, CC_IRIS_RELATIVE, CC_ZOOM_ABSOLUTE, CC_ZOOM_RELATIVE, CC_DIGITAL_ZOOM, CC_PAN_ABSOLUTE, CC_PAN_RELATIVE, CC_TILT_ABSOLUTE, CC_TILT_RELATIVE, CC_ROLL_ABSOLUTE, CC_ROLL_RELATIVE, CC_PRIVACY, CC_PAN_RESET, CC_TILT_RESET, CC_V4L2_BASE = 0x1000, CC_V4L2_CUSTOM_BASE = 0x2000, CC_V4L2_MPEG_BASE = 0x3000, CC_V4L2_CAMERA_CLASS_BASE = 0x4000, CC_LOGITECH_BASE = 0x046d0000, CC_LOGITECH_PANTILT_RELATIVE, CC_LOGITECH_PANTILT_RESET, CC_LOGITECH_LED1_MODE, CC_LOGITECH_LED1_FREQUENCY, CC_LOGITECH_DISABLE_PROCESSING, CC_LOGITECH_RAW_BITS_PER_PIXEL } |
| Control identifiers. More... | |
| enum | _CControlFlags { CC_CAN_READ = 1 << 0, CC_CAN_WRITE = 1 << 1, CC_CAN_NOTIFY = 1 << 2, CC_IS_CUSTOM = 1 << 8, CC_IS_RELATIVE = 1 << 9, CC_IS_ACTION = 1 << 10 } |
| Flags specifying control properties and capabilities. More... | |
| enum | _CControlType { CC_TYPE_RAW = 1, CC_TYPE_BOOLEAN, CC_TYPE_CHOICE, CC_TYPE_BYTE, CC_TYPE_WORD, CC_TYPE_DWORD } |
| Types for controls. More... | |
| enum | _CEventId { CE_CONTROL_INVALID = 0 } |
| Event identifiers. | |
| enum | _CEventFlags { CE_INVALID = 0 } |
| Flags specifying properties of events. | |
| enum | _CFrameSizeTypes { CF_SIZE_DISCRETE = 1, CF_SIZE_CONTINUOUS, CF_SIZE_STEPWISE } |
| Types of frame size specifications. More... | |
| enum | _CFrameIntervalTypes { CF_INTERVAL_DISCRETE = 1, CF_INTERVAL_CONTINUOUS, CF_INTERVAL_STEPWISE } |
| Types of frame interval specification. More... | |
| enum | _CDynctrlFlags { CD_DONT_VALIDATE = 1 << 0, CD_REPORT_ERRORS = 1 << 1, CD_RETRIEVE_META_INFO = 1 << 2 } |
| Flags specifying control properties and capabilities. More... | |
| enum | _CDynctrlMessageSeverity { CD_SEVERITY_ERROR = 2, CD_SEVERITY_WARNING = 3, CD_SEVERITY_INFO = 4 } |
| Severity levels for messages returned by the dynamic control functions. More... | |
Functions | |
| CResult | c_init (void) |
| Initializes libwebcam. | |
| void | c_cleanup (void) |
| Clean up resources. | |
| CHandle | c_open_device (const char *device_name) |
| Opens a camera device. | |
| void | c_close_device (CHandle hDevice) |
| Closes a device handle. | |
| CResult | c_enum_devices (CDevice *devices, unsigned int *size, unsigned int *count) |
| Enumerates all devices available in the system. | |
| CResult | c_get_device_info (CHandle hDevice, const char *device_name, CDevice *info, unsigned int *size) |
| Returns information about a given camera device. | |
| CResult | c_enum_pixel_formats (CHandle hDevice, CPixelFormat *formats, unsigned int *size, unsigned int *count) |
| Enumerates all pixel formats supported by the given camera. | |
| CResult | c_enum_frame_sizes (CHandle hDevice, const CPixelFormat *pixelformat, CFrameSize *sizes, unsigned int *size, unsigned int *count) |
| Enumerates all frame sizes supported for the given pixel format. | |
| CResult | c_enum_frame_intervals (CHandle hDevice, const CPixelFormat *pixelformat, const CFrameSize *framesize, CFrameInterval *intervals, unsigned int *size, unsigned int *count) |
| Enumerates all frame intervals supported for the given pixel format and frame size. | |
| CResult | c_enum_controls (CHandle hDevice, CControl *controls, unsigned int *size, unsigned int *count) |
| Enumerates all controls supported by the given device. | |
| CResult | c_set_control (CHandle hDevice, CControlId control_id, const CControlValue *value) |
| Sets the value of a device control. | |
| CResult | c_get_control (CHandle hDevice, CControlId control_id, CControlValue *value) |
| Returns the value of a device control. | |
| CResult | c_enum_events (CHandle hDevice, CEvent *events, unsigned int *size, unsigned int *count) |
| Enumerates the events supported by the given device. | |
| CResult | c_subscribe_event (CHandle hDevice, CEventId event_id, CEventHandler handler, void *context) |
| Subscribes the caller to receive the given event. | |
| CResult | c_unsubscribe_event (CHandle hDevice, CEventId event_id) |
| Unsubscribes the caller from the given event. | |
| CResult | c_add_control_mappings_from_file (const char *file_name, CDynctrlInfo *info) |
| Parses a dynamic controls configuration file and adds the contained controls and control mappings to the UVC driver. | |
| char * | c_get_error_text (CResult error) |
| Returns the error message associated with a given error code. | |
| char * | c_get_handle_error_text (CHandle hDevice, CResult error) |
| Returns the error message associated with a given error code and device handle. | |
|
|
A list of choices for a choice type of control.
|
|
|
Control identifiers. This is an exhaustive list of all controls supported by libwebcam. As new controls appear, these should be added to this list. |
|
|
Types for controls. These types give both hints to graphical user interfaces on how to display the control to the user as well as to the implementation in terms of data length required to store control values. |
|
|
A description of one or multiple frame intervals. Each frame interval is described as a fraction of a second. |
|
|
|
Control identifiers. This is an exhaustive list of all controls supported by libwebcam. As new controls appear, these should be added to this list.
|
|
|
Types for controls. These types give both hints to graphical user interfaces on how to display the control to the user as well as to the implementation in terms of data length required to store control values.
|
|
|
Flags specifying control properties and capabilities.
|
|
|
Severity levels for messages returned by the dynamic control functions.
|
|
|
Types of frame interval specification.
|
|
|
Types of frame size specifications.
|
|
|
Return values for libwebcam functions.
|
|
||||||||||||
|
Parses a dynamic controls configuration file and adds the contained controls and control mappings to the UVC driver. Notes:
|
|
|
Clean up resources. This method should be called when the library is no longer used. |
|
|
Closes a device handle.
|
|
||||||||||||||||||||
|
Enumerates all controls supported by the given device. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size.
|
|
||||||||||||||||
|
Enumerates all devices available in the system. Users must call c_init() prior to using this function. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size.
|
|
||||||||||||||||||||
|
Enumerates the events supported by the given device. [unimplemented]
|
|
||||||||||||||||||||||||||||
|
Enumerates all frame intervals supported for the given pixel format and frame size. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size. A list of pixel formats can be obtained from c_enum_pixel_formats(). In a similar manner the list of supported frame sizes for each pixel format can be obtained from c_enum_frame_sizes().
|
|
||||||||||||||||||||||||
|
Enumerates all frame sizes supported for the given pixel format. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size. A list of pixel formats can be obtained from c_enum_pixel_formats().
|
|
||||||||||||||||||||
|
Enumerates all pixel formats supported by the given camera. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size.
|
|
||||||||||||||||
|
Returns the value of a device control.
|
|
||||||||||||||||||||
|
Returns information about a given camera device. The function returns information about a device specified using a device handle obtained from c_open_device() or a string that would be recognized by the same function. The hDevice and device_name arguments are mutually exclusive. If both are specified, the handle is used. If the device name should be used, hDevice should be set to zero. If the buffer is not large enough, C_BUFFER_TOO_SMALL is returned and the size parameter is modified to contain the required buffer size. Specifying a size of sizeof(CDevice) + strlen(device_name) + 84 will usually be enough. This information can be used to try receiving device information in a statically allocated buffer first. The number comes from the field lengths that V4L2 uses internally. There is no guarantee, however, that this does not change in the future, so applications must be prepared to allocate more memory if indicated by a return value of C_BUFFER_TOO_SMALL.
|
|
|
Returns the error message associated with a given error code. Note that the caller must free the buffer returned by this function.
|
|
||||||||||||
|
Returns the error message associated with a given error code and device handle. Note that the caller must free the buffer returned by this function. Compared to the c_get_error_text() function, this function can take the handle's last system error into account.
|
|
|
Initializes libwebcam. This method must be called prior to using most of the other methods. To release resources allocated during initialization, users should make a call to c_cleanup() when the library is no longer used. |
|
|
Opens a camera device. The function returns a handle that can be used for all functions that require a device handle.
|
|
||||||||||||||||
|
Sets the value of a device control.
|
|
||||||||||||||||||||
|
Subscribes the caller to receive the given event. [unimplemented]
|
|
||||||||||||
|
Unsubscribes the caller from the given event. [unimplemented]
|