[media] v4l: drop v4l2_buffer.input and V4L2_BUF_FLAG_INPUT

Remove input field in struct v4l2_buffer and flag V4L2_BUF_FLAG_INPUT which
tells the former is valid. The flag is used by no driver currently.

Also change the documentation accordingly.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Sakari Ailus 2012-05-02 09:40:03 -03:00 committed by Mauro Carvalho Chehab
parent 5cf73ce15f
commit 2b719d7baf
8 changed files with 29 additions and 48 deletions

View file

@ -2458,6 +2458,18 @@ details.</para>
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>V4L2 in Linux 3.5</title>
<orderedlist>
<listitem>
<para>Replaced <structfield>input</structfield> in
<structname>v4l2_buffer</structname> by
<structfield>reserved2</structfield> and removed
<constant>V4L2_BUF_FLAG_INPUT</constant>.</para>
</listitem>
</orderedlist>
</section>
<section id="other"> <section id="other">
<title>Relation of V4L2 to other Linux multimedia APIs</title> <title>Relation of V4L2 to other Linux multimedia APIs</title>

View file

@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details.
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>input</structfield></entry> <entry><structfield>reserved2</structfield></entry>
<entry></entry> <entry></entry>
<entry>Some video capture drivers support rapid and <entry>A place holder for future extensions and custom
synchronous video input changes, a function useful for example in (driver defined) buffer types
video surveillance applications. For this purpose applications set the <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
<constant>V4L2_BUF_FLAG_INPUT</constant> flag, and this field to the should set this to 0.</entry>
number of a video input as in &v4l2-input; field
<structfield>index</structfield>.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
@ -921,13 +919,6 @@ previous key frame.</entry>
<entry>The <structfield>timecode</structfield> field is valid. <entry>The <structfield>timecode</structfield> field is valid.
Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
ioctl is called.</entry> ioctl is called.</entry>
</row>
<row>
<entry><constant>V4L2_BUF_FLAG_INPUT</constant></entry>
<entry>0x0200</entry>
<entry>The <structfield>input</structfield> field is valid.
Applications set or clear this flag before calling the
<constant>VIDIOC_QBUF</constant> ioctl.</entry>
</row> </row>
<row> <row>
<entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>

View file

@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>,
<structfield>field</structfield> and <structfield>field</structfield> and
<structfield>timestamp</structfield> fields, see <xref <structfield>timestamp</structfield> fields, see <xref
linkend="buffer" /> for details. linkend="buffer" /> for details.
Applications must also set <structfield>flags</structfield> to 0. If a driver Applications must also set <structfield>flags</structfield> to 0.
supports capturing from specific video inputs and you want to specify a video The <structfield>reserved2</structfield> and
input, then <structfield>flags</structfield> should be set to <structfield>reserved</structfield> fields must be set to 0. When using
<constant>V4L2_BUF_FLAG_INPUT</constant> and the field
<structfield>input</structfield> must be initialized to the desired input.
The <structfield>reserved</structfield> field must be set to 0. When using
the <link linkend="planar-apis">multi-planar API</link>, the the <link linkend="planar-apis">multi-planar API</link>, the
<structfield>m.planes</structfield> field must contain a userspace pointer <structfield>m.planes</structfield> field must contain a userspace pointer
to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> to a filled-in array of &v4l2-plane; and the <structfield>length</structfield>

View file

@ -932,7 +932,7 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
buf->sequence = cam->buffers[buf->index].seq; buf->sequence = cam->buffers[buf->index].seq;
buf->m.offset = cam->buffers[buf->index].data - cam->frame_buffer; buf->m.offset = cam->buffers[buf->index].data - cam->frame_buffer;
buf->length = cam->frame_size; buf->length = cam->frame_size;
buf->input = 0; buf->reserved2 = 0;
buf->reserved = 0; buf->reserved = 0;
memset(&buf->timecode, 0, sizeof(buf->timecode)); memset(&buf->timecode, 0, sizeof(buf->timecode));

View file

@ -327,7 +327,7 @@ struct v4l2_buffer32 {
compat_caddr_t planes; compat_caddr_t planes;
} m; } m;
__u32 length; __u32 length;
__u32 input; __u32 reserved2;
__u32 reserved; __u32 reserved;
}; };
@ -387,8 +387,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
get_user(kp->index, &up->index) || get_user(kp->index, &up->index) ||
get_user(kp->type, &up->type) || get_user(kp->type, &up->type) ||
get_user(kp->flags, &up->flags) || get_user(kp->flags, &up->flags) ||
get_user(kp->memory, &up->memory) || get_user(kp->memory, &up->memory)
get_user(kp->input, &up->input))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_OUTPUT(kp->type)) if (V4L2_TYPE_IS_OUTPUT(kp->type))
@ -472,8 +471,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
put_user(kp->index, &up->index) || put_user(kp->index, &up->index) ||
put_user(kp->type, &up->type) || put_user(kp->type, &up->type) ||
put_user(kp->flags, &up->flags) || put_user(kp->flags, &up->flags) ||
put_user(kp->memory, &up->memory) || put_user(kp->memory, &up->memory)
put_user(kp->input, &up->input))
return -EFAULT; return -EFAULT;
if (put_user(kp->bytesused, &up->bytesused) || if (put_user(kp->bytesused, &up->bytesused) ||
@ -482,7 +480,8 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) ||
copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
put_user(kp->sequence, &up->sequence) || put_user(kp->sequence, &up->sequence) ||
put_user(kp->reserved, &up->reserved)) put_user(kp->reserved2, &up->reserved2) ||
put_user(kp->reserved, &up->reserved)
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {

View file

@ -359,11 +359,6 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
break; break;
} }
if (vb->input != UNSET) {
b->flags |= V4L2_BUF_FLAG_INPUT;
b->input = vb->input;
}
b->field = vb->field; b->field = vb->field;
b->timestamp = vb->ts; b->timestamp = vb->ts;
b->bytesused = vb->size; b->bytesused = vb->size;
@ -402,7 +397,6 @@ int __videobuf_mmap_setup(struct videobuf_queue *q,
break; break;
q->bufs[i]->i = i; q->bufs[i]->i = i;
q->bufs[i]->input = UNSET;
q->bufs[i]->memory = memory; q->bufs[i]->memory = memory;
q->bufs[i]->bsize = bsize; q->bufs[i]->bsize = bsize;
switch (memory) { switch (memory) {
@ -566,16 +560,6 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b)
goto done; goto done;
} }
if (b->flags & V4L2_BUF_FLAG_INPUT) {
if (b->input >= q->inputs) {
dprintk(1, "qbuf: wrong input.\n");
goto done;
}
buf->input = b->input;
} else {
buf->input = UNSET;
}
switch (b->memory) { switch (b->memory) {
case V4L2_MEMORY_MMAP: case V4L2_MEMORY_MMAP:
if (0 == buf->baddr) { if (0 == buf->baddr) {

View file

@ -336,9 +336,9 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b)
struct vb2_queue *q = vb->vb2_queue; struct vb2_queue *q = vb->vb2_queue;
int ret; int ret;
/* Copy back data such as timestamp, flags, input, etc. */ /* Copy back data such as timestamp, flags, etc. */
memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m)); memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m));
b->input = vb->v4l2_buf.input; b->reserved2 = vb->v4l2_buf.reserved2;
b->reserved = vb->v4l2_buf.reserved; b->reserved = vb->v4l2_buf.reserved;
if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) { if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) {
@ -860,7 +860,6 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b,
vb->v4l2_buf.field = b->field; vb->v4l2_buf.field = b->field;
vb->v4l2_buf.timestamp = b->timestamp; vb->v4l2_buf.timestamp = b->timestamp;
vb->v4l2_buf.input = b->input;
vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS; vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS;
return 0; return 0;

View file

@ -657,7 +657,7 @@ struct v4l2_buffer {
struct v4l2_plane *planes; struct v4l2_plane *planes;
} m; } m;
__u32 length; __u32 length;
__u32 input; __u32 reserved2;
__u32 reserved; __u32 reserved;
}; };
@ -671,7 +671,6 @@ struct v4l2_buffer {
/* Buffer is ready, but the data contained within is corrupted. */ /* Buffer is ready, but the data contained within is corrupted. */
#define V4L2_BUF_FLAG_ERROR 0x0040 #define V4L2_BUF_FLAG_ERROR 0x0040
#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
/* Cache handling flags */ /* Cache handling flags */
#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800