aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-03-07 08:16:48 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-13 10:16:39 -0400
commit22a437cd6336193d8ffeb4217e9753fb92c7c870 (patch)
tree72417f673034b57578644812ad8121c15ccdc250 /Documentation/DocBook
parent26092ffb72ed0ca4936dd979f2acf3a8566ccd38 (diff)
[media] DocBook media: clarify v4l2_buffer/plane fields
Be more specific as to who has to fill in each field/flag: the driver or the application. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/media/v4l/io.xml54
1 files changed, 36 insertions, 18 deletions
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index 49e48be9c2b4..0a5d8c6003cf 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -676,10 +676,11 @@ plane structures.</para>
676 <entry>__u32</entry> 676 <entry>__u32</entry>
677 <entry><structfield>index</structfield></entry> 677 <entry><structfield>index</structfield></entry>
678 <entry></entry> 678 <entry></entry>
679 <entry>Number of the buffer, set by the application. This 679 <entry>Number of the buffer, set by the application except
680field is only used for <link linkend="mmap">memory mapping</link> I/O 680when calling &VIDIOC-DQBUF;, then it is set by the driver.
681and can range from zero to the number of buffers allocated 681This field can range from zero to the number of buffers allocated
682with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry> 682with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>),
683plus any buffers allocated with &VIDIOC-CREATE-BUFS; minus one.</entry>
683 </row> 684 </row>
684 <row> 685 <row>
685 <entry>__u32</entry> 686 <entry>__u32</entry>
@@ -698,7 +699,7 @@ linkend="v4l2-buf-type" /></entry>
698buffer. It depends on the negotiated data format and may change with 699buffer. It depends on the negotiated data format and may change with
699each buffer for compressed variable size data like JPEG images. 700each buffer for compressed variable size data like JPEG images.
700Drivers must set this field when <structfield>type</structfield> 701Drivers must set this field when <structfield>type</structfield>
701refers to an input stream, applications when an output stream.</entry> 702refers to an input stream, applications when it refers to an output stream.</entry>
702 </row> 703 </row>
703 <row> 704 <row>
704 <entry>__u32</entry> 705 <entry>__u32</entry>
@@ -715,7 +716,7 @@ linkend="buffer-flags" />.</entry>
715buffer, see <xref linkend="v4l2-field" />. This field is not used when 716buffer, see <xref linkend="v4l2-field" />. This field is not used when
716the buffer contains VBI data. Drivers must set it when 717the buffer contains VBI data. Drivers must set it when
717<structfield>type</structfield> refers to an input stream, 718<structfield>type</structfield> refers to an input stream,
718applications when an output stream.</entry> 719applications when it refers to an output stream.</entry>
719 </row> 720 </row>
720 <row> 721 <row>
721 <entry>struct timeval</entry> 722 <entry>struct timeval</entry>
@@ -729,7 +730,9 @@ applications when an output stream.</entry>
729 stores the time at which the last data byte was actually sent out 730 stores the time at which the last data byte was actually sent out
730 in the <structfield>timestamp</structfield> field. This permits 731 in the <structfield>timestamp</structfield> field. This permits
731 applications to monitor the drift between the video and system 732 applications to monitor the drift between the video and system
732 clock.</para></entry> 733 clock. For output streams that use <constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant>
734 the application has to fill in the timestamp which will be copied
735 by the driver to the capture stream.</para></entry>
733 </row> 736 </row>
734 <row> 737 <row>
735 <entry>&v4l2-timecode;</entry> 738 <entry>&v4l2-timecode;</entry>
@@ -822,7 +825,8 @@ is the file descriptor associated with a DMABUF buffer.</entry>
822 <entry><structfield>length</structfield></entry> 825 <entry><structfield>length</structfield></entry>
823 <entry></entry> 826 <entry></entry>
824 <entry>Size of the buffer (not the payload) in bytes for the 827 <entry>Size of the buffer (not the payload) in bytes for the
825 single-planar API. For the multi-planar API the application sets 828 single-planar API. This is set by the driver based on the calls to
829 &VIDIOC-REQBUFS; and/or &VIDIOC-CREATE-BUFS;. For the multi-planar API the application sets
826 this to the number of elements in the <structfield>planes</structfield> 830 this to the number of elements in the <structfield>planes</structfield>
827 array. The driver will fill in the actual number of valid elements in 831 array. The driver will fill in the actual number of valid elements in
828 that array. 832 that array.
@@ -856,13 +860,15 @@ should set this to 0.</entry>
856 <entry><structfield>bytesused</structfield></entry> 860 <entry><structfield>bytesused</structfield></entry>
857 <entry></entry> 861 <entry></entry>
858 <entry>The number of bytes occupied by data in the plane 862 <entry>The number of bytes occupied by data in the plane
859 (its payload).</entry> 863 (its payload). Drivers must set this field when <structfield>type</structfield>
864 refers to an input stream, applications when it refers to an output stream.</entry>
860 </row> 865 </row>
861 <row> 866 <row>
862 <entry>__u32</entry> 867 <entry>__u32</entry>
863 <entry><structfield>length</structfield></entry> 868 <entry><structfield>length</structfield></entry>
864 <entry></entry> 869 <entry></entry>
865 <entry>Size in bytes of the plane (not its payload).</entry> 870 <entry>Size in bytes of the plane (not its payload). This is set by the driver
871 based on the calls to &VIDIOC-REQBUFS; and/or &VIDIOC-CREATE-BUFS;.</entry>
866 </row> 872 </row>
867 <row> 873 <row>
868 <entry>union</entry> 874 <entry>union</entry>
@@ -901,7 +907,9 @@ should set this to 0.</entry>
901 <entry>__u32</entry> 907 <entry>__u32</entry>
902 <entry><structfield>data_offset</structfield></entry> 908 <entry><structfield>data_offset</structfield></entry>
903 <entry></entry> 909 <entry></entry>
904 <entry>Offset in bytes to video data in the plane, if applicable. 910 <entry>Offset in bytes to video data in the plane.
911 Drivers must set this field when <structfield>type</structfield>
912 refers to an input stream, applications when it refers to an output stream.
905 </entry> 913 </entry>
906 </row> 914 </row>
907 <row> 915 <row>
@@ -1031,7 +1039,7 @@ buffer cannot be on both queues at the same time, the
1031<constant>V4L2_BUF_FLAG_QUEUED</constant> and 1039<constant>V4L2_BUF_FLAG_QUEUED</constant> and
1032<constant>V4L2_BUF_FLAG_DONE</constant> flag are mutually exclusive. 1040<constant>V4L2_BUF_FLAG_DONE</constant> flag are mutually exclusive.
1033They can be both cleared however, then the buffer is in "dequeued" 1041They can be both cleared however, then the buffer is in "dequeued"
1034state, in the application domain to say so.</entry> 1042state, in the application domain so to say.</entry>
1035 </row> 1043 </row>
1036 <row> 1044 <row>
1037 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry> 1045 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry>
@@ -1049,27 +1057,35 @@ state, in the application domain to say so.</entry>
1049 <entry>Drivers set or clear this flag when calling the 1057 <entry>Drivers set or clear this flag when calling the
1050<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video 1058<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video
1051capture devices when the buffer contains a compressed image which is a 1059capture devices when the buffer contains a compressed image which is a
1052key frame (or field), &ie; can be decompressed on its own.</entry> 1060key frame (or field), &ie; can be decompressed on its own. Also know as
1061an I-frame. Applications can set this bit when <structfield>type</structfield>
1062refers to an output stream.</entry>
1053 </row> 1063 </row>
1054 <row> 1064 <row>
1055 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry> 1065 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry>
1056 <entry>0x00000010</entry> 1066 <entry>0x00000010</entry>
1057 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant> 1067 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1058this flags predicted frames or fields which contain only differences to a 1068this flags predicted frames or fields which contain only differences to a
1059previous key frame.</entry> 1069previous key frame. Applications can set this bit when <structfield>type</structfield>
1070refers to an output stream.</entry>
1060 </row> 1071 </row>
1061 <row> 1072 <row>
1062 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry> 1073 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry>
1063 <entry>0x00000020</entry> 1074 <entry>0x00000020</entry>
1064 <entry>Similar to <constant>V4L2_BUF_FLAG_PFRAME</constant> 1075 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1065 this is a bidirectional predicted frame or field. [ooc tbd]</entry> 1076this flags a bi-directional predicted frame or field which contains only
1077the differences between the current frame and both the preceding and following
1078key frames to specify its content. Applications can set this bit when
1079<structfield>type</structfield> refers to an output stream.</entry>
1066 </row> 1080 </row>
1067 <row> 1081 <row>
1068 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry> 1082 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry>
1069 <entry>0x00000100</entry> 1083 <entry>0x00000100</entry>
1070 <entry>The <structfield>timecode</structfield> field is valid. 1084 <entry>The <structfield>timecode</structfield> field is valid.
1071Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> 1085Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
1072ioctl is called.</entry> 1086ioctl is called. Applications can set this bit and the corresponding
1087<structfield>timecode</structfield> structure when <structfield>type</structfield>
1088refers to an output stream.</entry>
1073 </row> 1089 </row>
1074 <row> 1090 <row>
1075 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> 1091 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
@@ -1141,7 +1157,9 @@ in which case caches have not been used.</entry>
1141 the frame. Logical 'and' operation between the 1157 the frame. Logical 'and' operation between the
1142 <structfield>flags</structfield> field and 1158 <structfield>flags</structfield> field and
1143 <constant>V4L2_BUF_FLAG_TSTAMP_SRC_MASK</constant> produces the 1159 <constant>V4L2_BUF_FLAG_TSTAMP_SRC_MASK</constant> produces the
1144 value of the timestamp source.</entry> 1160 value of the timestamp source. Applications must set the timestamp
1161 source when <structfield>type</structfield> refers to an output stream
1162 and <constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant> is set.</entry>
1145 </row> 1163 </row>
1146 <row> 1164 <row>
1147 <entry><constant>V4L2_BUF_FLAG_TSTAMP_SRC_EOF</constant></entry> 1165 <entry><constant>V4L2_BUF_FLAG_TSTAMP_SRC_EOF</constant></entry>