Working on cleanup...
Running, looks like it will hit 50Hz with cleanup
Working ok, latencyMeasurement up
This works well. Biggest latency is in MATLABs internal frame polling function. Replacing that with 2 or 3 ms polling is fine. Current problem is graphics display not being done before next frame arrives.
This is working well. Added a switch that disables video preview during latency critical periods.