The current solution adds an extra delay for every frame. If the processing takes place outside of the API thread, it would alleviate the lagging.