Merge commit 'b31320a79e2054c6739b5229259dbf98f3afc547' into merges
[unleashed.git] / share / man / man7d / dcam1394.7d
blob22ad775895f2e0bfe5fe2a8b94331153832e09f8
1 '\" te
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"
7 .SH NAME
8 dcam1394 \- 1394-based digital camera (IIDC) driver
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB#include <sys/dcam/dcam1394_io.h>\fR
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
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.
21 .SH READING DATA
22 .sp
23 .LP
24 Isochronous data is read from the driver frame-by-frame and is maintained
25 within the driver in a ring buffer.
26 .sp
27 .LP
28 Video frames are read from the isochronous input device using \fBread\fR(2).
29 .sp
30 .LP
31 The \fBdcam1394_frame_t\fR structure describes the frame layout and is defined
32 as follows:
33 .sp
34 .in +2
35 .nf
36      struct {
37           unsigned int vid_mode;
38           unsigned int seq_num;
39           hrtime_t     timestamp;
40           unsigned char *buff;
41      };
42 .fi
43 .in -2
45 .sp
46 .LP
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.
50 .SH IOCTL REQUESTS
51 .sp
52 .LP
53 The following ioctl requests are supported:
54 .sp
55 .ne 2
56 .na
57 \fBDCAM1394_CMD_CAM_RESET\fR
58 .ad
59 .sp .6
60 .RS 4n
61 Reset the device.
62 .RE
64 .sp
65 .ne 2
66 .na
67 \fBDCAM1394_CMD_REG_READ\fR
68 .ad
69 .sp .6
70 .RS 4n
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:
73 .sp
74 .in +2
75 .nf
76     struct {
77          unsigned int offs;
78          unsigned int val;
79     };
80 .fi
81 .in -2
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.
86 .sp
87 After the operation is completed, the camera register value is put in the
88 \fBval\fR field.
89 .RE
91 .sp
92 .ne 2
93 .na
94 \fBDCAM1394_CMD_REG_WRITE\fR
95 .ad
96 .sp .6
97 .RS 4n
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.
109 .ne 2
111 \fBDCAM1394_CMD_PARAM_GET\fR
113 .sp .6
114 .RS 4n
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.
123 .ne 2
125 \fBDCAM1394_CMD_PARAM_SET\fR
127 .sp .6
128 .RS 4n
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.
137 .ne 2
139 \fBDCAM1394_CMD_FRAME_RCV_START\fR
141 .sp .6
142 .RS 4n
143 Start receiving video frames from the camera.
145 The contents of the ring buffer may be accessed by reading the isochronous
146 stream device.
150 .ne 2
152 \fBDCAM1394_CMD_FRAME_RCV_STOP\fR
154 .sp .6
155 .RS 4n
156 Stop receiving frames from the camera.
160 .ne 2
162 \fBDCAM1394_CMD_RING_BUFF_FLUSH\fR
164 .sp .6
165 .RS 4n
166 Flush the frames in the ring buffer.
170 .ne 2
172 \fBDCAM1394_CMD_FRAME_SEQ_NUM_COUNT_RESET\fR
174 .sp .6
175 .RS 4n
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:
188 .ne 2
190 \fBPARAM_LIST_INIT(param_list)\fR
192 .sp .6
193 .RS 4n
194 Initialize the parameter list.
198 .ne 2
200 \fBPARAM_LIST_ADD(param_list, param, subparam)\fR
202 .sp .6
203 .RS 4n
204 Add a parameter to the list.
208 .ne 2
210 \fBPARAM_LIST_REMOVE(param_list, param, subparam)\fR
212 .sp .6
213 .RS 4n
214 Remove a parameter from the list.
218 .ne 2
220 \fBPARAM_LIST_IS_ENTRY(param_list, param, subparam)\fR
222 .sp .6
223 .RS 4n
224 Indicates if a specific parameter is in the list.
228 .ne 2
230 \fBPARAM_VAL(param_list, param, subparam)\fR
232 .sp .6
233 .RS 4n
234 Value of a specified parameter.
238 .ne 2
240 \fBPARAM_ERR(param_list, param, subparam)\fR
242 .sp .6
243 .RS 4n
244 Indicates if a specific parameter is successfully set.
249 When no subparam value is required, the value DCAM1394_SUBPARAM_NONE may be
250 used.
251 .SH PARAMETERS
254 The following parameters may appear in the list:
256 .ne 2
258 \fBDCAM1394_PARAM_CAP_POWER_CTRL\fR
260 .sp .6
261 .RS 4n
262 Queries if the camera can be turned off and on through software. The subparam
263 value is ignored.
267 .ne 2
269 \fBDCAM1394_PARAM_POWER\fR
271 .sp .6
272 .RS 4n
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.
278 .ne 2
280 \fBDCAM1394_PARAM_CAP_VID_MOD\fR
282 .sp .6
283 .RS 4n
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:
289 .in +2
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.
315 .in -2
320 .ne 2
322 \fBDCAM1394_PARAM_VID_MODE\fR
324 .sp .6
325 .RS 4n
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:
333 .in +2
335   DCAM1394_VID_MODE_0
336   DCAM1394_VID_MODE_YUV_444_160_120
337        Video mode is 4:4:4, YUV color space, 160x120 resolution.
339   DCAM1394_VID_MODE_1
340   DCAM1394_VID_MODE_YUV_422_320_240
341        Video mode is 4:2:2, YUV color space, 320x240 resolution.
343   DCAM1394_VID_MODE_2
344   DCAM1394_VID_MODE_YUV_411_640_480
345        Video mode is 4:1:1, YUV color space, 640x480 resolution.
347   DCAM1394_VID_MODE_3
348   DCAM1394_VID_MODE_YUV_422_640_480
349        Video mode is 4:2:2, YUV color space, 640x480 resolution.
351   DCAM1394_VID_MODE_4
352   DCAM1394_VID_MODE_RGB_640_480
353        Video mode is RGB color space, 640x480 resolution.
355   DCAM1394_VID_MODE_5
356   DCAM1394_VID_MODE_Y_640_480
357        Video mode is Y color space, 640x480 resolution.
359 .in -2
364 .ne 2
366 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_0\fR
368 .sp .6
369 .RS 4n
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:
376 .in +2
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.
398 .in -2
403 .ne 2
405 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_1\fR
407 .sp .6
408 .RS 4n
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.
415 .ne 2
417 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_2\fR
419 .sp .6
420 .RS 4n
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.
427 .ne 2
429 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_3\fR
431 .sp .6
432 .RS 4n
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.
439 .ne 2
441 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_4\fR
443 .sp .6
444 .RS 4n
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.
451 .ne 2
453 \fBDCAM1394_PARAM_CAP_FRAME_RATE_VID_MODE_5\fR
455 .sp .6
456 .RS 4n
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.
463 .ne 2
465 \fBDCAM1394_PARAM_FRAME_RATE\fR
467 .sp .6
468 .RS 4n
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:
476 .in +2
478           DCAM1394_FRAME_RATE_0
479           DCAM1394_3_75_FPS
480                The frame rate is 3.75 frames per second.
482           DCAM1394_FRAME_RATE_1
483           DCAM1394_7_5_FPS
484                The frame rate is 7.5 frames per second.
486           DCAM1394_FRAME_RATE_2
487           DCAM1394_15_FPS
488                The frame rate is 15 frames per second.
490           DCAM1394_FRAME_RATE_3
491           DCAM1394_30_FPS
492                The frame rate is 30 frames per second.
494           DCAM1394_FRAME_RATE_4
495           DCAM1394_60_FPS
496                The frame rate is 60 frames per second.
498 .in -2
503 .ne 2
505 \fBDCAM1394_PARAM_RING_BUFF_CAPACITY\fR
507 .sp .6
508 .RS 4n
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.
514 .ne 2
516 \fBDCAM1394_PARAM_RING_BUFF_NUM_FRAMES_READY\fR
518 .sp .6
519 .RS 4n
520 Queries the number of frames in the ring buffer ready to be accessed. The
521 subparam field is ignored.
525 .ne 2
527 \fBDCAM1394_PARAM_RING_BUFF_READ_PTR_INCR\fR
529 .sp .6
530 .RS 4n
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.
536 .ne 2
538 \fBDCAM1394_PARAM_FRAME_NUM_BYTES\fR
540 .sp .6
541 .RS 4n
542 Queries the number of bytes in a frame at the current video mode. The subparam
543 field is ignored.
547 .ne 2
549 \fBDCAM1394_PARAM_STATUS\fR
551 .sp .6
552 .RS 4n
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
556 possibly set:
558 .ne 2
560 \fBDCAM1394_STATUS_FRAME_RCV_DONE\fR
562 .sp .6
563 .RS 4n
564 Frame successfully received.
568 .ne 2
570 \fBDCAM1394_STATUS_RING_BUFF_LOST_FRAME\fR
572 .sp .6
573 .RS 4n
574 A frame has been lost while processing the ring buffer.
578 .ne 2
580 \fBDCAM1394_STATUS_PARAM_CHANGE\fR
582 .sp .6
583 .RS 4n
584 A parameter has been changed.
588 .ne 2
590 \fBDCAM1394_STATUS_FRAME_SEQ_NUM_COUNT_OVERFLOW\fR
592 .sp .6
593 .RS 4n
594 Frame sequence number has reached its maximum possible value and has
595 overflowed.
599 .ne 2
601 \fBDCAM1394_STATUS_CAM_UNPLUG\fR
603 .sp .6
604 .RS 4n
605 Camera has been unplugged.
611 .ne 2
613 \fBDCAM1394_PARAM_BRIGHTNESS\fR
615 .sp .6
616 .RS 4n
617 Query or control a camera feature. This feature queries or controls the
618 brightness of the camera.
620 .ne 2
622 \fBDCAM1394_SUBPARAM_PRESENCE\fR
624 .sp .6
625 .RS 4n
626 Indicates if the feature is available.
630 .ne 2
632 \fBDCAM1394_SUBPARAM_CAP_ON_OFF\fR
634 .sp .6
635 .RS 4n
636 Indicates if the feature may be enabled and disabled. May only be queried.
640 .ne 2
642 \fBDCAM1394_SUBPARAM_ON_OFF\fR
644 .sp .6
645 .RS 4n
646 Indicates if the feature is enabled.
650 .ne 2
652 \fBDCAM1394_SUBPARAM_CAP_CTRL_AUTO\fR
654 .sp .6
655 .RS 4n
656 Indicates if the automatic control of this feature is supported by the camera.
657 May only be queried.
661 .ne 2
663 \fBDCAM1394_SUBPARAM_CAP_CTRL_MANUAL\fR
665 .sp .6
666 .RS 4n
667 Indicates if the manual control of this feature is supported by the camera. May
668 only be queried.
672 .ne 2
674 \fBDCAM1394_SUBPARAM_CTRL_MODE\fR
676 .sp .6
677 .RS 4n
678 Indicates if the feature is in auto or manual mode.
682 .ne 2
684 \fBDCAM1394_SUBPARAM_MIN_VAL\fR
686 .sp .6
687 .RS 4n
688 Minimum value of the feature. May only be queried.
692 .ne 2
694 \fBDCAM1394_SUBPARAM_MAX_VAL\fR
696 .sp .6
697 .RS 4n
698 Maximum value of the feature. May only be queried.
702 .ne 2
704 \fBDCAM1394_SUBPARAM_VALUE\fR
706 .sp .6
707 .RS 4n
708 Current value of the feature.
712 .ne 2
714 \fBDCAM1394_SUBPARAM_CAP_READ\fR
716 .sp .6
717 .RS 4n
718 Indicates if the feature may be read. May only be                queried.
724 .ne 2
726 \fBDCAM1394_PARAM_EXPOSURE\fR
728 .sp .6
729 .RS 4n
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.
736 .ne 2
738 \fBDCAM1394_PARAM_SHARPNESS\fR
740 .sp .6
741 .RS 4n
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.
748 .ne 2
750 \fBDCAM1394_PARAM_WHITE_BALANCE\fR
752 .sp .6
753 .RS 4n
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.
759 .ne 2
761 \fBDCAM1394_SUBPARAM_U_VALUE\fR
763 .RS 29n
764 U or B component of the white balance.
768 .ne 2
770 \fBDCAM1394_SUBPARAM_V_VALUE\fR
772 .RS 29n
773 V or R component of the white balance.
779 .ne 2
781 \fBDCAM1394_PARAM_HUE\fR
783 .sp .6
784 .RS 4n
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.
791 .ne 2
793 \fBDCAM1394_PARAM_SATURATION\fR
795 .sp .6
796 .RS 4n
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.
803 .ne 2
805 \fBDCAM1394_PARAM_GAMMA\fR
807 .sp .6
808 .RS 4n
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.
815 .ne 2
817 \fBDCAM1394_PARAM_SHUTTER\fR
819 .sp .6
820 .RS 4n
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.
827 .ne 2
829 \fBDCAM1394_PARAM_GAIN\fR
831 .sp .6
832 .RS 4n
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.
839 .ne 2
841 \fBDCAM1394_PARAM_IRIS\fR
843 .sp .6
844 .RS 4n
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.
851 .ne 2
853 \fBDCAM1394_PARAM_FOCUS\fR
855 .sp .6
856 .RS 4n
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.
863 .ne 2
865 \fBDCAM1394_PARAM_ZOOM\fR
867 .sp .6
868 .RS 4n
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.
875 .ne 2
877 \fBDCAM1394_PARAM_PAN\fR
879 .sp .6
880 .RS 4n
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.
887 .ne 2
889 \fBDCAM1394_PARAM_TILT\fR
891 .sp .6
892 .RS 4n
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
900 .ne 2
902 \fB\fB/dev/dcam\fIN\fR\fR\fR
904 .RS 17n
905 Device node for isochronous input from camera.
909 .ne 2
911 \fB\fB/dev/dcamctl\fIN\fR\fR\fR
913 .RS 17n
914 Device node for camera control.
917 .SH FILES
919 .ne 2
921 \fB\fBkernel/drv/sparcv9/dcam1394\fR\fR
923 .sp .6
924 .RS 4n
925 64-bit ELF kernel module.
929 .ne 2
931 \fB\fBkernel/drv/dcam1394\fR\fR
933 .sp .6
934 .RS 4n
935 32-bit ELF kernel module.
938 .SH ATTRIBUTES
941 See \fBattributes\fR(5) for descriptions of the following attributes:
946 box;
947 c | c
948 l | l .
949 ATTRIBUTE TYPE  ATTRIBUTE VALUE
951 Interface Stability     Evolving
954 .SH SEE ALSO
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