Ben Bridgwater wrote: > Anders Gnistrup wrote: > > > > > > Ok. that cleared up my overview. Thanks. > > in fact I have downloaded all bttr drivers but I could not find the "the thin red > > line". > > > > I have attached my code. > > You should really be doing a *single* mmap() of size indicated by > VIDIOCGMBUF, and then using the frame offsets into that to retrieve the > captured frames. > hmm. okay. done it. > > Also your capture loop seems a bit convoluted, and I don't think you're > giving yourself any time to copy each frame after you set the condition > variable before you start to overwrite You are absolutely right. I tried to implement another pthread_cond_t and made the thread wait until the copy was finish and SUCCES. ;-) . the code now work like this. frame = next_frame = 0 capture frame while(1) { capture(next_frame) sync(frame) copy(frame) frame = next_frame; nextframe = (nextframe +1) %2 } The difference between this and the below is that this is convoluted and works at 25Hz. BTW. is legal/safe to convolute? And thanks for the overview and the littly "hint". > it with the next capture. Try > restructuring your loop like this: > > frame = 0 > capture(frame) > while (1) { > sync(frame) > next_frame = (frame + 1) % 2 > capture(next_frame) > process(frame) > frame = next_frame > } > > Hope this helps. > > Ben > > _______________________________________________ > Video4linux-list mailing list > Video4linux-list@xxxxxxxxxx > https://listman.redhat.com/mailman/listinfo/video4linux-list