Re: buggy v4l apps (was: VIDIOCSYNC and bad data)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, 5 Aug 2003, Gerd Knorr wrote:

>> Using multiple mmap buffers, yes, but where's the point?
>Let video application and capture hardware work in parallel:

Ah, but since it works in parallel with just one mmap buffer, I must ask
again, where's the point in providing multiple mmap buffers--except when
using multiple CPUs to process multiple buffers at once.

>To do something simliar with just one buffer the application would
>need one extra memcpy:
>
>MCAPTURE(0)
>while (true) {
>        SYNC(0)
>        memcpy frame
>        MCAPTURE(0)
>        // process frame while hardware/driver refills frame
>}

No, it doesn't:

while (true)
  MCAPTURE(0) <- effectively null operation for driver
  SYNC(0)     <- driver converts internal buffer into mmap buffer
  // application processes frame directly in mmap buffer, no memcpy
  // * hardware will continue capturing into internal buffers! *
}

There is a kind of "memcpy" when the internal buffer is converted into the
mmap buffer, but since the conversion would be anyway quite difficult to do
in-place, the copying would be likely to be necessary anyway.




[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux