Hello all,
I am currently working on an image processing project, using the DaVinci DM6437.
I modified the video_preview.c program a little, so that I can now use one of the DIP switches on the board and enter a "processing block" in my code. I intend capture a single frame, process it, and then proceed to a while( DIP switch still down) {} in order to display th processed frame.
However, during my work I have encountered several problems, most are related to memory allocation and the FVID_frame structure.
To my understanding, there exists a structure called FVID_frame which the video preview program uses. with a pointer to this kind of a struct you can reach the frame buffer: frameBuffPtr->frame.frameBufferPtr
I want to allocate my own array ( with mem_alloc ) and then:
1) make the frameBufferPtr to point to my allocated memory block
2) use the FVID_exchange function to capture a new frame and assert it in to that memory block
3) process the captured frame
4) display the processed frame by using FVID_exchange again, only this time with a handle to the video driver instead of the codec's.
One problem is that while debugging, I cannot access the original memory block of the frame buffer
if I try watch this address: frameBuffPtr->frame.frameBufferPtr I get kicked out and the CCS shuts down.
therefore I do not know what other problems am I facing here.
some notes:
1. I use mem_Alloc to allocate a buffer of width*height*2 to the DDR2 memory, and as far as I know, this is supposed to be the frame buffer's size too ( in FVID_frame).
2. I also managed to process and display a frame with the method offered in the "Accessing Pixels In A Frame" guide that was mentioned in many of the posts in this forum. Though this allows me some of the functionality I desired, I still have to run over the captured frame, without using a memory block which I allocated myself.
Problem #2 arises from note #2: If I process the current captured frame in the method mentioned in "Accessing Pixels In A Frame" i get a very weird result - most of the frame is processed, but some of the bottom pixels are not. I have attached an image which will explain what I mean. In this image I have tried to set a 0x80 gray level to all even pixels.
Thank you all very much, any support will be much appreciated.