This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Writing into video buffers on Leopard board.

Hello!

I think everything is in the title. I am using a Leopard board 365. I could successfully run a source code demo getting video from NTSC and displaying on the composite output with a Leopard board 365. Now I would like to make changes to the buffer before displaying it. For instance writing menus. So I need a pointer to the memory location where the data is written.
By looking at the v4l2 structure, the part which most likely contains this information is the m union (contains offset and userptr).
In my code, I can successfully print out this data, and it looks like a memory location. The following instructions have been added just before the buffer is passed to the display function:
static framecount = 0;
printf("Data location [%4d] : 0x%8x", framecount++, buf.m.userptr);
which results in :
Data location[0236] : 0x82000000 // start sequence of buffers
Data location[0237] : 0x82800000
Data location[0238] : 0x80800000
Data location[0239] : 0x84000000
Data location[0240] : 0x84800000
Data location[0241] : 0x82000000 // sequence repeated here
Data location[0242] : 0x82800000
Data location[0243] : 0x80800000
Data location[0244] : 0x84000000
Data location[0245] : 0x84800000
Data location[0246] : 0x82000000 // … and here
Data location[0237] : 0x82800000

But if I write:

memset((char *)(buf.m.userptr+100*720), 0, 100);

this results in a segmentation fault.
Does anybody know how to write in a buffer before displaying it?
Is it possible to directly access video memory does linux prevents it for memory management reasons? In this case, is there an API letting me alter video buffers?
Thanks for any hint!

Pascal