DCAM1394(4D) | Devices | DCAM1394(4D) |
dcam1394 - 1394-based digital camera (IIDC) driver
#include <sys/dcam/dcam1394_io.h>
The dcam1394 driver supports devices implementing the 1394 Trade Association Digital Camera Specification (also referred to as the IIDC specification). Only a subset of the specification is supported.
Isochronous data is read from the driver frame-by-frame and is maintained within the driver in a ring buffer.
Video frames are read from the isochronous input device using read(2).
The dcam1394_frame_t structure describes the frame layout and is defined as follows:
struct {
unsigned int vid_mode;
unsigned int seq_num;
hrtime_t timestamp;
unsigned char *buff;
};
The size to allocate for the structure is determined by the video mode for which the camera is configured. Possible values for the vid_mode field are listed under DCAM1394_PARAM_VID_MODE below.
The following ioctl requests are supported:
DCAM1394_CMD_CAM_RESET
DCAM1394_CMD_REG_READ
struct {
unsigned int offs;
unsigned int val;
};
The offs field should be set to the offset of the register from which to read. Register offset values are defined in the 1394 Trade Association Digital Camera Specification.
After the operation is completed, the camera register value is put in the val field.
DCAM1394_CMD_REG_WRITE
The offs field should be set to the offset of the register from which to read. The register offset values are defined in the 1394 Trade Association Digital Camera Specification.
The val field should be set to the value to be written to the camera register.
DCAM1394_CMD_PARAM_GET
The parameter list only supports Format 1 video formats.
DCAM1394_CMD_PARAM_SET
The parameter list only supports Format 1 video formats.
DCAM1394_CMD_FRAME_RCV_START
The contents of the ring buffer may be accessed by reading the isochronous stream device.
DCAM1394_CMD_FRAME_RCV_STOP
DCAM1394_CMD_RING_BUFF_FLUSH
DCAM1394_CMD_FRAME_SEQ_NUM_COUNT_RESET
The parameter list is initialized and access through macros. The data type for the parameter list is dcam1394_param_list_t.
The following macros are used to access the parameter list:
PARAM_LIST_INIT(param_list)
PARAM_LIST_ADD(param_list, param, subparam)
PARAM_LIST_REMOVE(param_list, param, subparam)
PARAM_LIST_IS_ENTRY(param_list, param, subparam)
PARAM_VAL(param_list, param, subparam)
PARAM_ERR(param_list, param, subparam)
When no subparam value is required, the value DCAM1394_SUBPARAM_NONE may be used.
The following parameters may appear in the list:
DCAM1394_PARAM_CAP_POWER_CTRL
DCAM1394_PARAM_POWER
DCAM1394_PARAM_CAP_VID_MOD
subparam is one of the following and is used to determine if a specified video mode is supported by the camera:
DCAM1394_SUBPARAM_VID_MODE_0
DCAM1394_SUBPARAM_VID_MODE_YUV_444_160_120
Video mode is 4:4:4, YUV color space, 160x120 resolution.
DCAM1394_SUBPARAM_VID_MODE_1
DCAM1394_SUBPARAM_VID_MODE_YUV_422_320_240
Video mode is 4:2:2, YUV color space, 320x240 resolution.
DCAM1394_SUBPARAM_VID_MODE_2
DCAM1394_SUBPARAM_VID_MODE_YUV_411_640_480
Video mode is 4:1:1, YUV color space, 640x480 resolution.
DCAM1394_SUBPARAM_VID_MODE_3
DCAM1394_SUBPARAM_VID_MODE_YUV_422_640_480
Video mode is 4:2:2, YUV color space, 640x480 resolution.
DCAM1394_SUBPARAM_VID_MODE_4
DCAM1394_SUBPARAM_VID_MODE_RGB_640_480
Video mode is RGB color space, 640x480 resolution.
DCAM1394_SUBPARAM_VID_MODE_5
DCAM1394_SUBPARAM_VID_MODE_Y_640_480
Video mode is Y color space, 640x480 resolution.
DCAM1394_PARAM_VID_MODE
The value of this parameter may be one of the following:
DCAM1394_VID_MODE_0
DCAM1394_VID_MODE_YUV_444_160_120
Video mode is 4:4:4, YUV color space, 160x120 resolution.
DCAM1394_VID_MODE_1
DCAM1394_VID_MODE_YUV_422_320_240
Video mode is 4:2:2, YUV color space, 320x240 resolution.
DCAM1394_VID_MODE_2
DCAM1394_VID_MODE_YUV_411_640_480
Video mode is 4:1:1, YUV color space, 640x480 resolution.
DCAM1394_VID_MODE_3
DCAM1394_VID_MODE_YUV_422_640_480
Video mode is 4:2:2, YUV color space, 640x480 resolution.
DCAM1394_VID_MODE_4
DCAM1394_VID_MODE_RGB_640_480
Video mode is RGB color space, 640x480 resolution.
DCAM1394_VID_MODE_5
DCAM1394_VID_MODE_Y_640_480
Video mode is Y color space, 640x480 resolution.
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0
subparam is one of the following and used to determine if a specified frame rate is supported by the camera:
DCAM1394_SUBPARAM_FRAME_RATE_0
DCAM1394_SUBPARAM_FRAME_RATE_3_75_FPS
Frame rate is 3.75 frames/second.
DCAM1394_SUBPARAM_FRAME_RATE_1
DCAM1394_SUBPARAM_FRAME_RATE_7_5_FPS
Frame rate is 7.5 frames/second.
DCAM1394_SUBPARAM_FRAME_RATE_2
DCAM1394_SUBPARAM_FRAME_RATE_15_FPS
Frame rate is 15 frames/second.
DCAM1394_SUBPARAM_FRAME_RATE_3
DCAM1394_SUBPARAM_FRAME_RATE_30_FPS
Frame rate is 30 frames/second.
DCAM1394_SUBPARAM_FRAME_RATE_4
DCAM1394_SUBPARAM_FRAME_RATE_60_FPS
Frame rate is 60 frames/second.
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_1
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_2
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_3
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_4
DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_5
DCAM1394_PARAM_FRAME_RATE
The value of this parameter may be one of the following:
DCAM1394_FRAME_RATE_0
DCAM1394_3_75_FPS
The frame rate is 3.75 frames per second.
DCAM1394_FRAME_RATE_1
DCAM1394_7_5_FPS
The frame rate is 7.5 frames per second.
DCAM1394_FRAME_RATE_2
DCAM1394_15_FPS
The frame rate is 15 frames per second.
DCAM1394_FRAME_RATE_3
DCAM1394_30_FPS
The frame rate is 30 frames per second.
DCAM1394_FRAME_RATE_4
DCAM1394_60_FPS
The frame rate is 60 frames per second.
DCAM1394_PARAM_RING_BUFF_CAPACITY
DCAM1394_PARAM_RING_BUFF_NUM_FRAMES_READY
DCAM1394_PARAM_RING_BUFF_READ_PTR_INCR
DCAM1394_PARAM_FRAME_NUM_BYTES
DCAM1394_PARAM_STATUS
The values for the parameter status is a bit field with the following values possibly set:
DCAM1394_STATUS_FRAME_RCV_DONE
DCAM1394_STATUS_RING_BUFF_LOST_FRAME
DCAM1394_STATUS_PARAM_CHANGE
DCAM1394_STATUS_FRAME_SEQ_NUM_COUNT_OVERFLOW
DCAM1394_STATUS_CAM_UNPLUG
DCAM1394_PARAM_BRIGHTNESS
DCAM1394_SUBPARAM_PRESENCE
DCAM1394_SUBPARAM_CAP_ON_OFF
DCAM1394_SUBPARAM_ON_OFF
DCAM1394_SUBPARAM_CAP_CTRL_AUTO
DCAM1394_SUBPARAM_CAP_CTRL_MANUAL
DCAM1394_SUBPARAM_CTRL_MODE
DCAM1394_SUBPARAM_MIN_VAL
DCAM1394_SUBPARAM_MAX_VAL
DCAM1394_SUBPARAM_VALUE
DCAM1394_SUBPARAM_CAP_READ
DCAM1394_PARAM_EXPOSURE
DCAM1394_PARAM_SHARPNESS
DCAM1394_PARAM_WHITE_BALANCE
DCAM1394_SUBPARAM_U_VALUE
DCAM1394_SUBPARAM_V_VALUE
DCAM1394_PARAM_HUE
DCAM1394_PARAM_SATURATION
DCAM1394_PARAM_GAMMA
DCAM1394_PARAM_SHUTTER
DCAM1394_PARAM_GAIN
DCAM1394_PARAM_IRIS
DCAM1394_PARAM_FOCUS
DCAM1394_PARAM_ZOOM
DCAM1394_PARAM_PAN
DCAM1394_PARAM_TILT
/dev/dcamN
/dev/dcamctlN
/kernel/drv/sparcv9/dcam1394
/kernel/drv/amd64/dcam1394
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Evolving |
1394 Trade Association Digital Camera Specification, Version 1.04 - 1996
IEEE Std 1394-2000 Standard for a High Performance Serial Bus - 2000
January 10, 2020 | OmniOS |