I use the VCL TdxCameraControl (Version 17.2.6). The component itself works fine.
However, the permanent CPU load is very high when the component is activated (14% at 1024x768 component size in my case).
The CPU load goes even higher when the component size is increased.
Setting the dxCameraControl1.state = ccsPaused doesn't help. The cpu load remains the same.
This behaviour is shown with different cameras connected to the PC.
Is there a possibility to influence the CPU load caused by the component? Reduce frame rate, …?
Kind regards,
Johannes
Hello Johannes,
Right now we do not provide a way to reduce the amount of used CPU resources. In our Camera control, we just query the camera device to get a frame image and display this image in our control with the same frequency as the camera device works.
In your message, you mentioned that you are testing our control with the ccsPaused state. We found that we can significantly reduce CPU load in this mode. Will this be sufficient in your scenario?
As for reducing the frame rate, we can try to implement this feature in future builds. However, there may be an alternative solution with the current version of our controls. To check if this solution is suitable for your task, we need to have some more information about your scenario. Would you please describe the way you are using our camera control in your project? Is it a single control on one of your forms or you have several camera controls there? A couple of screenshots demonstrating your application's UI would be much appreciated.
I am looking forward to your reply.
Hello Paulo,
having a reduced CPU load in ccsPaused state would help allot!
I have only one TdxCameraControl on the form.
Thanks, Johannes. I have just published the hotfix that should help you decrease the amount of used CPU resources in the ccsPaused state. Please download it from the right side of this page, apply it to v17.2.6 and let me know the result.
Thanks Paulo for your excellent support!!!
The provided solution is nearly perfect. There is a small side effect.
The component behaves different when dxCameraControl1.state = ccsPaused and the method dxCameraControl1.Capture is called.
Before the change the displayed image was updated.
Now it doesn't get updated when the component is in ccsPaused state and capture is called.
I think it would be just a minor change in TdxCustomCameraControl.Capture an the component behaves as before.
procedure TdxCustomCameraControl.Capture;
begin
cxInvalidateRect(Self); //add
FCamera.Capture(FCapturedBitmap);
end;