Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b719d7b authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarSakari Ailus <sakari.ailus@iki.fi>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5cf73ce1
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2458,6 +2458,18 @@ details.</para>
      </orderedlist>
    </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">
      <title>Relation of V4L2 to other Linux multimedia APIs</title>

+5 −14
Original line number Diff line number Diff line
@@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details.
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>input</structfield></entry>
	    <entry><structfield>reserved2</structfield></entry>
	    <entry></entry>
	    <entry>Some video capture drivers support rapid and
synchronous video input changes, a function useful for example in
video surveillance applications. For this purpose applications set the
<constant>V4L2_BUF_FLAG_INPUT</constant> flag, and this field to the
number of a video input as in &v4l2-input; field
<structfield>index</structfield>.</entry>
	    <entry>A place holder for future extensions and custom
(driver defined) buffer types
<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
should set this to 0.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
@@ -921,13 +919,6 @@ previous key frame.</entry>
	    <entry>The <structfield>timecode</structfield> field is valid.
Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
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>
	    <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
+3 −6
Original line number Diff line number Diff line
@@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>,
<structfield>field</structfield> and
<structfield>timestamp</structfield> fields, see <xref
linkend="buffer" /> for details.
Applications must also set <structfield>flags</structfield> to 0. If a driver
supports capturing from specific video inputs and you want to specify a video
input, then <structfield>flags</structfield> should be set to
<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
Applications must also set <structfield>flags</structfield> to 0.
The <structfield>reserved2</structfield> and
<structfield>reserved</structfield> fields must be set to 0. When using
the <link linkend="planar-apis">multi-planar API</link>, the
<structfield>m.planes</structfield> field must contain a userspace pointer
to a filled-in array of &v4l2-plane; and the <structfield>length</structfield>
+1 −1
Original line number Diff line number Diff line
@@ -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->m.offset = cam->buffers[buf->index].data - cam->frame_buffer;
	buf->length = cam->frame_size;
	buf->input = 0;
	buf->reserved2 = 0;
	buf->reserved = 0;
	memset(&buf->timecode, 0, sizeof(buf->timecode));

+5 −6
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ struct v4l2_buffer32 {
		compat_caddr_t  planes;
	} m;
	__u32			length;
	__u32			input;
	__u32			reserved2;
	__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->type, &up->type) ||
		get_user(kp->flags, &up->flags) ||
		get_user(kp->memory, &up->memory) ||
		get_user(kp->input, &up->input))
		get_user(kp->memory, &up->memory)
			return -EFAULT;

	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->type, &up->type) ||
		put_user(kp->flags, &up->flags) ||
		put_user(kp->memory, &up->memory) ||
		put_user(kp->input, &up->input))
		put_user(kp->memory, &up->memory)
			return -EFAULT;

	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) ||
		copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
		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;

	if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {
Loading