USB Camera, part 3

We have full screen video!!!!

full screen video

USB Camera, part 2

Just a few notes and an image to show that I have got other resolutions working as well as a better yuy2 to rgb converter.

320 x 240 x 16bit stream

This resolution is twice the size, now at 320 x 240. No more orange and red fire looking stuff. However, I kept this image to show that there was a payload that was in error, so there is a line just under my nose. This shows that I need to figure out what to do when a payload is received in error, or incomplete.

There is a lot of glare with this image, as well as a mirror effect of the image bouncing off the back of my phone and back onto the screen. Notice a silhouette of my head up and to the right.

I again tried a 640 x 480 x 16-bit stream and it worked okay, though some of the payloads were missed so a line or two of the stream was from the previous frame data. I still need to do some work on the scheduler to fix this.

USB Camera

Well, since I show how to enumerate and retrieve data from a camera in Volume 8, I thought it would be interesting to actually start receiving frames from the camera. It isn't as easy as I might have thought. If the timing isn't just right, the camera to PC data can be lost. However, after some tweeks and a few hours of work, I got a decent 160 x 120 x 16-bit stream to show.

160 x 120 x 16bit stream

It's a small image, 160 x 120, and I just bit_blit it to the upper left corner of the screen, but it is quite smooth. The orange and red fire looking stuff in the bottom right corner of the feed is my conversion from yuy2 to RGB565. It needs a little work.

I tried a 640 x 480 x 16-bit stream and it worked okay, though some of the payloads were missed so a line or two of the stream was from the previous frame data. This is solely because my task scheduler is currently set at a 10ms interval. I don't have a variable task priority task scheduler yet. Therefore, my stream retrieval routine would miss about 2 micro-frames of payload data every 10ms.

Anyway, I got the thing to work in most any resolution. Now to document it and add information to the book.

P.S. Note that the background of the screen is text displaying the information I needed to see what was going on. Then note that this camera can stream a feed size of 1280 x 1024 at 16-bits. Notice that the rate is 157 million. I didn't try this resolution. I am sure it would be missing quite a few payloads. :-)