Hi Developers.
Iám programming a new ambilight system
I hope anyone can help me with my problem.
I have this code to get a pic from the decoder memory on my Dreambox 800.
But my problem is that my code is to fast.
I have tryed it with sleep but then my pics are to late.
See my attachements:
pic1 Ok.
pic2 you see pic3 on top of pic2(so my code is to fast)
pic3 Ok.
Is there some fix, so i can check when memory is complete and has a complete pic ?
Or some lock and unlock ?
Code:
memory = (unsigned char*)mmap(0, offset + stride*(ofs2+64), PROT_READ, MAP_SHARED, mem_fd, adr);
if (memory == MAP_FAILED) {
printf("[grabber] mmap failed\n");
return false;
}
usleep(1000); // we try to get a full picture, its not possible to get a sync from the decoder so we use a delay
How can i check if the mmap is complete ?
I hope any can help.
Kind regards Martijn