aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-08 17:01:44 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-09 09:18:49 -0400
commitbf4404b482f927096ba3001d829a79f788d2265f (patch)
tree83f901803a0e51e2e57c73c8758b7a6f14470ead /include/media
parent24ade5b6de002c51d18722e996dd92e49ad88802 (diff)
[media] videobuf2-v4l2.h: improve documentation
There are a few issues at the documentation: fields not documented, bad cross refrences, etc. Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf2-v4l2.h52
1 files changed, 33 insertions, 19 deletions
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 01b1b71fc6fd..611d4f330a4c 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -25,11 +25,13 @@
25 25
26/** 26/**
27 * struct vb2_v4l2_buffer - video buffer information for v4l2 27 * struct vb2_v4l2_buffer - video buffer information for v4l2
28 *
28 * @vb2_buf: video buffer 2 29 * @vb2_buf: video buffer 2
29 * @flags: buffer informational flags 30 * @flags: buffer informational flags
30 * @field: enum v4l2_field; field order of the image in the buffer 31 * @field: enum v4l2_field; field order of the image in the buffer
31 * @timecode: frame timecode 32 * @timecode: frame timecode
32 * @sequence: sequence count of this frame 33 * @sequence: sequence count of this frame
34 *
33 * Should contain enough information to be able to cover all the fields 35 * Should contain enough information to be able to cover all the fields
34 * of struct v4l2_buffer at videodev2.h 36 * of struct v4l2_buffer at videodev2.h
35 */ 37 */
@@ -53,6 +55,7 @@ int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
53/** 55/**
54 * vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies 56 * vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies
55 * the memory and type values. 57 * the memory and type values.
58 *
56 * @q: videobuf2 queue 59 * @q: videobuf2 queue
57 * @req: struct passed from userspace to vidioc_reqbufs handler 60 * @req: struct passed from userspace to vidioc_reqbufs handler
58 * in driver 61 * in driver
@@ -62,6 +65,7 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req);
62/** 65/**
63 * vb2_create_bufs() - Wrapper for vb2_core_create_bufs() that also verifies 66 * vb2_create_bufs() - Wrapper for vb2_core_create_bufs() that also verifies
64 * the memory and type values. 67 * the memory and type values.
68 *
65 * @q: videobuf2 queue 69 * @q: videobuf2 queue
66 * @create: creation parameters, passed from userspace to vidioc_create_bufs 70 * @create: creation parameters, passed from userspace to vidioc_create_bufs
67 * handler in driver 71 * handler in driver
@@ -70,15 +74,17 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create);
70 74
71/** 75/**
72 * vb2_prepare_buf() - Pass ownership of a buffer from userspace to the kernel 76 * vb2_prepare_buf() - Pass ownership of a buffer from userspace to the kernel
77 *
73 * @q: videobuf2 queue 78 * @q: videobuf2 queue
74 * @b: buffer structure passed from userspace to vidioc_prepare_buf 79 * @b: buffer structure passed from userspace to vidioc_prepare_buf
75 * handler in driver 80 * handler in driver
76 * 81 *
77 * Should be called from vidioc_prepare_buf ioctl handler of a driver. 82 * Should be called from vidioc_prepare_buf ioctl handler of a driver.
78 * This function: 83 * This function:
79 * 1) verifies the passed buffer, 84 *
80 * 2) calls buf_prepare callback in the driver (if provided), in which 85 * #) verifies the passed buffer,
81 * driver-specific buffer initialization can be performed, 86 * #) calls buf_prepare callback in the driver (if provided), in which
87 * driver-specific buffer initialization can be performed.
82 * 88 *
83 * The return values from this function are intended to be directly returned 89 * The return values from this function are intended to be directly returned
84 * from vidioc_prepare_buf handler in driver. 90 * from vidioc_prepare_buf handler in driver.
@@ -88,53 +94,57 @@ int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b);
88/** 94/**
89 * vb2_qbuf() - Queue a buffer from userspace 95 * vb2_qbuf() - Queue a buffer from userspace
90 * @q: videobuf2 queue 96 * @q: videobuf2 queue
91 * @b: buffer structure passed from userspace to vidioc_qbuf handler 97 * @b: buffer structure passed from userspace to VIDIOC_QBUF() handler
92 * in driver 98 * in driver
93 * 99 *
94 * Should be called from vidioc_qbuf ioctl handler of a driver. 100 * Should be called from VIDIOC_QBUF() ioctl handler of a driver.
101 *
95 * This function: 102 * This function:
96 * 1) verifies the passed buffer, 103 *
97 * 2) if necessary, calls buf_prepare callback in the driver (if provided), in 104 * #) verifies the passed buffer,
105 * #) if necessary, calls buf_prepare callback in the driver (if provided), in
98 * which driver-specific buffer initialization can be performed, 106 * which driver-specific buffer initialization can be performed,
99 * 3) if streaming is on, queues the buffer in driver by the means of buf_queue 107 * #) if streaming is on, queues the buffer in driver by the means of buf_queue
100 * callback for processing. 108 * callback for processing.
101 * 109 *
102 * The return values from this function are intended to be directly returned 110 * The return values from this function are intended to be directly returned
103 * from vidioc_qbuf handler in driver. 111 * from VIDIOC_QBUF() handler in driver.
104 */ 112 */
105int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); 113int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b);
106 114
107/** 115/**
108 * vb2_expbuf() - Export a buffer as a file descriptor 116 * vb2_expbuf() - Export a buffer as a file descriptor
109 * @q: videobuf2 queue 117 * @q: videobuf2 queue
110 * @eb: export buffer structure passed from userspace to vidioc_expbuf 118 * @eb: export buffer structure passed from userspace to VIDIOC_EXPBUF()
111 * handler in driver 119 * handler in driver
112 * 120 *
113 * The return values from this function are intended to be directly returned 121 * The return values from this function are intended to be directly returned
114 * from vidioc_expbuf handler in driver. 122 * from VIDIOC_EXPBUF() handler in driver.
115 */ 123 */
116int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb); 124int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb);
117 125
118/** 126/**
119 * vb2_dqbuf() - Dequeue a buffer to the userspace 127 * vb2_dqbuf() - Dequeue a buffer to the userspace
120 * @q: videobuf2 queue 128 * @q: videobuf2 queue
121 * @b: buffer structure passed from userspace to vidioc_dqbuf handler 129 * @b: buffer structure passed from userspace to VIDIOC_DQBUF() handler
122 * in driver 130 * in driver
123 * @nonblocking: if true, this call will not sleep waiting for a buffer if no 131 * @nonblocking: if true, this call will not sleep waiting for a buffer if no
124 * buffers ready for dequeuing are present. Normally the driver 132 * buffers ready for dequeuing are present. Normally the driver
125 * would be passing (file->f_flags & O_NONBLOCK) here 133 * would be passing (file->f_flags & O_NONBLOCK) here
126 * 134 *
127 * Should be called from vidioc_dqbuf ioctl handler of a driver. 135 * Should be called from VIDIOC_DQBUF() ioctl handler of a driver.
136 *
128 * This function: 137 * This function:
129 * 1) verifies the passed buffer, 138 *
130 * 2) calls buf_finish callback in the driver (if provided), in which 139 * #) verifies the passed buffer,
140 * #) calls buf_finish callback in the driver (if provided), in which
131 * driver can perform any additional operations that may be required before 141 * driver can perform any additional operations that may be required before
132 * returning the buffer to userspace, such as cache sync, 142 * returning the buffer to userspace, such as cache sync,
133 * 3) the buffer struct members are filled with relevant information for 143 * #) the buffer struct members are filled with relevant information for
134 * the userspace. 144 * the userspace.
135 * 145 *
136 * The return values from this function are intended to be directly returned 146 * The return values from this function are intended to be directly returned
137 * from vidioc_dqbuf handler in driver. 147 * from VIDIOC_DQBUF() handler in driver.
138 */ 148 */
139int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking); 149int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking);
140 150
@@ -144,7 +154,9 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking);
144 * @type: type argument passed from userspace to vidioc_streamon handler 154 * @type: type argument passed from userspace to vidioc_streamon handler
145 * 155 *
146 * Should be called from vidioc_streamon handler of a driver. 156 * Should be called from vidioc_streamon handler of a driver.
157 *
147 * This function: 158 * This function:
159 *
148 * 1) verifies current state 160 * 1) verifies current state
149 * 2) passes any previously queued buffers to the driver and starts streaming 161 * 2) passes any previously queued buffers to the driver and starts streaming
150 * 162 *
@@ -159,9 +171,11 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type);
159 * @type: type argument passed from userspace to vidioc_streamoff handler 171 * @type: type argument passed from userspace to vidioc_streamoff handler
160 * 172 *
161 * Should be called from vidioc_streamoff handler of a driver. 173 * Should be called from vidioc_streamoff handler of a driver.
174 *
162 * This function: 175 * This function:
163 * 1) verifies current state, 176 *
164 * 2) stop streaming and dequeues any queued buffers, including those previously 177 * #) verifies current state,
178 * #) stop streaming and dequeues any queued buffers, including those previously
165 * passed to the driver (after waiting for the driver to finish). 179 * passed to the driver (after waiting for the driver to finish).
166 * 180 *
167 * This call can be used for pausing playback. 181 * This call can be used for pausing playback.