Moved all camera work to separate thread

Solves problem with main application thread freeze when opening
the camera or starting the preview capture