Keep separate map for fd to files so we can implement dup.
Filter out duplicates in enumfmt.
tryfmt should return the closest match.
Use pthread_once to init the global state.
Make things mostly work in GStreamer.
Add support for more formats.
Connect in the reqbufs ioctl so that we can negotiate the right amount
of buffers.
Keep file and buffer maps so that we can map an address to a file and
then the address to a buffer of that file. We can then also check if the
buffers were unmapped properly.
Implement some more ioctls.
Add some more checks.
Collect all video/source nodes and enumerate their formats. We use this
to return the supported formats and to check if a format is supported.
Use evenfd as the even we return from open. Make the eventfd readable
when we have a new buffer ready.
Connect a stream when setting a format. Collect buffers. Implement
mmap/munmap on the buffer memory. Implement queue and dequeue of buffers.
This is enough to make the webcam test work in firefox.