• Laurent Aimar's avatar
    * mjpeg grabbing added, thanks to Paul Forgey <paulf at aphrodite dot com> · ba8a0334
    Laurent Aimar authored
     that had done all the work.
    
    Paul Forgey's notes:
    --------------------
    
    Unfortunatley, the v4l interface shows how much it sucks here.  I can't
    wait for v4l2 to become more common.  Anyway, the mjpeg mechanism
    captures completely differently than the uncompressed frame capture
    mechanism.  This means the code has to split off a bunch to do similar
    things depending on mjpeg being set or not.  For some reason, I can't
    use non v4l2 calls to capture uncompressed frames from the lml33,
    however I do have another bttv card on my system to test that I didn't
    break the non-mjpeg stuff.
    
    The Zoran encoders don't use square pixels.  So the 4:3 (or 16:9)
    picture is going to show up as 720x480.  I don't know my way around the
    code well enough to know how to specify a non-square pixel aspect
    ratio.  If there isn't a way to do it, it would be nice to be able to
    specify as an option the aspect ratio of the sourc.  Either 4:3 or 16:9
    in the case of anamorphic S-Video, which does occur.
    
    I stole the videodev_mjpeg.h header from the lavrec project.  Despite
    the linux kernels having support for the Zoran cards, there doesn't seem
    to be a reliable way to pick up this header, which is probably why
    lavrec did it this way.  Since it only defines ioctl definitions, I
    don't think using it is a legal problem.
    
    I also modified the audio handling a bit.  If the card supports audio,
    great, we'll set the card's parameters as we did before.  But if adev=
    is specified, use it regardless.  The reason to do this is to capture
    audio from the sound card with video coming from, say, a web cam or in
    my case, an encoder card which doesn't have any audio capabilities at
    all.
    ba8a0334
v4l.c 49.6 KB