2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH DCAM1394 7D "May 19, 2004"
8 dcam1394 \- 1394-based digital camera (IIDC) driver
12 \fB#include <sys/dcam/dcam1394_io.h>\fR
18 The \fBdcam1394\fR driver supports devices implementing the \fI1394 Trade
19 Association Digital Camera Specification\fR (also referred to as the IIDC
20 specification). Only a subset of the specification is supported.
24 Isochronous data is read from the driver frame-by-frame and is maintained
25 within the driver in a ring buffer.
28 Video frames are read from the isochronous input device using \fBread\fR(2).
31 The \fBdcam1394_frame_t\fR structure describes the frame layout and is defined
37 unsigned int vid_mode;
47 The size to allocate for the structure is determined by the video mode for
48 which the camera is configured. Possible values for the vid_mode field are
49 listed under DCAM1394_PARAM_VID_MODE below.
53 The following ioctl requests are supported:
57 \fBDCAM1394_CMD_CAM_RESET\fR
67 \fBDCAM1394_CMD_REG_READ\fR
71 Read the indicated dcam/IIDC register. The argument is a pointer to a
72 \fBdcam1394_reg_io_t\fR structure, which is defined as follows:
83 The offs field should be set to the offset of the register from which to read.
84 Register offset values are defined in the \fI1394 Trade Association Digital
85 Camera Specification\fR.
87 After the operation is completed, the camera register value is put in the
94 \fBDCAM1394_CMD_REG_WRITE\fR
98 Write the indicated dcam/IIDC register. The argument is a pointer to a
99 \fBdcam1394_reg_io_t\fR structure (described above).
101 The offs field should be set to the offset of the register from which to read.
102 The register offset values are defined in the \fI1394 Trade Association Digital
103 Camera Specification\fR.
105 The val field should be set to the value to be written to the camera register.
111 \fBDCAM1394_CMD_PARAM_GET\fR
115 Gets a list of parameters associated with a camera. The argument is a pointer
116 to a \fBdcam1394_param_list_t\fR structure (described below). The parameter
117 list is accessed through macros defined below.
119 The paramter list only supports Format 1 video formats.
125 \fBDCAM1394_CMD_PARAM_SET\fR
129 Sets a list of parameters associated with a camera. The argument is a pointer
130 to a \fBdcam1394_param_list_t structure\fR (described below). The parameter
131 list is accessed through macros defined below.
133 The paramter list only supports Format 1 video formats.
139 \fBDCAM1394_CMD_FRAME_RCV_START\fR
143 Start receiving video frames from the camera.
145 The contents of the ring buffer may be accessed by reading the isochronous
152 \fBDCAM1394_CMD_FRAME_RCV_STOP\fR
156 Stop receiving frames from the camera.
162 \fBDCAM1394_CMD_RING_BUFF_FLUSH\fR
166 Flush the frames in the ring buffer.
172 \fBDCAM1394_CMD_FRAME_SEQ_NUM_COUNT_RESET\fR
176 Reset frame sequence number.
179 .SH PARAMETER LIST ACCESS
182 The parameter list is initialized and access through macros. The data type for
183 the parameter list is \fBdcam1394_param_list_t\fR.
186 The following macros are used to access the parameter list:
190 \fBPARAM_LIST_INIT(param_list)\fR
194 Initialize the parameter list.
200 \fBPARAM_LIST_ADD(param_list, param, subparam)\fR
204 Add a parameter to the list.
210 \fBPARAM_LIST_REMOVE(param_list, param, subparam)\fR
214 Remove a parameter from the list.
220 \fBPARAM_LIST_IS_ENTRY(param_list, param, subparam)\fR
224 Indicates if a specific parameter is in the list.
230 \fBPARAM_VAL(param_list, param, subparam)\fR
234 Value of a specified parameter.
240 \fBPARAM_ERR(param_list, param, subparam)\fR
244 Indicates if a specific parameter is successfully set.
249 When no subparam value is required, the value DCAM1394_SUBPARAM_NONE may be
254 The following parameters may appear in the list:
258 \fBDCAM1394_PARAM_CAP_POWER_CTRL\fR
262 Queries if the camera can be turned off and on through software. The subparam
269 \fBDCAM1394_PARAM_POWER\fR
273 Controls or queries if the camera is powered up. Verify this feature using
274 DCAM1394_PARAM_CAP_POWER_CTRL before use. The subparam field is ignored.
280 \fBDCAM1394_PARAM_CAP_VID_MOD\fR
284 Queries if a specific video mode is supported by the camera.
286 subparam is one of the following and is used to determine if a specified video
287 mode is supported by the camera:
291 DCAM1394_SUBPARAM_VID_MODE_0
292 DCAM1394_SUBPARAM_VID_MODE_YUV_444_160_120
293 Video mode is 4:4:4, YUV color space, 160x120 resolution.
295 DCAM1394_SUBPARAM_VID_MODE_1
296 DCAM1394_SUBPARAM_VID_MODE_YUV_422_320_240
297 Video mode is 4:2:2, YUV color space, 320x240 resolution.
299 DCAM1394_SUBPARAM_VID_MODE_2
300 DCAM1394_SUBPARAM_VID_MODE_YUV_411_640_480
301 Video mode is 4:1:1, YUV color space, 640x480 resolution.
303 DCAM1394_SUBPARAM_VID_MODE_3
304 DCAM1394_SUBPARAM_VID_MODE_YUV_422_640_480
305 Video mode is 4:2:2, YUV color space, 640x480 resolution.
307 DCAM1394_SUBPARAM_VID_MODE_4
308 DCAM1394_SUBPARAM_VID_MODE_RGB_640_480
309 Video mode is RGB color space, 640x480 resolution.
311 DCAM1394_SUBPARAM_VID_MODE_5
312 DCAM1394_SUBPARAM_VID_MODE_Y_640_480
313 Video mode is Y color space, 640x480 resolution.
322 \fBDCAM1394_PARAM_VID_MODE\fR
326 Controls or queries the current video mode of the camera. The subparam field
327 is ignored. When selecting the video mode, it should be compatible with the
328 capability of the camera, which may be determined by checking the
329 DCAM1394_PARAM_CAP_VID_MODE parameter.
331 The value of this parameter may be one of the following:
336 DCAM1394_VID_MODE_YUV_444_160_120
337 Video mode is 4:4:4, YUV color space, 160x120 resolution.
340 DCAM1394_VID_MODE_YUV_422_320_240
341 Video mode is 4:2:2, YUV color space, 320x240 resolution.
344 DCAM1394_VID_MODE_YUV_411_640_480
345 Video mode is 4:1:1, YUV color space, 640x480 resolution.
348 DCAM1394_VID_MODE_YUV_422_640_480
349 Video mode is 4:2:2, YUV color space, 640x480 resolution.
352 DCAM1394_VID_MODE_RGB_640_480
353 Video mode is RGB color space, 640x480 resolution.
356 DCAM1394_VID_MODE_Y_640_480
357 Video mode is Y color space, 640x480 resolution.
366 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0\fR
370 Queries if a specific frame rate is supported by the camera in video mode 0
371 (4:4:4, YUV, 160x120).
373 subparam is one of the following and used to determine if a specified frame
374 rate is supported by the camera:
378 DCAM1394_SUBPARAM_FRAME_RATE_0
379 DCAM1394_SUBPARAM_FRAME_RATE_3_75_FPS
380 Frame rate is 3.75 frames/second.
382 DCAM1394_SUBPARAM_FRAME_RATE_1
383 DCAM1394_SUBPARAM_FRAME_RATE_7_5_FPS
384 Frame rate is 7.5 frames/second.
386 DCAM1394_SUBPARAM_FRAME_RATE_2
387 DCAM1394_SUBPARAM_FRAME_RATE_15_FPS
388 Frame rate is 15 frames/second.
390 DCAM1394_SUBPARAM_FRAME_RATE_3
391 DCAM1394_SUBPARAM_FRAME_RATE_30_FPS
392 Frame rate is 30 frames/second.
394 DCAM1394_SUBPARAM_FRAME_RATE_4
395 DCAM1394_SUBPARAM_FRAME_RATE_60_FPS
396 Frame rate is 60 frames/second.
405 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_1\fR
409 Queries if a specific frame rate is supported by the camera in video mode 1
410 (4:2:2, YUV, 320x240). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a
411 listing of valid subparam values.
417 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_2\fR
421 Queries if a specific frame rate is supported by the camera in video mode 2
422 (4:1:1, YUV, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a
423 listing of valid subparam values.
429 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_3\fR
433 Queries if a specific frame rate is supported by the camera in video mode 3
434 (4:2:2, YUV, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a
435 listing of valid subparam values.
441 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_4\fR
445 Queries if a specific frame rate is supported by the camera in video mode 4.
446 (RGB, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of
447 valid subparam values.
453 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_5\fR
457 Queries if a specific frame rate is supported by the camera in video mode 5.
458 (Y, 640x480). See DCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0 for a listing of
459 valid subparam values.
465 \fBDCAM1394_PARAM_FRAME_RATE\fR
469 Controls or queries the current frame rate of the camera. The subparam field
470 is ignored. When selecting a frame rate, it should be compatible with the
471 capability of the camera, which can be determined by querying one of the frame
472 rate capability parameters above.
474 The value of this parameter may be one of the following:
478 DCAM1394_FRAME_RATE_0
480 The frame rate is 3.75 frames per second.
482 DCAM1394_FRAME_RATE_1
484 The frame rate is 7.5 frames per second.
486 DCAM1394_FRAME_RATE_2
488 The frame rate is 15 frames per second.
490 DCAM1394_FRAME_RATE_3
492 The frame rate is 30 frames per second.
494 DCAM1394_FRAME_RATE_4
496 The frame rate is 60 frames per second.
505 \fBDCAM1394_PARAM_RING_BUFF_CAPACITY\fR
509 Controls or queries the number of frames that the ring buffer may hold. This
510 value can range between 2 and 30. The subparam field is ignored.
516 \fBDCAM1394_PARAM_RING_BUFF_NUM_FRAMES_READY\fR
520 Queries the number of frames in the ring buffer ready to be accessed. The
521 subparam field is ignored.
527 \fBDCAM1394_PARAM_RING_BUFF_READ_PTR_INCR\fR
531 Controls or queries the number of bytes to advance the read pointer as it
532 consumes data from the ring buffer. The subparam field is ignored.
538 \fBDCAM1394_PARAM_FRAME_NUM_BYTES\fR
542 Queries the number of bytes in a frame at the current video mode. The subparam
549 \fBDCAM1394_PARAM_STATUS\fR
553 Queries the parameter status. The subparam field is ignored.
555 The values for the parameter status is a bit field with the following values
560 \fBDCAM1394_STATUS_FRAME_RCV_DONE\fR
564 Frame successfully received.
570 \fBDCAM1394_STATUS_RING_BUFF_LOST_FRAME\fR
574 A frame has been lost while processing the ring buffer.
580 \fBDCAM1394_STATUS_PARAM_CHANGE\fR
584 A parameter has been changed.
590 \fBDCAM1394_STATUS_FRAME_SEQ_NUM_COUNT_OVERFLOW\fR
594 Frame sequence number has reached its maximum possible value and has
601 \fBDCAM1394_STATUS_CAM_UNPLUG\fR
605 Camera has been unplugged.
613 \fBDCAM1394_PARAM_BRIGHTNESS\fR
617 Query or control a camera feature. This feature queries or controls the
618 brightness of the camera.
622 \fBDCAM1394_SUBPARAM_PRESENCE\fR
626 Indicates if the feature is available.
632 \fBDCAM1394_SUBPARAM_CAP_ON_OFF\fR
636 Indicates if the feature may be enabled and disabled. May only be queried.
642 \fBDCAM1394_SUBPARAM_ON_OFF\fR
646 Indicates if the feature is enabled.
652 \fBDCAM1394_SUBPARAM_CAP_CTRL_AUTO\fR
656 Indicates if the automatic control of this feature is supported by the camera.
663 \fBDCAM1394_SUBPARAM_CAP_CTRL_MANUAL\fR
667 Indicates if the manual control of this feature is supported by the camera. May
674 \fBDCAM1394_SUBPARAM_CTRL_MODE\fR
678 Indicates if the feature is in auto or manual mode.
684 \fBDCAM1394_SUBPARAM_MIN_VAL\fR
688 Minimum value of the feature. May only be queried.
694 \fBDCAM1394_SUBPARAM_MAX_VAL\fR
698 Maximum value of the feature. May only be queried.
704 \fBDCAM1394_SUBPARAM_VALUE\fR
708 Current value of the feature.
714 \fBDCAM1394_SUBPARAM_CAP_READ\fR
718 Indicates if the feature may be read. May only be queried.
726 \fBDCAM1394_PARAM_EXPOSURE\fR
730 Query or control a camera feature. This feature queries or controls the
731 exposure of the camera. The subparams supported by this feature are described
732 under DCAM1394_PARAM_BRIGHTNESS.
738 \fBDCAM1394_PARAM_SHARPNESS\fR
742 Query or control a camera feature. This feature queries or controls the
743 sharpness of the camera. The subparams supported by this feature are described
744 under DCAM1394_PARAM_BRIGHTNESS.
750 \fBDCAM1394_PARAM_WHITE_BALANCE\fR
754 Query or control a camera feature. This feature queries or controls the white
755 balance of the camera. The subparams supported by this feature are described
756 under DCAM1394_PARAM_BRIGHTNESS, except for DCAM1394_SUBPARAM_VALUE.
757 DCAM1394_SUBPARAM_VALUE is replaced by two distinct subparams.
761 \fBDCAM1394_SUBPARAM_U_VALUE\fR
764 U or B component of the white balance.
770 \fBDCAM1394_SUBPARAM_V_VALUE\fR
773 V or R component of the white balance.
781 \fBDCAM1394_PARAM_HUE\fR
785 Query or control a camera feature. This feature queries or controls the hue of
786 the camera. The subparams supported by this feature are described under
787 DCAM1394_PARAM_BRIGHTNESS.
793 \fBDCAM1394_PARAM_SATURATION\fR
797 Query or control a camera feature. This feature queries or controls the
798 saturation of the camera. The subparams supported by this feature are described
799 under DCAM1394_PARAM_BRIGHTNESS.
805 \fBDCAM1394_PARAM_GAMMA\fR
809 Query or control a camera feature. This feature queries or controls the gamma
810 of the camera. The subparams supported by this feature are described under
811 DCAM1394_PARAM_BRIGHTNESS.
817 \fBDCAM1394_PARAM_SHUTTER\fR
821 Query or control a camera feature. This feature queries or controls the
822 sharpness of the camera. The subparams supported by this feature are described
823 under DCAM1394_PARAM_BRIGHTNESS.
829 \fBDCAM1394_PARAM_GAIN\fR
833 Query or control a camera feature. This feature queries or controls the gain of
834 the camera. The subparams supported by this feature are described under
835 DCAM1394_PARAM_BRIGHTNESS.
841 \fBDCAM1394_PARAM_IRIS\fR
845 Query or control a camera feature. This feature queries or controls the iris of
846 the camera. The subparams supported by this feature are described under
847 DCAM1394_PARAM_BRIGHTNESS.
853 \fBDCAM1394_PARAM_FOCUS\fR
857 Query or control a camera feature. This feature queries or controls the focus
858 of the camera. The subparams supported by this feature are described under
859 DCAM1394_PARAM_BRIGHTNESS.
865 \fBDCAM1394_PARAM_ZOOM\fR
869 Query or control a camera feature. This feature queries or controls the zoom of
870 the camera. The subparams supported by this feature are described under
871 DCAM1394_PARAM_BRIGHTNESS.
877 \fBDCAM1394_PARAM_PAN\fR
881 Query or control a camera feature. This feature queries or controls the pan of
882 the camera. The subparams supported by this feature are described under
883 DCAM1394_PARAM_BRIGHTNESS.
889 \fBDCAM1394_PARAM_TILT\fR
893 Query or control a camera feature. This feature queries or controls the tilt of
894 the camera.The subparams supported by this feature are described under
895 DCAM1394_PARAM_BRIGHTNESS.
898 .SH DEVICE SPECIAL FILES
902 \fB\fB/dev/dcam\fIN\fR\fR\fR
905 Device node for isochronous input from camera.
911 \fB\fB/dev/dcamctl\fIN\fR\fR\fR
914 Device node for camera control.
921 \fB\fBkernel/drv/sparcv9/dcam1394\fR\fR
925 64-bit ELF kernel module.
931 \fB\fBkernel/drv/dcam1394\fR\fR
935 32-bit ELF kernel module.
941 See \fBattributes\fR(5) for descriptions of the following attributes:
949 ATTRIBUTE TYPE ATTRIBUTE VALUE
951 Interface Stability Evolving
957 \fBattributes\fR(5), \fBhci1394\fR(7D)
960 \fI1394 Trade Association Digital Camera Specification, Version 1.04 - 1996\fR
963 \fIIEEE Std 1394-2000 Standard for a High Performance Serial Bus - 2000\fR