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.