<feed xmlns='http://www.w3.org/2005/Atom'>
<title>uvc-gadget.git/lib, branch v0.1.0</title>
<subtitle>UVC gadget userspace sample application</subtitle>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/'/>
<entry>
<title>lib: uvc: Respond to control requests with dummy values</title>
<updated>2022-11-22T16:08:30+00:00</updated>
<author>
<name>Daniel Scally</name>
<email>dan.scally@ideasonboard.com</email>
</author>
<published>2022-11-22T15:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=0df9d3ad860ecd78f1bf8ad6bd5ceccaf40a9e07'/>
<id>0df9d3ad860ecd78f1bf8ad6bd5ceccaf40a9e07</id>
<content type='text'>
Without a response, the host will assume there has been an error and
throw a bunch of errors. The noise of those errors makes it difficult
to see what's going on properly, so return a dummy response that
silences the errors until the functionality is properly implemented.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without a response, the host will assume there has been an error and
throw a bunch of errors. The noise of those errors makes it difficult
to see what's going on properly, so return a dummy response that
silences the errors until the functionality is properly implemented.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: uvc: Add control names in output prints</title>
<updated>2022-11-22T16:08:30+00:00</updated>
<author>
<name>Daniel Scally</name>
<email>dan.scally@ideasonboard.com</email>
</author>
<published>2022-11-22T15:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=70d68062373502d159771b53b3e6d94c0557a0da'/>
<id>70d68062373502d159771b53b3e6d94c0557a0da</id>
<content type='text'>
It's easier to see what's going on at a glance when the output is
human-readable, so replace the control codes with their names.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's easier to see what's going on at a glance when the output is
human-readable, so replace the control codes with their names.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: uvc: Drop maxsize</title>
<updated>2022-11-22T16:08:24+00:00</updated>
<author>
<name>Daniel Scally</name>
<email>dan.scally@ideasonboard.com</email>
</author>
<published>2022-11-22T15:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=bca24b4b5b2c18b844e8da80ac19819944f80a93'/>
<id>bca24b4b5b2c18b844e8da80ac19819944f80a93</id>
<content type='text'>
The maxsize field of struct uvc_device is probably unecessary even if
it weren't currently fixed at 0. It's used to set dwMaxVideoFrameSize
in addition to the sizeimage member of a struct v4l2_pix_fmt (multiplied
in the latter instance by 1.5x). The documentary definitions for those
two values are such that they should be identical though, so simply
set dwMaxVideoFrameSize to width*height*2 (to maintain commonality
with other UVC Video devices) and use that to set the sizeimage.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The maxsize field of struct uvc_device is probably unecessary even if
it weren't currently fixed at 0. It's used to set dwMaxVideoFrameSize
in addition to the sizeimage member of a struct v4l2_pix_fmt (multiplied
in the latter instance by 1.5x). The documentary definitions for those
two values are such that they should be identical though, so simply
set dwMaxVideoFrameSize to width*height*2 (to maintain commonality
with other UVC Video devices) and use that to set the sizeimage.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: events: Use list_for_each_entry() instead of the _safe() version</title>
<updated>2022-11-22T16:07:58+00:00</updated>
<author>
<name>Daniel Scally</name>
<email>dan.scally@ideasonboard.com</email>
</author>
<published>2022-11-22T15:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=d47c0701f2250889970afa6b5af025ea0a02b3be'/>
<id>d47c0701f2250889970afa6b5af025ea0a02b3be</id>
<content type='text'>
For the UVC_EVENT_STREAMOFF event, the callback frees _other_ events
because it's closing down the pipe. The use of the _safe() version
of the list iterator results in a use-after-free of those events
because they're fetched before the callback that frees them. The
_safe() version is unecessary here; no other callback's behaviour
requires it.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the UVC_EVENT_STREAMOFF event, the callback frees _other_ events
because it's closing down the pipe. The use of the _safe() version
of the list iterator results in a use-after-free of those events
because they're fetched before the callback that frees them. The
_safe() version is unecessary here; no other callback's behaviour
requires it.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>jpg-source: add jpg source class</title>
<updated>2022-11-22T16:05:21+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T15:41:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=bb83c7135540d3391f4d0b46911c8aedbcd84313'/>
<id>bb83c7135540d3391f4d0b46911c8aedbcd84313</id>
<content type='text'>
The jpg_source class is an implementation of the video_source class that
streams a still jpg image as video.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The jpg_source class is an implementation of the video_source class that
streams a still jpg image as video.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test-source: add test source class</title>
<updated>2022-11-22T16:02:25+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T10:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=7dc71fd6fef7a242d108d5c8cb7683aa9fd4511f'/>
<id>7dc71fd6fef7a242d108d5c8cb7683aa9fd4511f</id>
<content type='text'>
The test_source class is an implementation of the video_source class
that generates a test pattern in userspace to provide video. We have
some operations which are implemented as no-ops. To quiet the
compiler warnings this causes, flag their arguments as unused.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test_source class is an implementation of the video_source class
that generates a test pattern in userspace to provide video. We have
some operations which are implemented as no-ops. To quiet the
compiler warnings this causes, flag their arguments as unused.

Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>v4l2: write size value when dequeueing buffer</title>
<updated>2022-11-22T16:02:25+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T10:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=34477392ceff6d4d5473679f33a6a73cbe7326de'/>
<id>34477392ceff6d4d5473679f33a6a73cbe7326de</id>
<content type='text'>
When we dequeue a buffer from a V4L2 device, it would be good to know
the size of the buffer. Save it to our struct video_buffer when
dequeueing.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we dequeue a buffer from a V4L2 device, it would be good to know
the size of the buffer. Save it to our struct video_buffer when
dequeueing.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>v4l2: populate video_buffer mem field at dequeue</title>
<updated>2022-11-22T16:02:25+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T10:54:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=6a466b3e46b843385cea82dd6cc042aefdb986ed'/>
<id>6a466b3e46b843385cea82dd6cc042aefdb986ed</id>
<content type='text'>
Our v4l2_queue_buffer and v4l2_dequeue_buffer functions give us a
wrapper around the raw V4L2 ioctls with a wrapper struct video_buffer
around the raw struct v4l2_buffer. The problem is that the
video_buffer's mem field is never populated, so there's no way to access
the mem that the buffer refers to given only the buffer.

Populate the video_buffer's mem field at v4l2_dequeue_buffer based on
the dequeued v4l2 buf's index.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Our v4l2_queue_buffer and v4l2_dequeue_buffer functions give us a
wrapper around the raw V4L2 ioctls with a wrapper struct video_buffer
around the raw struct v4l2_buffer. The problem is that the
video_buffer's mem field is never populated, so there's no way to access
the mem that the buffer refers to given only the buffer.

Populate the video_buffer's mem field at v4l2_dequeue_buffer based on
the dequeued v4l2 buf's index.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>stream: allow buffers to be allocated on uvc side</title>
<updated>2022-11-22T16:02:25+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T10:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=d11fa45c11dfce99a737f46d7d6e41f280e01ae0'/>
<id>d11fa45c11dfce99a737f46d7d6e41f280e01ae0</id>
<content type='text'>
We want to allow video sources whose data is generated in userspace.
Currently buffers are allocated on the V4L2-backed video source and
exported to the uvc-gadget's V4L2 device. Since a video source with
data generated in userspace will not be backed by a V4L2 device, we
allow a way for buffers to be allocated on uvc-gadget's V4L2 device.

As a corollary, the way the buffers are passed has to be changed as
well. Previously they were queued and dequeued between the V4L2 video
source and uvc and vice versa. To allow a video source not backed by
a V4L2 device, we allow an alternative flow where they are dequeued and
queued from and to uvc, and giving a chance to the video source to fill
the buffer in between.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to allow video sources whose data is generated in userspace.
Currently buffers are allocated on the V4L2-backed video source and
exported to the uvc-gadget's V4L2 device. Since a video source with
data generated in userspace will not be backed by a V4L2 device, we
allow a way for buffers to be allocated on uvc-gadget's V4L2 device.

As a corollary, the way the buffers are passed has to be changed as
well. Previously they were queued and dequeued between the V4L2 video
source and uvc and vice versa. To allow a video source not backed by
a V4L2 device, we allow an alternative flow where they are dequeued and
queued from and to uvc, and giving a chance to the video source to fill
the buffer in between.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video-source: add fill_buffer</title>
<updated>2022-11-22T16:02:25+00:00</updated>
<author>
<name>Paul Elder</name>
<email>paul.elder@ideasonboard.com</email>
</author>
<published>2022-11-22T10:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ideasonboard.org/uvc-gadget.git/commit/?id=6fe259939e375ed8e8bd604e93cabbf664a20de5'/>
<id>6fe259939e375ed8e8bd604e93cabbf664a20de5</id>
<content type='text'>
We are preparing to allow video sources whose data is generated in
userspace. To this end, add a fill_buffer function to video_source.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are preparing to allow video sources whose data is generated in
userspace. To this end, add a fill_buffer function to video_source.

Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
