RVCamera1GetImage(Sender: TObject; img: TRVMBitmap);
Posted: Wed Oct 30, 2019 9:55 am
In my application I need to have a direct access to a frame bitmap. I draw frames by myself via OpenGL texture.
RVCamera has an event OnGetImage, so RVCamera1GetImage is called when a new frame is decoded.
RVCamera1GetImage has input parameter img and property img.Data that is a pointer to an array of pixels.
First I was sure that this pointer is a fixed address where all frames are placed. So I tried just to get data from this address. But I was wrong!
It changes!
Can you explain why?
Because of this I have to copy data of frame each time OnGetImage happens (FLastFrame.AssignRVMBitmap(img)). This is an overhead and useless routine. And I have to do it because of my custom drawing procedure that is called not synchronousely with OnGetImage and I get access violation if I try to access data located at img.Data address.
RVCamera has an event OnGetImage, so RVCamera1GetImage is called when a new frame is decoded.
RVCamera1GetImage has input parameter img and property img.Data that is a pointer to an array of pixels.
First I was sure that this pointer is a fixed address where all frames are placed. So I tried just to get data from this address. But I was wrong!
It changes!
Can you explain why?
Because of this I have to copy data of frame each time OnGetImage happens (FLastFrame.AssignRVMBitmap(img)). This is an overhead and useless routine. And I have to do it because of my custom drawing procedure that is called not synchronousely with OnGetImage and I get access violation if I try to access data located at img.Data address.