Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#include <sys/dcam/dcam1394_io.h>
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.
Reset the device.
Read the indicated dcam/IIDC register. The argument is a pointer to a dcam1394_reg_io_t structure, which is defined as follows:
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.
Write the indicated dcam/IIDC register. The argument is a pointer to a dcam1394_reg_io_t structure (described above). 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.
Gets a list of parameters associated with a camera. The argument is a pointer to a dcam1394_param_list_t structure (described below). The parameter list is accessed through macros defined below. The parameter list only supports Format 1 video formats.
Sets a list of parameters associated with a camera. The argument is a pointer to a dcam1394_param_list_t structure (described below). The parameter list is accessed through macros defined below. The parameter list only supports Format 1 video formats.
Start receiving video frames from the camera. The contents of the ring buffer may be accessed by reading the isochronous stream device.
Stop receiving frames from the camera.
Flush the frames in the ring buffer.
Reset frame sequence number.
The following macros are used to access the parameter list: PARAM_LIST_INIT(param_list)
Initialize the parameter list.
Add a parameter to the list.
Remove a parameter from the list.
Indicates if a specific parameter is in the list.
Value of a specified parameter.
Indicates if a specific parameter is successfully set.
When no subparam value is required, the value DCAM1394_SUBPARAM_NONE may be used.
Queries if the camera can be turned off and on through software. The subparam value is ignored.
Controls or queries if the camera is powered up. Verify this feature using DCAM1394_PARAM_CAP_POWER_CTRL before use. The subparam field is ignored.
Queries if a specific video mode is supported by the camera. 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.
Controls or queries the current video mode of the camera. The subparam field is ignored. When selecting the video mode, it should be compatible with the capability of the camera, which may be determined by checking the DCAM1394_PARAM_CAP_VID_MODE parameter. 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.
Queries if a specific frame rate is supported by the camera in video mode 0 (4:4:4, YUV, 160x120). 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.
Queries if a specific frame rate is supported by the camera in video mode 1 (4:2:2, YUV, 320x240). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of valid subparam values.
Queries if a specific frame rate is supported by the camera in video mode 2 (4:1:1, YUV, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of valid subparam values.
Queries if a specific frame rate is supported by the camera in video mode 3 (4:2:2, YUV, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of valid subparam values.
Queries if a specific frame rate is supported by the camera in video mode 4. (RGB, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of valid subparam values.
Queries if a specific frame rate is supported by the camera in video mode 5. (Y, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of valid subparam values.
Controls or queries the current frame rate of the camera. The subparam field is ignored. When selecting a frame rate, it should be compatible with the capability of the camera, which can be determined by querying one of the frame rate capability parameters above. 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.
Controls or queries the number of frames that the ring buffer may hold. This value can range between 2 and 30. The subparam field is ignored.
Queries the number of frames in the ring buffer ready to be accessed. The subparam field is ignored.
Controls or queries the number of bytes to advance the read pointer as it consumes data from the ring buffer. The subparam field is ignored.
Queries the number of bytes in a frame at the current video mode. The subparam field is ignored.
Queries the parameter status. The subparam field is ignored. The values for the parameter status is a bit field with the following values possibly set: DCAM1394_STATUS_FRAME_RCV_DONE
Frame successfully received.
A frame has been lost while processing the ring buffer.
A parameter has been changed.
Frame sequence number has reached its maximum possible value and has overflowed.
Camera has been unplugged.
Query or control a camera feature. This feature queries or controls the brightness of the camera. DCAM1394_SUBPARAM_PRESENCE
Indicates if the feature is available.
Indicates if the feature may be enabled and disabled. May only be queried.
Indicates if the feature is enabled.
Indicates if the automatic control of this feature is supported by the camera. May only be queried.
Indicates if the manual control of this feature is supported by the camera. May only be queried.
Indicates if the feature is in auto or manual mode.
Minimum value of the feature. May only be queried.
Maximum value of the feature. May only be queried.
Current value of the feature.
Indicates if the feature may be read. May only be queried.
Query or control a camera feature. This feature queries or controls the exposure of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the sharpness of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the white balance of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS, except for DCAM1394_SUBPARAM_VALUE. DCAM1394_SUBPARAM_VALUE is replaced by two distinct subparams. DCAM1394_SUBPARAM_U_VALUE
U or B component of the white balance.
V or R component of the white balance.
Query or control a camera feature. This feature queries or controls the hue of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the saturation of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the gamma of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the sharpness of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the gain of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the iris of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the focus of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the zoom of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the pan of the camera. The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Query or control a camera feature. This feature queries or controls the tilt of the camera.The subparams supported by this feature are described under DCAM1394_PARAM_BRIGHTNESS.
Device node for isochronous input from camera.
Device node for camera control.
Device driver (SPARC)
Device driver (x86)
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